Posts

Showing posts from April, 2010

icecast - Is it possible to schedule a Liquidsoap source at a specific date and time? -

i'd attempting schedule liquidsoap streaming source played @ specific date , time in future. believe can accomplished using liquidsoap switch command i'm having trouble understanding documentation described here: http://liquidsoap.fm/doc-1.2.0/reference.html#switch is possible using liquidsoap? i'd nice if pass timestamp. i'm not sure can pass absolute timestamp switch , can pass time of day or week. see "time intervals" section: http://savonet.sourceforge.net/doc-svn/language.html i think best bet using playlist file rewritten via cron, or using request.dynamic custom external script determines play based on time. see documentation playlist here: http://savonet.sourceforge.net/doc-svn/reference.html#playlist

r - Reduce space between axis and geom -

Image
i have plot looks this: how can remove space between laft edge of line , y axis without cutting off directlabels? the code: library(ggplot2) library(scales) labs <- c("special ed., charter school", "gen. ed., charter school", "special ed., public school", "gen. ed., public school") pot <- data.frame(engagement = c(643, 793, 590, 724, 735, 928, 863, 662), classroom = rep(rep(c("special ed.", "gen. ed."), each = 2), 2), gender = factor(rep(c("male", "female"), 4), levels = c("male", "female")), school = rep(c("charter", "public"), each = 4), id = factor(rep(1:4, each = 2)), labs = factor(rep(labs, each=2), levels=labs) ) library(directlabels) xout <- ggplot(pot, aes(y = engagement, x = gender, group = id)) + geom_line(aes(color=labs), size=2) + theme_classic() + scale_x_discrete(expand = c(.1, .3))

arrays - Excel List Top Occuring Numbers -

i've search haven't found example finds top 3 occurring numbers in list. code text, top scoring or top 3 biggest values. i have list of orders part numbers , prices occurred during year. -a---------b---------c-------d-------e 60470 $58 60470 $58 89038 $60 31859 $37 60470 $58 29079 $78 35568 $40 82677 $92 69172 $37 31859 $37 89038 $60 31859 $37 31859 $37 60470 $58 31859 $37 60470 $58 31859 $37 column has part numbers , column b has prices. in column d list top 3 occurring part numbers column , then in column e sum total occurrences. in example above, column d , e show following respectively: 31859 $222.00 60470 $290.00 89038 $120.00 i can't sort or add "helper" columns trying accomplish using array formula. any assistance appreciated. thank you. i

unit testing - How to test node.js websocket server with mocha? -

i need test poker game server, based on websocket. so, if player1 send message server, server should send message other players. i write test block below: describe('protocol', () => { before(() => { player1 = new websocket('ws://xxxxxx'); player1 = new websocket('ws://xxxxxx'); player2 = new websocket('ws://xxxxxx'); player3 = new websocket('ws://xxxxxx'); }); it('player1 send message1 player3 should receive' (done) => { //block1 let message1 = { id: 'message1', data: 'message1' }; player1.send(json.stringify(message1)); player3.once('message', (message) => { //block2 expect(message).equal(json.stringify(message1)), done(); }); }); it('player2 send message2 player3 should receive' (done) => { //block3 let message2 = { id: 'message2', data: 'message2' };

c# - Format number to string with custom group and decimal separator without changing precision -

i format numbers strings in c# custom group/thousands separator , decimal separator. group , decimal separator can change based on user input use numberformatinfo object instead of hardcoded formatting string. code below gets proper separators, changes precision of number 2 decimal places, whereas want keep full precision of number , show decimal places when needed (so integer values dont have decimal places). how can achieve this? guessing need change "n" parameter, change what? double n1 = 1234; double n2 = 1234.5; double n3 = 1234567.89; double n4 = 1234.567; var nfi = new numberformatinfo(); nfi.numberdecimalseparator = ","; nfi.numbergroupseparator = " "; string s1 = n1.tostring("n", nfi); //want "1 234" "1 234,00" string s2 = n2.tostring("n", nfi); //want "1 234,5" "1 234,50" string s3 = n3.tostring("n", nfi); //correct output of "1 234 567,89" string s4 = n4.t

javascript - Programmatically focus on a form element after mounting -

i have form component (formcomponent) need programmatically focus on when sibling button component clicked. used able call this.refs.myform.focus() (given myform formcomponent) written call .focus() on first form field inside. however, i've refactored , abstracted behavior higher order component wraps formcomponent now, .focus() method on formcomponent intercepted wrapper component. using react 0.14.x (so don't need reactdom.finddomnode() dom components): // formcomponent class formcomponentbase extends react.component { focus() { this.refs.firstfield.focus(); } render() { return ( <form ...> <input ref="firstfield" /> </form> ); } } // wraps formcomponent in wrapper component abstracted/reusable functionality const formcomponent = hocwrapper(formcomponent); // othercomponent class othercomponent extends react.component { handleclick(ev) { //

data structures - Asterisk:- How to achieve Autodialling in Asterisk box in context with java -

i have web app, connects user asterisk box via sip , allow user call mobile or landlines number, want make automatic, in current scenario user have manually click on html button called dial dial number, want achieve "as user logged in, asterisk automatically call 3 nos campaign list allocated user , gives user call when client connected it. means caller given call when receiver receives it. any configuration or java code help, algorithm also, know english poor so, sorry mistakes, hope people understand trying achieve above para. i higly recomend use dialler code. becuase there more issues never thought about. http://www.vicidial.org or other. if still think qualified enought write own code, can read page: http://www.voip-info.org/wiki/view/asterisk+auto-dial+out

c# - Try-Catch Exception abuse -

i have found code this: try { myclass.do().tostring(); } catch () { } which results in exception being thrown when do() returns null . could, instead, use (myclass.do() ?? "").tostring(); to avoid exception being thrown. see code this: for (int = 0; < x.length; i++) { if (x.phases[i].num == activenum) { try { result = x.phases[i + 1].obj; } catch (exception ex) { } } } i think not practice. however, can't find references support ideas. i tried search on web, did not have luck. of references or documentation meant c++ or java. will please me justify idea strong reference, or enlighten me if previous approaches above in fact acceptable. you're correct: using exceptions purposes of flow control bad practice. referred anti-pattern reason. you can find detailed explanation here . while article references java , c++, anti-pattern in c# same reasons. for c#/.net specific e

javascript - angular auto-suggestion text typeahead and html ul li dropdown -

i creating auto-complete dropdown control using ul li . drop down come out when user click control. user can select item want. program can print out selected key , value. working fine 1 problem. i want display auto-suggestion list when user type control. so use typeahead not work , not popout when user typing. plunker <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> <style type="text/css"> .dropdown-menu { width: 230px; } .dropdown-menu li { word-wrap: break-word; wh

ios - Adjusting constraints programmatically do they need to be first removed and then re-added? -

i have function in code adjust layout of buttons. called when .hidden set. private func layoutbuttons() { redbutton.hidden = !redbuttonenabled redbuttonlabel.hidden = !redbuttonenabled yellowbutton.hidden = !yellowbuttonenabled yellowbuttonlabel.hidden = !yellowbuttonenabled removeconstraint(yellowbuttontrailingcontraint) if yellowbuttonenabled && !redbuttonenabled { yellowbuttontrailingcontraint = nslayoutconstraint(item: yellowbutton, attribute: .trailing, relatedby: .equal, toitem: self, attribute: .trailing, multiplier: 1.0, constant: -horizontalmargin) } else { yellowbuttontrailingcontraint = nslayoutconstraint(item: yellowbutton, attribute: .trailing, relatedby: .equal, toitem: redbutton, attribute: .leading, multiplier: 1.0, constant: -horizontalmargin) } addconstraint(yellowbuttontrailingcontraint) } is necessary first remove constraint before changing , re-a

ruby on rails - No implicit conversion of String into Integer for import CSV file -

when import csv file different attributes: parent , student. error message: no implicit conversion of string integer . how can import parent’s attributes within student attributes. appreciated. class student < activerecord::base belongs_to :parent delegate :email,:name,:phone_number,to: :parent, allow_nil: true def self.to_csv attributes = %w{parent_id email phone_number first_name last_name age workshop interest registration_date email } csv.generate(headers: true) |csv| csv << attributes all.each |script| csv << attributes.map{ |attr| script.send(attr) } end end end def self.import(file) spreadsheet = open_spreadsheet(file) header=spreadsheet.row(1) (2..spreadsheet.last_row).each |i| row = hash[[header,spreadsheet.row(i)].transpose] spreadsheet.each |row| student = find_by_id(row["id"])|| new paren

html5 - Why my page will not change when use history.push using react-router -

i have single page application webpage... below of code... var createbrowserhistory = require('history/lib/createbrowserhistory'); var history = createbrowserhistory(); history.push('account/person'); when click button, can see browser's url change http://ip/account/person , nothing happened, still on same page. but if replace url directly http://ip/account/person typing, page map correct page. below react router config <router history={new createbrowserhistory()}> <route path='/account' component={gift}></route> <route path='/account/person' component={person}></route>

excel - IF Statement for Date comparison -

Image
i creating system tag response time "breached" or "within service level". receive issues needs addressed within 15 minutes. so, example, receive issue @ 12/2/2015 10:20:25 (that way format date on excel), , needs responded before 12/2/2015 10:35:25 or tagged "breached". in case, issue posted, should automatically create response time 15 minutes time received , should compare time if within 15 minutes or more tagging. there can create if statement tag response "breached" or "within service level" depending if within 15-minute-mark received? i see happening in couple of ways. assume 3 columns. column time received, column b service limit (+15 min) , column c alert lets received call time logged in a2 2016/04/19 00:50. in column b place following formula add 15 minutes: =a2+time(0,15,0) to real time text alert status, in column c use following =if(now()<b2,"within service level","breached") or

java - Fetching Record from Local Database and Showing in Listview IllegalStateException: -

getting ids 1 table , matching table , getting record table.some time records in list when want insert 1 more record in list illegalexception not notified listview etc. private void getallrecords() { string cmpid = ""; //fetching ids table 1 one , passing id table cursor preappointmentrecord = jasperdatabase.getinstance(preappointmentsactivity.this).getpreappointmentrecord(); preappointmentrecord.movetofirst(); if (preappointmentrecord.getcount() != 0) { while (!preappointmentrecord.isafterlast()) { cmpid = preappointmentrecord.getstring(1); getallcompanyname(cmpid); preappointmentrecord.movetonext(); } preappointmentrecord.close(); } } private void getallcompanyname(string companyid) { //fetching company names matched ids cursor companynamecursor = jasperdatabase.getinstance(preappointmentsactivity.this).getpreappointmentcompanies(companyid); companynamecursor.movetofirst

ios - Working out a difficult case with NSRegularExpression -

i using swift playground experiment nsregularexpression , not to. here code: import uikit let str = "qwun782h218gs634 abcd56efgh7zsde985\nxzsr519ukge9823sdfg91nui uihiheg875d dss77ds", patn = "(([a-z][a-z]){2}([0-9]+)){3}", rgx = try! nsregularexpression(pattern: patn, options: .anchorsmatchlines) print("start with:\(str)") let strns = str nsstring rgx.enumeratematchesinstring(str, options: .reportcompletion, range: nsmakerange(0,str.utf8.count), usingblock: { (result, _, stop: unsafemutablepointer<objcbool>) -> void in if let _ = result?.range.location { var n = 0, thestr = strns.substringwithrange(nsmakerange((result?.rangeatindex(n).location)!, (result?.rangeati

java - Indent group variable function call code convention -

i have habit of indenting group of function calls this: list <dog> dogs = new arraylist<>(); dogs.add(new dog(1)); dogs.add(new dog(2)); dogs.add(new dog(3)); dogs.add(new dog(4)); dogs.add(new dog(5)); system.out.println("list of dogs: " + dogs); cat cat1 = new cat(1); cat.meow(); cat.startsrunningfrom(dogs); dog d1 = dogs.get(1); d1.catches(cat1); are these bad practices in code convention, or these haven't being talked about? because i've tried find code conventions recommend such indentations on function calls variables/class. for me, above code more readable without: list<dog> dogs = new arraylist<>(); dogs.add(new dog(1)); dogs.add(new dog(2)); dogs.add(new dog(3)); dogs.add(new dog(4)); dogs.add(new dog(5)); system.out.println("list of dogs: " + dogs); cat cat1 = new cat(1); cat.meow(); cat.startsrunningfrom(dogs); dog d1 = dogs.get(1); d1.catches(cat1); the indentations me provide clear separ

ios - how to create the pie Chart and fill percentage in swift -

Image
i have create uiview uiviewcontroller , how create pie chart in uiview ?, have create pieview class uiview , class code below, import uikit import foundation class pieview: uiview { public var datapoints: [datapoint]? { // use whatever type makes sense app, though i'd suggest array (which ordered) rather dictionary (which isn't) didset { setneedsdisplay() } } @ibinspectable internal var linewidth: cgfloat = 2 { didset { setneedsdisplay() } } } i have confused format used? coreplot or charts frameworks or other method. objective-c custom code need swift language code, how implement pie chart in uiview , fill percentage, thanks in advance. i think code snippet taken https://stackoverflow.com/a/33947052/1271826 imagined simple pieview class defined like: import uikit public class datapoint { let text: string let value: float let color: uicolor public init(text: string, value: float, col

ios - get the specific record from nsarray -

hello in nsarray data ( { trip = { "trip_id" = 41; "trip_post_date" = "2016-03-28 07:52:19"; "user_id" = 65; }; user = { "first_name" = irfan; "last_name" = sheikh; "user_id" = 65; }; "arrival_country" = { "city_name" = "feldkirchen in karnten"; "country_name" = austria; id = 272221; }; "departure_country" = { "city_name" = "colonia la tordilla"; "country_name" = argentina; id = 1234057; }; }, { trip = { "trip_id" = 40; "trip_post_date" = "2016-03-28 07:50:48"; "user_id" = 65;

docker registry v2 : get parent image name -

i parent of current image using docker registry api v2. possible ?. i trying construct tree structure of docker images parent/child relationship need parent of each docker image. can repositories using /v2/_catalog & manifest each repository /v2//manifests/latest, couldn't figure out how parent out of it. any appreciated. if examine manifest of image should see blocks of "v1compatibility" sections in json output. if @ those, should see base image information. example when ran on 1 of images, derived centos 7: curl --insecure https://myregistry:5000/v2/imagename/manifests/latest | grep -i centos i see: [...] "v1compatibility": "{\"id\":\"172ab63cd5e007f8b1dbd7659c2d9520bf9e50755c081f39d171a603ad5d0890\",\"parent\":\"0c908fa575ec22f872f78b12d9e57d132b67a683f7deacd9f02462c546bf52dd\",\"created\":\"2016-04-01t21:28:21.706982438z\",\"container_config\":{\"cmd\

Kendo Grid with rowTemplate and reorderable binds data in wrong column -

i've come across issue when using rowtemplates , switching on reorderable gridoption in kendo grid. link example: http://dojo.telerik.com/@antman/azevi to reproduce, 1. run 2. drag ship country column first column (before id) 3. page right note data has been bound in original column order (id, ship country). data hasn't sync'ed column re-order. what doing wrong? for experiencing problem, got response telerik support work-around: http://www.telerik.com/forums/column-reordering-row-templates-for-grids#yhcaitvaaeax2uwj6ieaka

r - Allocate along members of a group in data.table -

i have table of demand looks this: set.seed(1) dtd <- data.table(loc="l1", product="p1", cust=c("c1","c2","c3"), period=c("per1","per2","per3","per4"), qty=runif(12,min=0,max=100), key=c("loc","product","cust","period")) dtd[] # loc product cust period qty #1: l1 p1 c1 per1 12.97134 #2: l1 p1 c1 per2 65.37663 #3: l1 p1 c1 per3 34.21633 #4: l1 p1 c1 per4 24.23550 #5: l1 p1 c2 per1 85.68853 #6: l1 p1 c2 per2 98.22407 #7: l1 p1 c2 per3 92.24086 #8: l1 p1 c2 per4 70.62672 #9: l1 p1 c3 per1 62.12432 #10: l1 p1 c3 per2 84.08788 #11: l1 p1 c3 per3 82.67184 #12: l1 p1 c3 per4 53.63538 and table of supply looks this: dts <- data.table(loc="l1", product="p1", period=c("per1","per2","

fingerprint - How to wait TouchID until it finishes? -

i want integrate touchid in application. based on true fingerprint, let user authenticate/not authenticate. so, in viewwillappear of viewcontroller, have written following code: - (void)viewwillappear:(bool)animated { [super viewwillappear:animated]; if ([appconfig getsettingwithkey:app_token_key] != nil ){ if ([appconfig getistouchidpreferred] == preferred){ bool shouldauthenticate: [mytouchidclass authenticatewithfingerprint]; if (shouldauthenticate == yes){ //normal flow } } } } here, authenticatewithfingerprint main job , code: lacontext *context = [[lacontext alloc] init]; nserror *error = nil; __block bool tobereturned = no; if([context canevaluatepolicy:lapolicydeviceownerauthenticationwithbiometrics error:&error]){ [context evaluatepolicy:lapolicydeviceownerauthenticationwithbiometrics localizedreason:@"are device owner?" reply:^(bool success, nserror *error) {

mips - Syscall print int -

i wondering why doesn't work: print integer: li $v0, 1 li, $a0, $v0 #with $v0 being added value syscall but, works: print integer: li $v0, 1 li, $a0, 100 syscall is there register can use print integer has been altered algorithm? thought $v0 register stores returns. first of all, you've got syntax error here: li, $a0, $v0 there should no comma after li . secondly, purpose of li pseudo-instruction load immediates (e.g. 1, 0x42, or 12345). if want move (copy) contents of 1 register another, use move (as in move $a0, $v0 ). and finally, assigned $v0 value 1 on first line of code, if correctly said move $a0, $v0 you'd $a0 = 1 . if want previous value of $v0 have move $a0, $v0 before li $v0, 1 .

Converting CURL request to HTTP Request Java by method GET -

i have following curl request can please confirm me subsequent http request: curl -i -l -h "accept: application/json" --data "client_id=app-uja2fdflivk14wmw&client_secret=6d8d32f1-1c25-4356-8b15-4d803d9a869e&grant_type=authorization_code&code=dj4kyk&redirect_uri=https://developers.google.com/oauthplayground" "https://api.sandbox.orcid.org/oauth/token" can kind enough me convert above curl request httpreq. you should have @ post: using java.net.urlconnection fire , handle http requests you should able pass data part is: urlconnection connection = new url(url + "?" + datastring).openconnection(); using: connection.setrequestproperty("accept: application/json", charset); to add header this starting point...

java - Unable to return the read the values present in an excel file -

i want return values present in excel file returning values [[ljava.lang.string;@490ab905. data not returning values user name. used jxl , data provider. not aware of data provider much. please me fetch accurate values excel. following code: public class excelutil { // public string suitefilename = "/suite.xls"; string testdatafile = "/src/testdata/testdata.xls"; // public string testdatafile = "/testdata/testdata.xls"; @dataprovider public object[][] gettestdata(string sheetname) { //string gettestdata(string sheetname, int rownumber, int colnum) { // read excel string path = system.getproperty("user.dir") + testdatafile; workbook w = null; file inputworkbook = new file(path); // open workbook try { w = workbook.getworkbook(inputworkbook); } catch (biffexception | ioexception e) { // todo auto-generated catch block

javascript - Backbone views which don't know about their container, models to be fetched via AJAX, no UI/UX trade-offs and maintainable code -

since i'm not totally sure on level issue solved best, i'd summarise path went , things tried first: it's more or less $el (i think). as basic backbone examples state, started having $el defined within view, like invoice.invoiceview = backbone.view.extend({ el: $('#container'), template: .., .. }); it didn't feel right, view supposed know parent (=container). paragraph 'decouple views other dom elements' written on http://coenraets.org/blog/2012/01/backbone-js-lessons-learned-and-improved-sample-app/ ) puts words. following article's advice, switched passing $el on view while calling render() -method. example: $('#container').html( new winelistview({model: app.winelist}).render().el ); so far - render() gets called, while maybe shouldn't (yet). for example view asynchronously fetch es model in initialize() -routine. adding binding reset or sync (e.g. this.model.bind('sync', this.render, this) ) makes s

How to run desktop shortcut using window service background worker C# -

i have application shortcut in desktop. need run shortcut every 1 hour using windows service in c#. possible? you'd rather not start external processes locking workstation. can lock workstation calling: (not tested) [dllimport("user32.dll", setlasterror = true)] static extern bool lockworkstation(); call with: lockworkstation(); source: http://www.pinvoke.net/default.aspx/user32.lockworkstation

r - Saving Forest Plots (metafor) -

Image
i have forest plot (using metafor) number of rows change depending on input conditions. code saves plot after each run using: dev.copy(png,'myplot.png') dev.off() depending on number of rows in plot, data can squashed. anymore 30 rows , data becomes unreadable, see below examples. first chart readable, second chart useless , gets worse want include more data. is there way save charts height automatically update fit in rows correctly? there no specific need chart square, in fact envisage rectangular fit in data. chart code included @ base of question reference. forest(x = final$avgpts, ci.lb = final$min, ci.ub = final$max, slab = final$players, ilab = final$value, ilab.xpos = max(final$max)+10,ilab.pos =4, alim = c(min(final$min)-5, max(final$max)+5), xlim = c(min(final$min)-170, 2*(max(final$max)+5)), xlab = "moneyball points spread", efac = 1, cex = 0.75, mgp = c(1, 1, 0), refline=mean(final$avgpts),digits=1,col="dark blue",pch = 19, main=p

android - How cancel notification with own id? -

i have service download file internet , show progress on notification panel. when download finish notification cancel. have problem when closed app , remove ram (but time service work , download , show on notification. mean there no problem downloading). when download finished notification doesn't cancel. problem? if don't close app notification cancel , lost notification panel. code change progress on notification panel: void progresschange(int progress, int id, string nameofmusic,notificationmanager nm) { if (lastupdate != progress) { lastupdate = progress; // not.contentview.setprogressbar(r.id.status_progress, // 100,integer.valueof(progress[0]), false); // inform progress bar of updates in progress // nm.notify(42, not); log.e("id",id+""); if (progress < 100) { mbuilder.setprogress(99, integer.valueof(progress), false) .setcontentinfo(progress + &quo

android - Imageview not showing on Lollipop and Marshmallow -

Image
i have simple activity , xml shows .png file fills whole activity. have tested in kitkat , ice cream. working. not working on lollipop , marshmallow. i've check other answers not 1 looking for. activity simple one. help activity package com.pointwest.timetrackermobilelog.activities; import android.content.intent; import android.os.bundle; import android.support.v7.app.appcompatactivity; import com.pointwest.timetrackermobilelog.r; public class helpactivity extends appcompatactivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_help_material); getsupportactionbar().setdisplayhomeasupenabled(true); getsupportactionbar().sethomebuttonenabled(true); } @override public void onbackpressed() { super.onbackpressed(); intent mainintent = new intent(this, mainactivity.class); startactivity(mainintent); } }

uima ruta Score Condition -

i tried script mark journal using score condition. w{regexp("journal",true)->mark(only_journal)}; w{regexp("retraction|retracted")->mark(retract)}; w{regexp("suppl")->mark(supply)}; num {->mark(volumeissue,1,6)}lparen num special?{regexp("-")} num? rparen; reference{contains(only_journal)->markscore(10,journal_maybe)}; reference{contains(journalvolumemarker)->markscore(5,journal_maybe)}; reference{contains(volumeissue)->markscore(15,journal_maybe)}; reference{contains(journalname)->markscore(10,journal_maybe)}; reference{contains(retract)->markscore(10,journal_maybe)}; reference{contains(supply)->markscore(5,journal_maybe)}; journal_maybe{score(20,55)->mark(journal)}; sample text 1.lawrence ra. review of medical 342รข€“340 benefits , contraindications breastfeeding in united states [internet] . arlington (va): national center education in maternal , c

In Scala, List is Immutable But -

i beginner scala language. in scala, list immutable per below code: scala> var list = list(1,2,3,4,5) // list created named ‘ list ’ list: list[int] = list(1, 2, 3, 4, 5) scala> 25 :: list // prepend cons( :: ) , here new list created. res2: list[int] = list(25, 1, 2, 3, 4, 5) scala> list // print ‘ list ’ res3: list[int] = list(1, 2, 3, 4, 5) but, scala> list res1: list[int] = list(1, 2, 3, 4, 5) scala> list :+= 12 // append list :+= scala> list res2: list[int] = list(1, 2, 3, 4, 5, 12) in above example, same "list" appended. how list immutable? it's confusing me. 1 kindly explain me?

refresh - ASP.NET: F5 in Firefox keeps DropDownList value in UI (but not in code) -

i don't meaning of firefox's behaviour when hitting f5 on asp.net page. i have dropdownlist (autopostback=true if significant) , change value "first value" (index 0, default) "second value" (index 1). page posts , filters lists. now, when hit f5 (or refresh button in address bar) dropdownlist keeps selected value in ui ("second value"), when debugging page_load() dropdownlist.selectedindex-property 0 instead of 1 leads manner dropdownlist selection , lists not fit. ispostback false when hitting f5. internet explorer resets @ least dropdownlist makes acceptable. imho best behaviour simple same request again when hitting f5 (with postback). i know familiar problem (for me bug in firefox, isnt it?), there workaround? thank you. no solution workaround: i store selected value of dropdownlist in cookie , set on every page_load.

Declaring arrays in c language without initial size -

write program manipulate temperature details given below. - input number of days calculated. – main function - input temperature in celsius – input function - convert temperature celsius fahrenheit.- separate function - find average temperature in fahrenheit. how can make program without initial size of array ?? #include<stdio.h> #include<conio.h> void input(int); int temp[10]; int d; void main() { int x=0; float avg=0,t=0; printf("\nhow many days : "); scanf("%d",&d); input(d); conv(); for(x=0;x<d;x++) { t=t+temp[x]; } avg=t/d; printf("avarage %f",avg); getch(); } void input(int d) { int x=0; for(x=0;x<d;x++) { printf("input temperature in celsius #%d day",x+1); scanf("%d",&temp[x]); } } void conv() { int x=0; for(x=0;x<d;x++) { temp[x]=1.8*temp[x]+32; } } in c arrays , point