Posts

How can I get to WIFI Direct Screen by code in Android? -

this thread answered question going wifi setting screen. however, direct user wifi direct screen when exists on device. how can that? there no standard intent structure go settings screen related wifi direct.

cmake - Bad Reloc Address using MinGW -

i use mingw on windows 7 64bit. i used google test netbeans (followed bo qian instruction: http://www.youtube.com/watch?v=ts2ctf11k1u&feature=c4-overview-vl&list=pl5jc9xfgsl8gyes7nh-1yqljjdtvifssh&hd=1 ) , worked correctly. tried link google mock (with google test inside) project. used cmake , cmakelists.txt file: cmake_minimum_required(version 2.8) project(fs_report) include_directories(${project_source_dir}) set(cmake_cxx_flags_debug "-g -wall -std=c++11") set(google_mock gmock-1.6.0) add_subdirectory(${google_mock}) include_directories(${project_source_dir}/${google_mock}/include) include_directories(${project_source_dir}/${google_mock}/gtest/include) add_subdirectory(source) enable_testing() file(make_directory ${project_binary_dir}/tests) set(testnames aircraft airport exception flightlevel flightnumber pilotid registration remarks route) foreach(test ${testnames}) add_executable(tests/${test}.test tests/${test}test.c...

algorithm - In-place QuickSort in Python -

i had implement quicksort algorithm homework in language of choice , chose python. during lectures, we've been told quicksort memory efficient because works in-place; i.e., has no additional copies of parts of input array recursions. with in mind, tried implement quicksort algorithm in python, shortly afterwards realized in order write elegant piece of code have pass parts of array function while recursing. since python creates new lists each time this, have tried using python3 (because supports nonlocal keyword). following commented code. def quicksort2(array): # create local copy of array. arr = array def sort(start, end): # base case condition if not start < end: return # make known inner function work on arr # outer definition nonlocal arr = start + 1 j = start + 1 # choosing pivot first element of working part # part of arr pivot = arr[start] # start partit...

php - Adding a class to the last listed item -

i list latest 5 events on 1 section of website. , every time item listed, has divider @ bottom. want add last last <li> divider disappear on last item. so changed <li class="clearfix"> <li class="clearfix last"> . how can it? fyi, <?php $icounterli++; ($icounterli==5)? 'last':''; ?> wont work because may have less 5 upcoming events time time. thanks! <?php $get_latest_events = get_latest_events(5); if(count($get_latest_events) > 0) { foreach($get_latest_events $eventdata) { $entity_data = node_load($eventdata->entity_id); $event_start_date = check_isset_start_date($entity_data,'event_calendar_date','und'); if($event_start_date !='') { $explode_event_date = explode(" ",$event_start_date); $explode_event_day = strtotime($explode_event_date[0]); $explode_event_time = $explode_event_date[1]; $event_start_day1 = strf...

ruby on rails - Nested Routes alternative -

i having problems nesting resources. want find out if there better way of doing things. i have to-do list application 3 resources user, list , task. each user has his/her own todo list. my question how else can set associations , routes prevent me nesting 3 layer deep in route file. resources :users resources :list resources :task end end end i want prevent that. cheers since user can see her/his own lists , tasks, don't have nest these resources. define them separately in routes file: resources :users resources :lists resources :tasks end and retrieve current user authentication framework: class listscontroller < applicationcontroller def index @lists = current_user.lists end end

ios - Cannot determine when UIImageView frames are equal -

i have 2 layers. bottom layer consists of hidden uiimageview s, upper layer consists of visible uiimageview s. when frames of bottom layer uiimageview s equal frames of upper layer uiimageview s, have see in nslog . the problem boolean method called nstimer returns true immediately, see nslog . want see nslog when corresponding frames equal each other. this code: - (void)checktheframes { bool allequals = [self isequalframes]; if (allequals) { nslog(@"all frames equal"); [allposcorrecttimer invalidate]; } } -(bool)isequalframes { for(int = 0; < arrayimg.count; i++ ){ uiimageview *imageview1 = arrayimg[i]; uiimageview *imageview2 = hiddenfieldview[i]; if (!cgrectequaltorect(imageview1.frame, imageview2.frame)) { return no; } } return yes; } is there way solve issue? i think whats wrong you're comparing xs , ys too... maybe should go further frame.size , compare th...

loops - JSP varStatus javax.el.PropertyNotFoundException: Property status is not found on type -

i'm having problem objects list index: my jsp: <c:choose> <c:when test="${empty findattributes}"> <h1 align="center">attributes empty</h1> </c:when> <c:otherwise> <table align="center" border="1" id="resulttable"> <c:foreach items="${findattributes}" var="findattributesvar" varstatus="status"> <tr> <td align="center">${findattributesvar.status.index.formdescriptionlist.status.status.institutions.nameofinstitution}</td> <td align="center">${findattributesvar.status.index.formdescriptionlist.status.status.institutiontype.typeofinstitution}</td> <td al...