Posts

go - Golang - Read Os.stdin input but don't echo it -

in golang program i'm reading os.stdin input bufio.reader. after enter pressed, program reads input , printed onto console. possible not print input onto console? after reading it, process input , reprint (and no longer need original input). i read data this: inputreader := bufio.newreader(os.stdin) { outgoing, _ := inputreader.readstring('\n') outs <- outgoing } i cannot think other methods use ansi escape codes clear terminal , move cursor specific location (in case column 1:row 1). var screen *bytes.buffer = new(bytes.buffer) var output *bufio.writer = bufio.newwriter(os.stdout) and here basic helper methods ease job working terminal. // move cursor given position func movecursor(x int, y int) { fmt.fprintf(screen, "\033[%d;%dh", x, y) } // clear terminal func clearterminal() { output.writestring("\033[2j") } then inside function need clear terminal , move cursor first column , first row of terminal wind...

scala - Constructor TransportClient in class TransportClient cannot be accessed -

i wrote following class indexing documents in elasticsearch: import java.net.inetaddress import com.typesafe.config.configfactory import org.elasticsearch.client.transport.transportclient import org.elasticsearch.common.settings.settings import org.elasticsearch.common.transport.inetsockettransportaddress import play.api.libs.json.{jsstring, jsvalue} /** * created liana on 12/07/16. */ class elasticsearchconnector { private var transportclient: transportclient = null private val host = "localhost" private val port = 9300 private val cluster = "elasticsearch" private val indexname = "tests" private val doctype = "test" def configelasticsearch(): unit = { val settings = settings.settingsbuilder().put("cluster.name", cluster).build() transportclient = new transportclient(settings) transportclient.addtransportaddress(new inetsockettransportaddress(inetaddress.getbyname(host), port.toint)) } def ...

angularjs - Angular digest loop -

i have problem app because creates infinite loop cycle when trying generate form. form generated based on json (example in code). problem occurs when go step , go form. have no idea causes problem because happens when state loaded second time. possible angular keep watchers created in previous state , overlaps each other? whole idea app have form definition in "form" section, there "schema" define each model element , @ end there "model" stores variables. <schema-form data-name = "theemployeeform" data-schema = "$ctrl.json.all_fields.schema" data-form = "$ctrl.json.all_fields.form" data-model = "$ctrl.json.model"> </schema-form> to see error please open chrome inspector and: home -> form -> home -> form error: [$rootscope:infdig] app example on plunker https://plnkr.co/edit/nkdzwlueo0rauzt1jpoj?p=preview see if have created watch of own on propert...

php - Show dimensions in product page for opencart -

i need display product dimensions in product page. here code not executed. added in catalog/controller/product/product.php <?php $this->data['length'] = number_format($product_info['length'],2) . ' cm'; $this->data['width'] = number_format($product_info['width'],2) . ' cm'; $this->data['height'] = number_format($product_info['height'],2) . ' cm'; and in same file $this->data['text_dimensions'] = $this->language->get('text_dimensions'); $this->data['text_by'] = $this->language->get('text_by'); and in catalog/view/theme/default/template/product/product.tpl <?php echo $length; ?><?php echo $text_by; ?><?php echo width; ?><?php echo $text_by; ?><?php echo $height; ?><?php echo $text_by; ?> and in catalog/language/english/product/product.php $_['text_dimensions'] = 'dimension...

angular - “Has no exported member ionicBootstrap” (ionic2 Typescript) -

i have such error: has no exported member ionicbootstrap. ionicbootstrap introduced in ionic-angular 2.0.0-beta.8. upgrade 2.0.0-beta.32 , error still remains. can be? i had problem well. turned out had 2 typings ionic , cordova-ionic appeared outdated. installed starter see if had same problem did not. starter project did not have typings removed them , ran typings prune . after project rebuilt error gone. looks typings included in ionic-angular package npm. also screenshot posted looks still have 2.0.0-beta.7 . try running npm install --save @2.0.0-beta.8

SAS SQL or data step: How to select values that begin with different numbers -

maybe title bit blurry, hope understand question. background: work data university students, , have been given task of calculating grade point averages exams on specific semester subset of predefined students. time span of data 10 years , activity names exams varies across time. my problem: data has hierarchy structure level of education, semester , activity names. how can use data step/sql on lowest level select values beginning value top hierarchy. the hierarchy following (for single student): 13109963 1310996300001 131099630000100001 13109963000010000100001 (activities) 13109963000010000100002 (activities) 13109963000010000100003 (activities) i have struggled few hours, , appreciate suggestions how proceed on special problem. have been using sas 3 years , have background social sciences. thank in advance henning there few options in sas let accomplish task. here quick example. data sample; length level $60.; input level $1-60; /*option 1 subset obs ...

php - Trying to get property of non object Laravel 5.2 -

the error occurs when print messages logged in user sent others him. did var_dump in controller in view. did {{$threads->count()}} in view , showed 27(thread count). when access view file throws me above mentioned error. here controller code public function index() { $currentuserid = auth::user()->id; $threads = thread::getalllatest()->get(); return view('chatindex', compact('threads', 'currentuserid')); } i printed currentuserid in view , works fine here view code (where error occurs) @extends('layouts.app') @section('content') @if (session::has('error_message')) <div class="alert alert-danger" role="alert"> {!! session::get('error_message') !!} </div> @endif @if($threads->count() > 0) @foreach($threads $thread) <?php $class = $thread->isunread($currentuserid) ? 'alert-info' : '...