11 Jun 2013, 07:52
Avatar_pragsmall

Javier Acero (2 posts)

(from Programming Elixir > Compiling inside iex not working)

I am doing the exercises on section 6.1 (the Times module). Here is my solution:


defmodule Times do
  def double(n),    do: ( n * 2 )
  def triple(n),    do: ( n * 3 )
  def quadruple(n), do: ( double(double(n)) )
end

When I run it doing:


⌘ ~/Dev/elixir ❯ iex times.ex
Erlang R16B (erts-5.10.1) [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]

Interactive Elixir (0.9.1) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> Times.quadruple(4)
16

It works like a charm. But, when I start iex and then try to compile I get this error:


⌘ ~/Dev/elixir ❯ iex
Erlang R16B (erts-5.10.1) [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]

Interactive Elixir (0.9.1) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> c('times.ex')
== Compilation error on file 116 ==
** (FunctionClauseError) no function clause matching in :elixir_compiler.file_to_path/2
    src/elixir_compiler.erl:47: :elixir_compiler.file_to_path(116, ".")
    /private/tmp/elixir-5Yng/elixir-0.9.1/lib/elixir/lib/kernel/parallel_compiler.ex:56: Kernel.ParallelCompiler."-spawn_compilers/7-fun-0-"/3

Any idea why? I am running elixir 0.9.1 in case it helps. Thanks!

11 Jun 2013, 00:08
Generic-user-small

Martin W. (3 posts)

(from Agile Web Development with Rails 4 > A1 Action Controler -> Migrations are pending; run 'rake db:migrate RAILS_ENV)

Hi Sam,
thank you for your quick reply.
I started over already without changing anything in

rails40/depot_a/db/migrate/20121130000001_create_products.rb 
just to see if it would work.
and before I started over again I deleted the folder depot completely.
What you mean with delete both?
thank you very much.

10 Jun 2013, 20:50
Ds_2009_mpark_pragsmall

Daniel Sauter (39 posts)

(from Rapid Android Development > Networking Android device to PC)

Hi Mark,
you most likely have another sketch running using OSC (probably port 12000), conflicting with the sketch WiFi example. Close the other app, and you’ll be fine.
Best,
Daniel

10 Jun 2013, 16:48
Generic-user-small

Alfonso Muñoz-Pomer Fuentes (3 posts)

(from Programming Ruby 1.9 & 2.0 (4th edition) > 4th Edition Typography Suggestions)

The problem with changing the hash symbol is that certain tools like ri already work with that syntax.

I don’t think it’s a good idea to switch to a yet-again different syntax instead of sticking to what it’s now widely accepted and understood in the Ruby community.

I didn’t skip the usage explanation, but I rarely skip text. The box sounds like a good idea.

10 Jun 2013, 16:45
Generic-user-small

Alfonso Muñoz-Pomer Fuentes (3 posts)

(from Programming Ruby 1.9 & 2.0 (4th edition) > `Float` presented as a method)

In ‘Chapter 3’ (page 30 in the PDF version) Float(price) is presented as a method but it breaks the convention that methods should start with a lower case letter. Of course Float is also a class, but I think it might need a bit of clarification.

10 Jun 2013, 13:43
Samr_small_pragsmall

Sam Ruby (567 posts)

(from Agile Web Development with Rails 4 > A1 Action Controler -> Migrations are pending; run 'rake db:migrate RAILS_ENV)

I can’t explain how you got to this state, but explaining these messages may help. What rails is comparing is the contents of db/development.sqlite3 against the directory db/migrate. If you are starting over, it probably would be best to delete both.

10 Jun 2013, 11:38
Silvias_temp_avatar_pragsmall

Silvia Domenech (29 posts)

(from Create Mobile Games with Corona > Running on a Device)

Oh, I think that had been updated in Beta 2.0. If you want, you can download the newest code files (here) and try to run those.

Silvia

10 Jun 2013, 02:05
Generic-user-small

Andrew Davis (11 posts)

(from Create Mobile Games with Corona > Running on a Device)

I haven’t tried to put it back in, but you’re right. “setGravity” was being called before physics.start. At least according to the book’s source code, so might want to update that.

Thanks again for the help!

10 Jun 2013, 00:38
Silvias_temp_avatar_pragsmall

Silvia Domenech (29 posts)

(from Create Mobile Games with Corona > Running on a Device)

Hi Andy,

Wow, I didn’t know that disabling gravity that way caused problems on some phones. Some people got errors when using setGravity() before physics.start(), but I had not seen setGravity cause any problems when setting it to zero.

I am delighted that it’s finally working on your phone!

Silvia

10 Jun 2013, 00:36
Generic-user-small

Martin W. (3 posts)

(from Agile Web Development with Rails 4 > A1 Action Controler -> Migrations are pending; run 'rake db:migrate RAILS_ENV)

Hi, I just got stuck at A1 somehow. I deleted the depot folder after a typo and did the setup again.
rails new depot
than
rails generate scaffold Product \​ title:string description:text image_url:string price:decimal​​
after that I restarted the server,
but an error occures with Action Controller:
Migrations are pending; run 'rake db:migrate RAILS_ENV=development' to resolve this issue.
I tried to -> rake db:migrate:redo – what did not solve the issue neither -> rake db:migrate RAILS_ENV=development …

Could you please point me in the right direction?
Many thanks,
Martin

environment:
Xfce Ubuntu 12.04
ruby 1.9.3p0 (2011-10-30 revision 33570) [i686-linux]
Rails 4.0.0.beta1