Posts

Showing posts from June, 2010

osx - Spelling suggestions in NSTextField -

my app has nstextfields input; purposely not use nsnumberformatter in order special handling of input. app implements "full screen" mode. when app in full screen, , focus in text field, , press esc key resume windowed mode, instead pop-up spelling suggestions/completions. don't want either of these behaviors when esc key pressed: completions pop-up, nor not being able exit full screen mode. suggestions? thanks. you need setup nstextfielddelegate handle command, , set delegate on textfield. here's example: @property (weak) iboutlet nswindow *window; @property (weak) iboutlet nstextfield *textfield; @end @implementation appdelegate - (void)applicationdidfinishlaunching:(nsnotification *)anotification { // insert code here initialize application self.textfield.delegate = self; } - (bool)control:(nscontrol*)control textview:(nstextview*)textview docommandbyselector:(sel)commandselector { if (commandselector == @selector(canceloperation:)) {

kie server - Drools externalize condition -

in organization have decided use kieserver running drools. not using kieworkbench, because need more control on deployment , should aligned related application. ask externalize condition check. for example in rule below, check "2008" stored in database when $customer:customer(membersince <= "2008") $customer.setofferpercent("50%") i have figured out way value 2008 database/inmemory cache implementation , change below. allow operations/business change such values without deployment in kie server , reduce lot of efforts when $customer:customer(membersince <= cache.get("member_since_elite")) $customer.setofferpercent("50%") my question is, there other way declare global , auto populate values when changed in database. hoping below using annotations, , need help. declare properties member_since_elite : string @property("member_since_elite") end when $customer:customer(membersince &l

javascript - Fetch html page content into a var -

just small question here, how fetch html content via ajax variable use later. right now, have button on click of which, fetch html page through load method follows: $('#container').load('http://127.0.0.1/someurl') i want content var instead @ later time use append dom $('#somecontainer').append(somevar) var somevar; $.get("http://127.0.0.1/someurl",function(data){ somevar = data; }); i use $.get instead

c# - Simple Membership: can I create a user without referencing webmatrix? -

i have restrictions not reference webmatrix here. i want create user record in membership tables of simple membership (using ef 5). make easier, have mapped ef models tables. is possible code without webmatrix ? edit i don't want use membership provider. edit the system uses simple membership. don't want change that. separate project, want add user database without referencing webmatrix. possible ? no, cannot use simplemembership without webmatrix simplemembership lives in webmatrix namespace. you can, however, use number of other membership providers, such original sqlmembershipprovider, universal providers, or number others available. edit: yes, can add user database manually. in comments below have included link source simplemembershipprovider.cs, examine code , use same methods in own project.

Python: Write Nested JSON as multiple elements in List -

after 2 3 days of programming, seeking help. what want do: import json string/ file , write database. there multiple combination of input (cars). lowest nested dict/ list defines number of elements of list written in db. here json/ string: input = [{"id":"bmw_1_series", "years":[{"id":10052,"year":2008, "styles":[{"id":560,"name":"128i 2", "submodel":{"body":"conver","nicename":"conve"},"trim":"128i"}, {"id":561,"name":"135i ", "submodel":{"body":"conver","nicename":"conver"},"trim":"135i"} ] }, {"id":427,"year":2016,

Android WebView Responsive While Zooming -

the font size , image in webview able zoom, not responsive screen. expected fit on width of 100%. not applicable on android 5.0 lollipop , above. tried on kitkat device, worked. i'm wondering should in order make works on 5.0 , above. i did configure meta tag of webpage: < meta name="viewport" content="width=device-width, initial-scale=1" /> the following configurations have applied on webview: webview wv1 = (webview) findviewbyid(r.id.webview); wv1.setwebviewclient(new mywebviewclient()); wv1.getsettings().setloadsimagesautomatically(true); wv1.getsettings().setjavascriptenabled(true); wv1.getsettings().setloadwithoverviewmode(true); wv1.getsettings().setusewideviewport(true); wv1.getsettings().setloadwithoverviewmode(true); wv1.getsettings().setsupportzoom(true); wv1.getsettings().setbuiltinzoomcontrols(true); wv1.getsettings().setdisplayzoomcontrols(false);

ios - Audio not playing in simulator -

i have 3 buttons , i'm trying sound play each button. the sounds don't play on simulator wondering going wrong in code. import uikit import avfoundation class viewcontroller: uiviewcontroller { override func viewdidload() { super.viewdidload() } @ibaction func mmm_sound(sender: uibutton) { playsound("mmm") } @ibaction func aww_sound(sender: uibutton) { playsound("aww") } @ibaction func maniacal_sound(sender: uibutton) { playsound("hah") } //sound function func playsound(soundname: string) { let sound = nsurl(fileurlwithpath:nsbundle.mainbundle().pathforresource(soundname, oftype: "wav")!) do{ let audioplayer = try avaudioplayer(contentsofurl:sound) audioplayer.preparetoplay() audioplayer.play() }catch { print("error getting audio file")

java - Create an ArrayList that can hold String objects -

... add names of 3 cars arraylist , display contents of arraylist.. this question in class, last one. please i think need full code: import java.util.arraylist; public class arraylist_test { public static void main(string[] args) { arraylist<string> carnames = new arraylist<string>(3); carnames.add("carname1"); carnames.add("carname2"); carnames.add("carname3"); (string carname : carnames) { system.out.println(carname); } } }

osx - Publishing a CoreCLR project into an OS X Application Bundle -

are there instructions or guides on how publish coreclr project os x application bundle? i'm start porting desktop application windows os x , trying assess suitability of coreclr task. i've seen , given don't require exising gui libraries (i'll custom building myself) seems viable option. previous versions of coreclr i've managed working manually construction app package in script. what i'm wondering though whether there's pre-existing method assembling these app packages. eg: way dnu publish app package.

javascript - Angular 2 : how to refer to a class variable inside a function called by Observable map -

in angular 2 app uses observable in service, how can refer private field of class inside map ? illustrated in code below, how can refer this._datastore inside extractdata function? thanks! note did see this question suggests putting function body inside () => {function body here} , i'd able call function, logic used @ other places (don't want copy , paste on places.) @injectable() export class dataservice{ constructor(private http: http){} private _datastore = []; getdata(): observable<any> { if(this._datastore.length > 0) { //return cached data return observable.of(this._datastore); } else { return this.http.get('url') .map(this.extractdata) .catch(this.handleerror); } } private extractdata(res: response){ if(res.status < 200 || res.status >= 300){ throw new error('bad response status '+ res.status); } var data = res.json(); (var in data

javascript - 'this' refers to wrong dynamically generated element in jQuery on() -

as part of dynamic form have checkbox field enables , disables next input field (they pair, when add new section form, checkbox , input field both added together). .form-element .checkbox = f.label :foo_bool_field = f.check_box :foo_bool_field, class: 'foo-bool-field-form-toggle' .desc_foo_bool_field= "text describing field" .input = f.label :bar_input_field = f.text_field :bar_input_field, disabled: f.object.foo_bool_field and it's in .form class block. here code disabling $('.form').on('change', '.foo-bool-field-form-toggle', function(e) { // disabling code goes here }); if add few of these form elements, click on text "text describing foo_bool_field", enables/disables input form of first set only. if throw debugger above form disabling code , check this , this returns first set. if click text box □, works properly, disabling check boxes , referring right this of checkbox clicked o

virtual - Reusing functions in C++ -

i having trouble writing code in class inherits class reuses function of class in 1 of functions file pessoa.h: #ifndef pessoa_h #define pessoa_h #include "data.h" #include <string> class pessoa { string nome; data aniversario; public: pessoa(string tnome, data taniversario){nome = tnome; aniversario = taniversario;} pessoa(){}; int aniversario(data data_atual); virtual void imprime(); ~pessoa(); }; #endif file universitario.h: #ifndef uni_h #define uni_h #include "pessoa.h" #include "data.h" class universitario: public pessoa { int matricula; data ingresso; public: universitario(int tmatricula, data tingresso, string nome, data aniversario): pessoa(nome, aniversario) {matricula = tmatricula; ingresso = tingresso;} universitario(){}; void imprime(); ~universitario(); }; #endif function imprime() definition pessoa.cpp: void pessoa::imprime() { cout << "nome: &qu

sublimetext2 - Ruby .gets doesn't work -

i'm trying simple user input in ruby, can't working. i'm using gets method, program never stops ask me input. i'm using sublime text 2 text editor, , run program in it, (if makes difference). here's code: puts "what name?" name = gets puts "hello " + name + ". how you?" and here's error (and output) given me: c:/users/sten sootla/desktop/ruby workspace/exercise.rb:3:in `+': can't convert nil string (typeerror) c:/users/sten sootla/desktop/ruby workspace/exercise.rb:3:in `' name? [finished in 0.1s exit code 1] why doesn't program stop ask me input? here's how understand it. gets , puts instance methods of io , , default io s $stdout , $stdin . calls gets/puts effective if translator capable of handling stdout/in e.g. irb if run ruby file bash works too. io_test.rb puts gets in bash ruby io_test.rb then "put" stdout whatever "gets" stdin.

boxplot - Box plotting in R? -

i have data looks this: data r i want create side-by-side box plot comparing agecat , ttscore. love have ttscore on y-axis values 0-5 , on x-axis have different values of agecat a, b, c , d each representing age group. help appreciated, thank you! try this: boxplot(ttscore ~ agecat,df) assumption: df name of dataset

how to make a smoothly connected plot on a sphere in MATLAB? -

Image
this question has answer here: how plot data? 2 answers there points on unit sphere , want join them smoothly along sphere smoothly how can in matlab,because when using 3dplot function in matlab joins point using straight lines. for example there have point in first quadrant , second point in 8th quadrant join them using straight line. without following curved path. these values of theta : theta = [ 80.0000 73.2995 65.7601 95.5007 100.4861 97.8834 94.0849 52.5174 74.4710 104.6674 52.7177 97.0538 75.7018 83.2817 97.5423 85.1797 84.2677 126.2296 81.1814 66.1376 91.6953 167.7085 46.5980 87.8220 113.4588 180.0000 80.7624 95.8623 115.0538 76.5773 61.9858 141.0402 109.9872 76.1273 84.4166 75.2734 110.4489 82.2434 96.8303 100.0815 73.2454 82.0755 64.6457 76.3510 87.7863 133.2706 86.1305 76.8

javascript - Why JSON.parse cant detect if argument is already in JSON format -

as know json.parse parses stringified json , if variable json , try json.parse on throws error : > [] > = json.parse(a) syntaxerror: unexpected end of input @ object.parse (native) @ repl:1:10 @ replserver.defaulteval (repl.js:132:27) @ bound (domain.js:254:14) @ replserver.runbound [as eval] (domain.js:267:12) @ replserver.<anonymous> (repl.js:279:12) @ replserver.emit (events.js:107:17) @ replserver.interface._online (readline.js:214:10) @ replserver.interface._line (readline.js:553:8) @ replserver.interface._ttywrite (readline.js:830:14) why cant json.parse verify argument json object , nothing in case instead of throwing error? from ecma docs on json.parse , looks first thing parse method stringify first argument using tostring() . can check docs here: http://www.ecma-international.org/ecma-262/5.1/#sec-15.12.2 . in other words, json.parse([]) equivalent json.parse([].tostring()) , equivalent json.parse(&

ios - Why is the query returning a nil when called in CellForRow method? -

i trying import pffile image , put in cell, error fatal error: index out of range . why getting this? how fix it? importing image correctly? if let imagepic = object["animal"] as? pfobject{ if let imageofpic = imagepic["pic"] as? pffile{ imageofpic.getdatainbackgroundwithblock({ (data: nsdata?, error: nserror?) -> void in if(error == nil){ let image = uiimage(data: data!) self.imagepro.append(image!) dispatch_async(dispatch_get_main_queue()){ self.table.reloaddata() } }else{ print(error) } }) func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell { let cell:

How do i call function that already declared in angularjs controller? -

i have defined function in angularjs controller. if call somewhere in same controller it's not working. controller.js function manageproductcontroller($http, $scope, $mddialog, $document, $location, $localstorage) { var vm = this; vm.uid = $localstorage._id; vm.purchased = ''; $scope.types = [{code:1, type:'available items'}, {code:2, type:'purchased items'}, {code:3, type:'guest contributed'}, {code:4, type:'full list'}]; $scope.update(); $scope.update = function() { if($scope.selectedcode == 1){ vm.purchased = "yes"; }else if($scope.selectedcode == 2){ vm.purchased = ""; }else{ vm.purchased = "no"; } $http({ url: 'http://localhost:7200/api/manage-product', method: 'post', data: {userid:vm.uid, code:vm.purch

c# - XML serialization of interface property -

i xml serialize object has (among other) property of type imodelobject (which interface). public class example { public imodelobject model { get; set; } } when try serialize object of class, receive following error: "cannot serialize member example.model of type example because interface." i understand problem interface cannot serialized. however, concrete model object type unknown until runtime. replacing imodelobject interface abstract or concrete type , use inheritance xmlinclude possible, seems ugly workaround. any suggestions? this inherent limitation of declarative serialization type information not embedded within output. on trying convert <flibble foo="10" /> into public class flibble { public object foo { get; set; } } how serializer know whether should int, string, double (or else)... to make work have several options if don't know till runtime easiest way using xmlattributeoverrides . sadly work base cl

How to write a average formula in excel vba -

i trying calculate average, getting run-time error. here code.. lastrowcell = range("b1", range("b1").end(xldown)).rows.count range("f1").value = "high+low/2" n = 2 lastrowcell range(cells(n, 6)).formula = "=average(" & range(cells(n, 2), cells(n, 3)).address(false, false) & ")" next can show did wrong. thanks in advance... you don't need loop, excel smart enough fill entire thing in 1 go: lastrowcell = range("b1", range("b1").end(xldown)).rows.count range("f1").value = "high+low/2" range("f6:f" & lastrow).formula = "=average(b6:c6)" the 6 incremented in each row if want last row though, better come bottom unless looking first blank: lastrowcell = range("b" & rows.count).end(xlup).row

ios - How To convert an image to vector / bezier path in objective c? -

Image
i have image in black & white, outlines. want convert image bezier paths. ( have convert side application) sample image

python - numpy matrix arithmetic with its diagonal element -

Image
i love numpy because allows vectorized operation such as: mat1 = np.array([[1,2],[3,4]]) mat2 = np.array([[10,20],[30,40]]) mat3 = (mat1 + mat2)*2.0 # vectorization way. nice. but, can not find how kind of operation diagonal elements. i'd is possible operate above in vectorization way numpy? for first exemple : with : in [3]: """ array([[1, 3, 4, 0, 4], [2, 3, 3, 3, 0], [1, 0, 4, 1, 0], [0, 3, 3, 2, 0], [2, 1, 0, 3, 2]]) """ in [4]: aii=vstack((diag(a),)*a.shape[0]) """ array([[1, 3, 4, 2, 2], [1, 3, 4, 2, 2], [1, 3, 4, 2, 2], [1, 3, 4, 2, 2], [1, 3, 4, 2, 2]]) """ in [5]: ajj=aii.t # transpose in [6]: b= 1/ (aii+ajj-2*a) or, more abstract tools : b1 = 1 / (np.add.outer(diag(a),diag(a))-2*a) b2 = / np.sqrt(np.multiply.outer(diag(a),diag(a)))

Convert the python code into a graphical flowchart -

just wondering if there way convert python code graphical flowchart image? or maybe method or module or else output in textual description near flowchart comments done earlier in pascal process keys comments condition keys comments process keys comments condition visustin automated flow chart program software developers , document writers please check link aivosto

sql - How to get number of days for next month? -

given date, how number of days in next month? so, if original date in december should give 31(january), in january 28/29 (february), etc. you want number of days in next month? use add_months() that. use last_day() establish last day of month. extract() day give number of days. today in april, how many days in may? sql> select sysdate 2 , extract(day (last_day(add_months(sysdate, 1)))) days_next_month 3 dual 4 / sysdate days_next_month --------- --------------- 19-apr-16 31 sql> oracle has wealth of date functions. can chain them achieve virtually calendrical calculation our heart desires. find out more .

How can I know programatically if the android device has soft navigation keys or not? -

i want show view above navigation bar if present on device screen, else if not @ bottom of screen. use method in activity or fragment know whether device has soft navigation bar or not. can code per requirement in method call. like :- if (hasnavbar(getresources())) { //do code here } public boolean hasnavbar (resources resources) { int id = resources.getidentifier("config_shownavigationbar", "bool", "android"); return id > 0 && resources.getboolean(id); }

bootstrap modal show close when clicked outside -

i have bootstrap modal : <div class="modal show" id="mymodal" role="dialog" data-keyboard="true" data-backdrop="true"> <div class="modal-dialog"> <!-- modal content--> <div class="modal-content"> <div class="modal-body"> <p>some text in modal.</p> </div> </div> </div> </div> it gives me modal. here used show initialize modal @ first. when modal initialized , click outside modal not close. what might issue here data-backdrop="static" property value 'static' prevent closing modal. data-keyboard="false" property prevent closing modal pressing esc.

java - connectivity between eclipse and robomongo -

how view datas in robomongo written in eclipse using java? have intalled monjadb plugin in eclipse yet not able view datas created using java in java project. details libraries

create php array from loop and without braces in key -

i need push value array loop based on count number found in database. here scenario. $num_images = 5; $numb_images = array(); ($x = 1; $x <= $num_images; $x++) { #$numb_images[] = array('image' . $x => '_image' . $x); $numb_images['image' . $x] = "_image" . $x; } when print_r($numb_images), print following array ( [image1] => _image1 [image2] => _image2 [image3] => _image3 [image4] => _image4 [image5] => _image5 ) 2 issues. prints key braces [] not want. 2nd thing is, printing them in same row. this how need populate $numb_images = array( 'image1' => '_image1', 'image2' => '_image2', ); so image1 => _image1 key/pair needs looped given number. any highly appreciated. thanks function print_r useful if want print stored in variable. , it's outputs variable created in right way. if print_r

api - How can I check my Android app's network consumption? -

Image
i need check android app's internet consumption. in app have numerous number of web service apis being called. i want know how app consumes internet in kb/mb @ full go. how can check that? there tool check that? android studio 2.0 introduce new network section in android monitor can problem. tx == transmit bytes rx == receive bytes

Python / Numpy: Triangle mask from point mask -

i'm working triangulated mesh consisting of points 3 x n , triangles specified point indices 3 x m. can plot e.g. using mlab mesh = mlab.triangular_mesh(p[0,:],p[1,:],p[2,:],t.t i generating mask masking points out of bounds or nan , have mask size of n. want mask triangles have masked point. solutions far: 1: use mask turn masked points nan , e.g. p[mask] = nan mlab still shows nan (i need include threshold filter...) , don't want mess data 2: generating triangle mask, started this def trianglemask(triangles, pointmask): maskedtris = np.zeros((triangles.shape[1]), dtype=np.bool) maskedidx = np.nonzero(pointmask)[0] i,t in enumerate(triangles.t): if (i%5000) == 0: print('working it.:', i) p in t: if p in maskedidx: maskedtris[i] = true break return maskedtris this works, not fast. , in case, n = 250.000 , m = 500.000, "not fast" quite problem.

javascript - how to get value of inner html objects of a div -

i have 3 span elements inside div. whole div created dynamically inside loop. here code $.each(data.payload, function(index, value){ stmt+='<li class="list-group-item">'+ '<div class="col-xs-12 col-sm-9">'+ '<div class="refugeeinfo">'+ '<span class="name" style="cursor: pointer">'+ value.firstname +' '+value.lastname+'</span><br/>'+ '<label><strong>unid: </strong><span class="unid" style="cursor: pointer;"> '+ value.unid +'</span></label>'+ '&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp'+ '<label><strong>rmsid: </strong><span class="rmsid" style="cursor: pointer&

c# - Bold a part of string in richtextbox -

Image
this question has answer here: bold in richtextbox 2 answers i trying bold part of string in richtextbox . looks now: okl-24-220-20-10.56 the last digits 10.56 stands square meters of specific calculation. want have bold . these numbers used generate barcode hoping doing this, barcode display 10.56 bold text. i thought of using in summary richtextbox : var sb = new stringbuilder(); sb.append(@"{\rtf1\ansi"); sb.append(@"\b amount: \b0 "); sb.append((txtamount.text); sb.append(@" \line "); sb.append(@"\b length: \b0 "); sb.append(txtlength.text); sb.append(@" \line "); sb.append(@"\b width: \b0 "); sb.append(txtwidth.text); sb.append(@" \line "); sb.append(@"\b total: \b0 "); sb.append(txttotal.text); sb.append(@" \line \line "); sb.append(@"}"); rtxtrequest.r

Django ORM: How to get unique records based on a column from all records(Need model object not particular value object) -

using mysql backend db. querying records database like: ob = shop.objects.all() here querying records because need n number of columns values. come question. want non duplicate records based on column. tried python set function. deletes exact same records. have records having same value in particular column value not same value in other columns. can 1 share idea hoe of django orm!!! if have understood question correctly want retrieve records not have duplicates. can query: select * shops group (duplicate_field_name) having count(*) = 1 how django? group sucks django. can achieved raw query. ob = shop.objects.raw('select * shops group (duplicate_field_name) having count(*) = 1 order some_field') remember replace shops , , duplicate_field_name actual name of table , column name respectively.

excel - How to select a Column based on the Header value using VBA -

i working on deleting rows if particular value not found in column. example excel data is sl.no content 1 apple 2 ball 3 cat 4 ball 5 cat and code using is sub delete() dim startrow long 'starting row number here startrow = 2 ' assuming data check in column until startrow > cells(cells.rows.count, "a").end(xlup).row if cells(startrow, 2).value = "ball" rows(startrow).delete else startrow = startrow + 1 end if loop end sub the output of code is sl.no content 1 apple 3 cat 5 cat this code working perfect. need small change here. trying select b column using column header 'content' , delete rows containing 'ball' instead of providing cell number. please me in arriving @ this. tia sub delete() dim startrow long dim rng1 range 'starting row number here startrow = 2 ' assuming data check

Matlab script: To code an event that causes a shift in the resulting graph of a nonlinear dynamical system -

Image
i have matlab script generates periodic oscillations in nonlinear dynamical system. getting oscillations perfectly. when try insert small disturbance (event), oscillations dying out. code shown below. clear; clc; %% % storing rate constants/parameters using struct function 'p'. % fprintf('\nstart: %s ', datestr(datetime('now'))); start = tic; rng('default'); nsim = 1; [avg_p, mean_avg_vrnce] = deal(zeros(1,nsim)); [ca_, ip3_,hopen_]= deal(zeros(10001,nsim)); start1 = tic; a=1: nsim %% standard values p = struct('c0',2, 'c1',0.185, 'v1',6, 'v2',0.11, 'v3',0.9,... 'k3',0.1, 'd1',0.13, 'd2',1.049, 'd3',0.943, 'd5',0.082,... 'a2',0.2, 'tmax',100, 'ipr',10000, 'dt',0.01, 'alpha',0.2,... 'k4',1.1, 'v4',1.2, 'ir',1); %% %simulation time t = (

java - Parsing BPMN file -

my question simple. how can parse bpmn file ? there package in java ? found example code googling, there no main , there no method take bpmn file parse it. import java.net.url; import java.text.parseexception; import java.text.simpledateformat; import java.util.arraylist; import java.util.date; import java.util.enumeration; import java.util.list; import javax.xml.namespace.qname; import org.w3c.dom.element; import org.jbpm.api.jbpmexception; import org.jbpm.api.activity.activitybehaviour; import org.jbpm.bpmn.common.resource; import org.jbpm.bpmn.common.resourceparameter; import org.jbpm.bpmn.flownodes.bpmnactivity; import org.jbpm.bpmn.model.bpmnprocessdefinition; import org.jbpm.bpmn.model.sequenceflowcondition; import org.jbpm.bpmn.parser.bindingsparser; import org.jbpm.internal.log.log; import org.jbpm.pvm.internal.cal.cronexpression; import org.jbpm.pvm.internal.cal.duration; import org.jbpm.pvm.internal.env.environmentimpl; import org.jbpm.pvm.internal.model.activityim

php - Preg_match only working in order -

i having problems following code. getting users subjects using $_get sending server see if row contains subjects , if returns subject matches row each row matches. works fine if user enters lets "english,maths" , in database listed "maths, english" fail , not echo row although correct in different order. there doing wrong?? thanks, curtisb $subjects = $_get["subjects"]; while ($row = mysql_fetch_array($result, mysql_assoc) , ($counter < $max)) { if(preg_match('/'.$subjects.'/',$row['subjects'])){ echo "subject matches row"; } } update: tried code below, echoing every row if not correct subject. function is_matched($subjectsfromus, $subjectsfromdb){ $subjectsfromus = explode($subjectsfromus, ','); $subjectsfromdb = explode($subjectsfromdb, ','); foreach($subjects $s){ if(!in_array($s, subjectsfromdb))

android - Why is my item Image in custom RecyclerView changing while scrolling? -

my app works fine, except saw items changing images while scrolling, somehow know that's recycling problem, dont know how solve it. tried code modifications in adapter, because think there, didn't succeed. public void onbindviewholder(customadapter_versionr.myviewholder holder, int position) { //get current product of list currentproduit = productlist.get(position); try { getimgurl = currentproduit.geturlimagelist_thumb().get(0); picasso.with(context).load(getimgurl).fit().into(myimageview); log.i("info", "image loaded"); } catch (exception e) { myimageview.setimageresource(r.drawable.no_image); log.e("error", "no image or image error"); e.printstacktrace(); } for download image, i'm using picasso, ! edit : full adapter private product currentproduit; private imageview myimageview; private context context; private list<product> productlist; priva

google chrome devtools - How to show mouse pointer in responsive mode? -

Image
i used able uncheck checkbox said emulate touch screen in emulation/sensors -panel see mouse pointer when using responsive mode. panel gone, , new sensors-panel doesn't have setting. this makes impossible use responsive mode, have no pointer , no control touch/click (who designed feature?!). how can see pointer/mouse when use responsive mode in newer chrome? apparently, you're supposed see circle mouse when using responsive mode. have never seen that, using several different machines, feature seems broken. however, right after posting question, stumbled upon solution. in version 50, solution press 3 dots ⋮ right in responsive mode, , select show device type . gives new dropdown next sizes etc., in desktop or mobile (no touch) can selected use normal mouse pointer (disable touch emulation) while using responsive mode.

coldfusion cfquery.getMetaData() -

Image
i have simple cfquery object: <cfquery name="getp" datasource="ds"> select top 5 * table </cfquery> when dump of getp.getmetadata() , see getprecision(int) in method list. though, when perform getp.getmetadata().getprecision(1) , error: java.lang.unsupportedoperationexception: getprecision() what doing wrong? the error: the javadocs it's not supported yet, hence throws error. http://sqlitejdbc.sourceforge.jp/org/sqlite/jdbc/jdbcparametermetadata.html