Posts

Featured post

c - Run time Error with scanf -

i new programming . tried implement sample program gives me run time error.but height property float type one. format ‘%f’ expects argument of type ‘float *’, argument 2 has type ‘double’ #include<stdio.h> #include<string.h> struct user { char name[30]; float height; /*float weight; int age; char hand[9]; char position[10]; char expectation[10];*/ }; struct user get_user_data() { struct user u; printf("\nenter name: "); scanf("%c", u.name); printf("\nenter height: "); scanf("%f", u.height); return u; }; int height_ratings(struct user u) { int heightrt = 0; if (u.height > 70) { heightrt =70/10; } return heightrt; }; int main(int argc, char* argv[]) { struct user user1 = get_user_data(); int heighrate = height_ratings(user1); printf("your height ", heighrate); return 0; } your scanf() calls have...

winforms - Remove axis line from chart c# -

Image
i want remove axis line chart in c#. want have point there. how that? here result here code: public chartbuilder(ref chart chart, double minvalue, double maxvalue) { this.chart = chart; this.chart.series.clear(); chart.chartareas[0].axisx.minimum = minvalue; chart.chartareas[0].axisx.maximum = maxvalue; chart.chartareas[0].axisy.minimum = minvalue; chart.chartareas[0].axisy.maximum = maxvalue; chart.chartareas[0].axisx.minorgrid.enabled = false; chart.chartareas[0].axisx.majorgrid.enabled = false; chart.chartareas[0].axisy.minorgrid.enabled = false; chart.chartareas[0].axisy.majorgrid.enabled = false; chart.chartareas[0].axisy.majorgrid.linewidth = 0; chart.chartareas[0].axisx.labelstyle.enabled = false; chart.chartareas[0].axisy.labelstyle.enabled = false; chart.chartareas[0].axisx.interval = 1; chart.chartareas[0].axisy.interval = 1; chart.chartareas[0].axisx.linecolor = color.transparent; chart.char...

javascript - How to update a get parameter in a url with jquery -

here code: <input type="date" name="date" id="date_input" value="<?php echo $_get['date']; ?>" class="date"> <a href="shopping_list.php?page_id=1&title=<?php echo $_get['title']; ?>&date=" id="back_button">back</a> i need user puts date input put "date" part of url on shopping_list.php without page refreshing , needs changed live. thanks in advance! one solution jsfiddle: $("#date_input").on("change", function(){ $("#back_button").attr("href", "shopping_list.php?page_id=1&title=<?php echo $_get['title']; ?>&date="+this.value); }); hope helps!

jsf - custom boolean converter to set style class -

a converter defined in faces-config.xml changes boolean string "yes" or "no" <converter> <converter-id>booleanconverter</converter-id> <converter-class>com.example.booleanconverter</converter-class> </converter> this works fine using <h:outputtext value="#{bean.booleanvalue}" converter="booleanconverter" /> but if intention style surrounding div element possible using converter? example if converter defined return string "booleantrue" , "booleanfalse" (which defined in css) <converter> <converter-id>booleanstyleconverter</converter-id> <converter-class>com.example.booleanstyleconverter</converter-class> </converter> could like: <div class="#{booleanstyleconverter.getasstring(null,null,bean.booleanvalue)}"> <h:outputtext value="#{bean.booleanvalue}" converter="booleanconverter...

amazon web services - How to determine the state of an AWS instance -

i'm trying determine how remove instance several applications (freeipa, chef, service discovery) within aws autoscaling group i'm finding there's no reliable way determine if instance stopping (sometimes our admins take instance out of asg analysis) vs terminating. if instance stopped retain ability have stay connected our ldap , other systems. know way this? is instance ebs backed or using instance store? if instance store, cannot stop (only terminate it) have looked @ ec2 api (via aws-sdk maybe)? (looks describe-instances , looking @ reservations should trick here) http://docs.aws.amazon.com/awsec2/latest/apireference/api_describeinstances.html

android - Upgrading to API 22 breaks test suite -

i attempting upgrade existing project compile , target api 22. changed following lines in build.gradle: android { compilesdkversion 22 ... defaultconfig { ... targetsdkversion 22 } ... dependencies { ... compile 'com.android.support:appcompat-v7:22.2.0' compile 'com.android.support:support-v4:22.2.0' ... } } note these only changes in entire project. suddenly, many of tests fail. of failing tests use robotium , call solo.clickonactionbaritem() . however, button on action bar never seems clicked. when watch test running, not see expected behavior button click. what reasons failure of solo.clickonactionbaritem() not click action bar item? more importantly, how can figure out problem when appears in third-party library using?

bitmap - Android load image into imageview efficiently -

i have next problem: avoid outofmemoryerror i'm loading big images imageviews using picasso in such way: public static requestcreator picasso(final context context, final int resourceid) { return picasso.with(context) .load(resourceid) .fit() .centercrop() .nofade(); } and in activity or fragment, i'm loading image imageview final imageview backgroundimage = (imageview) root.findviewbyid(r.id.background_image); util.picasso(getactivity(),r.drawable.background_soulmap) .into(backgroundimage); however, have 2 problems: image loads delay (but need load immideatly) centercrop() not need in cases. how can implement topcrop() or bottomcrop()? i've tried https://github.com/cesards/cropimageview library, i'm getting nullpointerexception in setframe() method (getdrawable() returns null), because image did not load yet. in advance! image loads delay (but need load immideatly) you h...