Posts

php - Yii - How To Show Other Property Not Its ID -

Image
i have related tables on database picture below: then, have page view file picture below: i want show username, not it's id. here code in view/file/_view.php <div class="view"> <b><?php echo chtml::encode($data->getattributelabel('id_file')); ?>:</b> <?php echo chtml::link(chtml::encode($data->id_file),array('view','id'=>$data->id_file)); ?> <br /> <b><?php echo chtml::encode($data->getattributelabel('nama_file')); ?>:</b> <?php echo chtml::encode($data->nama_file); ?> <br /> <b><?php echo chtml::encode($data->getattributelabel('deskripsi')); ?>:</b> <?php echo chtml::encode($data->deskripsi); ?> <br /> <b><?php echo chtml::encode($data->getattributelabel('id_user')); ?>:</b> <?php echo chtml::encode($data->id_user); ?> <br /> <b><?php echo cht...

java - subclasses common methods implemented in abstract superclass with different constructors -

i know has been discussed here have add question. need make abstract class called abstractgraph, , has extended 2 types of graph implementations: 1 uses matrix, other 1 uses lists. so far have this: abstract class abstractgraph implements graph { public void removealledges(){ //implementation here } } and subclasses: public graphmatrix(){ graphmatrix() { //implementation matrix type } } public graphlist(){ graphlist() { //different implementation lists type } } both implementations have same removealledges() method written same, guess has placed in abstract class. question is, how use references this inside abstract class ? have fill implementations getters , setters ? if so, benefit of using single implementation of method 2 (or more) subclasses. you can use same code removealledges long not depend on underlying structure (e.g., matrix or list) or functionality implemented encapsulated methods use u...

java - Fix (freeze) y axis for Android GraphView package -

i need way fix y axis graph view package. showing real time frequency spectra not possible visualise data y axis adjusts current largest value. please advise. offer bounty answer solves problem. package: http://android-graphview.org/#documentation if know range if y axis, method setmanualyaxisbounds(max,min) can used. example, if using sin function, graphview.setmanualyaxisbounds(1,-1); or if yours percentage graph, graphview.setmanualyaxisbounds(100,0); if have values plotted in array, again method can used max , min values of array (with formatting looks neater).

ios - How to populate data in a tableView as alphabetical order while using section index -

Image
i'm implementing app need show tableview. tableview needs have alphabetical search on right side clicking on letter needs show data starting letter. i've implemented vertical alphabet search , when user clicks on letter takes user particular section. problem every section has same data it's not populating according alphabet. here code this. // here exhibitorarray contains info populate data in tableview. - (nsinteger)numberofsectionsintableview:(uitableview *)tableview { return [self.exhibitorarray count]; } - (nsstring *)tableview:(uitableview *)tableview titleforheaderinsection:(nsinteger)section { return [[[uilocalizedindexedcollation currentcollation] sectiontitles] objectatindex:section]; } - (nsarray *)sectionindextitlesfortableview:(uitableview *)tableview { return [[uilocalizedindexedcollation currentcollation] sectionindextitles]; } - (nsinteger)tableview:(uitableview *)tableview sectionforsectionindextitle:(nsstring *)ti...

linux - Job on specific day of week -

i want have job running on 5 pm every wed, sat , sun... correct? 0 17 * * 0,3,6 my.command.goes.here. ps: using centos as of recent research cron, wrote correct. it not hurt search google crontab manual ;) http://www.linuxmanpages.com/man5/crontab.5.php

android - ScrollBy() is not working -

as title i have fragment layout <scrollview xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/host_profile_scroll_view" android:layout_width="match_parent" android:layout_height="match_parent" android:fillviewport="true" > </scrollview> declare scrolview: content = (scrollview) rootview.findviewbyid(r.id.host_profile_scroll_view); and set on click listener button public void onclick(view v) { content.scrollby(0, +20); system.out.println(content.canscrollvertically(+20)); } but not working @ , sysout comman print out "false". question cause canscrollvertically false result , how resolved . in advance ! is content of scrollview scrollable? mean code wrote, content of scrollview should have height @ least 20px greater height of scrollview.

crash - How to find or log currently running test in MSTEST.exe -

we have build process including unittest launched via mstest.exe. unittest stuck, messagebox or send error dialog stuck or entire process crashes. don't know how find of tests bad one. is there way how find name of running test in case unittest stuck? is there way how find name of unittest runned last time? i don't want set timeout every single test, because not sure, suitable timeout. a nice solution me log when unittests start when finish. find last logged unittest. there way log it? you can use testcontext.testname it: /// use method run code before running each test. [testinitialize()] public void testinitialize() { yourlogger.logformat("run test {0}", this.testcontext.testname); } /// use testcleanup run code after each test has run [testcleanup()] public void mytestcleanup() { yourlogger.logformat("test {0} done", this.testcontext.testname); }