Posts

Featured post

php - mySQL problems with this code? -

i having problems code , hoping can help. basically have issue whereby mysql running out of connections when script run hundreds of times in sequence. https://gist.github.com/anthonyts/b6c46d54ee8bf2d714b8 here database class: https://gist.github.com/anthonyts/89f5a831e31d970fb5e1 here error get: e_error: call member function query() on non-object stack trace: in db::single called @ /var/www/html/scripts/stalk/db.php (68) in db::single called @ /var/www/html/scripts/stalk/beanstalk_check_monitoring_logs.php (88) in {closure} called @ /var/www/html/application/libraries/stalk.php (80) in stalk::background called @ /var/www/html/scripts/stalk/ beanstalk_check_monitoring_logs.php (188) you should put db initialization: $con = mysql_connect(db_host, db_user, db_pass); mysql_select_db(db_database); $db = new db(db_host, db_user, db_pass, db_database); above your: $stalk = new stalk(array(beanstalkd_server, beanstalkd_port)); on top of script, create

java - Checkbox item adds to spinner -

i have 2 checkbox , when checkbox item selected should added spinner. possible that? cant find on google, hoping can save me here :) spinner : public class checkbox extends appcompatactivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_checkbox); spinner spinner; spinner = (spinner) findviewbyid(r.id.spinner2); arrayadapter adapter = arrayadapter.createfromresource(this, r.array.itinerary, android.r.layout.simple_spinner_item); spinner.setadapter(adapter); } the layout <checkbox android:id="@+id/cbsiargao" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="surigao" android:layout_alignparenttop="true" android:layout_alignparentleft="true" android:layout_alignparentstart="true" android:layout_margintop="104dp" />

google cloud platform - High memory consumption on idle Kubernetes cluster -

Image
i´ve created cluster on google cloud platform consisting of 3 g1-small instances , have not yet added pod / service / etc. still, when log on kubernetes ui, 3 instances show high memory consumption of ~ 1.3 gb. memory used for? or problem kubernetes ui? thanks, fabian kube-ui seems showing total memory usage, opposed memory working set. former includes inactive pages not in use, memory appear higher. see memory working set, can try reaching other monitoring services such monitoring-grafana (backed heapster) or reach cadvisor port on node. to reach cadvisor: run kubectl proxy , open http://localhost:8001/api/v1/proxy/nodes/nodename:4194/ alternatively, can deploy kubedash ui.

C# MVC AngularJS -

code: [responsetype(typeof(list<myclass>))] public async task<ihttpactionresult> get() { var userid = user.identity.name; var obj = await this.findallasync(userid); if (obj == null) { return this.notfound(); } return this.ok(obj); } it doesn't seem throw errors server side however, client side in angular controller 1 have ideas? i had code as: responsetype(typeof(bool)] , since changing not work, returning list object not allowed or need in either angular js file or c# controller class work, e.g. json-fy it?!?! refer http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/build-a-single-page-application-(spa)-with-aspnet-web-api-and-angularjs code base. have done change 1 of calls return list cannot see why different. have not modified client side controller class significance other upgrade code new syntax. $http.get("/api/crosswordhelper").then( function (response) { //$sco

php - MySQL Fulltext search results in html content -

i have database oages of content. content in html format. want make content searchable figured fulltext search best. have query setup below: select * pages match(content) against ('search'); that gives me list of pages, however, there multiple matches on pages. want pull out matches of content surrounding show little snippets of results on search results page. i using php running query. you use clause simple string matching, along lines of: select content pages content '%keyword%';

How to debug "expected android.widget.TextView but found java.lang.string" in Android? -

can please take @ code? trying build app personal school project. new android studio. have put simple app display spaces available in parking lot. but trying open second activity screen when click on 1 of lots in listview screen. got error , have no way of solving it. **mainactivity.java** <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="fill_parent" > <textview android:id="@+id/lotname" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <textview android:id="@+id/lotspaces" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/lotname"/> </relativelayout> **singlelotview.java** package com.example.sahan.smart

r - how do you merge two data frames the best way? -

i need merge data.frame s: dput(data) structure(list(hostname = structure(c(8l, 8l, 9l, 5l, 6l, 7l, 1l, 2l, 3l, 4l), .label = c("db01", "db02", "farm01", "farm02", "tom01", "tom02", "tom03", "web01", "web03"), class = "factor"), date = structure(c(6l, 10l, 5l, 3l, 2l, 1l, 8l, 9l, 7l, 4l ), .label = c("10/5/2015 1:15", "10/5/2015 1:30", "10/5/2015 2:15", "10/5/2015 4:30", "10/5/2015 8:30", "10/5/2015 8:45", "10/6/2015 8:15", "10/6/2015 8:30", "9/11/2015 5:00", "9/11/2015 6:00"), class = "factor"), cpubusy = c(31l, 20l, 30l, 20l, 18l, 20l, 41l, 21l, 29l, 24l), usedpercentmemory = c(99l, 98l, 95l, 99l, 99l, 99l, 99l, 98l, 63l, 99l)), .names = c("hostname", "date", "cpubusy", "usedpercentmemory"),