Posts

javascript - How do I parse a JSON multidimensional array in jQuery? -

here json need parse: {"opcode":"groupdetails", "status":"success", "data":[{"group id":5,"group name":"data structure","group subject":"computer science","role type":"teacher"},{"group id":4,"group name":"information technology","group subject":"computer science","role type":"student"},{"group id":6,"group name":"data mining","group subject":"computer science","role type":"parent"},{"group id":7,"group name":"dccn","group subject":"computer science","role type":"teacher"}]} i have tried , implemented solution provided here , implementation of js defined in there solution, which parses json array for (var = 0; < data.data.length; i++) { var...

parsing - Canonical mutual exclusive data structure -

note: unrelated concurrency problem of mutual exclusion, couldn't think of better way of describing problem. i have problem have case want let user select flags, flags mutually exclusive. want describe flags mutually exclusive using data structure, i've thought of has been clunky. basically, want able specify how flags used so: [ -fa | -e | -d ] [ -c ] [ -g | -h ] this should semantically mean, can have 1 of -fa, -e, -d, not 2 or more (however, f can used a, , don't need use both). can either have -c or not, , can have either -g or -h, not both. here's "best" solution. map[flag, mutexgroup] (and inverse, map[mutexgroup, list[flag]]) map[mutexgroup, list[mutexgroup]] what example be map("f" -> 1, "a" -> 1, "e" -> 2, "d" -> 3, "c" -> 4, "g" -> 5, "h" -> 6) map(1 -> list(2, 3), 2 -> list(1, 3), 3 -> list(1, 2), 4 -> list.empty, 5 -> lis...

html - Right header links not clickable when adding top drop down menu -

my site uses wordpress. have right header seen here http://www.gigster.me , top centered drop down menu plugin buddypress links. renders links on top right un-clickable. tried changing z-index properties of center tab it's still not working. drop down menu causing usable area right , left of actual tab/menu visible unusable. i'm not coder appreciate amateurs me. thank you ziad a few options: set login section display: relative; , push rest of page down. decrease it's z-index , when loads, set display: none; .header_right decrease login screen's z-index, increase when it's dropped down.

asp.net mvc 3 - Configuring Virtual Directory for Multiproject Areas in MVC3 -

i using technique described in answer: https://stackoverflow.com/a/7167198/22399 set multi-project areas in mvc3. issue, though, seems in configuring iis express, not in technique itself. i doing wrong in step 7 (using iis express.) keep getting error saying cannot find views (my test area called "sample") here error: the view 'index' or master not found or no view engine supports searched locations. following locations searched: ~/areas/sample/views/index/index.aspx<br /> ~/areas/sample/views/index/index.ascx<br /> ~/areas/sample/views/shared/index.aspx<br /> ~/areas/sample/views/shared/index.ascx<br /> ~/views/index/index.aspx<br /> ~/views/index/index.ascx<br /> ~/views/shared/index.aspx<br /> ~/views/shared/index.ascx<br /> ~/areas/sample/views/index/index.cshtml<br /> ~/areas/sample/views/index/index.vbhtml<br /> ~/areas/sample/views/shared/index.cshtml<br /> ~/areas/sample/views/shared/i...

jquery - Using c# code in javascript -

i trying use c# in javascript using in mvc razor view using @ sign , like suppose array name list passed view can access in view like: view length of array : <input type="text" value="@model.list.length" /> or can iterate list array like: @for(int i=0; i< model.list.length; i++) { console.log(model.list[i]); } but question how can iterate or use array in javascript code , similar : js for(var i=0; i<@model.list.length; i++) { $("body").append("<h1></h1>").html(@model.list[i]); } thanks ! as posted in comment, bit tricky. however, can try construct javascript object c#. something (i don't know how works exactly...): var array = [ @for(var = 0; < model.list.length-1; i++){ @model.list[i] , } @model.list[length] ] which should result in: var array = [ val1,...

windows phone 7 - Create folder with Skydrive API -

in windows phone 7(.5) application using skydrive , want create folder. how (or can find api to) create folder? far found examples scan , download files. i'm using liveconnectclient. direct link creating folders (example provided in several languages [c# windows phone apps]: http://msdn.microsoft.com/en-us/library/live/hh826531#creating_folders skydrive api: http://msdn.microsoft.com/en-us/library/live/hh826521

Equivalent method in java (numpy.random.normal(mean,var)) -

is there method in java equivalent numpy.random.normal(mean,variance) . you can use java.util.random class: random r = new random(); double randomvalue = mean + r.nextgaussian()*variance; note if need multiple random values, can use r multiple times. can supply constructor specific seed random r = new random(1234); .