<commit_before>package com.mobile.countme.framework;

import android.location.Location;

import java.util.ArrayList;

/**
 * Created by Kristian on 11/09/2015.
 * Renamed by Torgeir on 19/10/2015.
 */
public class GPSFilter {

    public static void filterTrip(ArrayList<Location> trip, ArrayList<Integer> modes){
        Location end = trip.get(trip.size() - 1);
        Location almostEnd;
        double accumulator = 0.0;
        double lengthSegment = 0.0;
        for(int i = trip.size() - 2; i >= 0; i --){
            almostEnd = trip.get(i);
            lengthSegment = almostEnd.distanceTo(end);
            if(lengthSegment < 20.0){
                accumulator += lengthSegment;
            }
            if( accumulator < 100.0){
                trip.remove(i);
                trip.remove(i);
            }
            else{
                trip.remove(i);
                trip.remove(i);
                break;
            }
            end = almostEnd;


        }
        Location start = trip.get(0);
        Location next;
        int lastIndex = 0;
        accumulator = 0.0;
        lengthSegment = 0.0;
        for(int i = 1; i < trip.size(); i ++){
            next = trip.get(i);
            lengthSegment = start.distanceTo(next);
            if(lengthSegment < 20.0){
                accumulator += lengthSegment;
            }
            if( accumulator < 100.0){

            }
            else{
                lastIndex = i;
                break;<commit_msg>remove from both lists not twice from same<commit_after>package com.mobile.countme.framework;

import android.location.Location;

import java.util.ArrayList;

/**
 * Created by Kristian on 11/09/2015.
 * Renamed by Torgeir on 19/10/2015.
 */
public class GPSFilter {

    public static void filterTrip(ArrayList<Location> trip, ArrayList<Integer> modes){
        Location end = trip.get(trip.size() - 1);
        Location almostEnd;
        double accumulator = 0.0;
        double lengthSegment = 0.0;
        for(int i = trip.size() - 2; i >= 0; i --){
            almostEnd = trip.get(i);
            lengthSegment = almostEnd.distanceTo(end);
            if(lengthSegment < 20.0){
                accumulator += lengthSegment;
            }
            if( accumulator < 100.0){
                trip.remove(i);
                modes.remove(i);
            }
            else{
                trip.remove(i);
                modes.remove(i);
                break;
            }
            end = almostEnd;


        }
        Location start = trip.get(0);
        Location next;
        int lastIndex = 0;
        accumulator = 0.0;
        lengthSegment = 0.0;
        for(int i = 1; i < trip.size(); i ++){
            next = trip.get(i);
            lengthSegment = start.distanceTo(next);
            if(lengthSegment < 20.0){
                accumulator += lengthSegment;
            }
            if( accumulator < 100.0){

            }
            else{
                lastIndex = i;
                break;
{'fraction_non_alphanumeric': 0.11100033233632436, 'fraction_numerical': 0.029245596543702228, 'mean_word_length': 1.4118589743589745, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3748833', 'n_tokens_mistral': 908, 'n_tokens_neox': 816, 'n_words': 200}