Posts

Showing posts from July, 2014

NativeScript camera and saving various pictures -

i trying take various photos , take them want them appear in view. idea add photo objects model observable , repeater in view have them displayed. note instead of image object adding simple strings noteimages debug it. what have is: the view model: function noteviewmodel(info) { info = info || {}; var viewmodel = new observable({ id: info.id || null, title: info.title || "title default", description: info.description || "description default" noteimages: [{src: "xxxx"}, {src: "yyyyyy"}] }); return viewmodel; } the "controller": ... var noteviewmodel = new noteviewmodel(); exports.loaded = function(args) { console.log("loading note view...") page = args.object; page.bindingcontext = noteviewmodel; }; ... exports.takephoto = function(){ cameramodule.takepicture({width: 300, height: 300, keepaspectratio: true}).then(function(imagesource) { var ima...

javascript - Access instance of anonimous function inside of itself -

how instance of anonymous function inside of itself? function () { //how access this? } it must anonymous, callback, , in function passed attaching property callback , invoke it. should return own property. function parent (val) { val.someprop = "abc" val() } parent(function(){ return this.someprop; // how access someprop because window? }) also can't pass props it. i'm not sure programming practise send argument itself: function parent(val) { val.someprop = "abc"; val(val); } parent(function(val){ console.log(val.someprop); });

python - Square root calculation using bisection -

i have following code should find square root using bisection, reason won't. when want find square root of 9 4.5. y = float(input('enter number want find square root of: ')) z = y x = 0 ans = 0 while abs(ans**2 - abs(y)) > 0.0001 , ans <= x: ans = (x + y) / 2.0 if ans**2 < z: x = ans else: y = ans print 'the square root of', z, 'is', ans you need check if ans <= y , because y right border in case. need compare ans**2 absolute value of z , not y , because changing y inside loop: while abs(ans**2 - abs(z)) > 0.00001 , ans <= y: ans = (x + y) / 2.0 if ans**2 < z: x = ans else: y = ans

indexing - R delete rows in data frame where nrow of index is smaller than certain value -

i want delete rows in data frame when number of rows same index smaller pre-specified value. > fof.6.5[1:15, 1:3] draw fund.id firm.id 1 1 1667 666 2 1 1572 622 3 1 1392 553 4 1 248 80 5 1 3223 332 6 2 2959 1998 7 2 2659 1561 8 2 14233 2517 9 2 10521 12579 10 2 3742 1045 11 3 9093 10121 12 3 15681 21626 13 3 26371 70170 14 4 27633 52720 15 4 13751 656 in example, want each index have 5 rows. third draw (which index) has fewer 5 rows. how can delete draws third 1 if have fewer 5 rows? you using dplyr (assuming data in data frame called dt : dt %>% group_by(draw) %>% filter(n() >= 5) %>% ungroup() or use table or xtabs : tab <- xtabs(~ draw, dt) dt[!dt$draw %in% as.numeric(names(which(tab < 5))), ]

elasticsearch - How to create a Kibana Visualization to show jobs failing over last 7 days -

my app executes 3 4 million jobs every day. jobs scheduled same unique id , every job has completion status representing success or failure. create kibana visualization shows jobs failing continuously more 7 days. how can that? select term failure in split bars section in x-axis use range option in split chart field , can select date range 1 week u asked earlier

github - Changing remote git repository -

i have cloned repo local folders , wanted change git repository other url. have changed using git remote set-url origin git://new.url.here and when doing git remote -v it shows me correct repository in want work.but when git branch --all it shows me old branches in old repository. wondering why?? new repo doesn't have branches yet. you in fact seeing local copies of old remote branches. use git remote prune origin remove them. on safe side, it's recommended run git remote prune origin --dry-run first, see removed before removing it.

php - Laravel - After I ran composer update CLI artisan issue shows up -

i have made composer update on laravel project latest version, after no cli command working g:\xamp\htdocs\laraintro>php artisan make:controller actioncontroller ←[37;41m ←[39;49m ←[37;41m [unexpectedvalueexception] ←[39;49m ←[37;41m invalid route action: [app\http\controllers\] ←[39;49m ←[37;41m ←[39;49m i tried solution didn't work me @amarnasan correct. the impact of incorrectly defined route has on how laravel booted. if have invalid route, mess rest of code. so, need double check routes correctly defined. means need check if controllers exist , if methods each route exists. take look @ docs check how routes should defined. if routes correctly execute following command: php artisan route:clear

java - Does the compiler/JIT recognize redundant checks? -

lets have multiple applications layers, external libraries , java standard libraries , dealing string. at each , every command when hand in nullpointer, application going throw exception. prevent that, supposed check null object , handle yourself. now means check null, external libraries check null , java standard libraries check null , potentially low level c code checks null. isn't redundant ? somehow optimized compiler , branch prediciton handle cases ? as indicated comments , other answers: there many degrees of freedom , variables involved here. on highest level, refers design principles, aiming @ avoiding "meaningful" null values, , thus, explicit null checks. (this difficult sometimes. semantically meaningful cases of null built standard api). said redundant null checks can not avoided, because 1 never knows method called. on lower, technical levels, distinction between javac compiler , jit pointed out. on lowest level, things branch predic...

c# - Unity3d: How to use dll from Javascript? -

i have written dll in c# perform several tasks game. can use dll when use c# script in unity. when use dll javascript, gives error: namespace 'mylibrary' not found, maybe forgot add assembly reference? i have placed mylibrary.dll under assets folder. how access c#: using mylibrary; this how access javascript: import mylibrary; so, can use c#, how can use javascript? native plugin : c# : [dllimport ("pluginname")] private static extern float functionname (); javascript : @dllimport (dllname) static private function functionname () : float {}; managed plugin : c# : using mylibrary; javascript : go project directory, yourprojectname.csharp.csproj find it, open , add <reference include="mylibrary"> save it. restart unity , visual studio. put dll assets folder.

mysql - PHP/SQL How can I make my query include results that has no records in another table yet? -

i have 2 php codes performs room search. user specifies no. of beds, check in date , check out date. first code retrieves rooms corresponding number of beds. second code checks if room has existing booking, if , booking dates not clash user input dates room displayed, if not have existing booking displayed. my first php code: $sql = "select rooms.rid, beds, orientation, price rooms (beds = $nofbeds)"; if ($rorientation != "") { $sql .= " , orientation = '$rorientation'"; } $results = mysqli_query($conn, $sql) or die ('problem query' . mysqli_error($conn)); my second php code: <?php while ($row = mysqli_fetch_array($results)) { $sql2 = "select rid, checkin, checkout bookings"; $results2 = mysqli_query($conn, $sql2) or die ('problem query' . mysqli_error($conn)); $row2 = mysqli_fetch_array($results2); if ($row["rid"] == $row2["rid"]) { if (($cin...

automation - How to automate basic sanity on android? -

my aim run automated test check bare minimum on android build once loaded on device boot homescreen turn wifi on/off turn bt on/off start camera - take snapshot switch camcorder - take short video run audio , video log file passed , failed. i entirely using adb.exe on windows host. what want know how test each of above options adb shell command line? thanks in advance! consider using android compatibility test suite (cts) . for example, after you've downloaded cts test package, test camera issue command on host looks following: ./cts-tradefed run cts --class android.hardware.cts.cameratest

html - CSS transition 0s (zero seconds) not working? -

i want avoid of transition effects on element (for example: opacity ). should use opacity 0s , because should default value or in other words transition have no effect on this. it's not working way. tried: div { width: 100px; height: 100px; opacity: 0.5; background: red; -webkit-transition: 2s, opacity 0s; transition: 2s, opacity 0s; } div:hover { width: 300px; opacity: 1; } <div></div> div { width: 100px; height: 100px; opacity: 0.5; background: red; -webkit-transition: 2s, opacity 0.1s; transition: 2s, opacity 0.1s; } div:hover { width: 300px; opacity: 1; } <div></div> however, if 0s of opacity changed 0.1s , work(with duration of 0.1s), there way "disable" animation in other way, perhaps, work without small value 0.1s? here solution this transition: 2s, opacity 1ms; as 0s not valid time (i don'...

javascript - Validate the input field for existing item in object array? -

in todo list dont want user input same todos again again... problem is, when enter example (test) first time , enter (test2) , enter (test) again, taking value.... how validate properly.... fiddle https://jsfiddle.net/lal7h6lv/1/ html <div ng-app="todoapp" ng-controller="mainctrl"> <ul> <li ng-repeat="todoitem in todoitems">{{todoitem.name}}</li> </ul> <form ng-submit="additem()"> <input type="text" ng-model="newitem"> <input type="submit" name="go"> </form> </div> angularjs angular.module("todoapp", []) .controller('mainctrl', ['$scope', function($scope){ $scope.todoitems = [{'name' : 'akshay'}]; $scope.test = false; $scope.additem = function(){ if($scope.newitem){ $scope.checkrepeattodo(); if($scope....

java - Using MediaPlayer in a Service Class...? -

i'm making app, , i'm working on adding background music it. i've seen lot of ways that, , i've chosen make using service. problem, however, comes when call service, due hear nothing, music doesn't play! i've compared examples, , tried everything, there's no change...instead meanwhile i'm using intentservice play music (to have @ least something), isn't pretty good, cos example when press home button, music continues playing... the code of service class following: package edu.ub.pis2016.darmas.entrega1; import android.app.service; import android.content.context; import android.content.intent; import android.media.audiomanager; import android.media.mediaplayer; import android.os.ibinder; import android.widget.toast; public class service_1 extends service { mediaplayer player; public ibinder onbind(intent arg0) { return null; } @override public void...

javascript - create and use a CSS form in <Style>, not in <Body> with HTML -

i have learnt html , have small program. var acc = document.getelementsbyclassname("accordion"); var i; (i = 0; < acc.length; i++) { acc[i].onclick = function(){ this.classlist.toggle("active"); this.nextelementsibling.classlist.toggle("show"); } } .triangleright { width: 0; height: 0; border: solid 10px; border-color: transparent transparent transparent green ; } .triangledown { width: 0; height: 0; border: solid 10px; border-color: white transparent transparent transparent ; } button.accordion { background-color: rgb(213,227,233); color: #444; cursor: pointer; padding: 18px; width: 100%; border: none; text-align: left; outline: none; font-size: 15px; transition: 0.4s; } button.accordion.active { background-color: rgb(0,56,96); color: white; } button.accordion:after { /* content:"/2795...

ms access - INSERT INTO code returns a Compiler Error: Expected: End of Statement -

i wrote simple code insert record in test data table. followed msdn example cannot past compile error. have tried recordset , table name alone. same error. private sub cmdcommitchg_click() 'this tester environment dim ztemp1, ztemp2, ztemp3 string 'these dummy data append table dim tblinsert string dim dbsdonors dao.database dim rcdtemptester dao.recordset set rcdtemptester = dbsdonors.openrecordset("tbltemptester") ztemp1 = "tempid" ztemp2 = "tempentity" ztemp3 = "tempname" insert rcdtemptester!tbltemptester (id_members, id_entity, member_name) values (ztemp1, ztemp2, ztemp3) end sub you mixing vba , sql. this: private sub cmdcommitchg_click() 'this tester environment dim ztemp1 string dim ztemp2 string dim ztemp3 string dim tblinsert string dim dbsdonors dao.database dim rcdtemptester dao.recordset ztemp1 = "tempid" ztemp2 = "tempentity" ztemp3 =...

Javascript array of objects, objects sharing same member array? -

i have array of objects (this object contains array of it's own) i'm not sure why, when push values onto member array of 1 instance of object in array of objects seems push onto other member arrays on other array of objects. have provided code below: var imagegroup = { groupname:"", haz:[] }; var imagehandler = { imagegroupsarray:[], image_process: function() { //calling function here... //pushing objects this.imagegroupsarray.push(object.create(imagegroup)); this.imagegroupsarray.push(object.create(imagegroup)); //assigning values this.imagegroupsarray[0].haz.push("dog"); this.imagegroupsarray[1].haz.push("cat"); //should output array 'dog' in console.log(this.imagegroupsarray[0].haz); //should output array 'cat' in console.log(this.imagegroupsarray[1].haz); //instead, both of these output ["dog","cat"] //this.imagegroupsarray[1].haz , this.imagegroupsarray[0].haz point same 'haz' array...

How to enable Windows console QuickEdit Mode from python? -

i'd force quickedit mode in console when running python script , disable right before terminating. there way that? you can use ctypes call getconsolemode , setconsolemode . ctypes definitions: import msvcrt import atexit import ctypes ctypes import wintypes kernel32 = ctypes.windll('kernel32', use_last_error=true) # input flags enable_processed_input = 0x0001 enable_line_input = 0x0002 enable_echo_input = 0x0004 enable_window_input = 0x0008 enable_mouse_input = 0x0010 enable_insert_mode = 0x0020 enable_quick_edit_mode = 0x0040 # output flags enable_processed_output = 0x0001 enable_wrap_at_eol_output = 0x0002 enable_virtual_terminal_processing = 0x0004 # vt100 (win 10) def check_zero(result, func, args): if not result: err = ctypes.get_last_error() if err: raise ctypes.winerror(err) return args if not hasattr(wintypes, 'lpdword'): # py2 wintypes.lpdword = ctypes.pointer(wintype...

javascript - JSON element added not showing -

i using express.js develop api. have json object returned mongoose , need add en element each element in result.docs. i doing follows: for(a in result.docs) { result.docs[a].links={ "test":'test', "test": 'test', "test": 'test' }; } after doing returning result object, links not added. on other hand if write console.log(result.docs[1].links); the object shown properly. any ideas please? thanks possibly you're working mongoose document instance instead of plain object, in case use toobject method plain object, implementation be: var objs = []; for(var in result.docs) { var obj = result.docs[a].toobject(); obj.links = { "test":'test', "test": 'test', "test": 'test' }; objs.push(obj); } // objs toobject documentation

c# - How to run headless YUI tests and log success/failure in a log file? -

i have yui tests need them run headless. currently, these tests run launching corresponding testfilename.html . upon launching, browser shows passed or failed tests on screen green , red icons , corresponding messages. during process, machine unusable because browser's ui keeps popping , down. i trying make test run headless. created webbrowser (from .net) control in memory , launched page in it. but, way can not see ui , determine if tests passed of failed. need log success/failure , corresponding messages in log file in file system. i not sure how so. can please tell me can achieve headless execution of yui , creating logs? thanks you might want @ phantom.js. it's head-less version of webkit (ie. safari , chrome), , people use time running head-less js tests, can find lot more information out there .net thing mentioned.

Django return select_related() filter as JSON -

i'm trying return object , it's relations json. works fine if this: plant = plant.objects.get(slug=kwargs['slug']) return httpresponse(serializers.serialize("json", [plant]), content_type='application/json') but wheni try select_related() , no worky: plant = plant.objects.select_related().filter(slug=kwargs['slug']) return httpresponse(serializers.serialize("json", [plant]), content_type='application/json') is there way make django stop being lazy , and build object? know go ahead , render template , display output json, seems bit of kludge. thanks helping! i don't think has select_related() when plant = [plant] putting queryset inside list in serializers/base.py when iterates on list finds queryset instead of individual objects that's why error 'queryset' object has no attribute '_meta but case plant = plant.objects.get(slug=kwargs['slug']) return httpresponse(seri...

swift - Is the functionality of AppleScript (or OSA) a subset of Cocoa -

i.e. can can osa cocoa? example communicate other open apps , tell them specific thing (resize window, etc.) technically yes. cocoa supports things nsapplescript , nsscriptcommand accomplish same things, pretty similar applescript themselves.

In Perl, how can I determine if a subroutine was invoked as a method? -

is there way determine whether subroutine invoked method (with @isa probing) or plain subroutine? perhaps sort of extension module super- caller() ? for example, given package ad::hoc; sub func() { ... } how can func() discriminate between following 2 invocations: ad::hoc->func; # or $obj->func ad::hoc::func('ad::hoc'); # or func($obj) (i know, desire likely indication of poor design™ .) see if devel::caller helps. changed code invoke func on object , seems work on mac perl 5.14.3 (and 5.24.0): called_as_method($level) called_as_method returns true if subroutine @ $level called method. #!/usr/bin/env perl package ad::hoc; use strict; use warnings; use devel::caller qw( called_as_method ); sub func { printf "%s\n", called_as_method(0) ? 'method' : 'function'; return; } package main; use strict; use warnings; ad::hoc->func; ad::hoc::func(); output: method function

php - Laravel Call to a member function isValid() on null -

in project users can upload stuff , attach image. have controller isvalid check on file input. works great long select file. when don't select file error call member function isvalid() on null on line of code: if (input::file('image')->isvalid()) the error obvious since don't select image have no idea how can fix this. if can i'd happy :) in advance! first need check if request containing file / input or not. determining if file uploaded if (request::hasfile('image')) { /*determining if uploaded file valid*/ if (request::file('image')->isvalid()) { // } } just info make sure getting file while posting. enctype="multipart/form-data" you can use of input , request facade. input class referencing \illuminate\http\request in laravel

messaging - In a Master-Slave cluster, how to make sure the master is really dead for the slave to take over? -

i have in-house messaging system, similar message broker. have 1 master message broker , 1 slave message broker. message broker receives messages , sends them nodes. slave acting node, receiving messages master , building state can take on in case of master failure. now problem is: how can detect, if possible , without human intervention, master dead!? master may dead, , slave might tempted take over, might end in situation of 2 masters in system. i'm trying understand how clustering systems implement master-dead detection. until looks human has manually kill master , turn on slave, more preferable process automatic.

kendo ui - Set JsonRequestBehavior to AllowGet only happens on combo and dropdown boxes? -

i have mvc4 .net app using kendo ui. set jsonrequestbehavior issue comboboxes , dropdowns not listview when use same function read. want populate dropdown box. missing something? relevant code: relevant part of cshtml(view): <script type="text/x-kendo-tmpl" id="propertiestemplate"> <div class="partnersss"> <h5>#:partnerid#</h5> <p>#:partnername#</p> </div> </script> <div class="editor-field"> @(html.kendo().dropdownlist() .name("partnerddl") .htmlattributes(new { style = "width: 250px" }) .datatextfield("partnername") .datavaluefield("partnerid") .autobind(true) .datasource(source => { source.read(read => { read.action("getpropertypartner...

Python map a value to each i-th sublist's element -

i'm trying following in python: given list of lists , integer i input = [[1, 2, 3, 4], [1, 2, 3, 4], [5, 6, 7, 8]] = 1 i need obtain list has 1s elements of i-th list, 0 otherwise output = [0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0] i wrote code output = [] sublist in range(0, len(input)): item in range(0, len(input[sublist])): output.append(1 if sublist == else 0) and works, since i'm newbie in python suppose there's better 'pythonic' way of doing this. i thought using map work, can't index of list it. creating variable index of current element in interation quite unpythonic. usual alternative usage of enumerate built-in function. return enumerate object. sequence must sequence, iterator, or other object supports iteration. next() method of iterator returned enumerate() returns tuple containing count (from start defaults 0) , values obtained iterating on sequence. you may use list comprehension double loop insid...

mysql - Adding columns (from other tables) to the 'most recent notes for each user' query sql -

i have following tables: [run code snippet] <!--__________________________________________________--> ---------------------'notes' table----------------------- <!--__________________________________________________--> <table> <thead> <th>note_id</th> <th>note_date</th> <th>note_time</th> <th>writer_id</th> </thead> <tbody> <tr> <td>1</td> <td>2-05-2016</td> <td>08:37:05</td> <td>1</td> </tr> <tr> <td>2</td> <td>14-05-2016</td> <td>11:44:01</td> <td>2</td> </tr> <tr> <td>3</td> <td>14-05-2016</td> <td>07:57:35</td> <td>2</td> </tr> <tr> <td...

Removing old accounts from the Xcode Organizer -

Image
when open xcode 4 organizer , select devices, , choose team name, see several duplicate people on there. of have yellow warning icon indicates invalid. there no way select them in order delete them. how delete accounts on screen? in order delete these accounts, following: launch keychain access. select certificates on left (not certificates). delete certificate invalid, or doesn't have private key associated it. certificates have private keys associated them have triangle left, similar seen here next 2nd , 4th options in list: restart xcode. when launch organizer, recreate single entry (and corresponding certificate) each developer on team.

Reverse engineering Delphi code - UML -

i totally new uml , using trial version of delphi xe4 currently. trying create uml design project built using delphi 2009. when open project in delphi xe4, able see class diagram in "model view" option each pas file there no relationship among classes. there more 100 pas files in project. i not clear possible uml diagrams automatically? or need create each diagram manually? basically want know how complecated current project migrate java. wanted perform reverse engineering. to best of knowledge, ide's built in uml diagram support not reverse engineer code diagrams. various third party tools claim ability, example modelmaker, enterprise architect, rational rose, etc.

powershell - Creating files at PSModulePath in batch -

i trying write batch program installs module named setconsolepath.psm1 @ correct location. beginner batch , have absolutely no powershell experience. through internet, have learned how display psmodulepath powershell -command "echo $env:psmodulepath . how can i, via .bat file, move setconsolepath.psm1 desktop location displayed powershell -command "echo $env:psmodulepath ? thank in advance, , apologize lack of experience. before answer, must out not want copy powershell module files directly path pointed psmodulepath . want create folder inside psmodulepath , copy files there instead. the prefix env in powershell variable indicates environment variable . $env:psmodulepath referring psmodulepath environment variable. on command line, , in batch files, environment variables can displayed placing name between percent symbols. (in fact, have displayed value typing echo %psmodulepath% instead.) to reference desktop folder, have @ this answer , sho...

linux - gdb python module can't find any function of it's own -

i compiled&installed gdb(7.1.1) source code doing cc=gcc-6 ./configure --with-python=python3 && make sudo make install . invoked gdb bash usual. when tried load python script within gdb doing source asdf.py , threw error saying attributeerror: 'module' object has no attribute 'execute' i tried change code try more functions gdb module every function tried execute looking it's missing. invoked python interpreter within gdb did import gdb , dir(gdb) see gdb's contents, output ['__doc__', '__loader__', '__name__', '__package__', '__path__', '__spec__'] so there module called gdb it's contents empty. have gone wrong during installation? or bug in gdb? how can fix this? i found files needed gdb located @ gdb/data-directory. moving files place python scripts should did trick. sudo cp -r gdb/data-directory/* /usr/share/gdb/

asp.net mvc - DOT Exception When Trying To Open/Call a Funtion -

Image
i have problem calling function show books same author, example have these authors : author name : jeremy mcpeak; joe fawcett; nicholas c. zakas ; when click on "jeremy mcpeak" , "joe fawcett" new page opened , show books authors . but when click on author "nicholas c. zakas" , since has dot in name , got exception object reference not set instance of object. this problem when click on author have dot in name .. also here function : public actionresult author(string authorname, int? page) { if (authorname != null) { viewbag.authorname = authorname; int pagesize = 6; int pagenumber = page ?? 1; var result = db.books.where(s => s.author_name.contains(authorname)).orderbydescending(x => x.book_id).tolist(); return view(result.topagedlist(pagenumber, pagesize)); } return redirecttoaction("index", "home"); } author view code: @using pagedlist.mvc @usi...

android - Error in NavigationView methods after updating gradle dependencies -

Image
i have (previously) functioning code: if (navigationview.getheadercount() > 0) { navigationview.removeheaderview(navigationview.getheaderview(0)); } after updating gradle dependencies, i'm getting following error: which strange because can see there's nothing on documentation stating removed or something . project gradle: // top-level build file can add configuration options common sub-projects/modules. buildscript { repositories { jcenter() mavencentral() } dependencies { classpath 'com.android.tools.build:gradle:2.1.0' classpath 'com.google.gms:google-services:3.0.0' // note: not place application dependencies here; belong // in individual module build.gradle files } } allprojects { repositories { jcenter() maven { url "https://jitpack.io" } } } task clean(type: delete) { delete rootproject.builddir } app module gradle (...

html - Multiple borders around a div with a transparent layer -

i trying create button 3 layers of border around middle layer showing background of containing div. examples worth thousand words here go http://jsfiddle.net/e5sxt/2/ html <div id="content"> <p>generic content</p> <button class="button">search</button> </div> css #content{ width: 500px; height: 500px; background-color: black; padding: 50px; color: white; } button{ margin-top: 50px; padding: 20px; text-align: center; background-color: #333; box-shadow: 0 0 0 5px #666, 0 0 0 10px red, 0 0 0 15px #bbb; border: none; cursor: pointer; } the red box-shadow black of containing div should come through. if box-shadow set transparent layer, box-shadow under shows through instead. i have tried utilizing outlines, borders, , box-shadows no avail far. of right now, think have wrap button in div outer border , padding show background, wanted see if without add...

java - How to open new activity using onItemClick -

i have onitemclick listener. there's no error, every time click on "caloocan" in listview nothing happens. @override public void onitemclick(adapterview<?> parent, view view, int position, long id) { restaulv.setonitemclicklistener(new onitemclicklistener() { public void onitemclick(adapterview<?> parent, view view, int position, long id) { int value = (int) restaulv.getitematposition(position); if (value == 0){ intent cal = new intent(hopnow.this, caloocan.class); startactivity(cal); } } }); } } this code caloocan.java package com.example.aspiree1_472g.finalfirstpage; import android.os.bundle; import android.support.v7.app.appcompatactivity; public class caloocan extends appcompatactivity { @override protected void oncreate(bundle savedinstancestate) { sup...