Posts

C#: Passing null to overloaded method - which method is called? -

say have 2 overloaded versions of c# method: void method( typea ) { } void method( typeb b ) { } i call method with: method( null ); which overload of method called? can ensure particular overload called? it depends on typea , typeb . if 1 of them applicable (e.g. there no conversion null typeb because it's value type typea reference type) call made applicable one. otherwise depends on relationship between typea , typeb . if there implicit conversion typea typeb no implicit conversion typeb typea overload using typea used. if there implicit conversion typeb typea no implicit conversion typea typeb overload using typeb used. otherwise, call ambiguous , fail compile. see section 7.4.3.4 of c# 3.0 spec detailed rules. here's example of not being ambiguous. here typeb derives typea , means there's implicit conversion typeb typea , not vice versa. overload using typeb used: using system; class typea {} class typeb : typea {...

powershell - Create azure website programatically in C# -

i want create/update websites/cloud services in azure in c#. objective deploy website/cloud service in azure without user intervention. can please me resolve below queries? can manage azure websites/cloud services using c# code? if yes how (any library/api/nuget package)? if not possible in c#, other options achieve this? read webdeploy(msdeploy), powershell can work not sure 1 best in scenario , how use them. this depends on scenario. if have got system run powershell script from, might option ( https://azure.microsoft.com/en-us/documentation/articles/powershell-install-configure/ ) use cross platform command line tools script deployment / web app creation. there different other options, continous deployment web app. can example connect github repo existing web app , deploy repository. the c# library looking should one: https://github.com/azure/azure-sdk-for-net/tree/master/src/resourcemanagement/website

xml - Button not shown in Android layout -

i trying create layout edittext , textview , 2 buttons . here xml layout: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:padding="25sp" > <edittext android:id="@+id/etcommands" android:layout_width="fill_parent" android:layout_height="wrap_content" android:hint="type command.." android:inputtype="textpassword" /> <linearlayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:weightsum="20" > <button android:id="@+id/bresults" ...

json downloaddata model building C# -

i try implementation of final i want every data var jsresult = (jobject)jsonconvert.deserializeobject(response); (int = 0; <= 19; i++) { string mediaid = (string)jsresult["data"][i]["id"]; string commenturl = "https://api.instagram.com/v1/media/" + mediaid + "/comments?access_token=" + accesstoken + ""; var commentjson = webclient.downloaddata(commenturl); var commentresponse = system.text.encoding.default.getstring(commentjson); session.add("commentresponse", commentresponse); } var commentdata = jsonconvert.deserializeobject<comment.rootobject>(session["commentresponse"].tostring());

javascript - Angular Intellisense not working in Visual Studio 2015 Community -

i've done thought possible make angular js intellisense works in vs 2015 community, no success. including http://madskristensen.net/post/the-story-behind-_referencesjs _reference.js, visual studio references (web implicit)... tried them both! am missing or it's impossible have angular intellisense in vs 2015 community? thanks our help... screenshot

Excel - calculating the percentage of individuals that return over consecutive months -

Image
i have spreadsheet of patients collecting medication on several months. patients grouped according month when first collected medication. for each patient group, want calculate percentage of patients return during each of following months collect medication again. have inserted example of in spreadsheet, highlighted in yellow. how can automate calculation in excel? so if "cell s3 calculated c3/c2; cell s4 c4/c2 , on." the formula need =c3/c$2 put in s3 , copy , paste cells below s3. explanation by default addresses in excel relative c3 means"this row, column -16" if copy down relative address stay same. fix address can use dollar symbols (highlight address & press f4 on keyboard) fix actual cell c2 not relative address. more info

vba - How to show print dialog box and have preview display on same screen -

i trying emulate ctrl-p in excel 2013 print dialog box shown on left print preview on right. (although preview displays, have click "show print preview" first - can't seem find way force preview show every time). i have tried following: application.dialogs(xldialogprint).show this shows old style dialog box need click "preview" button activesheet.printpreview this shows preview doesn't allow printer changed same screen something this? option explicit sub example() application.commandbars.executemso ("printpreviewandprint") end sub commandbars.executemso method (link) is useful method in cases there no object model particular command.