Posts

facebook - Given URL is not allowed by the Application configuration in wordpress social plugin -

Image
error - given url not allowed application configuration.: 1 or more of given urls not allowed app's settings. must match website url or canvas url, or domain must subdomain of 1 of app's domains. i have created app facebook error comes in wordpress socil login plugin . if body know me out just add wordpress web page url application settings. must add url in "website facebook login" part.

clojure - Architecture for plugins to be loaded in runtime -

considering developing end-user software program (as uberjar) wondering options make possible user download plugin , load during runtime. the plugin(s) should come compiled , without source code, sth. load not option. existing libraries (or ways of java...?) exist build on? edit: if not sure satisfied way costs reboot/-start of main-program. however, important source-code won't included in jar file (neither main application nor plugin-jars, see :omit-source of leiningen documentation). to add jar during runtime, use pomegranate lets add .jar file classpath. plugins of software should regular clojure libs follow conventions need establish: make them provide (e. g. in edn ) symbol object implementing constructor/destructor mechanism such lifecycle protocol in stuart sierras component library. in runtime, require , resolve symbol, start resulting object , hand on rest programs plugin coordination facilities. provide public api in program allows plugins int...

knockout.js - using knockout to set css class with an if condition -

i want set bootstrap css class span if condition (up binded value). have isapproved field in list , want see field 'label-success' class when active , 'label-important' class when inactive i added line , time taking first class : data-bind="text: isapproved, css: isapproved = 'true' ? 'label label-important' : 'label label-important'" is possible in html or should add computed field on vm? if understood right, binding looking for. data-bind="text: isapproved, css: { 'label' : true, 'label-success' : isapproved(), 'label-important': !isapproved() }" i hope helps.

How do I pass a value to an object in javascript? -

i have think called object(?) in javascript: paymentwindow = new paymentwindow({ 'merchantnumber': "xxxxxx", 'amount': '10500', 'currency': "dkk" }); now want set amount value object. like: paymentwindow.amount = '20000'; however, not work. sure simple, can't find solution. now want able set amount outside object. this easy or impossible, depending on how object looks like. if constructor set this: function paymentwindow(options) { this.amount = options.amount; } then it's easy , works propose. attached this becomes public property. however, if constructor set this: function paymentwindow(options) { var amount = options.amount; } then it's impossible, because var amount private constructed object.

spring - Mock MVC - Add Request Parameter to test -

i using spring 3.2 mock mvc test controller.my code is @autowired private client client; @requestmapping(value = "/user", method = requestmethod.get) public string initusersearchform(modelmap modelmap) { user user = new user(); modelmap.addattribute("user", user); return "user"; } @requestmapping(value = "/byname", method = requestmethod.get) @responsestatus(httpstatus.ok) public @responsebody string getuserbyname(@requestparam("firstname") string firstname, @requestparam("lastname") string lastname, @modelattribute("userclientobject") userclient userclient) { return client.getuserbyname(userclient, firstname, lastname); } and wrote following test: @test public void testgetuserbyname() throws exception { string firstname = "jack"; ...

android - Close Application if no internet connection -

oncreate of "home" activity, want check if there's internet connection, if false close activity showing toast.. but, home activity not first on stack, if set finish(); close activity , show top 1 in activity stack.. so i've written down code, make sense? if(!utils.isonline(mcontext)) if(!movetasktoback(true)) finish(); where utils.isonline() method check internet connection edit : i've created method check internet connection , it's utils.isonline().. i'm not asking how check internet connectio... edit2 : movetasktoback() not best choice achieve target, because yes puts activity onbackground if reopen it, app doesn't check anymore condition (don't know why.. skips oncreate(?)) , shows blank activity.. if want close app can add lines: intent intent = new intent(intent.action_main); intent.addcategory(intent.category_home); intent.setflags(intent.flag_activity_new_task); startactivity...

C++ vector<vector<int>>`select only entries that appear just once -

i have vector<vector<int>> has following entries: 2 3 3 4 2 3 4 5 5 6 i need create vector<vector<int>> entries apeears once. so: 3 4 4 5 5 6 this gives result looking for. using std::map , std::pair #include <iostream> #include <vector> #include <map> int main() { std::map<std::pair<int, int>, int> count_map; std::vector<std::pair<int, int> > v; std::vector<std::pair<int, int> > v2; int a[10] = {2,3,3,4,2,3,4,5,5,6}; for(int = 0; < 10; i++) { int first = a[i]; int second = a[++i]; std::pair<int, int> p = std::make_pair(first, second); v.push_back(p); count_map[p]++; } for(auto = count_map.begin(); != count_map.end(); ++it) { if(it->second != 1) continue; v2.push_back(it->first); std::cout << it->first.first << ", " << it->first.second ...