Questions tagged [elixir-iex]

Elixir’s interactive shell.

iex is Elixir’s interactive shell, which can be used to interactively run Elixir code from the command line.

150 questions
1
vote
1 answer

Running powershell scripts with python under one session

I try to create a python program which will deobfuscate powershell malware, which uses IEX. My python program is actually hooking the IEX function and instead of running the desired string, it will print the string. Now my problem is that I have…
1
vote
1 answer

Filtering long list of data from IEX

I would like to filter my data so that I only get the symbol, close and sector. I tried using the code below but I get an error that 'list is not callable' . Also, do note that iexfinance uses filter_, as filter is a reserved word in Python …
Jonathan
  • 424
  • 4
  • 14
1
vote
2 answers

Why does my iex return a '-C' or a '-A' when I run this function

I've been learning Elixir for awhile now but I came across something today that totally confused me. I made this filtering function: thingy = for a <- ["may", "lay", "45", "67", "bay", "34"], do: Integer.parse(a) for {n, _} <- thingy, do: n output:…
Peter
  • 45
  • 8
1
vote
2 answers

What's the iex equivalent of erl's 'rr'?

In the Erlang shell, erl, I can use rr(Mod) to load the record definitions from the specified module. This allows me to see the field names when looking at a record in the shell. What's the equivalent to rr(Mod) in the Elixir shell, iex? For…
Roger Lipscombe
  • 89,048
  • 55
  • 235
  • 380
1
vote
0 answers

Evaluate Elixir command from cmdline - module is not available

I’m finding that if I do the following everything works as expected: $ iex --sname console --remsh eprocess@service eprocess@service)1> MyModule.process() However, MyModule is not available if I try: $ iex --sname console --remsh eprocess@$HOSTNAME…
Olshansky
  • 5,904
  • 8
  • 32
  • 47
1
vote
1 answer

Why is my app being referenced twice when using alias in the console?

in iex -S mix when I do alias MyApp.Services.DoStuff I see a response of MyApp.MyApp.Services.DoStuff Which doesn't seem to let me use my module in the console. My module is defined in lib/myapp/services/dostuff.ex defmodule MyApp.Services.DoStuff…
Terence Chow
  • 10,755
  • 24
  • 78
  • 141
1
vote
1 answer

Make fixtures and testhelp functions available for ExUnit and iex

I am writing a project that I want to test, both automatically with ExUnit and interactivly with iex. Say my project look like this: [mto@bgobuildwin8g sample]$ tree . ├── config │   └── config.exs ├── fixtures │   └── complex_struct.exs ├── lib │  …
toftis
  • 1,070
  • 9
  • 26
1
vote
1 answer

Unable to ssh via phoenix / Elixir

I want to ssh to a remote host via a phoenix app. I am using Erlang :ssh following these steps 1) Starting an iex Session iex -S mix phoenix.server 2) Ensuring that :ssh application has started :application.ensure_all_started(:ssh) 3) ssh to…
Robin Solanki
  • 203
  • 1
  • 8
1
vote
1 answer

Code.ensure_loaded? in .iex.exs

I have an elixir console configuration stored in .iex.exs: if Code.ensure_loaded?(MyApp.Repo) do alias MyApp.Repo end I want to have an ability to run both iex and iex -S mix. I'll have exception if I remove condition on iex. But this conditions…
Alex Antonov
  • 14,134
  • 7
  • 65
  • 142
1
vote
0 answers

How can I get out of a bad state in `iex`?

When using iex, I sometimes create an incomplete expression by accident. A trivial example: iex(1) String.reverse("foo" ...(1) If I supplied the missing ) here, all would be well, but sometimes I don't see what I did wrong. Is there a way to…
Nathan Long
  • 122,748
  • 97
  • 336
  • 451
1
vote
1 answer

iex, how to reload structs effectively?

I found a minimal example that shows one of the problem that I encounter while learning Elixir. I write a script: defmodule P do defstruct a: 2 def geta(%P{a: a}), do: a end Use iex "filename" to start an iex session check that it works with…
lc2817
  • 3,722
  • 16
  • 40
1
vote
0 answers

What is the effect on using | without a list?

I was doing this in iex: Interactive Elixir (1.3.0-dev) - press Ctrl+C to exit (type h() ENTER for help) iex(1)> a = [1] [1] iex(2)> b = [a | [2]] [[1], 2] iex(3)> [head | tail] = b [[1], 2] iex(4)> head [1] iex(5)> tail [2] iex(6)> n =…
Geo
  • 93,257
  • 117
  • 344
  • 520
1
vote
2 answers

Why Do I See Two Results?

I'm working through Sasa Juric's "Elixir In Action" and I spotted something I find a little bit puzzling. I was working through the examples he gives around page 140 or so and I saw this: iex(2)> send(self, {:message, 1}) # Line 1 {:message,…
Onorio Catenacci
  • 14,928
  • 14
  • 81
  • 132
0
votes
1 answer

PDF Merging with Elixir and pdftk with Implementation?

I am working on an Elixir project that involves merging PDF files using the pdftk command-line tool. I have written a function in my Elixir module, PdfMerger.MergePdfs, to merge PDFs using the pdftk command. However, when I call this function with…
SANONICHAN
  • 21
  • 3
0
votes
1 answer

(SyntaxError) mix.exs:50:7: syntax error before: '{'

I am trying to add the mnemonic_slugs library into my mix.exs file but I keep getting the error ** (SyntaxError) mix.exs:50:7: syntax error before: '{' | 50 | {:mnemonic_slugs, "~> 0.0.3"} | ^ (mix 1.15.3)…
Pickle
  • 27
  • 1
  • 7