Posts

recycler view reset items - android -

Image
i've been working on app quite time now. app supposed take family names , measure visit time, constant(30 minutes). have family object holds info such name, number of members , end of visit, represented future milliseconds value. the way i've implemented timers part create class called countdownmanager responsible updating , calculating remaining time families' view holders listed. the problem is, if clean data(holders , dataset) , add new family, family not added countdowntimer class. here image when family added correctly: and here image after clean data , try add new family: here codes adapter, view holder , counddownmanager class: package bikurim.silverfix.com.bikurim.adapters; import android.content.context; import android.graphics.drawable.drawable; import android.support.v4.content.contextcompat; import android.support.v7.widget.helper.itemtouchhelper; import android.util.log; import android.view.layoutinflater; import android.view.view; import and...

javascript - External library (AJV) is not recognized when using Dojo -

i'm trying use json schema validator ( ajv ) , sample code provided works fine in jsfiddle when use plain java script this ajv test - jsfiddle no library (pure javascript) var ajv = ajv({allerrors: true}); var schema = { "properties": { "foo": { "type": "string" }, "bar": { "type": "number", "maximum": 3 } } }; var validate = ajv.compile(schema); test({"foo": "abc", "bar": 2}); test({"foo": 2, "bar": 4}); function test(data) { var valid = validate(data); if (valid) console.log('valid!'); else console.log('invalid: ' + ajv.errorstext(validate.errors)); } but when try use same exact code above in conjunction dojo ajv test - jsfiddle using dojo 1.10.4 i error fiddle.jshell.net/pbq2yjxy/18/show/:50 uncaught referenceerror: ajv not defined how can use ajv library dojo? global require supplie...

combine JSON service responses using Camel -

i have 2 resource based services returning data in json format. the first 1 order service returns order details.this contains orderid , list of products including product id , quantity. the other product service returns product details(description,unit price) of product productid passed input it. i want combine these 2 services using camel route, route response order details along product details (description,unitprice,quantity,quantity * unitprice) of each product in order. since both services separately return json not sure how can combine them both return final result. i think have convert each of services's json response java objects , compute details required , using pojo , convert response json , return result. but, not sure if right approach camel or there way use indivdual json responses directly , combine them , return responses . can me on this. you should use content-enrich pattern claus suggested , aggregate response product service body of ...

sql server - I dont get all rows with the contain function -

i have varchar(max) , create full text index. use query: select * mytable contains(field, '68396.68403.'); but have 1 result, row has value "68396.68403". have more rows "68396.68403.xxxx", "68396.68403.yyy", etc. don't result. contais "68396.68403.". what problem? i using sql server 2014 express , stopword using "system". if stopword have query: select stopword sys.fulltext_stopwords i don't have row. thank much. try using prefix: select * mytable contains(field, '68396.68403.*');

php - MySql : Can I use query results in nested queries as a variable? -

i'm trying save server resources , reduce number of queries what need use variable holding query result in query nested query $names = ("select * table username 'm%'"); this return names starting m in table later want use $names nested query $myname = ("select * $names username='mohammad'"); i saw answer suggests create temp table first query result in memory not need, because i'll keep $names long time , can't keep table in memory time, drawn server resources. i tried syntax above , many ways similar didn't work i don't want in 1 query because execute nested query every time need use $names $myname = ("select * ("select * table username 'm%'") username='mohammad'"); because need first result separate variable use in other places of script. edit i need first query because i'll many queries based on like $name = ("select * $names username='many...

mongodb - Mongo DB find() query error -

i new mongodb. have collection called person . i'm trying records without _id field query: db.person.find({}{_id:0}) but error syntax error: unexpected { but if write db.person.find() it works perfectly. consider following documents inserted in person collection db.person.insert({"name":"abc"}) db.person.insert({"name":"xyz"} if want find exact matching use query db.person.find({"name":"abc"}) this return matched name documents if want names without _id use projeciton id query db.person.find({},{"_id":0}) which return { "name" : "abc" } { "name" : "xyz" }

Django Ajax post 500 internal error -

i hope can me, im trying make django post form without reloading page using ajax, im getting error 500 when submit, can me fix this, code: models.py class productoconcepto(models.model): producto = models.foreignkey(producto) orden = models.foreignkey(cobro) cantidad = models.floatfield() urls.py from django.conf.urls import patterns, include, url django.contrib import admin cobro import views urlpatterns = [ url(r'^cobro/agregar_concepto/$', views.addconcept_product, name='add_concepto'), ] views.py def addconcept_product(request): if request.method == 'post': if form.is_valid(): producto = request.post['producto'] orden = request.post['orden'] cantidad = request.post['cantidad'] productoconcepto.objects.create(producto=producto, orden=orden, cantidad=cantidad) return httpresponse('') template <div class="m...