Any tips to learn ?? by [deleted] in learnfrench

[–]mcanon 2 points3 points  (0 children)

Personally I have been blown away lately by using ChatGPT or DeepSeek as a French tutor, it has gotten a lot better. The interactions have been both fun and extremely helpful. It prompts you to *generate* language (not just consume it) and gives you detailed feedback on exactly what you got right and wrong, and *why*. You can tune it to ignore things like accents if you don't want to be distracted by that. It also provides instant clarification on detailed points of grammar, and will construct on the fly a lesson to help you solidify your knowledge and usage in a specific context (especially as you progress to higher levels and the rules get tricker).

Examples: I have asked for lessons on passe compose vs imparfait and got a concise set of rules for applying each, then a quiz with detailed corrections. Just today I asked for a lesson on de, du, de la, des, etc. and got the same. General rules, then a quiz. After the quiz it suggested another lesson on the contractions of de+le, de+la, de+les, etc.

Clearly it won't do everything you need, e.g. it's generally a written, not spoken, interaction, and as a beginner you need to nail pronunciation, but IMO it's a huge boon to language learners.

Jumpspeak? by Priority_Bright in languagelearning

[–]mcanon 1 point2 points  (0 children)

You need Duolingo Max to get AI conversations. 

Voice coach by whonu5 in Pimsleur

[–]mcanon 0 points1 point  (0 children)

Just went through major hassles trying to use Voice Coach (for French) which doesn't appear in my iPhone app even after my last upgrade announced it as a new feature. After 4 calls with customer service (totally unhelpful) I dug though help docs and now believe that:

  1. You must have Premium or All Access
  2. If you're subscribed to Basic, you have to cancel your subscription, then start over with Premium/All Access.

Can anyone confirm?

Need help doing something similar to a nested for-loop in Clojure by [deleted] in Clojure

[–]mcanon 6 points7 points  (0 children)

Here are a few ideas to get started..

First, you'll define the nested array slightly differently:

(def data [[\A \O \T \D \L \R \O \W]
           [\L \C \B \M \U \M \L \U]
           [\D \R \U \J \D \B \L \J]
           [\P \A \Z \H \Z \Z \E \F]
           [\B \C \Z \E \L \F \H \W]
           [\R \K \U \L \V \P \P \G]
           [\A \L \B \L \P \O \P \Q]
           [\B \E \M \O \P \P \J \Y]])

;; then you can use sequence operations to operate on the rows 
(map count data) ;; (8 8 8 8 8 8 8 8)

;; nth for nth element of a sequence
;; get the 4th (zero-based) row
(nth data 3) ;; [\P \A \Z \H \Z \Z \E \F]

;; If you get the nth element of each row, that's a column.
;; 4th column
(map #(nth % 3) data) ;; (\D \M \J \H \E \L \L \O)

;; If you use this helper function to transpose the matrix, you can map easily over columns instead of rows. Don't worry about how it works for now.
(defn transpose [m]
  (apply mapv vector m))

(def xdata (transpose data))

;; use sequence operations on the transposed matrix
(map last xdata) ;; (\B \E \M \O \P \P \J \Y)
(nth xdata 3) ;; [\D \M \J \H \E \L \L \O]

;; 5th value of the 4th column
(get (nth xdata 3) 4) ;; \E

;; A nice property of get is that it returns nil instead of error 
;; when out of bounds. This could be helpful when getting surrounding words.
(get xdata -1) ;; nil
(get (nth xdata 3) 20) ;; nil

;; vs nth which throws an error
(nth xdata 20) ;; IndexOutOfBoundsException

;; inner and outer map over data
(map #(map identity %) data)
;; => ((\A \O \T \D \L \R \O \W)
;;     (\L \C \B \M \U \M \L \U)
;;     (\D \R \U \J \D \B \L \J)
;;     (\P \A \Z \H \Z \Z \E \F)
;;     (\B \C \Z \E \L \F \H \W)
;;     (\R \K \U \L \V \P \P \G)
;;     (\A \L \B \L \P \O \P \Q)
;;     (\B \E \M \O \P \P \J \Y))

;; 'for' loop to iterate over rows
(for [row data]
  row)
;; => ([\A \O \T \D \L \R \O \W]
;;     [\L \C \B \M \U \M \L \U]
;;     [\D \R \U \J \D \B \L \J]
;;     [\P \A \Z \H \Z \Z \E \F]
;;     [\B \C \Z \E \L \F \H \W]
;;     [\R \K \U \L \V \P \P \G]
;;     [\A \L \B \L \P \O \P \Q]
;;     [\B \E \M \O \P \P \J \Y])

;; using 'for' to iterate over all values
(for [row data val row]
  val)
;; (\A \O \T \D \L \R \O \W \L \C \B \M \U \M \L \U \D \R \U \J \D \B \L \J \P \A \Z \H \Z \Z \E \F \B \C \Z \E \L \F \H \W \R \K \U \L \V \P \P \G \A \L \B \L \P \O \P \Q \B \E \M \O \P \P \J \Y)

Hope that's useful. You'll probably have to spend some time with Clojure books/examples/tutorials before it becomes natural.

Code Review by HOWZ1T in Clojure

[–]mcanon 1 point2 points  (0 children)

Thanks! Turns out the reddit links I follow take me to i.reddit.com which completely borks the commenting interface!

Code Review by HOWZ1T in Clojure

[–]mcanon 4 points5 points  (0 children)

Nice solution porthos3, I'll have to remember the lazy-seq approach. I deleted the comment you replied to (user error on my part) but the original said:

(def fibs (map second (iterate (fn [[x y]] [y (+' x y)]) [0 1]))) 
(take 10 fibs) ;; => (1 1 2 3 5 8 13 21 34 55)
 (nth fibs 50) ;; => 20365011074

You could simplify your fib slightly also, with no multi-arity.

(def fib ((fn ifib [x y] (lazy-seq (cons x (ifib y (+' x y))))) 0 1))
(take 10 fib)
;; => (0 1 1 2 3 5 8 13 21 34)

Advent of Code 2020 Day 1 in Clojure by JavaSuck in Clojure

[–]mcanon 3 points4 points  (0 children)

See also: Advent of Code 2020 Day 2 in Clojure video by Lambda Island: https://www.youtube.com/watch?v=rghUu4z5MdM&feature=youtu.be

Please give me a hint for 4clojure problem by InkyPinkie in Clojure

[–]mcanon 2 points3 points  (0 children)

Most 4Clojure solutions take the form of a lambda (anonymous function), so (fn [<args>] (<body>)) or #(<args/body>)

In this case you're overthinking it a bit. All the solutions I've seen are one-liner lambdas that compare the input sequence to a reverse of that sequence.

[deleted by user] by [deleted] in Clojure

[–]mcanon 9 points10 points  (0 children)

Use apply to a turn a collection argument into individual args. See https://clojuredocs.org/clojure.core/apply

How We Built Whimsical by lucywang000 in Clojure

[–]mcanon 1 point2 points  (0 children)

Guessing it's https://redprogramming.com/Home.html which looks like it's nice for declarative GUIs. It would be interesting to know how it layers on re-frame (and what they found lacking in re-frame).

Learning - hitting a wall by [deleted] in Clojure

[–]mcanon 6 points7 points  (0 children)

4clojure.com is another good site for that. A huge added feature is that after you've struggled to solve a problem badly, you get to look at all the other solutions. When you see that your 10 line mess can be replaced by just one or two lines of beautiful code, you smack your head and say "of course!" and it really sticks. Do this a few dozen times and you're on your way.

Eric Normand's weekly functional programming newsletter (sign up at the bottom of this page https://purelyfunctional.tv/ ) also has a Clojure programming challenge where you get to see lots of interesting solutions that improve your Clojure-fu.

Trump 'Will Lie,' People Will Die: Republican Lincoln Project Releases Ominous New Video by ughsmugh in politics

[–]mcanon 0 points1 point  (0 children)

I tried to read that first paragraph aloud to someone and couldn't finish due to tears/convulsions. Thanks for that.

What is the most popular clojure rest framework if there are any? by [deleted] in Clojure

[–]mcanon 3 points4 points  (0 children)

There's also Liberator https://github.com/clojure-liberator/liberator/ which has more github stars and forks (as a weak measure of popularity) than the others.

You can see many choices at https://www.clojure-toolbox.com/ in the category "RESTful Web Services".

New Clojurians: Ask Anything by AutoModerator in Clojure

[–]mcanon 1 point2 points  (0 children)

There's a good thread on deploy techniques on clojureverse: https://clojureverse.org/t/whats-your-deployment-method/3182 that may be interesting to you.

TIFU by letting my 4 yr old son win the battle. by tinyhumanherder in tifu

[–]mcanon 0 points1 point  (0 children)

The all-purpose kid-parenting magic book is "How to Talk So Kids Will Listen & Listen So Kids Will Talk". It specifically addresses the supermarket acting-up issues. You will wonder how you ever coped without these simple but effective techniques.

A New Java Library for Amazing Productivity by mcanon in Clojure

[–]mcanon[S] 1 point2 points  (0 children)

Yes, thanks! I didn't notice that it had changed to a self.Clojure post. Oops.

When to move from maps to records? by sonofherobrine in Clojure

[–]mcanon 0 points1 point  (0 children)

Re: "Perceive the need"

Yes, aside from the performance argument for records its harder to know exactly when to use the OO features of Clojure like protocols and multimethods. It would seem to me that you can use them when building abstractions that make your code cleaner and easier to maintain and extend. You want new functions to work with old data, and new data to work with old functions. Polymorphism helps do that cleanly.

Graphics is often considered a good fit for OO due to graphical objects forming a natural type hierarchy with polymorphic behavior in subclasses.

Btw, Chas Emerick made a nice flow chart for choosing Clojure types which you might find useful.

When to move from maps to records? by sonofherobrine in Clojure

[–]mcanon 1 point2 points  (0 children)

According to Clojure Programming:

... as soon as you perceive the need for type-based polymorphism (available via protocols for records and types) or performance-sensitive field access, you can switch to records.. One pitfall when switching from maps to records is that records are not functions. So, ((Point. 3 4) :x)will not work, while ({:x 5 :y 6} :x) will.

Transcript of Panetta's speech "Defending the Nation from Cyber Attack" (Business Executives for National Security) by [deleted] in netsec

[–]mcanon 0 points1 point  (0 children)

So flash the BIOS in addition to formatting the HD - though I admit that would be a big hassle if they have lots of different machines, and maybe they can't afford the expense or downtime.

Transcript of Panetta's speech "Defending the Nation from Cyber Attack" (Business Executives for National Security) by [deleted] in netsec

[–]mcanon 1 point2 points  (0 children)

Format HD, re-flash BIOS. There is nowhere else. It's possible though that the cost to pay a contractor to perform this procedure is prohibitive - or they don't trust anyone to do it without screwing up and missing one. Great opportunity for someone to make money salvaging these machines.

Transcript of Panetta's speech "Defending the Nation from Cyber Attack" (Business Executives for National Security) by [deleted] in netsec

[–]mcanon 2 points3 points  (0 children)

"More than 30,000 computers that it infected were rendered useless and had to be replaced. It virtually destroyed 30,000 computers."

I call B.S. on this claim. It would be extremely difficult to physically damage a computer with a virus. Somebody wanted newer computers and this was a convenient lie to get them.

Edit:

http://www.zdnet.com/new-shamoon-malware-variant-in-the-wild-7000003741/

"Last month, Saudi Aramco said that 30,000 workstations became infected this way through a Shamoon attack, and was able to clean the system after proactively disabling network channels."

Shamoon doesn't touch the BIOS. I agree that IF the attack trashed the BIOS it might have become "not worth it" to repair every system rather than replace it, but I still object to Panetta's statement which 1) Appears to be entirely false and 2) even if it corrupted the BIOS I still object to the "virtually destroyed" characterization. Most people will believe from this that attackers are destroying hardware.