Posts

javascript - Accessing JSON parsed object -

so here js code: $(document).ready(function() { $.ajax({ url: "/", type:"post", beforesend: function (xhr) { var token = $('meta[name="csrf_token"]').attr('content'); if (token) { return xhr.setrequestheader('x-csrf-token', token); } }, success:function(data){ console.log(data); },error:function(){ console.log("error!!!!"); } }); }); and in console: object { all_creations: "[{"id":"2","user_id":"2","title":"d…" } but i'd like: console.log(data.user_id) but return nothing.. same for: console.log(data['all_creations'].user_id) console.log(data['all_creations'][0].user_id) console.log(data[0].user_id) ... i using laravel5 btw , json object return tojson() function. (if help) ...

google maps - Why we need to convert GPS coordinates(latitude, longitude) from degrees and minutes into decimal degrees -

i'm getting nmea data gps. 1 i'm converting decimal degrees using them in google maps. we have gps coordinates conversions degrees minutes , seconds. why need convert coordinates between 2 representations? use conversion(degrees seconds), , how coded. sexagesimal (base 60) numeral system sixty base. originated ancient sumerians in 3rd millennium bc, passed down ancient babylonians, , still used—in modified form—for measuring time, angles, , geographic coordinates. degree minutes , degree seconds not units of time, reference degree in sexagesimal system. for further information: https://en.wikipedia.org/wiki/sexagesimal

bash - Find the 2nd ip address per line on file -

how can find 2nd ip address per line? input hostname1,10.160.226.49,10.160.35.80,10.14.1.80,10.14.5.80,10.160.0.27, 2048 hostname2,10.160.235.89,10.160.35.81,10.14.1.81,10.14.5.81,10.157.233.144, 1024 hostname3,10.160.231.247,10.160.35.82,10.14.1.82,10.14.5.82,10.157.239.26, 512 hostname4,10.160.227.232,10.160.35.84,10.14.1.84,10.14.5.84,10.241.14.2, 2048 hostname5,10.160.224.218,10.160.35.85,10.14.1.85,10.14.5.85,10.157.234.82, 1024 output 10.160.35.80 10.160.35.81 10.160.35.82 10.160.35.83 10.160.35.84 10.160.35.85 try this: cut -d "," -f 3 file or gnu grep: grep -op '^[^,]*,[^,]*,\k[^,]*' file or awk: awk -f "," '{print $3}' file or bash's builtin commands: while ifs="," read -r b c d; echo "$c"; done < file or array: while ifs="," read -ra a; echo "${a[2]}"; done < file output: 10.160.35.80 10.160.35.81 10.160.35.82 10.160.35.84 10.160.35.85

javascript - How to specify wildcards in sonar-project.properties -

i trying use sonarqube scan ui modules, have. ui modules lot in number. have common structure. each module has own js files. i need specify sonar.sources value match js files in project. possible this? sonar.sources=*/*/script sonar.language=js i used these. but, got error 'unable resolve path'. can 1 help? try use wildcard : * match 0 or more characters ** match 0 or more directories ? match single character sonar.sources=**/script

ios - Stream Song to Device with Multipeer Connectivity - Swift -

i'm using multipeer connectivity pair 2 devices , want stream song 1 device other in swift . i've been following this walkthrough in objective-c closely apple's documentation, admittedly don't have obj-c experience. i'm able track output avassetreadertrackoutput, add avassetreader, , start reading. however, once cmsamplebufferref enters equation, start lose sight of what's happening. if can explain process of getting samples track output , drilling down put data stream mc can consume, appreciated.

c++ - Use LLVM debugger inside Emacs on OSX Yosemite -

i want know if possible use llvm debugger emacs, m-x gdb interface standard. in advance. adding llvm debugger support emacs surprisingly (or not, depending on level of cynicism) contentious. in february, 2015, richard stallman wrote : the llvm source repository includes patch adding basic lldb support gud.el. it looks there systematic effort attack gnu packages. gnu project needs respond strategically, means not having each gnu package cooperate each attack. now, please not install change. stefan monnier, 1 of current maintainers, much less hostile change : thanks, andrew. i'd happy incorporate such patch. took quick @ code, , seen afar, there's no problem it, needed clear copyright status of code. as of march, 2015, don't believe llvm debugger patch has been accepted.

Ruby Sinatra table from MySQL -

Image
i working on project have pull data mysql database , display data in table using ruby sinatra. i able connect database , pull data , put inside array. example of table in database city country dallas usa tokyo japan example of array looks like ["dallas, usa", "tokyo, japan"] now, how display array table database. or, there way can copy table database onto webpage? thanks help! your_app/routes.rb: require 'sinatra' require 'slim' '/' raw_data = [ "dallas, usa", "tokyo,japan", "munich, germany", ] @results = {} raw_data.each |item| city, country = item.split(/, \s* /x) @results[city] = country end p results # {"dallas"=>"usa", "tokyo"=>"japan", "munich"=>"germany"} slim :index end your_app/views/layout.slim: doctype html html head meta char...