Posts

Showing posts from May, 2011

How to add a tag value to balloonTooltip in notifyIcon in C# winform? -

i have windows form application retrieve data web , show data in datagridview. when form minimized , new data have been fetched notifyicon tooltip appeared in screen , alert user. now want create feature: when user click on tooltip (balloon) form must become maximized , highlight row related balloon. there isn't tag or info holder balloon determinate row index or data identifier? how can customize balloon or send data accessible in balloon click event? add data on tag: object obj = mydata; notifyicon1.tag = obj; add event click notify icon: private void notifyicon1_click(object sender, eventargs e) { object obj = notifyicon1.tag; myobject myobject = (myobject) obj; showintaskbar = true; notifyicon1.visible = false; windowstate = formwindowstate.normal; (int x = 0; x < datagridview1.rows.count; x++) { if (datagridview1.rows[x].cells["idobject"].value.tostring() == myobject.idobject.tostring()) {

javascript - Parallel downloading of JS files in HTML -

i have html file looks this <html> <head> <script src="1.js"></script> <script src="2.js"></script> ... <script src="200.js"></script> </head> </html> 1.js contains 1 line window.performance.setresourcetimingbuffersize(250); by default, resource buffer size in chrome 150. but, when see resources using resource timing api, length of resources not 200. keeps varying randomly between 150 200. i know why happening. because, chrome tries download resources in parallel , hence, registers resources in resource timing api. the snippet in 1.js window.performance.setresourcetimingbuffersize(250); actually gets executed bit later. hence, more resources added resource timing buffer. but, not of them added. is there way stop parallel download of resources? download first resource first, let code execute , resume downloading of remaining resource

SAPUI5: can not access `sortItemData` in the sap.m.P13nSortPanel at update event. -

i want collect sortitemdata in sap.m.p13nsortpanel object on update time. so wrote following function: _onupdatesortitem: function(oevent) { var parameters = oevent.getparameters(); var osortitemdata = oevent.getparameter("sortitemdata"); if (osortitemdata) { this._osorter[parameters.key] = { scolumnkey: osortitemdata.getcolumnkey(), soperation: osortitemdata.getoperation() }; } }, and bound onupdate handler. problem osortitemdata undefined while if use function onaddsortitem event works fine. after checking code of sap.m.p13nsortpanel fires event, assume did not bind sortitems aggregation. please have @ explored example well. there can see panel uses 2 aggregations, items , sortitems .

mapkit - Swift: How can I make less didupdatelocation calls -

i've come code prints address , postalcode of location. done in didupdatelocation function. the problem occur, every second address get's updated "didupdatelocation" function. because battery ineffecient, looking ways use interval couldn't find ways (also not on google en stackoverflow) on how this. can give me tips how can in swift? the answers of rajeshkumar , basir doesn't change battery power, delegate method still called same number of times per minute. if want have more efficient behavior, try change values of distancefilter, desiredaccuracy, , activitytype (you can find need here ) manager.distancefilter = 50 // distance changes want informed (in meters) manager.desiredaccuracy = 10 // biggest approximation tolerate (in meters) manager.activitytype = .automotivenavigation // .automotivenavigation stop updates when device not moving also if need location of user when changes significantly, can monitor significantlocationchanges, ca

java - What is the -b+ sign in creating locale specific directories in android? -

according android documentation, to add support more locales, create additional directories inside res/. each directory's name should adhere following format: <resource type>-b+<language code>[+<country code>] for eg. myproject/ res/ values/ strings.xml values-b+es/ strings.xml mipmap/ country_flag.png mipmap-b+es+es/ country_flag.png can why symbol -b+ ? educational purpose.if doubt present kindly comment.will try fix question. thanks time. link:- https://developer.android.com/training/basics/supporting-devices/languages.html#createdirs

c# - After submitting a form, the value disappered -

Image
after submitted form, "only display" values disappeared, knows error? in view, use @html.textboxfor , use viewbag.staffid value "readonly" variable, if submit form error, viewbag.staffid value disappears <div class="form-group"> @html.labelfor(model => model.staffid, "staffid", htmlattributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @html.textboxfor(model => model.staffid, new { @value = viewbag.staffid, @readonly = "readonly", @class = "form-control" }) @html.validationmessagefor(model => model.staffid, "", new { @class = "text-danger" }) </div> </div> <div class="form-group"> @html.labelfor(model => model.staffinfo.cname, htmlattributes: new { @class = "control-label col-md-2" })

angularjs - Moving image display bar left or right with arrow buttons and javascript -

sorry small piece of code, trying scroll image bar left or right 2 arrow buttons in html. error showing "uncaught typeerror: cannot read property 'style' of null @ movingimage" please if can help, let me know. js: function movingimage(el, e) { var amount = +e.target.dataset.amount; el.style.left = (el.offsetleft + amount) + 'px'; } var div = document.getelementbyid("movingimage"); var buttons = document.queryselectorall('button'); [].slice.call(buttons).foreach(function (button) { button.onclick = movingimage.bind(this, div); }); html: <button data-amount="-100"><div class="arrow left small" ng-click="changecolour(index-1)" ng-src="{{colour.thumbmedia | smcmediaurl}}"></div></button> <button data-amount="100"><div class="arrow right small" ng-c

vb.net - Changing the Visible property for a label on a windows form, after the form has been displayed -

so have windows form built in vb.net get's displayed used filter window... there "ok" button starts process of building sql query , requesting data. lblloading.visible defaulted false in designer...the code on ok button click follows: private sub btnok_click(byval sender object, byval e system.eventargs) handles btnok.click ' validation here lblloading.visible = true ' code data lblloading.visible = false end sub when code executes label not shown... tried changing value true in designer, , displays when form opened doesn't hide when code runs. i'm more used using c# wpf forms , in there raise on property changed event propagate view i'm wondering if there similar have missed here? thanks in advance quick solution? add on line after visible = true : refresh() or me.refresh() don't use (like inside loop!). let me know if helps!

Relative Layout GridView inside of ScrollView Android -

Image
i've feeling doing totally incorrect know stack overflow loves attempt. trying make whole view scrollable , icons in grid view scroll whole view, right icons scroll. unsure start this. attach layout file onto this. want below full scrollable view right icons @ bottom scroll. <?xml version="1.0" encoding="utf-8"?> <scrollview> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/activity_main" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_

c++ - How can I use environment variable as compile-time constant in native nodejs addon? -

i writing native addon nodejs. how can use environment variable constant @ compile time? is, "inject" constant in nodejs c++ addon environment variable set during node-gyp build or npm install . found this answer , far can see, there no equivalent option passing through variables node-gyp normally when create makefile can pass options compiler like: -d name=definition which equivalent of having in source code: #define name "definition" so using: -d name=$name would put name environment variable name constant in compiled source code. but node-gyp makefile generated you, see: https://nodejs.org/api/addons.html you may need change generated makefile after run: node-gyp configure but before run: node-gyp build or can make simple library entire purpose have given value defined used node addon. another option have script like: echo "#define name \"$name\"" > config.h and can include config.h file n

java - Integrating Lucene with Android getting error -

03-28 15:52:36.586 25855-25855/? d/dalvikvm: late-enabling checkjni 03-28 15:52:37.021 25855-25855/com.example.myapplication2.app e/tag: start/data/data/com.example.myapplication2.app/lib-----index 2 :/storage/emulated/0/notes/sfilename 03-28 15:52:37.421 25855-25855/com.example.myapplication2.app i/dalvikvm: not find method java.io.file.topath, referenced method org.apache.lucene.store.niofsdirectory.createslicer 03-28 15:52:37.422 25855-25855/com.example.myapplication2.app w/dalvikvm: vfy: unable resolve virtual method 8318: ljava/io/file;.topath ()ljava/nio/file/path; 03-28 15:52:37.422 25855-25855/com.example.myapplication2.app d/dalvikvm: vfy: replacing opcode 0x6e @ 0x000c 03-28 15:52:37.422 25855-25855/com.example.myapplication2.app i/dalvikvm: not find method java.io.file.topath, referenced method org.apache.lucene.store.niofsdirectory.openinput 03-28 15:52:37.422 25855-25855/com.example.myapplication2.app w/dalvikvm: vfy: unable resolve virtual method 8318: ljava/io/file;.

java - LINE Notify API - bypass access token security -

Image
i'm writing app notify many friend must login line notify website generate access token. are there ways access token without login website ? sorry asking, if question not , sorry language.

how get parent size in child view in react-native? -

i cannot understand how can send parent view's sizes child component of this. in renderpager() want calculate parameters depend on parent view size. know can through onlayout(). problem onlayout called after building of childs (i see console log). how can it? onpagelayout = (event) => { const { width, height } = event.nativeevent.layout; console.log("on layout"); }; render() { return ( <view style={styles.root} onlayout={this.onpagelayout} > {this.renderpager()} </view> ); } renderpager = () => { // how can root view's size here return ( <indicatorviewpager ref={(ref) => (this.viewpager = ref)} scrollenabled={!this.state.isdragging} onpagescroll={this.onpagescroll} style={styles.pageroot} > {this.renderpages()} </indicatorviewpager> ); }; thank you you can maybe pass data props, , tak

gridview - How to export grid view to excel 2007 and above C# -

i'm trying export grid view excel 2007 , above file using excel package library on every time run export function file empty. i'm working on old code implemented else. @ first converting list anonymous object type that: var exportdata = onpremisestransactionspagemodel.inclinictransactionslist.select(intrans => new { billingid = intrans.financialtransactionid == 0 ? string.empty : "tr" + intrans.financialtransactionid, appointmentdate = intrans.appointmentdatetime == datetime.minvalue ? string.empty : intrans.appointmentdatetime.tostring("mm/dd/yyyy, hh:mm tt"), amount = intrans.amount == 0 ? string.empty : intrans.amount.tostring("c"), paymenttype = intrans.amount == 0 ? string.empty : ((intrans.paymentmethodtypeid == convert.toint32(preferredinclinicpaymentoption.cash)) ? intrans.paymentmethodtypename : intrans.paymentmethodprovidername), receivern

Attempt to invoke virtual method 'void android.widget.TextView.append(java.lang.CharSequence)' on a null object reference -

i'm unable data(text) edittext textview via button. logic should fine , can't find mistake. i error click button triggeres "sendmessage(view v)". can't append text "chat" don't know why. mainactivity.java: package com.chattr.neonardo.chattr; import android.os.bundle; import android.support.v7.app.appcompatactivity; import android.util.log; import android.view.view; import android.widget.button; import android.widget.edittext; import android.widget.textview; import android.widget.toast; public class mainactivity extends appcompatactivity { textview chat; edittext message; button send; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); chat = (textview) findviewbyid(r.id.chat); message = (edittext) findviewbyid(r.id.message); send = (button) findviewbyid(r.id.send); log.d("test

ibm mq - IMB MQ: Getting message from queue before it leaves it. Java -

for example, have queue manager 2 queues. put message q1 goes queue q2 . , in q1 message new things in it's body, unique id. so question can somehow using java message q1 before goes q2 ? or @ least info it. actually example simplificated , want know possible message before leaves queue. update: i have message broker logic. queue manager , it's queues local. q2 transmission queue, message send adapter. i'm interesteg in browsing message put in q1 before goes adapter or q2 . can make java classes or jms without changing message flow triggers , handlers or changing adapter source code? your question not clear. messages in local queue not magically move 1 queue queue. should update question , more precise on type of queues using. is q1 cluster or remote queue?

This version of the Entity Framework Core Package Manager Console Tools doesn't support these types of projects -

after updating existing project asp.net core 1.1 , entity framework core 1.1 using tutorial tried execute "add-migration migrationname" in package management console got error: startup project 'src\projectname' asp.net core or .net core project visual studio 2015. version of entity framework core package manager console tools doesn't support these types of projects. i using vs 2015 update 3. project.json { "dependencies": { "coursesmanagement.dal": "1.0.0-*", "microsoft.aspnetcore.diagnostics": "1.1.1", "microsoft.aspnetcore.identity.entityframeworkcore": "1.1.1", "microsoft.aspnetcore.mvc": "1.1.2", "microsoft.aspnetcore.server.iisintegration": "1.1.1", "microsoft.aspnetcore.server.kestrel": "1.1.1", "microsoft.aspnetcore.staticfiles": "1.1.1", "microsoft.

How can I run automated tests to check the average response time of a rest API? -

i have restful api run tests against @ random moments of day in order check average response time. wasn't able using postman's collection runner. there tool allows me this, or maybe i'll have write own? you can use services pingdom retrieve calls api, or can use softwares (commercial or opensource, zabbix still around?) monitor api, or (if don't need many perks) can write script runs in cronjob , saves response time of api in txt file (or wherever want) further inspection. here's little example, in php, can adapt fav. language. // don't know how take run api request set_time_limit(0) $start = microtime(true); $result = executeapicall() $executiontime = microtime(true) - $start; storeexecutiontime($executiontime) function storeexecutiontime($time) { // store data somewhere }

Copy data from python lists into postgresql tables -

i have python list cve_id , pkg_name & vuln_status . i'd import data these lists int postgresql table what have tried: from scanner import * import psycopg2 try: conn = psycopg2.connect(database="test", user="postgres",password="something", host="127.0.0.1", port="5432") except: print "database un-successfull" quit() cur = conn.cursor() cur.execute("insert vuln_data(cve_id, pkg_name, status) values (%s,%s, %s)", (cve_id, pkg_name, vuln_status)) conn.commit() conn.close() i error saying psycopg2.dataerror: multidimensional arrays must have array expressions matching dimensions ^ would love if point out can done, here. thanks try replacing cur.execute code following cur.execute("""insert vuln_data(cve_id, pkg_name, status) values (%s,%s, %s);""", (cve_id, pkg_name, vuln_stat

c++ - DrawText and Text Clipping -

is there way detect when text passed drawtext has been clipped ? i able draw text in given rectangle, (i.e. have been clipped drawtext , means user might miss important part of text). i want height required show clipped text. appreciated. you can use dt_calcrect flag required rectangle size. in addition, return value of function gives height of text. from online documentation: if function succeeds, return value height of text in logical units. if dt_vcenter or dt_bottom specified, return value offset lprect->top bottom of drawn text.

javascript - After map.data.loadGeoJson, events of circle is covered by polygons of Geo Json -

after load geo json file map.data.loadgeojson(), makers , circles covered polygons , event cannot clicked. here sample codes. how should do? , there other way disable "clickable" of these polygons? thank you. map.data.loadgeojson(samplejson.json); // add circle overlay , bind marker var circle = new google.maps.circle({ map: map, radius: 1600, // 10 miles in metres fillcolor: fill_color_val, strokecolor: '#f5f5f5', strokeweight: 2, fillopacity: 1, }); var marker = new google.maps.marker({ position: latlng, title: data[i].author, draggable: false, map: map }); marker.setvisible(false); circle.bindto('center', marker, 'position'); var inf

javascript - Creating Node.JS HTTPS server in Cloud9 IDE -

is somehow possible create node.js https server in cloud9 ide? below example of simple https server setup in node.js. var https = require('https'); var fs = require('fs'); var app = require('./app'); // ssl configuration var ca_names = ['cert-name_1', 'cert-name_2', 'cert-name_3']; var options = { key: fs.readfilesync('./folder/server.key'), cert: fs.readfilesync('./folder/server.crt'), ca: ca_names.map(function(n) { return fs.readfilesync('./eid/ca/' + n + '.crt'); }), //crl: ca_names.map(function(n) { return fs.readfilesync('/eid/ca/' + n + '.crl'); }), requestcert: false, rejectunauthorized: false }; var server = https.createserver(options, app); server.listen(process.env.port || 8081, process.env.ip || "0.0.0.0"); console.log('server listening on port: ' + process.env.port); when try connect server getting following error: "econnr

javascript - JWT - High quality ways to handle the user experience of a returning logged in user -

i have client that, once authenticated, stores jwt in localstorage . if user closes browser, , once again navigates site, client first checks jwt in localstorage , , if present, redirects via: window.location.href = `/?jwt=${token}` this works fine except i'm not fan of user experience. user visits page, shown login page, , abruptly redirects new page. i have played around hiding /auth/login 's ui if jwt token found, it's still not great. what better ways handle case user has left site, comes , should logged in? is there way user return site after having closed browser, , shown logged in using jwt's? this post great job of answering question: https://dev.to/rtfeldman/defense-against-the-dark-arts-csrf-attacks

mysql - SQL DATE not generating correct result with NOW() or CURRENT_DATE() -

Image
sql: select * `ec_assessment_item` `ec_assessment_due_date` <= now() sql: select * `ec_assessment_item` `ec_assessment_due_date` <= current_date() i want shows data before due date, , tested few method including now() , current_date() empty result. expected result should id: 2 , 3. for , currentdate output example now() : 2017-03-28 14:27:45 currentdate() : 2017-03-28 now() datetime format (y-m-d h:m:s) curdate or currentdate date format (y-m-d) you can run script select now(),current_date() ; this should work. tested on side , works select * ec_assessment_item ec_assessment_due_date < current_date() ; sign of strict inferiority mean before also current date 2017-03-28 output should empty said before today add table row ec_assessment_due_date = 2017-03-27. result wont empty anymore.

vue.js - Vuejs computed properties and jquery ui sortable issue -

in project have component 3 ul lists. have kind of data array items, each item has properties. aim to: distribute items in basic array 3 lists make possible drag&drop items between lists , accordingly update items data, since each item has property tells list item belongs instead of copy-pasting lot of code, tried reproduce incorrect behaviour in jsfiddle using simple example here: https://jsfiddle.net/89pl26d2/4/ the thing is, when drag&drop, got 2 items dragged, instead of one. however, when switched computed properties watch , got desired behaviour , worked fine. i figure out line causes error: line when update item property telling me list item should belong after drag finished. can't figure out why causes this i know it's not best way work html directly, i'm okay now. generally, whenever see issue in vue, related lists, wrong item updated or that, comes down vue trying smart getting wrong because doesn't have best information.

How to write c# class serialize like this xml by RestSharp ? -

how write c# class serialize xml restsharp ? <?xml version="1.0" encoding="utf-8"?> <messages xmlns="http://mns.aliyuncs.com/doc/v1/"> <message> <messagebody>message1 base64 encoded result</messagebody> <delayseconds>60</delayseconds> <priority>1</priority> </message> <message> <messagebody>message2 base64 encoded result</messagebody> <delayseconds>60</delayseconds> <priority>1</priority> </message> </messages>

git - gitlab - push using https, specifying username & password -

i trying push newly created repository gitlab. here's did: create project in gitlab. example url: https://gitlab.example.com/examples/project1.git initiated local bare repo: cd ~/projects git init --bare ./project1.git cd project1.git question: next step push of local repo gitlab. want specify username , password using https. how change following it? git remote add origin https://gitlab.example.com:group1/project1.git git push --all git push --tags when created repo in gitlab, deafault provide clone git repo using 2 protocols, ssh , https. in https prompt user credential every time pull or push. i prefer use ssh. in ssh can push lot of files repo. in https have size restriction. perhaps want push 4gb files repo. follow these steps set ssh remote: git remote rm https://gitlab.example.com:group1/project1.git git remote set-url origin ssh://user@host:1234/srv/git/example useful information: worth reading setting git remote: https://help.github.c

php - Text-decoration: none; not working -

this question has answer here: why bootstrap's text-decoration:none not work? 2 answers i posting here first time. doing 1 project online web development course, have created footer using footer tag , i'm using bootstrap css file , css file. have used anchor tag add links can't remove text decoration reason, tried internal,external , inline style sheets nothing working. footer code below, footer page has been included in index.php file using include() function. <!doctype html> <html> <head> <title></title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- latest compiled , minified bootstrap css --> <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css" type=" text/css"> <!-- css --&

javascript - Node.js SELECT*FROM a table in a SQL database -

my problem can enter data input boxes sql table, problem text table not show on page want to. works playlist page show href links depending on how many playlists have made not text. i have left out database details security reasons. playlist.jade extends layout block content h1= title p welcome #{title} h1 playlists br a(href='/login') login br a(href='/users/createplaylist') create new playlists br a(href='/users/playlistcreated') test br playlist, in playlists a(href='/users/playlistcreated') | #{playlist.text} br users.js var express = require('express'); var mysql = require('mysql'); var router = express.router(); var dbconnectioninfo = { host : '', user : '', password : '', database : 'audio_collections' }; router.get('/createplaylist', function(req, res, next) { res.render('new_playlist'); }); router.get('/playlis

scala - Unable to rename Dataframe's column -

when showing partitions of table, using spark 1.6.3, unable rename dataframe's column. in order reproduce problem, build following partitioned table sqlcontext.sql("create table test (foo string) partitioned (dt string)") val df = sqlcontext.sparkcontext.parallelize(seq(("foo", 1), ("bar", 2))) .todf("column", "dt") df.write.mode("overwrite").partitionby("dt").insertinto("test") i can retrieve list of available partitions in table scala> sqlcontext.sql(s"show partitions test").show +------+ |result| +------+ | dt=1| | dt=2| +------+ now, rename column using withcolumnrenamed this sqlcontext.sql(s"show partitions test").withcolumnrenamed("result", "partition").show which fails following error message org.apache.spark.sql.analysisexception: resolved attribute(s) result#835 missing result#826 in operator !project [result#835 partition#

variables in dictionaries in python -

i trying create dataframe using dictionary in have added variables values.. gpa_min = df_gpa.min() gpa_q1 = df_gpa.quantile(0.25) ratio_gpa = 'gpa ratio q1/outlier ', df_gpa.quantile(0.25)/df_gpa.min(), 'should be' gre_min = df_gre.min() gre_q1 = df_gre.quantile(0.25) ratio_gre = 'gre ratio q1/outlier ', df_gre.quantile(0.25)/df_gre.min() index = ['gre','gpa'] columns = ['min','q1','q1/min'] outlier = pd.dataframe({"gre": [gre_min,gre_q1,ratio_gre], "gpa": [gpa_min,gpa_q1,ratio_gpa]}, index = index, columns = columns) print outlier this runs no error, answer data frame ´nan´ values... confusing, if called variables created above ('gre_min, gre_q1, ratio_gre, gpa_min, gpa_q1, ratio_gpa') values correctly i using python 2.7 thanks! building pandas dataframe way assume dictionary you're passing in dictionary of columns

javascript - How can I make a js function recognize a clicked or empty checkbox? -

i'm modifiying existing form. you can launch task block several fields, , if these empty, can remove block again. of them required, submit data complete. if not complete, can save work in process (sic! i'd have preferred work in progress...) for code recognize empty fields, seems of them have value="" . when completed, system seems to recognize not empty. but checkbox want use causes problems. if don't set value="" , it's not recognized empty, , can't remove block. if set value="" , it's not recognizing entered checkmark, , can't submit data complete. i thought onclick="...." , defining way set value="true" way forward, haven't found example while searching, , being quite beginner, haven't learned yet. the checkbox (to renumbered id 050): <label for="completed_001">task completed<em class="labelrequired">*</em></label> <input type=&

json - Encoding/Decode shapeless records with circe -

upgrading circe 0.4.1 0.7.0 broke following code: import shapeless._ import syntax.singleton._ import io.circe.generic.auto._ .run[record.`'transaction_id -> int`.t](transport) def run[a](transport: json => future[json])(implicit decoder: decoder[a], exec: executioncontext): future[a] with following error: not find implicit value parameter decoder: io.circe.decoder[shapeless.::[int shapeless.labelled.keytag[symbol shapeless.tag.tagged[string("transaction_id")],int],shapeless.hnil]] [error] .run[record.`'transaction_id -> int`.t](transport) [error] ^ am missing import here or these encoders/decoders not available in circe anymore? instances shapeless's hlists, records, etc. moved separate circe-shapes module in circe 0.6.0 release. if add module build, following should work: import io.circe.jawn.decode, io.circe.shapes._ import shapeless._, record.record, syntax.singleton._ val d

java - Creating a Spring bean from a Groovy class leads to "cannot find symbol error" -

i have groovy class returns instance of data base client: class dbclient { private static dbclient instance private string url private string username private string password private string driver @synchronized static dbclient getinstance() { if (!instance) { instance = new dbclient() } return instance } sql sql = sql.newinstance(url, username, password, driver) void seturl(string url) { this.url = url } void setusername(string username) { this.username = username } void setpassword(string password) { this.password = password } void setdriver(string driver) { this.driver = driver } def getallsaa() { sql.rows("select * saa") } } i try create bean of class in @configuration class: @configuration @profile("prod") public class oracleserverconfiguration { @bean public dbclient dbclient () { dbclient dbclient = dbclient.getinstance(); dbclient.seturl("jdbc:oracle:thin:@localhost:1521:xe");

swift - Unusual high CPU usage in UITableView -

i'm creating exercise app, , created uitableview show of exercises available (roughly 120). , i'm getting data coredata using nsfetchedresultscontroller. problem i'm having high cpu usage when i'm scrolling through table. ranges 50%-100% depending how fast scroll. here's cell row: override func tableview(_ tableview: uitableview, cellforrowat indexpath: indexpath) -> uitableviewcell { guard let cell = tableview.dequeuereusablecell(withidentifier: "cell", for: indexpath) as? exercisecell else {fatalerror("couldn't load appropriate index path custom cell")} let exercise = self.fetchedresultscontroller.object(at: indexpath) cell.exercisetitle.text = exercise.name if let getimage = exercise.image2 { let image = uiimage(data: getimage data) cell.exerciseimage.image = image } else { cell.exerciseimage.image = nil } return cell } i'm not sure if how

vb.net - How to sort the sequence of checkbox -

Image
i have 2 checkboxes. if check cb1 first , cb2 next, listbox should display data of checkboxes in order of checked sequence. public class form1 private sub button1_click(sender object, e eventargs) handles button1.click if cb1.checked = true , cb2.checked = false listbox1.items.add(cb1.text) if cb1.checked = true , cb2.checked = true listbox1.items.add(cb1.text) end if elseif cb2.checked = true , cb1.checked = false listbox1.items.add(cb2.text) if cb2.checked = true , cb1.checked = true listbox1.items.add(cb1.text) end if end if end sub end class if 1 checkbox checked displays data, if both checked there's no data displayed in list box. you're question not clear enough me sure of want here solution question interpreted: your code checking if both true nested within if statements wouldn't run if both true. also, dont put end if @ end of elseif if have more criteria come. fixed code:

android - How to create groups with menu items in toolbar programmatically? -

Image
how create menu groups menu items programmatically? each group have it's own icon. for example, need other icons "computer" , "phone" include submenus button 3 dots. how that?

c# - Cannot implicitly convert type 'string' to 'System.Windows.Controls.TextBox' error when trying to square root a text box -

i trying square root text box value , output different text box. have far: private void buttonsquareroot_click(object sender, routedeventargs e) { double input1double = convert.todouble(textboxinput1.text); double vartextboxanswer = math.sqrt(input1double); textboxanswer = vartextboxanswer.tostring(); } it comes error message: severity code description project file line suppression state error cs0029 cannot implicitly convert type 'string' 'system.windows.controls.textbox' calculator c:\users\user\documents\visual studio 2017\projects\calculator\calculator\mainwindow.xaml.cs 125 active line 125 1 starting textboxanswer if have idea how fix please help! if haven't been specific enough please reply , give more information. replace textboxanswer = vartextboxanswer.tostring(); with textboxanswer.text = vartextboxanswer.tostring(); you have write result text property of textbox object.

javascript - 400 Error When Sending JSON to Controller -

i try send json object javascript controller. 400 status code when sending object. tried many methods, last approach below. miss something? why keep getting 400? ajax post call: $.ajax({ type: "post", url: "http://localhost:8080/services/savereservation", cache: false, data: savereservation, contenttype: "application/json; charset=utf-8", datatype: "json", success: function(data) { console.debug("after success"); } }); my object looks this: { "accommodaion":"a0d8185c-a238-5qe7-aa48-5c196b108aba", "totaloutputprice":90, "bookerinfo":{ "country":"xa", "homeaddress":"", "phonenumber":"0019382663773", "contactchoice":"phone", "name":"test name", "id":"87" }, "creditcard":{ "

How to display Jasper long <band> until end of page, instead of having the whole band displayed on the next page? -

i have quite relatively long <band> in jasper report. page height 800. display band (band height 600) middle of page. how display band until end of current page , continue remaining part on next page, instead of having whole band displayed on next page? tried toying splittype , stretch , etc., no avail. can shed light on this?

javascript - Image inside canvas: distinguish onclick inside image and outside image (but inside canvas) -

edited question , code: if use return statement in function move_background() , save image inside var imageobj suggested, code still not working , plays sound2 both when inside , outside image (sound 3 correctly played when outside canvas though), ideas why? </script> <canvas id="mycanvas" width="400" height="400" style="border:1px solid white;" onclick="myfunct()"></canvas> <!-- audio source specified later--> <audio id="audio"></audio> <style> #mycanvas { position: absolute; top:0; bottom: 0; left: 0; right: 0; margin:auto; } </style> <script> var canvas=document.getelementbyid("mycanvas"); context = canvas.getcontext('2d'); var imageobj = make_background(); function make_background() { img = new image();; img.src="img.gif"; img.id = "myimage"; img.