Posts

jsp - Google App Engine Java Datastore Query - Limit Results? -

i trying fetch entries datastore , need filter them genre: <%@ page import="com.google.appengine.api.datastore.query.filter"%> <%@ page import="com.google.appengine.api.datastore.query.filterpredicate"%> <%@ page import="com.google.appengine.api.datastore.query.filteroperator"%> <%@ page import="com.google.appengine.api.datastore.*"%> <%@ page import="com.google.appengine.api.datastore.query.*"%> query confquery = new query("track"); query.filter topicfilter = new filterpredicate("genre", filteroperator.equal, genre); confquery.setfilter(topicfilter); confquery.addsort("lastplayed", sortdirection.ascending); preparedquery results = datastore.prepare(confquery); this return of entries given genre. how can limit e.g. 10 entries? you can use use fetchoptions this datastore.prepare(confquery).aslist(withlimit(10));

android - Textviews show linkable text when there isn't an actual link -

in lollipop, have textview populated html.fromhtml(). the text example can "hello.world" , shows link. in layout textview i've specified autolink="web" want links in string clickable actual url. android:autolink="web" this issue persists in whatsapp messages. any thoughts ?

Meteor: Calling/trigerring events from inside JavaScript? -

i have event looks this: template.foo.events({ 'bar': function() { console.log("hello!"); } }); how call/trigger within client using js? like: qwe = new event(foo); qwe.dispatchevent();? see events in meteor docs: http://docs.meteor.com/#/basic/template-events "the first part of key (before first space) name of event being captured. pretty dom event supported. common ones are: click, mousedown, mouseup, mouseenter, mouseleave, keydown, keyup, keypress, focus, blur, , change." so in example, 'bar' should replaced 'click'. fired when template clicked.

mysql - SQL join some tables -

i have 4 tables: user(userid,username,password) book(id,title,author,isbn,cost) orders(orderid,orderdate,userid) (manytoone user , onetomany orderitem ) orderitem(id,quantity,totalprice,book_id, order_orderid) (manytoone order , manytoone book ) i ma going retrieve title , cost , author , orderid , quantity userid=1 here query: select book.title, book.cost, book.author, orders.orderdate, orderitem.quantity, orderitem.totalprice book join orderitem on book.id = orderitem.id join orders on orders.orderid = orderitem.order_orderid user_id=1; but query has no result! select book.title, book.cost, book.author, orders.orderdate, orderitem.quantity, orderitem.totalprice book inner join orderitem on book.id = orderitem.book_id inner join orders on orders.orderid = orderitem.order_orderid user_id = 1;

html - border-radius not working with border-image output -

i'm creating css3 loading icon effect instead of using gif. have created loading icon effect i'm unable make circle. revolving in square instead of circle. border-radius not working border-image property ? html <div id="progress"> <span class="spinner-icon"></span> </div> css #progress { pointer-events: none; } #progress .spinner-icon { width: 30px; height: 30px; display:block; border: solid 2px transparent; border-radius:50%; -webkit-animation: progress-spinner 600ms linear infinite; animation: progress-spinner 600ms linear infinite; -moz-border-image: -moz-linear-gradient(top, #3acfd5 0%, #3a4ed5 100%); -webkit-border-image: -webkit-linear-gradient(top, #3acfd5 0%, #3a4ed5 100%); border-image: linear-gradient(to bottom, #3acfd5 0%, #3a4ed5 100%); border-image-slice: 1; } #progress { position: absolute; } @-webkit-keyframes progress-spinner { 0% { -webkit-transform: ...

c++ - error C3499: a lambda that has been specified to have a void return type cannot return a value -

i using following lambda , getting error. can't figure out why compiler doesn't doing. std::string captchaword(6, 0); std::generate(captchaword.begin(), captchaword.end(), []() { unsigned int num = randomizer('z' - 'a' + 1 + '9' - '0' + 1); char ch = num + 'a'; if (num >= 'z' - 'a' + 1) { ch += '0' - 'z' - 1; } return ch; }); by way, randomizer function following signature: unsigned int randomizer(unsigned int); this error message get: error c3499: lambda has been specified have void return type cannot return value. you have specify return type: []() -> char { // code; } the automatic deduction works if whole lambda consists of single return statement only (in c++11), otherwise, need specify type. see documentation on lambda on cppreference . in c++14, rules allow other statements before return.

select - Show name of columns in mysql -

i have 3 date values in table, namely activationdate, registrationdate, , creationdate , have select show name of column least value. i used select least(activationdate, registrationdate, creationdate) table name and returns smallest value. however, want know of these 3 smallest value. so, expected outcome name of column has least date can activation date, registration date or creation date. for solution, kindly state result if 3 of them have similar values? return or one? thanks you need test least value against each column, in conditional statement. assuming following table structure create table `test` ( `activationdate` datetime default null, `registrationdate` datetime default null, `creationdate` datetime default null ) with these values mysql> select * test; +---------------------+---------------------+---------------------+ | activationdate | registrationdate | creationdate | +---------------------+--------------------...