Categories
Mastering Development

Elixir: Looping through a map, comparing it to itself, and updating it

I have a map of a billiard ball table, as follows: ball_map = %{ "cue" => {"x":-15.0, "z": 0.0, "velocity_x": 0.0, "velocity_z": 0.0, "is_idle": true}, "ball_1" => {"x":15.0, "z": 0.0, "velocity_x": 0.0, "velocity_z": 0.0, "is_idle": true}, "ball_2" => {"x":17.0, "z": 1.1, "velocity_x": 0.0, "velocity_z": 0.0, "is_idle": true}, "ball_3" => {"x":17.0, "z": -1.1, "velocity_x": 0.0, "velocity_z": […]

Categories
Development

Android: fill a spinner data from the server dynamically

I’m new to android. How do you fill a spinner from the server’s data dynamically. So I’m trying to populate data from the server to my spinner. my JSON is {“topic”: “/waypoints”, “msg”: {“waypoints”: [{“header”: {“stamp”: {“secs”: 0, “nsecs”: 0}, “frame_id”: “map”, “seq”: 0}, “pose”: {“position”: {“y”: -140.901899144836, “x”: 44.36469369653882, “z”: 0.0}, “orientation”: {“y”: 0.0, […]

Categories
Development

Android: fill a spinner data from the server dynamically

I’m new to android. How do you fill a spinner from the server’s data dynamically. So I’m trying to populate data from the server to my spinner. my JSON is {“topic”: “/waypoints”, “msg”: {“waypoints”: [{“header”: {“stamp”: {“secs”: 0, “nsecs”: 0}, “frame_id”: “map”, “seq”: 0}, “pose”: {“position”: {“y”: -140.901899144836, “x”: 44.36469369653882, “z”: 0.0}, “orientation”: {“y”: 0.0, […]