Posts

swift - When should we clear Core Data cache entity? -

i using code in tutorial http://www.raywenderlich.com/76735/using-nsurlprotocol-swift in tutorial code caching every single request. my question when , how can clear entity of caching (core data)? or dont need clear caching entity? caching entity entity save data requested nsconnection. if need clear cache in core data how can choose data stay , others deleted. for example , making news app. every vc has label such title, date, category , uiwebview. , when app closed want delete caching links except "saved news". "saved news" category users choose tapping button "plus". i thinking create new column named "istosave". so, when user taps button save. need parse content text , pull out links (src=) , in coredata set column "istosave "to true. when app closed delete links column "istosave" = false so shortly: practice clear entity "cacheurls" , if yes how can clear urls selection ? here code: import ...

Count Distinct Number of Email Addresses in the Results of a Query in MS Access -

i have query in ms access return multiple columns multiple tables user-specified period of time. training registration database, , times, people take multiple classes during given time period. need count of distinct number of people trained during given time frame, can't figure out way in access. here query i'm starting with: select userstable.firstname, userstable.lastname, userstable.emailaddress, userstable.department, userstable.activeuser, classsessionstable.coursename, classsessionstable.starttime, activitytable.registered, activitytable.attended classsessionstable inner join (userstable inner join activitytable on userstable.[userid] = activitytable.[userid]) on classsessionstable.classsessionid = activitytable.classsessionid (((classsessionstable.starttime) between [early date in mm/dd/yyyy hh:mm:ss am/pm format] , [late date in mm/dd/yyyy hh:mm:ss am/pm format]) , ((activitytable.registered)=t...

node.js - knexjs column specific type -

how can specific type of column in knexjs? i have table users : id serial not null, id_file_avatar bigint, id_sectors bigint not null, name character varying(50), email character varying(100) when in rest got it: { "user": { "id": 1, "id_file_avatar": null, "id_sectors": "0", "name": "rodrigo lopes", "email": "rodlps22@gmail.com" } } my usermodel var user = bookshelf .model .extend({ tablename: 'users', visible: [ 'id', 'id_file_avatar', 'id_sectors', 'name', 'email' ], soft: false, initialize: function () { //this.on('saving', this.validatesave); }, validatesave: function () { return new checkit(rules).run(this.attributes); } }); but id_se...

matlab: keeping only first N digits of numbers -

i trying find way in matlab truncate values of vector, keeping first n digits (i don't want round it, cut it.) of them. wrote converts values in strings, cut , returns number truncated, slow. any more clever solution? thanks lot in advance! since strictly not want round number, here 1 possible solution floor function, drop numbers after specified decimal numbers n want keep: function trunc = truncate(x,n) trunc = floor(x*10^n)/10^n; end here's sample run: >> b=rand(1,2) b = 0.957166948242946 0.485375648722841 >> truncate(b,3) ans = 0.957000000000000 0.485000000000000 note if considering numbers greater one, function above have modified: function trunc = truncate(x,n) %for numbers equal or greater 1, getting n first digits trunc=x; idx = x>=1; trunc(idx) = floor(x(idx)/10^n); %for decimals, keeping n first digits after comma trunc(~idx) = floor(x(~idx)*10^n)/10^n; en...

Right way to set up Rust using Vim -

i've started dive rust , want clarify issues when comes setting nicely. i'm using vim on linux , found nice plugin syntax highlighting. autocompletion troublesome though, using phildawes/racer. the plugin needs src location rust in fact not big of deal, if know said directory (i found binaries , libs when using suggested curl <...> | sh install). sources downloadable separately, although didn't find install rust sets sources in let's e.g. /usr/local/src/rust binaries , libs. second i've looked through cargo docs , and didn't find extern dependencies cloned (wouldn't source directory?) also should rust sources updated setting manually kind of lame? is quintessence clone rust repository , build yourself? the plugin needs setting src location rust in fact not big of deal, if know said directory was i couldn't find sources either. if want sources without history: for 1.0.0, git clone --depth=1 --branch 1.0.0 --single-...

.net - SolrNet query not working for Scandinavian characters -

when making query through solrnet contains scandinavian characters ø, æ, å query returns no results while queries containing regular words work fine. the query has been added filterqueries collection using solrquerybyfield class values "ss_content" field name , values \"søren\" quoted set false. if test without "" in søren doesn't give results. when running same query through solr admin page in browser works fine. am missing configuration in solrnet causing issue? solr version 3.6 on tomcat 8 , being called .net 4.5 application any appreciated. solr admin page query plain html <form method=get action="#">[...]</form> , meaning browser automatically url-encode input values - why works admin page. you need url-encode parameter values when forming requests. in .net 4.5 can use webutility.urlencode(string) . please try replace "søren" string webutility.urlencode("søren") , see if wo...

android - How to hide drawn values in MPAndroidChart? -

i need hide value above bars in mpandroidchart barchart. have tried methods available in , not find solution. try dataset.setdrawvalues(false) . to alter (customise) drawn values, can use valueformatter interface.