Git Product home page Git Product logo

ginsing's Introduction

SolveMedia

Author:: Eddie Siegel Info:: www.solvemedia.com Documentation:: portal.solvemedia.com/portal/help/pub

Installation

SolveMedia can be installed as a gem by adding the following line to your environment.rb file:

config.gem "solvemedia"

And then running the following to install the gem:

sudo rake gems:install

Alternatively you can install SolveMedia as a plugin

script/plugin install git://github.com/SolveMedia/SolveMedia.git

API Keys

Your Solve Media API keys should be stored in config/solvemedia_config.yml, which can be generated by running

script/generate solvemedia_config

Don’t forget to edit the generated file to contain your API keys.

Adding A Solve Media Puzzle To A View

Displaying a Solve Media Puzzle is as simple as calling solvemedia_puzzle inside a form within your view. For example:

<% form_for(@user) do |f| %>
  # ...
  <p>
    <%= solvemedia_puzzle %>
  </p>
  # ...
<% end %>

The appearance of the puzzle can be adjusted by passing options to solvemedia_puzzle. For a full list of options, see the documentation.

Verifying The Input To A Solve Media Puzzle In A Controller

The verify_solvemedia_puzzle method verifies the user’s input and returns true if the user provided the correct input. In the simplest case, verification could be performed as follows:

respond_to do |format|
  if verify_solvemedia_puzzle && @user.save
    # ...
  else
    # ...
  end
end

verify_solvemedia_puzzle can also be used to add an error to a model object if the verification fails:

respond_to do |format|
  if verify_solvemedia_puzzle(:model => @user, :error_message => 'Solve Media puzzle input is invalid') && @user.save
    # ...
  else
    # ...
  end
end

See the documentation for a full list of options accepted by verify_solvemedia_puzzle.

ginsing's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ginsing's Issues

compiling log.cc on centos

i needed to add #include <arpa/inet.h> to log.cc for it to compile on centos6

before adding it i got the error

g++ -g -march=opteron -mtune=opteron -m64 -O3 -ffast-math -pthreads -Ipwd/../inc -I/usr/local/m64/include -DMYNAME="ginsing" -c -o log.o log.cc
g++: unrecognized option '-pthreads'
log.cc: In function 'void out_ipv6(FILE_, uint16_t_)':
log.cc:38: error: 'htons' was not declared in this scope
log.cc: In function 'void log_request(NTD_)':
log.cc:54: error: 'sockaddr_in' was not declared in this scope
log.cc:54: error: 'si' was not declared in this scope
log.cc:55: error: 'sockaddr_in6' was not declared in this scope
log.cc:55: error: 'ss' was not declared in this scope
log.cc:78: error: expected primary-expression before ')' token
log.cc:78: error: expected ';' before 'ntd'
log.cc:82: error: expected primary-expression before ')' token
log.cc:82: error: expected ';' before 'ntd'
make: *_* [log.o] Error 1

reload_config crash

valgrind --tool=memcheck --leak-check=full --show-reachable=yes ./ginsingd -c /home/millken/Config/ginsing/config -f

==10848== 298,610 bytes in 8,161 blocks are possibly lost in loss record 92 of 99
==10848==    at 0x4A075BC: operator new(unsigned long) (vg_replace_malloc.c:298)
==10848==    by 0x3B3309C3C8: std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) (in /usr/lib64/libstdc++.so.6.0.13)
==10848==    by 0x3B3309D19A: std::string::_Rep::_M_clone(std::allocator<char> const&, unsigned long) (in /usr/lib64/libstdc++.so.6.0.13)
==10848==    by 0x3B3309D5EB: std::string::reserve(unsigned long) (in /usr/lib64/libstdc++.so.6.0.13)
==10848==    by 0x40A2BC: cvt_name_to_wire(std::string*, std::string*) (basic_string.tcc:701)
==10848==    by 0x40AC7B: RRCompString::set_name(std::string, std::string*) (rr.cc:170)
==10848==    by 0x40B036: RR_Compress::configure(InputF*, Zone*, std::string*) (rr.cc:274)
==10848==    by 0x412B9E: Zone::load(ZDB*, InputF*) (zonefile.cc:460)
==10848==    by 0x413410: ZDB::load(std::string*, std::string*) (zonefile.cc:103)
==10848==    by 0x4136A9: load_zdb() (zonefile.cc:57)
==10848==    by 0x40D708: zdb_init() (zdb.cc:31)
==10848==    by 0x41C394: main (main.cc:114)
==10848== 
==10848== 303,682 bytes in 8,154 blocks are possibly lost in loss record 93 of 99
==10848==    at 0x4A075BC: operator new(unsigned long) (vg_replace_malloc.c:298)
==10848==    by 0x3B3309C3C8: std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) (in /usr/lib64/libstdc++.so.6.0.13)
==10848==    by 0x3B3309D19A: std::string::_Rep::_M_clone(std::allocator<char> const&, unsigned long) (in /usr/lib64/libstdc++.so.6.0.13)
==10848==    by 0x3B3309D5EB: std::string::reserve(unsigned long) (in /usr/lib64/libstdc++.so.6.0.13)
==10848==    by 0x40A2BC: cvt_name_to_wire(std::string*, std::string*) (basic_string.tcc:701)
==10848==    by 0x40ACEB: RRCompString::set_name(std::string, std::string*) (rr.cc:175)
==10848==    by 0x40B036: RR_Compress::configure(InputF*, Zone*, std::string*) (rr.cc:274)
==10848==    by 0x412B9E: Zone::load(ZDB*, InputF*) (zonefile.cc:460)
==10848==    by 0x413410: ZDB::load(std::string*, std::string*) (zonefile.cc:103)
==10848==    by 0x4136A9: load_zdb() (zonefile.cc:57)
==10848==    by 0x40D708: zdb_init() (zdb.cc:31)
==10848==    by 0x41C394: main (main.cc:114)
==10848== 
==10848== 330,688 bytes in 5,167 blocks are still reachable in loss record 94 of 99
==10848==    at 0x4A075BC: operator new(unsigned long) (vg_replace_malloc.c:298)
==10848==    by 0x40E12A: RRSet::make(Zone*, std::string*, bool, int) (zdb.cc:129)
==10848==    by 0x40E6DD: Zone::insert(ZDB*, RR*, std::string*) (zdb.cc:85)
==10848==    by 0x412BF2: Zone::load(ZDB*, InputF*) (zonefile.cc:471)
==10848==    by 0x413410: ZDB::load(std::string*, std::string*) (zonefile.cc:103)
==10848==    by 0x4136A9: load_zdb() (zonefile.cc:57)
==10848==    by 0x40D708: zdb_init() (zdb.cc:31)
==10848==    by 0x41C394: main (main.cc:114)
==10848== 
==10848== 384,685 bytes in 8,052 blocks are possibly lost in loss record 95 of 99
==10848==    at 0x4A075BC: operator new(unsigned long) (vg_replace_malloc.c:298)
==10848==    by 0x3B3309C3C8: std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) (in /usr/lib64/libstdc++.so.6.0.13)
==10848==    by 0x3B3309D19A: std::string::_Rep::_M_clone(std::allocator<char> const&, unsigned long) (in /usr/lib64/libstdc++.so.6.0.13)
==10848==    by 0x3B3309D533: std::string::assign(std::string const&) (in /usr/lib64/libstdc++.so.6.0.13)
==10848==    by 0x40A416: RR::set_name(std::string*) (basic_string.h:511)
==10848==    by 0x40A60C: RR::make(std::string*, int, int, int, bool) (rr.cc:65)
==10848==    by 0x412B7A: Zone::load(ZDB*, InputF*) (zonefile.cc:455)
==10848==    by 0x413410: ZDB::load(std::string*, std::string*) (zonefile.cc:103)
==10848==    by 0x4136A9: load_zdb() (zonefile.cc:57)
==10848==    by 0x40D708: zdb_init() (zdb.cc:31)
==10848==    by 0x41C394: main (main.cc:114)
==10848== 
==10848== 390,281 bytes in 8,161 blocks are possibly lost in loss record 96 of 99
==10848==    at 0x4A075BC: operator new(unsigned long) (vg_replace_malloc.c:298)
==10848==    by 0x3B3309C3C8: std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) (in /usr/lib64/libstdc++.so.6.0.13)
==10848==    by 0x3B3309D19A: std::string::_Rep::_M_clone(std::allocator<char> const&, unsigned long) (in /usr/lib64/libstdc++.so.6.0.13)
==10848==    by 0x3B3309D533: std::string::assign(std::string const&) (in /usr/lib64/libstdc++.so.6.0.13)
==10848==    by 0x40ABDF: RRCompString::set_name(std::string, std::string*) (basic_string.h:511)
==10848==    by 0x40B036: RR_Compress::configure(InputF*, Zone*, std::string*) (rr.cc:274)
==10848==    by 0x412B9E: Zone::load(ZDB*, InputF*) (zonefile.cc:460)
==10848==    by 0x413410: ZDB::load(std::string*, std::string*) (zonefile.cc:103)
==10848==    by 0x4136A9: load_zdb() (zonefile.cc:57)
==10848==    by 0x40D708: zdb_init() (zdb.cc:31)
==10848==    by 0x41C394: main (main.cc:114)
==10848== 
==10848== 392,737 bytes in 8,052 blocks are possibly lost in loss record 97 of 99
==10848==    at 0x4A075BC: operator new(unsigned long) (vg_replace_malloc.c:298)
==10848==    by 0x3B3309C3C8: std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) (in /usr/lib64/libstdc++.so.6.0.13)
==10848==    by 0x3B3309D19A: std::string::_Rep::_M_clone(std::allocator<char> const&, unsigned long) (in /usr/lib64/libstdc++.so.6.0.13)
==10848==    by 0x3B3309D5EB: std::string::reserve(unsigned long) (in /usr/lib64/libstdc++.so.6.0.13)
==10848==    by 0x40A2BC: cvt_name_to_wire(std::string*, std::string*) (basic_string.tcc:701)
==10848==    by 0x40A428: RR::set_name(std::string*) (rr.cc:111)
==10848==    by 0x40A60C: RR::make(std::string*, int, int, int, bool) (rr.cc:65)
==10848==    by 0x412B7A: Zone::load(ZDB*, InputF*) (zonefile.cc:455)
==10848==    by 0x413410: ZDB::load(std::string*, std::string*) (zonefile.cc:103)
==10848==    by 0x4136A9: load_zdb() (zonefile.cc:57)
==10848==    by 0x40D708: zdb_init() (zdb.cc:31)
==10848==    by 0x41C394: main (main.cc:114)
==10848== 
==10848== 461,056 bytes in 3,602 blocks are still reachable in loss record 98 of 99
==10848==    at 0x4A075BC: operator new(unsigned long) (vg_replace_malloc.c:298)
==10848==    by 0x40A941: RR::make(std::string*, int, int, int, bool) (rr.cc:43)
==10848==    by 0x412B7A: Zone::load(ZDB*, InputF*) (zonefile.cc:455)
==10848==    by 0x413410: ZDB::load(std::string*, std::string*) (zonefile.cc:103)
==10848==    by 0x4136A9: load_zdb() (zonefile.cc:57)
==10848==    by 0x40D708: zdb_init() (zdb.cc:31)
==10848==    by 0x41C394: main (main.cc:114)
==10848== 
==10848== 851,712 bytes in 6,654 blocks are still reachable in loss record 99 of 99
==10848==    at 0x4A075BC: operator new(unsigned long) (vg_replace_malloc.c:298)
==10848==    by 0x40A54D: RR::make(std::string*, int, int, int, bool) (rr.cc:34)
==10848==    by 0x412B7A: Zone::load(ZDB*, InputF*) (zonefile.cc:455)
==10848==    by 0x413410: ZDB::load(std::string*, std::string*) (zonefile.cc:103)
==10848==    by 0x4136A9: load_zdb() (zonefile.cc:57)
==10848==    by 0x40D708: zdb_init() (zdb.cc:31)
==10848==    by 0x41C394: main (main.cc:114)
==10848== 
==10848== LEAK SUMMARY:
==10848==    definitely lost: 32 bytes in 4 blocks
==10848==    indirectly lost: 0 bytes in 0 blocks
==10848==      possibly lost: 3,689,953 bytes in 91,627 blocks
==10848==    still reachable: 3,009,292 bytes in 37,625 blocks
==10848==         suppressed: 0 bytes in 0 blocks
==10848== 
==10848== For counts of detected and suppressed errors, rerun with: -v
==10848== ERROR SUMMARY: 61 errors from 61 contexts (suppressed: 6 from 6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.