ó ՐŽUc@s:ddlZdZd„Zd„Zd„Zd„ZdS(i˙˙˙˙Nsmy_db.dbcCs§y~tjtƒ}|jƒ}d}|j|ƒ|jƒ}|dkrYtjdƒnd}|j ƒ|j ƒt |fSWn"|j ƒ|j ƒt dfSXdS(Nsäselect distinct network_type,cell_signal_strength_dbm,device_latitude,device_longitude,device_position_accuracy,user_id,timestamp from networkmonitor where network_type !='WIFI' and device_latitude not NULLit( tsqlite3tconnecttDATABASEtcursortexecutetfetchonetNonetsystexittclosetTruetFalse(tconRtcommandtresultt weighted_data((s//home/rasmus/exjobb_database/database_helper.pytquery_weighted_datas         cCsÂy–tjtƒ}|jƒ}d}|j|ƒ|jƒ}|dkrYtjdƒn|d|d|dg}|j ƒ|j ƒt d|fSWn%|j ƒ|j ƒt ddfSXdS( Nsäselect distinct network_type,cell_signal_strength_dbm,device_latitude,device_longitude,device_position_accuracy,user_id,timestamp from networkmonitor where network_type !='WIFI' and device_latitude not NULLiiiitsuccessdatabase errorR( RRRRRtfetchallRRR R R R (R RRRtdata((s//home/rasmus/exjobb_database/database_helper.pytquery_unweighted_datas         cCs8|dkrdS|dkr dS|dkr0dSdSdS(Niœ˙˙˙iiŚ˙˙˙iiş˙˙˙ii((R((s//home/rasmus/exjobb_database/database_helper.pytsignal_strength_interval0s   cCs'ytjtƒ}|jƒ}d}|j|ƒ|jƒ}|dkrYtjdƒnddddg}ddddg}xc|dkrâ|ddkrš|t |dƒcd7s