Questions tagged [unfold]

An unfold function is the opposite (or dual) of a fold. Unfolds recursively generate a list (or other recursive data structure) of values from a seed value.

An unfold function is the opposite (or dual) of a . Unfolds recursively generate a list (or other recursive data structure) of values from a seed value.

Unfold functions are often used functional languages which support to construct a whose values are only created on demand.

48 questions
3
votes
2 answers

HW: Unfolding a list in a specific way

In Programming in Haskell, Graham Hutton defines an unfold for lists as follows: unfold :: (b -> Bool ) -> (b -> a) -> (b -> b) -> b -> [a] unfold p h t x | p x = [] | otherwise = h x : unfold p h t (t x) Define a function • listUnfold :: (b ->…
rlhh
  • 893
  • 3
  • 17
  • 32
2
votes
1 answer

How to indicate fold unfold icon at the line indicator in codearea of richtextfx control java

I just want to implement some code folding between brackets or carets like other java IDEs: eclipse, netbeans, intellij using codearea control of richtextfx library. Please give me some code hints? thank you.
garawaa garawaa
  • 154
  • 1
  • 6
2
votes
2 answers

How to manage Unfold precompiling error: _iszero not defined?

On a new computer I was trying to run Unfold and UnfoldMakie. See this error in both cases. Like something wrong with the MutableArithmetics library. Any idea how to manage it? Also get this after update of MakieCore package: Versions: Julia…
2
votes
2 answers

Where I can find an intuitive explanation of PyTorch's Tensor.unfold() being used to get image patches?

Recently I came across some code that extracted (sliding-window style) a number of square patches from an RGB image (or set of them) of shape N x B x H x W. They did this as follows: patch_width = 3 patches = image.permute(0,2,3,1).unfold(dim = 1,…
kairocks2002
  • 436
  • 1
  • 3
  • 15
2
votes
2 answers

What is the type of apomorphism specific to list and how is it implemented?

I am learning recursion schemes and it has proven very helpful to me to implement them specific to the list type. However, I got stuck on apomorphisms. Here is an implementation of tails in terms of apo I recently found: import…
user5536315
2
votes
1 answer

SQL - Impala - How to unfold one categorical column into many?

I have the following table : user category number 1 A 8 1 B 6 2 A 1 2 C 9 3 B 5 I want to "unfold" or "dummify" the category column and fill them with…
Vincent
  • 1,534
  • 3
  • 20
  • 42
2
votes
2 answers

R data.table: subsetting data.table/dataframe based on size of row value

This is a basic question, but I'm stumped: I have the following R data.table: library(data.table) DT <- fread('unique_point biased data_points team groupID …
ShanZhengYang
  • 16,511
  • 49
  • 132
  • 234
2
votes
1 answer

Reactive Extensions unfold / scan approach for nested hierarchy

I'm currently building a wizard system for an application, and we're using ReactiveUI and as a result Rx. Each step in the wizard implements IWizardStep where T is just the data type that the wizard ultimately produces. Each step has the…
Clint
  • 6,133
  • 2
  • 27
  • 48
2
votes
1 answer

Google Image Search : Unfolding image details effect with jquery?

I just noticed the nice "new" unfolding effect on Google Image Search when you click on an image. Id like to implement that into my project. Im sure there are already jquery plugins which will do just that. Yet I dunno how this effect may be called…
andibra
  • 153
  • 4
  • 15
1
vote
0 answers

XCode - stop unfolding by default

Newbie here: Is there any setting to tweak so that Xcode doesn't unfold the blocks of code by default? Whenever I re-open the project or copy - paste a folded code somewhere else (in the same file), Xcode unfolds not only that part of the code, but…
redwolfG
  • 11
  • 2
1
vote
2 answers

How to produce a true `Iterator[Long]` in Scala

I came across this other post looking for a way to create an Iterator[Long]. Currently the Scala SDK does not have any Iterator constructor that produces an Iterator[Long]. Other collection types may (unverified) provide some kind of constructor,…
Darren Bishop
  • 2,379
  • 23
  • 20
1
vote
1 answer

Highcharts fold/unfold waterfall

I use Highcharts watefall (and stacked waterfall for multiple measures) and it is very powerfull. I would like to get a better render with a dynamic fold/unfold. In the following example : https://jsfiddle.net/vegaelce/4x1ndpjr/ I would all…
vegaelce
  • 115
  • 6
1
vote
1 answer
1
vote
0 answers

How can I check/see the inside operations and calculations of any Keras (Dense, Conv1D, LSTM) layers?

I have a question about the architecture of the Keras layers. About kind of unfolding the architecture of the layer. For example, I would like to see the main equation used for the Dense layer in Keras, how the n. of neurons, activation function,…
Yevhenii
  • 23
  • 3
1
vote
1 answer

Unfold the loop three times

I got this Java function and I have to write the piece of code which results by unfolding the loop three times. What does it mean? int f(int x, int y) { while (true) { int m = x % y; if(m == 0) return y; x = y; y = m; …
PHPCore
  • 121
  • 9