Posts

Showing posts from June, 2010

linux kernel - How to connect ov5642 camera module Pixel clock (8MHz) to imx6 quad -

i using i.mx6quad debian jessie (3.14.60-fslc-imx6-sr). i want co connect ov5642 camera module parallel 8bit interface (using 8gpios data , 3 control signals). wrote linux kernel module service interrupts control signals. interrupts vsync , href signals serviced when connect pclk (about 8mhz) signal faster href or vsync linux hangs untill disconnect wire pclk (everything stucks). connect pclk use gpio90 (disp1_data22) tried other gpios. now question gpio should use service such fast signals pclk or can avoid linux hang ups ?? i include linux kernel module code use. #include<linux/init.h> #include<linux/module.h> #include<linux/kernel.h> #include<linux/gpio.h> #include<linux/interrupt.h> static unsigned int vsync_gpio_number=79; static unsigned int href_gpio_number=76; static unsigned int pclk_gpio_number=90; static unsigned int vsync_irqnumber; static unsigned int href_irqnumber; static unsigned int pclk_irqnumber; static irq_handler_t vsync_

Notepad++ Macro doesn't process down button -

i have written notepad++ macro convert sql query vb string paste vb code. the principal press ctrl + shift + e , macro should convert sql line select b "select b" & vbcrlf & _ , cursor should move next line. this macro looks like: <macro name="vb script" ctrl="yes" alt="no" shift="yes" key="69"> <action type="0" message="2453" wparam="0" lparam="0" sparam="" /> <action type="1" message="2170" wparam="0" lparam="0" sparam='&quot;' /> <action type="0" message="2451" wparam="0" lparam="0" sparam="" /> <action type="1" message="2170" wparam="0" lparam="0" sparam='&quot;' /> <action type="1" message="2170" wparam="0" lparam=&qu

c# - Saving or accepting changes failed because more than one entity of type have the same primary key value -

i use repository pattern in asp.net mvc 5, select data table , add 1 entity in data value , want set data in database added entity value saving or accepting changes failed because more 1 entity of type 'blogpost.dal.entity.blogpost.blog' have same primary key value error occured in database row inserted need avoid error. model = await _iblogserices.bloggetbyid(id); blog data = _db.blog.find(id); _db.blog.remove(data); _db.savechanges(); model.ispublish = true; await _iblogserices.createblog(model); return view(); it seem there not problem if bloggetbyid(id) function public task<blog> bloggetbyid(int id){ return _db.blog.firstordefaultasync(p => p.id ==id); }

c++ - How to change --usage output with argp? -

i built program config file parser , cli options. my goal have order of priority : cli options configuration mandatory configuration file hardcoded default configuration while parsing cli arguments argp need read path config file first (which not option) other cli options override config file settings. as described in glibc argp documentation, options read first non-option arguments, unless use argp_in_order flag. in case arguments read first last (option or not). in case, first mandatory argument path config file. behave expected, except usage output. i have : usage: myprogramm [option...] configurationfile i need : usage: myprogramm configurationfile [option...] is there way place non-optional arguments first in usage output?

python - How to deal with "None" when I using sklearn-decisiontreeclassifier? -

when use sklearn built decisiontree,examples: clf = tree.decisiontreeclassifier() clf = clf.fit(x,y) result = clf.predict(testdata) x training input samples,if there "none" in x,how it? decision trees , ensemble methods random forests (based on such trees) accept numerical data since performs splits on each node of tree in order minimize given impurity function (entropy, gini index ...) if have categorical features or nan in data, learning step throw error. to circumvent : transform categorical data numerical data : use example one hot encoder . here link sklearn 's documentation. warning : if have feature lot of categories (e.g. id feature) onehotencoding may lead memory issues. try avoid encoding such features. impute values missing ones. many strategies exist (mean, median, frequent ...). here link sklearn 's documentation. once you've done preprocessing , can fit decision tree data.

Nginx as reverse proxy for docker containers -

i'm trying nginx reverse proxy connections within lan several web applications including ones inside docker containers. both webapps reachable proxy_pass url i'm using following dockerfile: # set base image ubuntu ubuntu run apt-get update run apt-get install -y nginx run rm -v /etc/nginx/nginx.conf run echo "daemon off; \n\ \n\ worker_processes 1; \n\ events { worker_connections 1024; } \n\ \n\ http { \n\ \n\ server { \n\ listen 99; \n\ \n\ server_name dashboard; \n\ location / { \n\ proxy_pass http://dashboard:80; \n\ } \n\ location /app1 { \n\ proxy_pass http://otherhostname:9000/app1; \n\ } \n\ } \n\ } \n\ " >> /etc/nginx/nginx.conf expose 99 cmd service nginx start when running service (container) can reach app1, not dashboard. the weird thing had working before, , i'm pretty sure did not change fundamental dockerfile. missing something? edit: (i have

apache poi - Error When trying to use XSSF on Jmeter -

i getting error when trying create xlsx file using jmeter. try using hssf (for .xls) , works fine. when trying change using xlsx , getting error. copy jar file poi , poi-ooxml on jmeter lib file. here simple script : import org.apache.poi.ss.usermodel.cell; import org.apache.poi.ss.usermodel.row; import org.apache.poi.xssf.usermodel.xssfsheet; import org.apache.poi.xssf.usermodel.xssfworkbook; import java.io.file; import java.io.filenotfoundexception; import java.io.fileoutputstream; import java.io.ioexception; import java.util.*; import java.lang.string; import java.lang.object; xssfworkbook workbook = new xssfworkbook(); xssfsheet sheet = workbook.createsheet("sample sheet"); row row = sheet.createrow(0); cell cell = row.createcell(0); cell.setcellvalue("hencin"); try { fileoutputstream out = new fileoutputstream(new file("d:\\jmeter\\testhencin.xlsx")); workbook.write(out); out.close(); system.out.println("excel written

scala - sbt native packager and app writable directory -

using sbt-native-packager plugin, what's best approach have app-writable directory? in configuration use enableplugins(javaserverapppackaging, systemdplugin, debianplugin, universalplugin) , works except app needs write files own functioning, under /usr/share/package-name/ sounds wrong wonder , how best that, if should use debain postinst scripts of try alter directory permissions mappings of universal pluin. adding new writeable directory in linux distribution means adding mapping linuxpackagemappings (documentation) . linuxpackagemappings += packagetemplatemapping( s"/opt/${(packagename in linux).value}" )().withuser((daemonuser in linux).value) .withgroup((daemongroup in linux).value) .withperms("755") you can see old sbt syntax in use javaserverapp plugin . note: should not set /usr/share/<packagename> directory writeable. contains executables , config files , should modifiable root user. cheers, muki

javascript - ASP.NET Web Forms - Client side validation not working when field populated via jquery? -

i have following asp.net webform address field required field. address field populated via jquery value of location field. when click submit without filling in fields, client side validation fires , error message displayed below address control. if enter value location field, jquery fires , address field populated value previous error message doesn't clear - clears when manually enter value? <div> <label>location</label> <asp:textbox id="location" runat="server" cssclass="form-control" clientidmode="static" placeholder="enter location"></asp:textbox> </div> <div> <label >address</label> <asp:textbox id="address" runat="server" cssclass="form-control" clientidmode="static" placeholder="enter address"></asp:textbox> <asp:requiredfieldvalidator id="requiredfieldvalidator5"

javafx - JavaFXPorts: Selected item in ListView is not selected -

here sample code: package com.javafxportslistviewdemo; import com.gluonhq.charm.down.platform; import com.gluonhq.charm.down.services; import com.gluonhq.charm.down.plugins.lifecycleevent; import com.gluonhq.charm.down.plugins.lifecycleservice; import javafx.application.application; import javafx.beans.value.observablevalue; import javafx.collections.fxcollections; import javafx.collections.observablelist; import javafx.geometry.rectangle2d; import javafx.scene.scene; import javafx.scene.control.label; import javafx.scene.control.listview; import javafx.scene.input.keycode; import javafx.scene.input.keyevent; import javafx.scene.layout.vbox; import javafx.stage.screen; import javafx.stage.stage; public class javafxportslistviewdemo extends application { @override public void init() { } @override public void start(stage primarystage) throws exception { screen primaryscreen = screen.getprimary(); rectangle2d visualbounds = primaryscreen.getv

jquery - Margin-left on table based on screen width, with scrollbar -

Image
i've got sticky table column employee names on left side of screen. , large table scrollbar next it. the idea when im scroling right see content of large table sticky table column names pushes table right. in way i've got nice overview of names on left side of screen, , it's not overlapping table. can't seem work properly, have suggestions? if want achieve effect excel fixed column : do this: .table-wrapper { overflow-x:scroll; overflow-y:visible; width:250px; margin-left: 120px; } td, th { padding: 5px 20px; width: 100px; } th:first-child { position: fixed; left: 5px } working demo

winforms - button click windows form c# -

hi guys i'm trying make "minipaint" application has 3 buttons(rectangle, circle , line). i'm having problem making buttons work. example have rectangle class inherits color, thickness, startpoints x, y shape: class rectangle : shape { public int length { get; set; } public int width { get; set; } public override void draw(graphics g) { g.drawrectangle(new pen(color), new rectangle(startx, starty, width, length)); } } now want rectangle_btn_click print rectangle in panel whenever click on it. here panel code: private void panel1_paint(object sender, painteventargs e) { graphics g = panel1.creategraphics(); } and button : private void rectangle_btn_click(object sender, eventargs e) { rectangle r = new rectangle(); int retval = r.draw(g); } but has error , not recognize g . how should make work? you need declare graphics object globally: private graphics g; private void panel1_paint(object sender,

How to get the arclen between two curve points in Maya? -

in maya 2015, can arclen of curve using command: cmds.arclen('bezier1') but want arclen of 2 points in curve. there anyway this? using maya's api surely best way @scottiedoo said, here function made when didn't know api , gives same results. from maya import cmds def computecrvlength(crv, startparam = none, endparam = none): ''' compute length of curve between 2 given uparameters. if both uparameters arguments set none (default), compute length of whole curve. arguments: - crv = string; existing nurbcurve - startparam = 0 <= float <= 1 or none; default = none; point parameter value, if not none, compute points between startpt , endpt values. - endparam = 0 <= float <= 1 or none; default = none; point parameter value, if not none, compute points between startpt , endpt values. returns: - length of curve between given uparameters - length of curve start startp

c++ - will It evaluate at compile time? (pass const char* as template parametr) -

working example: #include <iostream> #include <boost/preprocessor/config/limits.hpp> #include <boost/preprocessor/repetition/repeat.hpp> /////////////////////////////////////////////////////////////////////////////////////////////// // compile-time c-string processing: /////////////////////////////////////////////////////////////////////////////////////////////// #define _debug_mode_ 1 #define _error_chk_ 1 #define my_nullptr nullptr #ifdef _msc_ver #define __func__ __function__ #else #define __func__ __func__ #endif /////////////////////////////////// // configuration: #define buffer_size 100 // limit: 256 // const char buffer[buffer_size]... // not find symbol name "buffer" abstraction #define empty_char '\0' #define default_msg "3w3a]3aw" /////////////////////////////////// // slice char[] separate char's constexpr __forceinline char getcharat (const char* cstr, unsigned int i, unsigned int l) {

Cumulocity find all pending operations for tracker -

i' writing parser particular acknowledgement message in tracker-agent. when parsed, retrieve pending commands/firmware updates tracker can compare them content of acknowledgement , update relevant operation display accordingly in cumulocity. how can that? example, maybe use operationshelper.getoperationsbystatusandagent() ? how have access operationshelper @ level? edit here i'm going try now: trackerdevice: public iterable<operationrepresentation> getpendingops() { operationfilter opsfilter = new operationfilter().bystatus(operationstatus.pending) .byagent(this.gid.getvalue()); return devicecontrol.getoperationsbyfilter(opsfilter).get().allpages(); } my custom parser: trackerdevice trackerdevice = trackeragent.getorcreatetrackerdevice(reportctx.getentry(pos_imei)); // looking pending operations... (operationrepresentation operation: trackerdevice.getpendingops()) { firmware frm = operation.get(firmware.class); // ...for firmw

amazon xml api returns nothing for GetMyPriceForSKU? -

i'm getting following response getmypriceforsku , <getmypriceforskuresponse xmlns="http://mws.amazonservices.com/schema/products/2011-10-01"> <getmypriceforskuresult sellersku="pskm173" status="success"> <product> <identifiers> <marketplaceasin> <marketplaceid>a21tjruun4kgv</marketplaceid> <asin>b00kxx1w8s</asin> </marketplaceasin> <skuidentifier> <marketplaceid>a21tjruun4kgv</marketplaceid> <sellerid>a106rr772ek7vy</sellerid> <sellersku>pskm173</sellersku> </skuidentifier> </identifiers> <offers> </offers></product> </getmypriceforskuresult> <responsemetadata> <requestid>9d351eda-fdb9-4b0e-a6f7-89cd4c74ed70</requestid> </responsemetadata> </getmypriceforskurespons

qt - QML BusyIndicator while loading a heavy qml file -

i've been trying run busyindicator ( http://doc.qt.io/qt-5/qml-qtquick-controls-busyindicator.html ) while loading qml file ( http://doc.qt.io/qt-5/qml-qtquick-loader.html ), busyindicator doesn't appear. what trying is: 1- user emits "handlerloader(name)", "name" url of next qml page. 2- in "onhandlerloader" run busyindicator. 3- then, change loader source. the problem no matter time spent between steps 2 , 3, busyindicator not appear. moreover, when comment step 3, busyindicator appears correctly. what doing wrong? thanks!! this code: rectangle { visible: true width: 800 height: 480 signal handlerloader (string name) loader { id: pageloader; source: "init.qml"; } busyindicator { id: busyindicator_inicio width: 100 height: 100 anchors.centerin: parent running: false } connections { target: pageloader.item onhan

javascript - Cache Update Dilemma -

we're facing following dilemma. our application requires file included our user's website this: <script src="https://example.com/example.js" async></script> the problem: ttl *.js files set 1 year (.htaccess). has been changed (for example.js). however, clients loaded myfile.js before not bust file until 1 year now. usually, add param force update or change filename. however, these solution won't work in our scenario, since we're not in control of source code (and contacting our many users isn't solution, either). unfortunately, our research on web didn't reveal solutions far. can think of ways handle issue? or, need accept fact setting ttl @ 1 year big mistake? any hints appreciated.

c# - Retrieve Data from a csv file and assign to a SSIS Variable -

good day! importing data csv file assign value in cell c2 variable used in ssis flow. know can done using script task i'm no c# person. appreciate help. enter image description here use record set destination assign valuues obj type variable , later using each loop (for each ado enumerator u can assign values separate variales)

perl - Understanding Arrays of Arrays -

i'm going through documentation of perldsc in section of array of arrays , shows array of arrays looks like @aoa = ( [ "fred", "barney" ], [ "george", "jane", "elroy" ], [ "homer", "marge", "bart" ], ); in next section on lines 1 - 4 shows how generate one # reading file while ( <> ) { push @aoa, [ split ]; } i want learn how create one. created file , had following contents in it. john adam joe rod fred james allison frank jean then used code example create array of arrays #!/usr/bin/perl -w use strict; use data::dumper; @aoa; while ( <> ) { push @aoa, [ split ]; } print dumper(@aoa); when ran code, contents of dumper is $var1 = [ 'john', 'adam', 'joe' ]; $var2 = [ 'rod', 'fred', 'james' ]; $var3 = [ 'allison', 'frank&

Why doesn't Python write to the file? -

i have programmed small password generator can save password , service on file named "password.txt". everytime run program, file remains blank. when delete file , run program again, file "password.txt" created still blank. import random letters = "1 2 3 4 5 6 7 8 9 q w e r t z u o p s d f g h j k l y x c v b n m q w e r t z u o p s d f g h j k l y x c v b n m : ; , . 0".split() def checknumb(string): in string: x = i.isdigit() if x == true: return true def createpassword(): global letters password = "" = 0 passlength = random.randint(7, 10) while < passlength: passletter = random.choice(letters) password += passletter += 1 x = checknumb(password) if x != true: password = createpassword() return password print("what name of service?") service = input() password = createpassword() print(password, "will password for", serv

tesseract - Stop tessseract recognize in Android -

i use tess_two library , need interrupt recognizing(method getutf8text) if goes long. how can it. method stop() dosen't work(( you need use gethocrtext instead of getutf8text if want use stop().

python - formatted output to an external txt file -

fp = open ('data.txt','r') saveto = open('backup.txt','w') someline = fp.readline() savemodfile = '' while someline : temp_array = someline.split() print('temp_array[1] {0:20} temp_array[0] {0:20}'.format(temp_array[1], temp_array[0]), '\trating:', temp_array[len(temp_array)-1])) someline = fp.readline() savemodfile = temp_array[1] + ' ' + temp_array[0] +',\t\trating:'+ temp_array[10] saveto.write(savemodfile + '\n') fp.close() saveto.close() the input file :data.txt has records of pattern: firstname lastname age address i backup.txt has format: lastname firstname address age how store data in backup.txt in nice formatted way? think should use format() method somehow... i use print object in code show understood format() far. of course, not desired results. to answer question: can indeed use .format() method on string template, see documentation https://docs.pyth

How to extend canvas image's background and convert to File object in javascript? -

i need upload png/jpeg image file (image a) in image size browser export new image different size (image b). can see, want keep image a's ratio , fill missing part plain color (eg. white). how do using javascript? edit: sorry bad question. i've edited question adding own code solve problem. work using canvas draw white background first draw uploaded image long fits canvas. use reimg.js capture canvas , download it. however, problem if want use captured image, have upload again. below code not want. so, there better way upload image file, processing code below retrieve file data (file object) without capturing , uploading image again ? // reimg.js window.reimg = { outputprocessor: function(encodeddata, svgelement) { var ispng = function() { return encodeddata.indexof('data:image/png') === 0; }; var downloadimage = function(data, filename) { var = document.createelement('a');

amazon web services - AWS Elastic BeanStalk Docker root file system switch to read-only -

i use docker application running on beanstalk autoscaling. the / file system within docker switch read @ random times. the application generating lot of logs written dedicated volume , 1 doesn't have issue. i tried issue mount -o remount,rw / within container, "permission denied" this happened twice recently, within 48 hours. both times 'fixed' problem redeploying docker image elastic beanstalk. during second redeploy ebs moved our app onto new ec2 instance. problem hasn't recurred since (it's been couple of weeks). our theory error being caused failing disk. kernel can remount file system read-only if corruption detected. (this might fit error saw trying remount file system read-write?). since we've been moved onto new hardware no longer have access old ec2 instance investigate further. leaving comment here in case happens else , can continue investigation.

c# - Why am I getting Bad request in response while reading Fitbit elevation data? -

when hit https://api.fitbit.com/1/user/-/activities/tracker/elevation/date/2016-11-01/2016-11-08.json or https://api.fitbit.com/1/user/-/activities/elevation/date/2016-11-01/2016-11-08.json i status code=400 response: bad request; whereas data other activites eg: distance, steps, calories etc. fetching time series data activity specified in this doc. any appreciated.

javascript - Concatenate date and time string into mongo date object -

i sending 2 fields client side date , time . date in format of yyyy-mm-dd i.e 2016-11-08 , time in format of 05:30 pm or 09:45 am . i want combine these 2 fields , create new field added_datetime , field going inserted inside mongodb , want in form of mongo date object can use searching date. tried random things using moments.js unable want. as mentioned in a similiar question can create date object var date = new date(datestring); the code var startdate = new date("1900-1-1 8:20:00 pm"); which original questioner supplied works in chrome , should work in node since it's same js engine. seems answer question. you can find more on dates in mdn documentation , mongodb documentation.

sql server - T-Sql search by hierarchy -

Image
this question has answer here: select statement return parent , infinite children 2 answers simplest way recursive self-join? 4 answers i using sql server. i have table groups 2 integer columns: megr_key megr_key1 megr_key primary key of group. each group can have sub groups. for example - have group 1195: megr_key = 1195 there subgroups of 1195: megr_key = 9484 megr_key1 = 1195 and megr_key = 7494 megr_key1 = 1195 basically megr_key1 telling, group parent. the problem have is, how find megr_key subgroups hierarchically, given root group name? let's (from previous example) there 1195 root group. there 2 subgroups: 7494 , 9484. now, 2 subgroups can parent groups other groups. so, have find rows megr_key1 = 7494 or megr_key1 = 9484. how find su

javascript - react isomirphic-fetch promise chaining -

okay, understood promise chain works keep returning promise inside previous promise response function: somepromise.then(function(response){ return anotherpromise(response.data); <- promise returning function }).then(function(response){ return yetanotherpromise(response.data); <- promise returning function }).then(function(response){ itisdone(response.data); }).catch(function(err){ someerrorhandling(err); }); if of promise returning function remove chain no continue. , yet today proved me wrong when did in react isomorphic-fetch. inside auth service; login: function (email, password) { let promise = fetch('http://localhost:3000/auth/login', { method : 'post', body : json.stringify({email, password}), headers: { 'content-type': 'application/json' } }); promise.then(function (res) { if (validator.isjson(res)) return res.json(); }).then(function (pa

PHP Unit Testing: How can we pass multiple parameters while mocking a method? -

$observer = $this->getmockbuilder('apps_sample_datahandler') ->disableoriginalconstructor() ->disableoriginalclone() ->disableargumentcloning() ->getmock(); $observer->method('getsampledata') ->will($this->returncallback('mocktestcall')); $this->assertequals('foo', $observer->getsampledata()); here trying mock method 'getsampledata' 'mocktestcall'. we wanted know how can pass parameter method 'mocktestcall'. definition method 'mocktestcall' given below: public function mocktestcall($arg1){ return $arg1; } for php >= 5.4: $observer->method('getsampledata') ->will($this->returncallback( function() { $this->mocktestcall('arg1_value'); } )); for php 5.3: $that = $this; $observer->method('getsampledata') ->will($t

excel vba - Highlight cell values starting with the same 'n' chars -

i need highlight(in column) cell values starting same 'n' chars. find 'highlight duplicates' code , inserted left function on activecell: each cl in rng if worksheetfunction.countif(rng, left(cl.value, 4)) > 1 cl.interior.colorindex = 6 end if next cl but doesn't work because incompatibility of left , countif. solution insert new column calculates first n chars, apply original loop on it. wonder if exists more elegant idea :) thank you. does want? * wild card. if worksheetfunction.countif(rng, left(cl.value, 4) & "*") > 1

SQL Server 2008 version of OVER(... Rows Unbounded Preceding) -

looking in converting sql server 2008 friendly can't work out. i've tried cross applies , inner joins (not saying did them right) no avail... suggestions? what have table of stock , table of orders. , combine 2 show me pick once stock taken away (see previous question more details more details ) with advpick (select 'a' placea, placeb, case when picktime = '00:00' '07:00' else isnull(picktime, '12:00') end picktime, cast(product int) product, prd_description, -qty qty t_pick_orders union select 'a' placea, placeb, '0', cast(code int) product, null, stock t_pick_stock), stock_post_order (select *,

ruby - Encoding JWT key for APNS using rails RPUSH gem -

i want use jwt key send push notifications i searched libraries implementing jwt token standard: https://jwt.io/ so found ruby-jwt gem: https://github.com/jwt/ruby-jwt but seems can't create key structure required apple: { "alg": "es256", "kid": "abc123defg" } { "iss": "def123ghij", "iat": 1437179036 } also, how should use apns auth key (.p8 mime-type) generate jwt token? any advices welcome update ok, found out, possible add custom fields header https://github.com/jwt/ruby-jwt/pull/8/files anyways, how should use apns auth key? rpush gem supports jwt tokens? here ruby gem new p8 format uses http2 , jwt https://github.com/andrewarrow/p8push

filestream - Sharepoint document library storing files on filesystem -

i'm in bit of trouble here. here context: one of our customers asked develop alternative solution storing documents of document library in content database content database growing fast. provided network storage documents stored in filesystem instead. after googling bit, i've found feature called remote blob storage rbs rbs , references say, per content database feature not acceptable context. other option i've come use of spitemeventreceiver in itemadded event save spfile associated listitem of spitemeventproperties property filesystem , possibly delete or truncate spfile object public static void deleteassociatedfile(spweb web, splistitem item) { try { if (item == null) { throw new argumentnullexception("item"); } if (item.filesystemobjecttype == spfilesystemobjecttype.file) { web.allowunsafeupdates = true; using (var filestream = item.file.openbinarystream()) {

ios - Q: Search Bar and Search Display Controller in storyboard with swift and Xcode8.0 crash at Appdelegate -

Image
storyboard layout below: this demo, , don't know error comes out. in viewcontroller : import uikit import foundation class viewcontroller: uiviewcontroller { @iboutlet weak var tableview: uitableview! @iboutlet var searchdisplay: uisearchdisplaycontroller! // 所有组件 var ctrls:[string] = ["label","button1-初级","button1-高级","button2-初级","button2-高级","switch"] // 搜索匹配的结果,table view使用这个数组作为datasource var ctrlsel:[string] = [] override func viewdidload() { super.viewdidload() // 起始加载全部内容 self.ctrlsel = self.ctrls // 注册tableviewcell self.searchdisplay.searchresultstableview.register(uitableviewcell.self, forcellreuseidentifier: "swiftcell") // 设置文本提示 self.searchdisplay.searchbar.placeholder = "输入搜索信息" // 可以设置初始值 //self.searchdisplay.searchbar.text = "b" // 设置搜索栏提示信息 self.searchdis

projectFilesBackup folder in android studio project for latest version -

if update android studio latest version , update plugin well. folder named projectfilesbackup created when open our old android studio project in latest android studio version. my question why folder created, why , how long should keep folder in our project folder? when accepted continue in convert project dialog, intellij created file. intellij idea old versions of project files projectfilesbackup folder within project, return old project version replacing project files old ones. if project working correctly, can delete file. https://www.jetbrains.com/help/idea/2016.2/convert-project-dialog.html

vue.js - How to listen for changes in state object loaded from API? -

if set state object this: const state: { tools: { tool1: { status: true. state: }, tool2: { status: false. state: 1 } } } on view side changing correctly when change example status using mutation. but if set tools using api response: state.tools = response.tools; where response 100% identical nothing happens. state object has changes can seen in vue debuger. so have tried add const state: { tools: { tool0: { status: true. state: } } } and added tool1 , tool1 ajax (so object had 3 child element tool0, tool1, tool3). if trigger change on tool1 or tool2 (loaded ajax) nothing happened. when trigger change on tool0 (hardcoded before) works fine - in case settings set on ajax loaded content applied. thanks hint! did try set state using vue.set ? ref: https://vuex.vuejs.org/en/mutations.html from

javascript - Mottie keyboard when click on any button trigger the input box -

i using mottie keyboard https://github.com/mottie/keyboard project.i trying trig keyup event of input box whenever button clicked in virtual keyboard. below code... <div class="block" id="autocomplete"> <input class="text" type="text" placeholder="name" ng-keyup="searchbyname()" ng-model="uname" name="uname" autocomplete="off"><i class="fa fa-keyboard-o icon" aria-hidden="true"></i> </div> below keyboard js code $('.text').keyboard({ layout: 'qwerty' }); below keyup function searchbyname() csi.controller('searchctrl', ['$scope', function($scope) { $scope.searchbyname=function(){ var uname=angular.element('.uname').val(); alert(uname) } so, i'm not able uname in function. kindly suggest me tips or tell me i'm misleading here. thank in advance

javascript - Calling element.focus() in iframe scrolls parent page to random position in Safari iOS10 -

safari on ios 10.1.1 seems have bug when setting focus on element inside iframe. when call element.focus() on element inside iframe, safari scroll parent page down , move focussed element off-screen (instead of scrolling focussed element view). however, happens if element in iframe taller device screen height (shorter iframes ok). so if there 2 elements, 1 @ top of iframe , 1 further down page, first focus fine second 1 jump off-screen when set focus. to me looks safari trying scroll element view maths wrong , end scrolling random position further down page. works ok in ios9 think new bug in ios10. is way of preventing parent page scrolling or other way of avoiding bug? i've put one-page gist replicates issue on ios 10 devices or simulator. here a url can use on phone: goo.gl/qyi7oe here's plunker can check desktop behaviour: https://embed.plnkr.co/d61ktglzbvtvydz4amqb/ and gist version of plunker: https://gist.github.com/coridyn/86b0c335a3e5bf72e8858995

Arduino to Sim900 wiring -

i need help. newbie in here want create communication between arduino , sim900 gsm/gprs module, still confuse wiring there 2 type wirings in sim900 arduino, hardware serial wiring , software serial wiring. 1 have use ? hardware serial wiring or software serial wiring thanks i think sim900 has i2c interface. if using arudino-uno, hardware serial port used communicate pc, therefore, use i2c interface. see "wire" https://www.arduino.cc/en/reference/wire library examples.

java - JPA: How to handle multiple Entities -

Image
i'm new jpa , have question how handle entitites. in case have 3 entities: user, group , event. event belongs group. means there onetomany-relation. user can subscribe multiple groups means there manytomany-relation. part i'm having troubles. user can subscribe multiple events means there manytomany-relation. code: user @entity public class user { @id @generatedvalue private integer id; @embedded @onetoone @joincolumn(name = "company_location") private companylocation companylocation; @manytomany(fetch = fetchtype.lazy) @jointable( name = "user_group_subscriptions", joincolumns = @joincolumn(name = "user_id", referencedcolumnname = "id"), inversejoincolumns = @joincolumn(name = "group_id", referencedcolumnname = "id")) private list<group> subscribedgroups; ... } group @entity public class group { @id @ge