Questions tagged [Clojure] (38)

1
answer

How to work in Clojure?

Greetings. Tell me how in clojure to work with the socket? Or just take and do(def socket (Socket. "127.0.0.1" 9999)) On github there are a couple of library wrappers over java.net.Socket, but the stars they don't dazzle.
hector_Leusch asked March 24th 20 at 13:57
1
answer

How to optimize the code and get rid of the crutches in recursion on the first and last iteration?

Task: Write a function that accepts a channel consisting of a sequence of numbers, the first of which is the number of subsequent items that you want to put into the array followed by the elements of this array, and returns separate arrays. For example 3, 4, 0, 2, 1, 2, 2, 4, 5 will be turned into [4, 0, 2], [2], [4, 5] Now...
Brionna_Mraz asked March 16th 20 at 14:07
2
answers

How to optimize a function that selects from the list only items that occur more than n times?

I wrote a function which counts how many times each item occurs in a vector and create a new vector of the type [{:value count} {:value count} ...] and then filtered a new vector, so that it remains only elements that are greater than n However, showing it to the teacher, I pointed to the fact that the algorithm is ineffici...
ansley asked March 16th 20 at 13:51
1
answer

How to calculate the integral with the use of memoization in Clojure?

There is a task: Implement a function (operator) that accepts an argument a function of one variable f and returns a function of one variable that computes (numerically) the expression: To optimize using memoization for tasks such as building the graphs (i.e. the multiple call functions at different points) Use the method o...
Sammie.West21 asked March 13th 20 at 14:25
4
answers

Whether to bother with Clojure?

Does anyone have experience developing in that language? How do you like it? Should I learn and in what field is better to use (web, client apps, etc)?
felicity.Moen77 asked October 7th 19 at 22:23
0
answer

How to run clojure from Matlab?

Good day, colleagues. You can't run a clojure script from Matlab. Wrote a small static method in java, which runs a script in clojure. From bash, everything works like clockwork. And of Matlab, swears by the class loader. I think this is a minimal example demonstrates the problem: (Matlab) javaaddpath([pwd '/lib/cloju...
Davonte.Rodriguez asked October 3rd 19 at 05:37
5
answers

What to write a programming language of your dreams?

Hello, help please with such problem: there is a wonderful Clojure, it suits me in everything except 1. solutions realtime task - I would like to work with memory directly, or ask how you can get around without crutches in Java 2. inline assembler In order not to write everything from scratch in pure assembler (that's a ...
Kaylee.Block asked October 2nd 19 at 22:53
2
answers

Are there any good books on Clojure?

In fact, the subject, if any such, to have and functionalso explained? In Russian even hope, you say? Google che does not speak much.
rachelle59 asked September 28th 19 at 02:31
2
answers

The choice of the framework to create REST services

Part of the question, which does not apply to you: Who could work on the REST services knows that it's pretty boring. You create a resource, saying that it is possible to go such and such methods, records have a certain set of fields with restrictions on their values, and default values. It is often stored in a regular RDBM...
stefan38 asked September 27th 19 at 01:15
2
answers

How to use matrix multiplication in clojure?

(ns my-namespace (:use clojure.core.matrix) (:require [clojure.core.matrix.operators :as M])) => nil (def a (matrix [[1 2 3] [4 5 6]])) => (var my-namespace/a) (def b (matrix [[10 20] [20 30] [30 40]])) => (var my-namespace/b) (M/* a b) RuntimeException Incompatible shapes, cannot broadcast [3 2] to [2 3] in cloj...
ryleigh56 asked September 25th 19 at 16:01