Posts

Showing posts from August, 2013

How to suppress `bicgstab` command output in MATLAB? -

this should trivial problem solve.... all want suppress output of bicgstab in matlab . reason, when use semicolon @ end, still prints out information?!?! try example documentation , , you'll see still prints though try suppress output: a = gallery('wilk',21); b = sum(a,2); tol = 1e-12; maxit = 15; m1 = diag([10:-1:1 1 1:10]); x = bicgstab(a,b,tol,maxit,m1); you need request 2nd output argument flag prevent information being printed (this mentioned in doc page link - it's not obvious though - below table describing different flag values) [x, flag] = bicgstab(a, b, tol, maxit, m1);

C++ Output Conversion Error -

i'm supposed make code converts feet , inches meters , centimeters. when run code, don't should get. example, input 1 foot , 0 centimeters. should 0.3048 meters , 0 centimeters instead i'm getting 1 meters , 0 centimeters . help! #include <iostream> using namespace std; void getlength(double& input1, double& input2); void convert(double& variable1, double& variable2); void showlengths(double output1, double output2); int main() { double feet, inches; char ans; { getlength(feet, inches); convert(feet, inches); showlengths(feet, inches); cout << "would go again? (y/n)" << endl; cin >> ans; cout << endl; } while (ans == 'y' || ans == 'y'); } void getlength(double& input1, double& input2) { cout << "what lengths in feet , inches? " << endl; cin >> input1 >> input2; cout <&

Spring mvc + Maven multi module + Ear - deployment -

Image
i created following multi module project spring + maven. has following hierarchy, when build project getting cleveree.ear file under clevermoe_ee/target . ear file contains following things, initially used jboss7.1.1 deployment, copied ear file jboss depolyments, able load war follows, http://localhost:8080/clevermoe_web i followed link make spring project, http://www.mkyong.com/spring3/spring-3-mvc-hello-world-example-annotation/ so used following classes in clevermoe_web module, springwebconfig, @enablewebmvc // mvc:annotation-driven @configuration @componentscan({ "com.zeptoh.clever.controllers" }) public class springwebconfig extends webmvcconfigureradapter { @override public void addresourcehandlers(resourcehandlerregistry registry) { registry.addresourcehandler("/resources/**").addresourcelocations( "/resources/"); } @bean public internalresourceviewresolver viewresolver() {

oop - Java - sharing static methods across classes -

i've got 3 classes meant simulate mips32 pipeline registers. pretty this. class idex { public static map<string, integer> write; public static map<string, integer> read; static { map<string, integer> tempmap = new hashmap<string, integer>(); tempmap.put("incrpc", 0); tempmap.put("readreg1value", 0); tempmap.put("readreg2value", 0); tempmap.put("seoffset", 0); tempmap.put("writereg_20_16", 0); tempmap.put("writereg_15_11", 0); tempmap.put("function", 0); read = new hashmap<string, integer>(tempmap); write = new hashmap<string, integer>(tempmap); } } i have utility methods copying data hashmaps , formatting/printing them. how can share these methods across register classes? in general, possible share methods between classes work on respective static variables?

ios - Repeat a function in set time Intervals -

i'v been using xcode/swift couple weeks , i'm working on first little ios game. nothing tricky trying learn program , having fun. leads me problem... ...i want background image have in app change randomly (from set of values in array) timed. example "every 2 seconds background image changes." this have far, i've seen stuff nstimer i'm not sure how implement have. @iboutlet weak var backview: uiimageview! let backnames = ["back 1", "back 2", "back 3", "back 4", "back 5", "back 6", "back 7"] let backvalue = int(arc4random_uniform(7)) backview.image = uiimage (named: backnames [backvalue]) so yeah said, know how make select random value background, happens when tap button. wondering how incorporate time feature arc4random. thanks! try animation of image : var imglistarray :nsmutablearray = ["back 1", "back 2", "back 3", "back 4"

Error With Android SDK in Linux Unity5.4.0f3 -

installed unity5.4.0.f (deb file), download [ https://forum.unity3d.com/threads/unity-on-linux-release-notes-and-known-issues.350256/#post-2648924] , while taking build getting below error. fyi, having problem install higher versions of unity 5.3 onwards in ubuntu using playonlinux. while searching alternatives, came across linux unity , spent quality time still no good. possible aiding answers welcome.thanks in advance. getting error:- win32exception: applicationname='/home/mohan/documents/unitystuff/sdk/tools/aapt', commandline='package --auto-add-overlay -v -f -m -j gen -m androidmanifest.xml -s "res" -i "/home/mohan/documents/unitystuff/sdk/platforms/android-23/android.jar" -f bin/resources.ap_', currentdirectory='temp/stagingarea' system.diagnostics.process.start_noshell (system.diagnostics.processstartinfo startinfo, system.diagnostics.process process) system.diagnostics.process.start_common (system.diagnostics.processstartinf

python - Difficulty in plotting Pandas Multi-indexed DataFrame or series -

Image
please see image s = pd.dataframe(combined_df.groupby(['session','age_range', 'gender']).size()) s.head(25) ​ 0 session age_range gender evening 0 - 17 female 31022 male 21754 18 - 24 female 79086 male 71563 unknown 75 25 - 29 female 29321 male 46125 unknown 44 30 - 34 female 21480 male 25803 unknown 33 35 - 44 female 17369 male 20335 unknown 121 45 - 54 female 8420 male 12385 unknown 24 55+ female 3433 male 9880 unknown 212 mid night 0 - 17 female 18456 male 12185 18 - 24 female

Building Docker images using Jenkins results in "Unsupported protocol scheme found" -

Image
i'm following this online tutorial line line. @ step 3 - task: configure plugin - i'm getting error message, when press "test connection" button: unsupported protocol scheme found: http://172.17.0.59:2345 here screen of i've done: so, wrong , right way of configuring docker image jenkins? i followed same tutorial, , entered instead: tcp://172.17.0.18:2345/ the test did work: version = 1.10.0, api version = 1.22

Grafana-web visual read-only/kiosk mode for integration in enteprise app -

have requirement in project integrate grafana-web in enteprise app. some of points are: don't show grafana menu (dashboards read via api , integrated in app menu) hide playground buttons users (even if grafana offers readonly mode, prevents saving not playing around settings/data) for users allow edit mode (add rows, dashboard settings, dashboard save ...) disable sharing users all these visual quirks in frontend, security level low (evil user can still bypass hidden buttons , that's ok) create/delete dashboards done via api triggered buttons in enteprise app as grafana has nothing this, thinking load iframe , xss hide buttons (both ui's loaded same domain). i understand , accept torkel , grafana team decision not have readonly mode in frontend "evil" user can query backend around it, security point of view right. but see edge cases/projects require if visual quirk. warning: sure got it, visual styling of grafana-web , not offer secur

r - Memory leak with closed connections -

Image
i have r application interacting java daemon via stdin , stdout in infinite loop, seems have memory leaks. simplified r app: while (true) { con <- file('stdin', open = 'r', blocking = true) line <- scan(con, = character(0), nlines = 1, quiet = true) close(con) } this loop ends using more , more ram, , if manually gc() after close(con) call, memory footprint seems ok while, grows forever. a basic script confirm this: rscript --vanilla -e "while(true)cat(runif(1),'\n')" | rscript --vanilla -e "cat(sys.getpid(), '\n');while (true) {con <- file('stdin', open = 'r', blocking = true);line <- scan(con, = character(0), nlines = 1, quiet = true);close(con);gc()}" this start 2 r processes: 1 writing stdout , other reading stdin connected pipe (and second printing pid can monitor related memory usage): i'm not sure i'm doing wrong, love stop memory leak highly appreciated.

php - Generate request token in contao on Maintenance Page -

i trying insert newsletter form maintenance page. using contao 3.5+ currently. have connected api on newsletter signup page trying send request token hidden field not being able generate on maintenance page specifically. currently sending following <input type="hidden" name="request_token" value="{{request_token}}" /> the insert tag {{request}} token should have generated random string in other pages . however, not seem work on maintenance page. so, contao developers out here. appreciate if me out here. for newsletter using existing hc_newsletter plugin contao repo. \controller::replaceinserttags(…) is executed in front end. use like <input type="hidden" name="request_token" value="<?= request_token ?>"> instead (depending on how echoing input), i.e. echo request_token constant directly.

javascript - Divide the anchor string value? -

i have anchor inject in html in jqgrid formatter below: var number = rowobject.number; var platenumber = rowobject.platenmber; var markup = "<a href=%href%;>%text%</a>" var replacements = { "%text%": platenumber , "%href%": "javascript:search.openviewbyplatenumber(" + number + "," + platenumber + ")" }; markup = markup.replace(/%\w+%/g, function(all) { return replacements[all]; }); here openviewbyplatenumber function: var openviewbyplatenumber = function(number, platenumber) { // }; in ui there number in grid. when click on number openviewbyplatenumber function called. working fine me. problem plate number string type. number can 1 , 2 , 3/4 , 340/2 etc. it's working fine when number simple 1 , 5 or 9 if number 340/2 , method receives value of 170.5 . divides number. how can pass string? to pass values function string wrap them in quotes: "%href%": 'j

angular - Lazy loading module with APP_INITIALIZER -

we have application lazy loading modules via router. need load resources before app module starts, don't want use resolve on router. that's why trying create provider factory (app_initializer) load data server , use in components in lazy loaded module. every module have different settings translations , on... i created plunker showcase. https://embed.plnkr.co/ubk23o5ca7qgwlvmbi73/ if click on lazy should wait 10 seconds load module not happening. we using angular 2.0.0 version. advice.

ios - How to use NSFetchedResultsController for scrolling bottom to top in messaging app? -

i building message app. when messaging in application messages getting store in core data. have connected core data tableviewcontroller nsfetchedresultscontroller . know how work , using nsfetchedresultscontroller long time tableview. in of case tableview load top , it's scroll down load more data on requirement , application works pretty well. here message app tableview behaviour opposite previous one. loads last messages(20-30 batch size) , if want see old message scroll top. trying implement on nsfetchedresultscontroller. example : suppose have 100 messages. setting batch size 10. first load 90-100 messages , scroll down last indexpath(here 100th). if want want scroll top , reach 90th indexpath give me 10 again have 80-100 messages won't scroll down keep on doing same thing scroll top. i know can sort in reverse order time 100-90 won't last message(100) bellow. so how can fix issue? configuration there nsfetchedresultscontroller missing? how fix?

reporting services - Aggregation and Percentage in SSRS -

Image
my 1st ssrs report looks in table 1. the output of report controlled 2 parameters: class , section, , user can enter these view report. i trying generate 2nd report (table 2) gives summary of 1st report. any idea how can accomplish 2nd report?

javascript - How to draw many functions with a loop in D3? -

i've got parabola , derivative line in point, , want draw lines approximations. data (points) right arrays. don't know how draw these approximations d3 using loop. obtain last approximation (in array) here's code: var x = d3.range(-4., 4.1, 0.1) var m = d3.range(2.5, 3.1, 0.1) myfunction = x => -math.pow(x, 2) + 2 * x myderiv = x => -2 * x + 2 mytangent = x => -4 * x + 9 myslope = x => (-math.pow(x, 2) + 2 * x + 3) / (x - 3) mylim = (x, m) => myslope(m) * x - 3 * myslope(m) - 3 var y = new array() var y1 = new array() var y2 = new array() var y3 = new array() (var = 0 ; < x.length ; i++) { y[i] = myfunction(x[i]) y1[i] = myderiv(x[i]) y2[i] = mytangent(x[i]) (var j = 0 ; j < m.length ; j++) y3[i] = mylim(x[i], m[j]) } var dataset = [] (var j = 0; j < x.length; j++) { dataset[j] = [] dataset[j][0] = x[j] dataset[j][1] = y[j] } var dataset1 = [] (var j = 0; j < x.length; j++) { dataset1[j] = [] da

oracle - Extracting output from PLSQL procedure to local drive of my laptop -

i have database connection server "server_dev" in sqldeveloper . now want create procedure output can directly saved in csv file data comparison later in local drive of laptop. so tried using utl_file oracle package when ran procedure utl_file trying write in file of server "server_dev" whereas dont have access server hence command isnt working. example: code is:- create or replace procedure export_to_csv_test v_file utl_file.file_type; v_string varchar2 (4000); cursor c_contexts select workspace_id,context_id contexts rownum<5; begin v_file := utl_file.fopen ('z:\my_project_knowledge\csvdir', 'empdata.csv','w',1000); cur in c_contexts `enter code here`loop v_string := cur.workspace_id || ',' || cur.context_id; utl_file.put_line (v_file, v_string); end loop; utl_file.fclose (v_file); end; calling :- begin export_to_csv_test; end; error report: ora-29280: invalid directory path ora-06512: @ "sys.u

matplotlib - tight_layout() for FigureCanvasTkAgg -

i need add 2 subplots in canvas. im trying use figurecanvastkagg plots need 3-d interactive. there equvivalent of tight_layout feature available in canvas/figurecanvastkagg ? tried figurecanvastkagg.tight_layout() , gives error.. f = figure(figsize=(5,3), dpi=100) = f.add_subplot(121) a.plot([1,2,3,4,5,6,7,8],[5,6,1,3,8,9,3,5]) a1 = f.add_subplot(122) a1.plot([1,2,3,4,5,6,7,8],[5,6,1,3,8,9,3,5]) canvas = figurecanvastkagg(f, self) canvas.show() canvas.tight_layout() canvas.get_tk_widget().grid(row=20,column=6,sticky=w) understood trials. tight_layout() associated figure , not backend. f.tight_layout() inserted before canvas declaration solves issue

javascript - How to sort a html -

we wanted sort following html using javascript: <fieldset class=""><input type="radio" name="devicestorage" id="storage3" value="32gb" class="storage-option device-storage3"/><label for="storage3" class="device-storage-label"><span class="big-size">32gb</span></label></fieldset> <fieldset class=""><input type="radio" name="devicestorage" id="storage3" value="16gb" class="storage-option device-storage3"/><label for="storage3" class="device-storage-label"><span class="big-size">16gb</span></label></fieldset> <fieldset class=""><input type="radio" name="devicestorage" id="storage3" value="128gb" class="storage-option device-storage3"/><label for=&quo

asp.net - GridView pagination performance -

let's have gridview 1.000 rows. , don't want pagination , have rows visible. can 2 things: set allowpaging="false" (most logical) or set allowpaging="true" , higher pagesize total rows: pagesize="9999" so question if there significant difference in performance between both options , if so, how measure that. i have been working more 4 years web developer asp.net developer. have used datatables.net . powerful,rich of features , evry easy use. if gridview has 250 rows max datatable can digest 250 rows . recommed load 250 rows , when user change number of rows can set option of datatable show many records. once gridview has loaded can apply datatable it.here little example. here jsfiddle you need set 'pagelength': 25 property decide how many records display. set 250 after user change option no server side call sent. and use 'lengthmenu' option show number of records show. $("#tblinfo"

How to parse XML file in Python when the value of an attribute is integer instead of character string -

i try parse xml file looks like: <?xml version="1.0" encoding="utf-8"?> <config> <basic logdir = "../log/" workthreadcnt=1 maxday="180" /> </config> i used xml.dom.minidom, such as: from xml.dom.minidom import parse import xml.dom.minidom domtree = xml.dom.minidom.parse("cfg.xml") and used xml.etree.elementtree, such as: import xml.etree.elementtree et tree = et.parse("cfg.xml") both of them didn't work until changed attribute workthreadcnt=1 to workthreadcnt="1" my questions is: if insist on using first format,how make work ?

rest - Symfony2 multiple kernels for different purposes? -

i wanted ask question here, i'm building application using symfony2 , require rest api @ point. i don't want wait point rebuild app later, decided work on appropriate structure / architecture now. so, question is: practice have multiple kernels? reason performance considerations of loading bundles twig , several others not required api. i appreciate if point me resources on that, no matter answer is! @edit to clarify i'd do: have 1 kernel called webkernel prepared full html responses have kernel called apikernel stripped bundles not needed api (twig, etc.) have 2 front controllers [web.php , api.php] both utilizing respective kernel have web server configured redirect api.php front controller on /api/* or using api subdomain is wise? i'm aware need have separate environment-like (i guess having separate environments do) configuration files account missing bundles in apikernel.

How to properly handle timezone when passing POSIXct objects between R and Postgres DBMS? -

Image
i struggling understand happens behind scenes when passing posixct objects between r , postgres using rpostgresql . in following example, define 2 timestamp fields: 1 with timezone other 1 without . however, appears treated same when passing posixct objects via dbwritetable , dbreadtable . library(rpostgresql) drv <- dbdriver("postgresql") con <- dbconnect(drv, host = "127.0.0.1", port = "5432", user= "postgres", dbname = "test_db") q <- " create table test_table ( dttm timestamp without time zone, dttmtz timestamp time zone )" dbsendquery(con, q) # using timezone cet dttm <- as.posixct("2016-01-01 10:20:10", tz="cet") df <- data.frame(dttm = dttm, dttmtz = dttm) dbwritetable(con, "test_table", df, overwrite=false, append=t, row.names=0) # using timezone utc dttm <- as.posixct("2016-01-01 14:20:10", tz="utc") df <- dat

ios - AWS: How to properly authenticate a user against Cognito Pool and use it for Cognito Federated Identity? -

i working on app use 2 authentication providers: facebook cognito user pool with former, have no issues, works intended. however, while setting authentication cognito user pools, hitting 1 wall after other. using aws sdk 2.4.9, xcode 8 , swift 3. i aware there lot of questions have been asked, , lot of "guides" out there. however, lot of them answered/made outdated docs , sdk. official aws documentation out of date. the authentication steps going through follows: 1. configure initial cognito pool /// set default service configuration let serviceconfiguration = awsserviceconfiguration(region: awsregiontype.useast1, credentialsprovider: nil) awsservicemanager.default().defaultserviceconfiguration = serviceconfiguration /// create pool configuration , register specific key use later let poolconfiguration = awscognitoidentityuserpoolconfiguration(clientid: appclientid, clientsecret: appclientsecret, poolid: poolid) awscognitoidentityuserpool.registercognito

mysql - Database: Sorting on non-indexed column -

does creating index on column there in sort order improves performance? need know mysql, postgresql , oracle database. e.g query: select * article_comments article_id = 245 order date_created desc limit 30; in article_comments table, article_id indexed field, date_created not. if create index on date_created, improve performance. table size around 5-7 million rows. does creating index on column there in sort order improves performance? a general answer is: depends on many factors, esspecialy on conditions used in clause. in case of query index on date_created column doesn't eliminate sort operation due where article_id = 245 clause. in case need create multicolum index in order skip sorting: create index somename on article_comments(article_id, date_created desc)

c# - Printing windows form with capture screen -

i trying print windows form controls on captured screen, prints blank page. wrong? here code use: private void outputlaundry_load(object sender, eventargs e) { out ou = new out(); ou.lst = main.laundryoutlist; ou.clientname = main.clientoutname; ou.employee = login.user.name; label2.text = datetime.today.tostring("dd.mm.yyyy"); label3.text = ou.clientname; dbc.outputlaundry(dgvout, ou.lst); label4.text = ou.employee; } private void button1_click(object sender, eventargs e) { capturescreen(); printdocument1.print(); } bitmap memoryimage; private void capturescreen() { graphics mygraphics = this.creategraphics(); size s = this.size; memoryimage = new bitmap(s.width, s.height, mygraphics); graphics memorygraphics = graphics.fromimage(memoryimage); memorygraphics.copyfromscreen(this.location.x, this.location.y, 0, 0

callkit - In ios10, how can I get end call delegate method, even if app is background or suspended? -

in ios10, callkit framework can catch call start , end. available if app background or suspended? , how can it? while callkit app has 1 or more calls ongoing, system ensure app not suspended , continue receive cxprovider delegate callback methods able request cxactions calls.

windows - netsh advfirewall firewall (set Allow if encrytped) -

i trying use "netsh advfirewall firewall add rule" create windows firewall rule. how can set "action" parameter "allow connection if secure" , require connections encrypted? security=authenc either action=allow or action=bypass depending upon particular requirements.

javascript - Can't upload multiple image using Ajax with codeigniter -

wana upload multiple image of ajax in codeigniter got error while calling function upload_business_photo_do() please help thanks in advance.... <input type="button" id="uploadbusinessimg" value="upload"> ajax code:- here call ajax via id="uploadbusinessimg" <script> $("#uploadbusinessimg").on("click",function(e) { var total_img=$("#txtbusinessimage").get(0).files.length; if(total_img<=5) { var f_size=0; var f_size_1=0; var f_type_1="" ,validfilename="",invalidfilename=""; var chkfilevalid=true; for(var i=0; i<=total_img-1; i++) { var f_name=$("#txtbusinessimage").get(0).files.item(i).name; var f_size=$("#txtbusinessimage").get(0).files.item(i).size; var f_type=f_name.split(

php - Getting cannot truncate a table referenced in a foreign key constraint in Yii framework -

i'm getting cannot truncate table referenced in foreign key constraint in yii framework i have tried below see in of answers still not working yii::app()->db->createcommand('set foreign_key_checks=0')->execute(); $this->db->createcommand()->checkintegrity(false)->execute(); $this->getfixturemanager()->checkintegrity(false); i error below database exception – yii\db\exception sqlstate[42000]: syntax error or access violation: 1701 cannot truncate table referenced in foreign key constraint ( yiibasic . educations , constraint fk_user foreign key ( user_id ) references yiibasic . users ( id )) sql being executed was: truncate table users error info: array ( [0] => 42000 [1] => 1701 [2] => cannot truncate table referenced in foreign key constraint ( yiibasic . educations , constraint fk_user foreign key ( user_id ) references yiibasic . users ( id )) ) can 1 me correct it. can give best way of seeding data

ios - Set limit to draggable item in Swift -

i have 1 imageview , textfield on image. make textfield draggable below code can draggable anywhere in screen. want textfield draggable in limit of imageview. if uncomment if check in draagedview function, textfield stuck @ left side of imageview because x values become same. i found solution can't modify work on project. use uipangesturerecognizer drag uiview inside limited area override func viewdidload() { super.viewdidload() // additional setup after loading view, typically nib. let gesture = uipangesturerecognizer(target: self, action: #selector(viewcontroller.draggedview(_:))) bottomtextfield.addgesturerecognizer(gesture) bottomtextfield.isuserinteractionenabled = true } func userdragged(gesture: uipangesturerecognizer){ let loc = gesture.location(in: self.view) self.bottomtextfield.center = loc } func draggedview(_ sender:uipangesturerecognizer) { let compare = myimageview.frame.maxx <= bottomtextfield.frame.maxx //if(myimag

javascript - Underscore extend an object -

i want extend object add attribute: var days = [{day:'monday'},{day:'tuesday'}]; _.extend(days,{day:'monday'},{name:'peter'}); // days not extended console.log(days); // want have result // [{day:'monday',name:'peter'},{day:'tuesday'}] the goal able update or insert depending of criteria, want find 'monday' , extend, 'tuesday' , extend , on ... if find 'monday' again want remove name attribute , replace new criteria ============ update this solution t.j crowder , update object if search new criteria same day : var days = [{day:'monday'},{day:'tuesday'}]; var day = _.find(days, function(day) { return day.day == 'monday'; }); if (day) { _.extend(day,{day:'monday'},{name:'peter'}); } console.log(days); this output (here search 'monday' , insert peter, same ronald, , search 'monday' again , update name sandy) : code update inse

reactjs - Webpack doesn't recompile files after make changes (create-react-app) -

i have project created create-react-app starter. after copying project 1 folder has stopped recompiling files after making changes , saving. if make changes in root components causes recompilation , can see changes on browser. i'm using react-router-redux, , i've realized webpack does't recompile components nested in route components. it's routes : <indexroute component={userisnotauthenticated(homepage)} /> <route component={auth}> <route path="signup" component={signuppage} /> <route path="login" component={loginpage} /> <route path="forgot" component={forgotpasswordpage} /> </route> <route component={userisauthenticated(main)}> <route component={profilepage} > <route path="profile/edit" component={editprofilepage} /> </route> <route path="groups" component={grouppage} /> <route path="about" component={aboutpage} /

Javascript If..else statement too long -

i writing code identify school google form. function not run unless reduce amount of if..else statements. there 204. when delete chunk of these function run leading me believe because if..else construct large. how can simplify code below able run. appreciated :) if (school == "abernethy primary") {group ="/primary/abernethy primary/"; domain ="grantowngrammar.org.uk"; schooltype ="primary";} else if (school == "acharacle primary") {group ="/primary/acharacle primary/"; domain ="ardnamurchanhigh.org.uk"; schooltype ="primary";} else if (school == "achiltibuie primary") {group ="/primary/achiltibuie primary/"; domain ="ullapoolhigh.org.uk"; schooltype ="primary";} else if (school == "aldourie primary") {group ="/primary/aldourie primary/"; domain ="invernessroyalacademy.org.uk"; schooltype ="primary";} else if (s

c# - Posting Radiobuttonfor to different boolean fields whilst grouping then using name property returns null? -

i have radiobuttons nested within 2 loops, quiz , 1 radiobutton should selected each question, here second loop radiobutton is: for (int k = 0; k < model[i].quizanswers.count(); k++) { <li> @html.hiddenfor(model => model[i].quizanswers[k].correct) @html.radiobuttonfor(model => model[i].quizanswers[k].chosen, true, new { id = "radioanswer", @name = "n-" + @model[i].order, data_questionid = @model[i].order }) @html.displayfor(model => model[i].quizanswers[k].answer) </li> } in order stop user selecting multiple radiobuttons have grouped name attribute each set of radiobuttons above. each radiobutton posting true individual boolean field. without grouped name attribute radiobuttons post correctly, grouped name attribute not post. i'm guessing because grouping buttons using name attribute mvc assumes should returning