Questions tagged [iota]

The iota function is used by several programming languages or their libraries to initialize a sequence with uniformly increasing values.

Definition:

The iota function is used by several programming languages or their libraries to initialize a sequence with uniformly increasing values.

The APL programming language uses the iota symbol () to generate sequences of successive integers.

The C++ language recently added iota to the standard library in the <numeric> header. The iota template function has existed in several unofficial C++ template libraries for years.

Important Links:

65 questions
3
votes
2 answers

How to use iota_view for custom IntLike types?

I would like to use std::ranges::iota_view for a custom data type that is "int" like in the same way I would use std::ranges::iota_view for an int. I couldn't figure out how to adjust the code based on gcc's error messages, which are posted…
MarkB
  • 672
  • 2
  • 9
3
votes
2 answers

for-loop counter gives an unused-variable warning

My program has an iterative algorithm with a for-loop that I had written as for ( auto i: std::views::iota( 0u, max_iter ) ) { ... } I really like the fact that it can be written like this, even if the necessary header files are enormous. When I…
alle_meije
  • 2,424
  • 1
  • 19
  • 40
2
votes
1 answer

Using std::iota to fill an alphabet vector

In this code I'm filling the vector alpha with letters from 'a' to 'z': std::vector alpha(26); std::iota(alpha.begin(), alpha.end(), 'a'); I'm assuming this will not work with all character encodings, can anyone confirm? Or deny? And if the…
anastaciu
  • 23,467
  • 7
  • 28
  • 53
2
votes
1 answer

How to use std::iota with std::pair?

Suppose I have to use this template which I cannot modify: // cannot modify template void foo(C& c,const T& t) { // ... std::iota(std::begin(c),std::end(c),t); // ... } It fails when c is a container of…
463035818_is_not_an_ai
  • 109,796
  • 11
  • 89
  • 185
2
votes
2 answers

Fill vector with alphabets depending on user input and put Start and End on the extremities

I am trying to make a vector to look like this: alphabet= {start,A,B,C,D,E,F,G,H,I,J,K,etc..,end} The alphabet doesn't go from A to Z, the user inputs the values. So if user inputs 5, I want the vector to be: {start,A,B,C,D,E,end} I tried using iota…
2
votes
2 answers

How to solve error on docker:layers_calculator to compute the Merkle tree on private tangle?

I want to setup a private tangle on my own virtual machine with Ubuntu 18.04, 4GB RAM and 20GB memory. I have follow this instructions: https://docs.iota.org/docs/compass/0.1/how-to-guides/set-up-a-private-tangle. Every command works fine until…
ismsm
  • 143
  • 2
  • 11
2
votes
1 answer

Can sawtooth be used as a permissionless blockchain?

I know large number of public blockchains are around but i realy love the flexibility that hyperledger sawtooth provides so is it a good idea to use sawtooth as a public permissionless blockchain? I can't use Ethereum because it is not feasible for…
2
votes
3 answers

STL iota include file change

The iota function was formerly in the header. It has been change to . I need to keep the old way for backward compatibility so I would like to use preprocessor option to select the right header to include. When does this…
jvtrudel
  • 1,235
  • 3
  • 15
  • 28
2
votes
1 answer

Unrolled Loops of Static Arrays

If I call the function /** Check if all Elements, possibly recursively, of $(D x) are zero. */ bool allZero(T)(in T x) @safe pure nothrow { import std.range: isIterable; static if (isIterable!T) { foreach (ref elt; x) { …
Nordlöw
  • 11,838
  • 10
  • 52
  • 99
1
vote
1 answer

Unmarshal to Enum type using a custom Scan func

I'm trying to unmarshall a Gender type that is an Enumeration that is just int64 under the hood (I don't want to use any string representation of this type). Problem is that the Gender value is not handled properly, I always ended with 0. I'm…
Big_Boulard
  • 799
  • 1
  • 13
  • 28
1
vote
1 answer

Rust tokio: Awaiting an async function in spawned thread

Trying to call an async-function inside a new tokio thread results in an error for some functions. In this minimal example, crates tokio and iota-streams are used. Method send_announce() is async and returns an Address. Awaiting this method results…
F P
  • 13
  • 1
  • 3
1
vote
3 answers

Which blockchain is best to implement tamper proof document?

I am just starting out as a blockchain developer and I want a blockchain service except Ethereum (already implemented) to store a hash (SHA256 and ISCC hashes) of a document in a blockchain so that it can verify its validity and is tamper proof.…
Mr.SsS
  • 113
  • 1
  • 6
1
vote
0 answers

How to install a proof-of-work proxy server on raspberry pi 3B

I am trying to install a proof-of-work proxy server from the link: https://docs.iota.org/docs/node-software/0.1/iri/how-to-guides/install-a-pow-proxy on Raspberry Pi 3B. However, when I try to build an executable file at step 4, I get the following…
user3582228
  • 181
  • 2
  • 14
1
vote
0 answers

FIWARE Orion error 'Couldn't connect to server' forwarding 'Query' to providing application

I am trying to provision a device and send actuation commands back using 2 components Orion and LoRaWAN IoT Agent. I am running Orion and other components on docker-compose file, and the IoT Agent using node bin/iotagent-lora I have successfully…
1
vote
0 answers

Iota java api unable to find valid certification path to requested target

I'm using the java wrapper for iota iota-java. I have a java ee application (payara) where I connect to the following url nodes. However when trying to get some information from the tangle, for example bundlesFromAddresses I get the following…
greedsin
  • 1,252
  • 1
  • 24
  • 49