Ad
  • Custom User Avatar

    I think you can easily use .trim() to avoid it.

  • Custom User Avatar

    Wow, cool. And here I realized how sophisticated was my code without using the StringBuilder))).

  • Custom User Avatar

    Alright, so there should be 3 classes. Not clear, what the Human class should do beside of having two inner classes inside of it. Nor it is said what methods each class should contain if any.

  • Custom User Avatar

    Please, fix the texting:
    'subtract' should return a mimus b! - Expected: 6, instead got: 3

    I believe, mimus should be replaced with minus

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    I am not able to find the correct solution.
    The query that goes inside the CROSSTAB function returns correct result (tried in pgAdmin RDMS), but when I wrap it into my general code, I am getting an error:
    PG::SyntaxError: ERROR: return and sql tuple descriptions are incompatible
    I can't see any contradictions to the PSQL documentation in my code. Can anyone tell me why may I be getting this error?
    Thanks in advance!

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    @Rainer, hey I keep getting the same issue too. My case is working (I have previously checked it on other solutions and in the DBMS tool as well), but the test mentioned by you is not passing and the '[no clan specified]' does not appear in the results. Did you manage to solve the issue?

  • Custom User Avatar

    I think, test cases for that check were just missing when you submitted solution.

  • Custom User Avatar

    @Voracious, I think the task is to create the table and then select a column from it with the string. At least this is how I am trying to implement it. It would be too easy to solve it if we would not have to return the table as well. Correct me someone if I am wrong. Would appreciate it.

  • Custom User Avatar

    How can one get a referral link? I can't find it anywhere.

  • Custom User Avatar

    @matt c, thanks for your reply. have already found the solution.

  • Custom User Avatar

    What's wrong with my code?
    I am passing 51 test and still getting one error:

    /usr/local/bundle/gems/sequel-4.48.0/lib/sequel/adapters/postgres.rb:166:in `async_exec'
    /usr/local/bundle/gems/sequel-4.48.0/lib/sequel/adapters/postgres.rb:166:in `block in execute_query'
    /usr/local/bundle/gems/sequel-4.48.0/lib/sequel/database/logging.rb:45:in `log_connection_yield'
    /usr/local/bundle/gems/sequel-4.48.0/lib/sequel/adapters/postgres.rb:166:in `execute_query'
    /usr/local/bundle/gems/sequel-4.48.0/lib/sequel/adapters/postgres.rb:153:in `block in execute'
    /usr/local/bundle/gems/sequel-4.48.0/lib/sequel/adapters/postgres.rb:129:in `check_disconnect_errors'
    /usr/local/bundle/gems/sequel-4.48.0/lib/sequel/adapters/postgres.rb:153:in `execute'
    /usr/local/bundle/gems/sequel-4.48.0/lib/sequel/adapters/postgres.rb:514:in `_execute'
    /usr/local/bundle/gems/sequel-4.48.0/lib/sequel/adapters/postgres.rb:326:in `block (2 levels) in execute'
    /usr/local/bundle/gems/sequel-4.48.0/lib/sequel/adapters/postgres.rb:536:in `check_database_errors'
    /usr/local/bundle/gems/sequel-4.48.0/lib/sequel/adapters/postgres.rb:326:in `block in execute'
    /usr/local/bundle/gems/sequel-4.48.0/lib/sequel/database/connecting.rb:301:in `block in synchronize'
    /usr/local/bundle/gems/sequel-4.48.0/lib/sequel/connection_pool/threaded.rb:107:in `hold'
    /usr/local/bundle/gems/sequel-4.48.0/lib/sequel/database/connecting.rb:301:in `synchronize'
    /usr/local/bundle/gems/sequel-4.48.0/lib/sequel/adapters/postgres.rb:326:in `execute'
    /usr/local/bundle/gems/sequel-4.48.0/lib/sequel/dataset/actions.rb:1081:in `execute'
    /usr/local/bundle/gems/sequel-4.48.0/lib/sequel/adapters/postgres.rb:679:in `fetch_rows'
    /usr/local/bundle/gems/sequel-4.48.0/lib/sequel/dataset/actions.rb:942:in `with_sql_each'
    /usr/local/bundle/gems/sequel-4.48.0/lib/sequel/dataset/actions.rb:950:in `with_sql_first'
    /usr/local/bundle/gems/sequel-4.48.0/lib/sequel/dataset/actions.rb:958:in `with_sql_single_value'
    /usr/local/bundle/gems/sequel-4.48.0/lib/sequel/dataset/actions.rb:773:in `single_value!'
    /usr/local/bundle/gems/sequel-4.48.0/lib/sequel/dataset/actions.rb:110:in `count'
    /home/codewarrior/setup.rb:48:in `block (3 levels) in run_sql'
    /home/codewarrior/setup.rb:383:in `wrap_error'
    /home/codewarrior/setup.rb:275:in `it'
    /home/codewarrior/setup.rb:47:in `block (2 levels) in run_sql'
    /home/codewarrior/setup.rb:258:in `block in describe'
    /home/codewarrior/setup.rb:249:in `measure'
    /home/codewarrior/setup.rb:254:in `describe'
    /home/codewarrior/setup.rb:46:in `block in run_sql'
    /home/codewarrior/setup.rb:188:in `try_connection'
    /home/codewarrior/setup.rb:44:in `run_sql'
    /home/codewarrior/.spec.rb:1:in `'
    /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    /home/codewarrior/.entry.rb:6:in `'
    /usr/local/bundle/gems/rspec-core-3.6.0/lib/rspec/core/configuration.rb:1922:in `load'
    /usr/local/bundle/gems/rspec-core-3.6.0/lib/rspec/core/configuration.rb:1922:in `load_spec_file_handling_errors'
    /usr/local/bundle/gems/rspec-core-3.6.0/lib/rspec/core/configuration.rb:1494:in `block in load_spec_files'
    /usr/local/bundle/gems/rspec-core-3.6.0/lib/rspec/core/configuration.rb:1492:in `each'
    /usr/local/bundle/gems/rspec-core-3.6.0/lib/rspec/core/configuration.rb:1492:in `load_spec_files'
    /usr/local/bundle/gems/rspec-core-3.6.0/lib/rspec/core/runner.rb:100:in `setup'
    /usr/local/bundle/gems/rspec-core-3.6.0/lib/rspec/core/runner.rb:86:in `run'
    /usr/local/bundle/gems/rspec-core-3.6.0/lib/rspec/core/runner.rb:71:in `run'
    /usr/local/bundle/gems/rspec-core-3.6.0/lib/rspec/core/runner.rb:45:in `invoke'
    /usr/local/bundle/gems/rspec-core-3.6.0/exe/rspec:4:in `'
    /usr/local/bundle/bin/rspec:22:in `load'
    /usr/local/bundle/bin/rspec:22:in `
    '```
    
    What's that?
    
  • Custom User Avatar

    For some reason my resuld is outcoming into this mess:

    got: [{:id=>1, :name=>"Shoes"}, {:id=>2, :name=>"Clothing"}, {:id=>3, :name=>"Jewelry"}, {:id=>4, :name=>"..., :name=>"Clothing"}, {:id=>3, :name=>"Jewelry"}, {:id=>4, :name=>"Tools"}, {:id=>5, :name=>"Home"}]

    I have no idea why is it going like this. My code seems to be correct, but maybe there's a tiny mistake. Should we use GROUP BY or ORDER BY in the subsection?

  • Custom User Avatar

    Gosh, why do I always tend to complicate the things?!)))) The solution is sooo easy than I thought.

  • Loading more items...