Posts

Showing posts from September, 2010

android - FCM - Get Message Label -

Image
to send message fcm backend, have view : i wanna message label ( libellé du message ) remotemessage . when debug field, content in message labeled google.c.a.c_l , think internal field. first, wonder same question. after read document here , played around it, found that: you cannot message label on client device, because label display on firebase console only. to title @ client side, have use advanced options auto collapse @ bottom. advanced options, can send data payload client key/value. then remotemessage.getnotification().getbody() notification's message body (from message text/texte du message), remotemessage.getnotification().gettitle() notitifcation's title (from advanced options), remotemessage.getdata() data payload (from advanced options).

excel vba - Replacing strings in a column sequentially -

i naive macros. have data in column 500 rows of data. note rows blank in between. data image files names (x0011@00.jpg). need rename them sequentially user input. user input must 400500. new name must (400500_image-1.jpg). _image-1, _image-2 , on must generated automatically in sequence omitting blank rows. see below how data displayed in column , how want in column b. i appreciate if can provide macro this. col col b x0011@00.jpg 400500_image-1.jpg x0021@00.jpg 400500_image-2.jpg x0041@00.jpg 400500_image-3.jpg x0071@00.jpg 400500_image-4.jpg x0051@00.jpg 400500_image-5.jpg x0031@00.jpg 400500_image-6.jpg x0061@00.jpg 400500_image-7.jpg x0091@00.jpg 400500_image-8.jpg thanks sub naming() rowstoprocess = range("a" & rows.count).end(xlup).row j = 1 userinput = inputbox("give me text") = 1 rowstoprocess if not cells(i, 1).value = "" cells(i, 2).value = userinput & "_image-

linux - Can tmux save commands to a file, like .bash_history? -

does tmux support saving file commands typed in "c-b :" mode ? i'd rather through ones typed have each command in man page. there history-file option looking for. history-file path if not empty, file tmux write command prompt history on exit , load on start. add .tmux.conf set -g history-file ~/.tmux_history note added in 2.1 version. if have older version of tmux read https://unix.stackexchange.com/questions/26548/write-all-tmux-scrollback-to-a-file

javascript - Angular2 bind ngModel from ngFor -

Image
so i'm rendering textarea dynamically using ngfor i'm not sure how can pass ngmodel bind in function. <div *ngfor="let inputsearch of searchboxcount; let = index" [ngclass]="{'col-sm-3': swaggerparamlength=='3', 'col-sm-9': swaggerparamlength=='1'}"> <textarea name="{{inputsearch.name}}" id="{{inputsearch.name}}" rows="3" class="search-area-txt" attr.placeholder="search product {{inputsearch.name}}" [(ngmodel)]="inputsearch.name"></textarea> </div> textarea example: textarea render based on length of response api call in case searchboxcount searchboxcount.length , if length = 1 render 1 textarea if 3 show 3 textareas . objs have different names (example: id/email/whatever), ngmodel based on obj name json object. how bind inputsearch.name function getquerystring() getquerystring() { this.isloading = true;

JavaScript: Module architecture suggestions -

i wanna create website have left side search filter option panel, sort through data on website. i thinking using revealing module pattern. but should create module each filter options have there own filter logic -and create init module render selected filters? what best module architecture in situation ? ? thanks in advance. no need use modules that. keep simple. just use simple functions implement same "interface" (though there no concept of "interface" in js unless use typescript or similar language). you can use library such lodash give lot tools define such kinds of functions , manipulate , compose them. that implementation of filter functions though. application bit more complex that, may want check out how structure code of application if new you. mvc pattern start, bigger applications there other architectures may more suitable , want use framework react/redux or angular implement them properly.

Server 2012 r2 and mysql -

Image
i have dell power edge t630 machine server 2012 r2 installed. trying install mysql 5.5 win 32. server instances configured except "apply security settings" fol screen appears whats wrong? try changing root password: mysqladmin -u root password [newpassword] and login new password.

c# - How to catch a custom FaultException in WCF -

i testing wcf potentially implementing api remote controlling device runs our controller-software (c#/.net 4.6.1) on windows. i trying figure out how throw , catch faultexception service , catch .net client. the problem having when running code (in debug-mode on vs 2015), exception not caught client, vs ends showing me exception inside vs @ code-location of service ( service.cs ), being thrown. exception message is: an exception of type 'system.servicemodel.faultexception`1' occurred in wcfservice.dll not handled in user code additional information: argument value not 1 where the argument value not 1 custom message provide me. here relevant parts of code. hope can spot, doing wrong: iservice.cs : [servicecontract(callbackcontract = typeof(imyevents))] public interface iservice { [operationcontract] [faultcontract(typeof(invalidvaluefault))] string throwsfaultifargumentvalueisnotone(int value); ... } [datacontract] public class inval

python - How I set default value to zope.schema.datetime? -

i codding product using python dexterity type, , have 1 field shema.datetime (see below), , want set default date time when form create in plone. i tried using zope datetime , python datetime, , don't work. in docs zope schema don't have examples this. # i'm tried use options datetime datetime import datetime # datetimenow = datetime() # datetimenow = datetime().asdatetime() # , tried use datetime import datetime datetimenow = datetime.datetime.now() class idigitalfile(model.schema): ... uploded_at = schema.datetime( title=_(u"data de upload"), required=true, defaultfactory=datetimenow, ) so, how set default value in case? the solution using python datetime, , not zope datetime, see code: from datetime import datetime ... def nowdatetime(): return datetime.today() ... directives.mode(uploded_at="hidden") uploded_at = schema.datetime( title=_(u"data de upload"), required=t

docker - How can I import a library from github to GO playground? -

hi want import 3rd party library go playground, saw answer question: https://stackoverflow.com/a/27813778/6638204 said can not done, xiam/go-playground library on github states can this. tried using did not understand should do. installed library , used run programs not need third party libraries. did not how can import third party library. ps: have docker installed in machine the answer still same: can't on "official" go playground (at https://play.golang.org/ ). if or else runs custom, modified version of go playground: answer can there whatever allowed, may include usage of external libraries custom engine may go get prior compilation , execution. also see related question: which packages may imported in go playground?

java - mapping text to buttons from within a method -

i'm in stages of developing android app, , i'm trying settext buttons within method. doing not in method fine, want call method on , over. when try create method this, "non-static method findviewbyid(int) cannot referenced static context" error. eg: button button = (button) findviewbyid(r.id.button); button.settext(options[0]); the findviewbyid red highlighted package com.example.lp1; import android.support.v7.app.appcompatactivity; import android.os.bundle; import android.view.view; import android.widget.button; import android.widget.textview; import java.util.arraylist; import java.util.arrays; import java.util.random; public class mainactivity extends appcompatactivity { private button button; private button button2; private button button3; private button button4; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); int score = 0; int count = 3;

r script to reshape and count columns within dataset -

hi have dataset of freshwater fish in range of sites, repeat monthly visits on many years. each row has species found, total , status (i.e. positive or negative test result). sample_id site coll_date species tot inf_status 382870 site 1 27/10/2007 species b 1 positive 382872 site 2 27/10/2007 species d 1 positive 487405 site 3 28/10/2007 species 1 positive 487405 site 3 28/10/2007 species 1 positive 382899 site 4 03/11/2007 species 1 positive 382900 site 5 03/11/2007 species 1 positive 382901 site 5 03/11/2007 species 1 positive 382902 site 6 03/11/2007 species 1 positive 382903 site 7 09/12/2007 species b 1 positive 382904 site 8 05/02/2008 species c 9 negative 382905 site 8 05/02/2008 species 13 negative 382906 site 9 14/02/2008 species 1 positive 382907 site 9 14/02/2008 species 1 positive i need reformat data there 1 row per site visit (i.e. in given site name , date combo) colu

H2 Database Primary Key on Create -

if create new tabel in h2 database this... create table mainincomer(timestamp timestamp, value real); it means id hidden , auto increment when write tabel, right? - (as far have learnt tutorial , features) will primary key assigned id automatically ? , how important primary key anyway in type of table 2 columns? or should best practice create table primary key assigned timestamp? create table mainincomer(timestamp timestamp primary key, value real); thanks, alex no: table not have id column, it's not listed in ddl create table . the simplest way know adding such auto incrementing column used primary key id identity . careful it's specific h2 , not portable. but it's shorter other database :-d please change ddl full line: create table mainincomer(id identity, timestamp timestamp, value real); you can test inside h2 web console this: @loop 1000 insert mainincomer (timestamp) values (now()); this insert 1000 records , you'll see id de

Group by 5 minute interval cakephp -

Image
select timestamp, name, count(b.name) time a, id … group unix_timestamp(timestamp) div 300, name i have above table , want count created_at column group 5 minutes interval of created_at , count create_at column 2016-09-01 16:21:29 2016-09-01 16:26:29 you have use floor() function unique integer every 5 minute select timestamp, name, count(b.name) time a, id … group floor(unix_timestamp(timestamp)/300)

javascript - Display the total count of json key-value pairs in the series in high charts -

i have json array whic has key status , 2 value pass , rescan. need display percentage of pass , rescan based on total counts in highcharts. have given hard coded values 2 , 1 in series section of code. below highcharts code: $(function () { // make monochrome colors , set them default pies highcharts.getoptions().plotoptions.pie.colors = (function () { var colors = [], base = highcharts.getoptions().colors[0], i; (i = 0; < 10; += 1) { // start out darkened base color (negative brighten), , end // brighter color colors.push(highcharts.color(base).brighten((i - 3) / 7).get()); } return colors; }()); // build chart $('#container').highcharts({ chart: { plotbackgroundcolor: null, plotborderwidth: null, plotshadow: false, type: 'pie' }, title: { text: 'authent

java - Delete row and delete table lock oracle -

i have 2 query 1. delete x; 2. delete x y='a' what type of lock oracle 11 g provide above query? and suppose iterate below query in program delete x y='$a' let have list of number 1,2,3,4.. if same program called 2 server 1 server delete 1,3... , other server delete 2,4...? 1) since there no clause, rows locked in table user session. 2) rows matching clause locked. oracle uses row level locking setting lock bit in data block row. unless , until commit issued - no other session see these deletions. oracle use rollback information - created each separate delete (or dml operation) statement provide read consistent view other session. meaning: other sessions see table without deletions. once rows locked - other sessions prevented issuing delete against rows , user blocked, waiting rows committed or rolled back. can test 2 sqlplus sessions. if want know more locks, @ tom kyte's excellent book, expert oracle db architecture. yes, 2 differen

ruby on rails - if I have 2 models can I sort them both at once? -

let's have image model , video model how can display them both in index date i going take torch here. :) sergio means this: class media < activerecord::base belongs_to :image belongs_to :video end then can sort/filter/paginate easily @media = media.where('created_at > ?', 2.days.ago).order(:id) just don't forget create corresponding media record when add new image/video image = ... media.create(image: image)

How To Connect A Azure Sql Server 2012 Database From Localmachine -

Image
i want connect sql server management studio running locally azure sql server 2012 database now have enable sa account on sql server side , check server name running query -- select @@servername i got output msrv01\sqlserver now local machine when trying loginto azure sql server -- it retun error do 1 have idea doing wrong here ! unless local machine on same domain (or subnet) azure vm accessing via machine hostname never work. if using azure hosted database (i.e. not vm) in management portal , navigate database settings panel. @ top listed server name url xxxxxxxx.database.windows.net . use connect database in ssms. further reading: https://azure.microsoft.com/en-gb/documentation/articles/sql-database-connect-query-ssms/

c++ - Qt slot from thread called more than once -

this question has answer here: slot being called multiple times every time signal emitted 1 answer qt signals , slot connected twice… happens? 3 answers i have created class calculationmanager has public slot process() emitting signal finished(). void calculationmanager::process() { cout << "calc fft: process()" << endl; ... emit finished(); } this used qthread gui (calculationmanager qscopedpointer) void mainwindow::on_pushbuttonstartfft_clicked() { cout << "on_pushbuttonstartfft_clicked()" << endl; ... calculationmanager->movetothread(thread); connect(thread, signal (started()), calculationmanager.data(), slot (process())); connect(calculationmanager.data(), signal (finished()), thread, slo

clearcase - type manager error while using clearfsimport -

while copying directories local vob using clearfsimport, starting type manager errors below.is there solution handle issue. clearfsimport: error: unexpected value (2) returned type manager "_html2" clearfsimport: error: unexpected value (2) returned type manager "_xml2" from this technote (for text , not html), this error occurs because source container associated version missing or unavailable or because cleartext cannot created successfully. try also, this technote , , test on 1 file using cleartool chtype : cleartool unco <filename> cleartool chtype text_file <filename> then try again clearfsimport , , see if specific file still generates same error.

asp.net mvc - EntityFrameworkCore FromSql method call throws System.NotSupportedException -

so using aspnetcore 1.0 efcore 1.0, both latest releases far aware. executing query delete object using fromsql method on dbset throws exception. both code , exception below. public void deletecolumn(int p_columnid) { int temp = p_columnid; string query = "delete columns id = {0}"; var columnslist = m_context.columns.fromsql(query, p_columnid).tolist(); foreach (columns c in columnslist) { m_context.columns.remove(c); } m_context.savechanges(); } after executing fromsql call, following exception an exception of type 'system.notsupportedexception' occurred in remotion.linq.dll not handled in user code additional information: not parse expression 'value(microsoft.entityframeworkcore.query.internal.entityqueryable`1[aspnet5_scrum_tool.models.columns]).fromsql("delete columns id = {0}", __p_0)': overload of method 'microsoft.entityframeworkcore.relationalqueryableextensions.fromsql' not supported.

angularjs - How to remove/hide focus-part of nvd3 LineWithFocusChart -

im using linewithfocuschart in angular nvd3 webapp this one . have use of hiding/showing bottom-part of diagramm dynamically. there option or have replace linewithfocuschart usual linechart , vice versa when needed? in same page have linked , can see focusenable controls display of bottom part.

python - Iteration in one line of code -

i noob in python , think have relevant question. i have 2 lists in python : in lista have column names of mysql table. lista = ["columna","columnb","columnc"] in listb have result of query values listb = [["10","30","40"], ["14","28","38"], ["13","23","45"]] what efficient way in python produce output this? columna = 10, columnb = 30, columnc = 40 columna = 14, columnb = 28, columnc = 38 columna = 13, columnb = 23, columnc = 45 a list of dictionaries work well: >>> [dict(zip(lista, row)) row in listb] [{'columna': '10', 'columnc': '40', 'columnb': '30'}, {'columna': '14', 'columnc': '38', 'columnb': '28'}, {'columna': '13', 'columnc': '45', 'columnb': '23'}] >

reactjs - How can I turn a string with style information into Text Components? -

for example, have string: "wherefor art <strong>thou</strong> mr. <strong>fancypants</strong>" i need turn react-native text components , render() method. string transformed into: <text>where art <text style={{ fontweight : 600}}>thou</text> mr. <text style={{fontweight: 600}}>fancypants</text>; so render method looks this: render() { let text = "wherefor art <strong>thou</strong> mr. <strong>fancypants</strong>"; return ( <view style={{marginbottom : 20}}> <text>{this.filterhtml(text)}</text> </view> ) } and tried turning text components, doesn't work: filterhtml = (text) => { if (text) { return text.replace(/<strong>([^<]*)<\/strong>/g, "<text style={{fontweight : 600}}>$1</text>") } return text; } not surprisingly ends happening literal string being rendered inside <

c++ - How to display values from lists in a UI QML (QT) inside a Repeater -

i've been facing issue days without coming conclusion, hope give me useful hints solve it. i'll try simplify issue example: in c++ code defined class myobjectmodel act later model in repeater block in main ui.qml file. myobjectmodel visible qqmlapplicationengine. myobjectmodel has 2 attributes (lists) : xcoordinateslist , ycoordinateslist. represent x , y pixel coordinates of list of points. i.e. xcoordinateslist = [100, 200], ycoordinateslist = [10, 20] mean logically have 2 points following pixel coordinates want display on screen: (100,10), (10,20). the xcoordinateslist , ycoordinateslist roles of model qml engine . means instance in common .qml file can print content of xcoordinateslist typing: component.oncompleted { console.log("x coordinates: ",xcoordinateslist); } the question is: how can display @ same time list of points on screen? if want display 1 dot (so 1 couple of coordinates) code works. don't know how extend make print

php - how to filter meta tags from xss -

at cms want give site moderators ability associate meta information page. meta keywords , description have different fields other stuff inserted raw html, this: <meta name="generator" content="drupal 7 (http://drupal.org)" /> <meta name="robots" content="nofollow" /> <link rel="canonical" href="http://example.com/content/poisk-i-upravlenie-kontentom" /> mainly meta tags , link(rel=canonical) here. , think have make sure there no xss attack in code. htmlpurifier or http://github.com/voku/anti-xss don't work meta tags. advise me? parse text regexp meta tags , check every metatag found style or on attributes or http-equiv="refresh" (to deny malicious metatag)?

jquery - How can I recognize Safari version in javascript? -

this question has answer here: how can detect version of browser? 20 answers can recognize version of safari browser in js or jquery? not looking webkit version version of safari (for example: 5.1.7). i need hide element safari less v7 :( this hack worked out combining multiple other hacks 6.1+: /* safari 6.1+ (9.0 latest version of safari @ time) */ @media screen , (min-color-index:0) and(-webkit-min-device-pixel-ratio:0) { @media { .safari_only { color:#0000ff; background-color:#cccccc; } }} below hacks separate 6.1-7.0, , 7.1+ these required combination of multiple hacks in order right result: /* safari 6.1-7.0 */ @media screen , (-webkit-min-device-pixel-ratio:0) , (min-color-index:0) { .safari_only {(; color:#0000ff; background-color:#cccccc; );} } here 1 safari 8 , newer: /* safar

office365 - Office.context.document.url still empty after saving the file -

i'm developing office task pane add-in microsoft project , bumped serious limitation. after creating new project file, load task pane app, has subfunction, reads office.context.document.url property, should have full path file. obviously, @ first, it's empty, because it's unsaved project, after save project, , fire subfunction again, url still empty. i suppose, document object not reloaded @ point during saving. how can manually? if it's possible... here's subfunction returns project path: function getprojectpath() { var documenturl = office.context.document.url; if (documenturl == null || documenturl == "") { return ""; } else { return documenturl; } } this question project, not support method, have dynamic access file url word, excel , ppt, recommend use getfilepropertiesasync method. here sample on how use it: function getfileurl() { //get url of current file. offic

javascript - how to Validate captcha before submit a form in joomla -

i have installed 5 captcha plugin in joomla site , set 1 captcha out of 5 in com_users configuration in backend of joomla. so want validate captcha client browser in registration form. client side validation every captcha client browser if using google's recaptcha default plugin joomla!, validation done off site , pass or fail "flag" returned form...no further action needed you.

linq - C# -Closure -Clarification -

i learning c#.can mean closure a construct can adopt changes in environment in defined. example : list<person> gurus = new list<person>() { new person{id=1,name="jon skeet"}, new person{id=2,name="marc gravell"}, new person{id=3,name="lasse"} }; void findpersonbyid(int id) { gurus.findall(delegate(person x) { return x.id == id; }); } the variable id declared in scope of findpersonbyid() t still can access local variable id inside anonymous function (i.e) delegate(person x) { return x.id == id; } (1) understanding of closure correct ? (2) advantages can closures? yes code inside of findpersonbyid taking advantage of closure using parameter id within lambda expression. strictly speaking definitions of closures bit more complex @ basic level correct. if want more information on how function encourage read follow

javascript - NodeJS Passport Authentication - always redirected to failure url -

i redirected failure url irrespective of login details, nothing logged on console , showing no errors. ideas why happening? login jade extends layout block content h1 login p please login below form(method='post', action='/users/login',enctype='multipart/form-data') .form-group label username input.form-control(name='username', type='text', placeholder='enter username') .form-group label password input.form-control(name='password', type='password', placeholder='enter password') input.btn.btn-default(name='submit', type='submit', value='login') user.js var express = require('express'); var router = express.router(); var multer = require('multer'); var uploads = multer({ dest: './uploads' }); var passport = require('passport'); var localstrategy = require('passport-local').strategy; var user = requ

javascript - Geolocation in Safari 9 always returning Position Unavailable -

i'm building app need user's location. have click event attached button, calls navigator.geolocation.getcurrentposition(getvenues, handleerror); this works expected on chrome , firefox, , getvenues function run after grant access location. on safari, after granting access handleerror function called. this happens on both local , production server, both of use https. computer on wifi connection. safari version 9.1.2 (11601.7.7). have looked through of other posts related geolocation in safari , none of solutions have worked far. i have tried passing options getcurrentposition increase timeout , maximumage no luck. here's full code example: $("#nearby-find").on('click', function() { navigator.geolocation.getcurrentposition(getvenues, handleerror); }); var getvenues = function(position) { console.log(position); }; var handleerror = function(error) { console.log(error); } clicking button initiates geolocation access request after

ios - EXC_BAD_INSTRUCTION in Swift when loading a WebView -

i followed tutorial make web view on ios app , don't errors. however, when build app test on simulator, error: exc_bad_instruction (code=exc_i386_invop, subcode=0x0) here viewcontroller.swift import uikit class viewcontroller: uiviewcontroller { @iboutlet var webview : uiwebview! var urlpath = "http://google.com" override func viewdidload() { super.viewdidload() loadaddressurl() } override func didreceivememorywarning() { super.didreceivememorywarning() // dispose of resources can recreated. } func loadaddressurl(){ let requesturl = nsurl(string:urlpath) let request = nsurlrequest(url:requesturl!) webview.loadrequest(request) } } when run app webview.loadrequest(request) marked in red , displays error. in debugger "fatal error: unexpectedly found nil while unwrapping optional value" you sure made mistake in connection uiwebview storyboard/xib co

javascript - Large data set causing custom search box to lag jquery datatables -

when testing data table 60,000 rows , 6 columns (defer render turned on), encountered lag when typing in custom search box (not default search datatables provides). clarify, happening start type in "zuz" custom search box, after typing in "u", should take second appear , not appear instantaneous. basically, current code has search , re-draw after each keyup event. searchboxonkeyup: function(e) { var table = this.getcurrenttable(); table.search($(e.target).val()).draw(); } i think what's happening table draws before next character input next character takes longer show in search box. i've used built in search box , has no problem dealing 60,000 rows , showing input without lag. reason can't use default built in search box because ui design has search box in different location other controls next (ex: select , checkbox) what have tried far throttling draw action: var search_term = $(e.target).val(); var search = $.fn.datatable.util

IIS URL Rewrite Rules for Subdomain Routing in ASP.NET MVC 5 -

i have web application written in asp.net mvc 5 contains information users. create profile page each of users accessible subdomain of web site (e.g. user1.example.com , user2.example.com , ...). i want these subdomains accessible on http, while rest of application must require https used. i run web application on iis figured best if used url rewrite rules rewrite user1.example.com example.com/profile/index?name=user1 , web application wouldn't have know subdomains being used. came these rewrite rules: <rewrite> <rules> <clear /> <rule name="rewrite user subdomains query string" stopprocessing="true"> <match url="^(.+)" /> <conditions> <add input="{http_host}" negate="true" pattern="^www\.example\.com$" /> <add input="{http_host}" pattern="^([^.]+)\.example\.com$" /> </conditions> <action

c++ - Cannot totally compile and link cpp project as a static library -

i have followed link , adapted steps make work project. my goal create libfile.a distribute static library. project tree following: project | +-src +- <some cpp , hpp files> | + containers | +- <other cpp , hpp files> i created configure.ac file , makefile.am s. tree structure changed way: project | +- configure.ac +- makefile.am +-src +- <some cpp , hpp files> + makefile.am | + containers | +- <other cpp , hpp files> now, when go: (*) aclocal; autoreconf --install; autoconf; ./configure make .o files generated .*pp files contained in src , fails when starts generating targets in src/containers . makefile not generated properly. doing wrong? can me? ps here there files involved: # --- configure.ac --- ac_prereq([2.68]) ac_init([filea], [1.0], [dev@host.net]) am_init_automake([filea], [1.0]) ac_config_srcdir([src/hashfunctio

networking - Meteor app stuck at loading on the client browser, clear cache needed -

Image
every , then, meteor application seems fail @ loading browser. switching incognito mode or clearing cache , cookies seems fix issue, can't understand why happens when don't change on server side. i attached network log, , last step seems take forever. things tried server side meteor rebuild command , deleting under .meteor/local except db folder. thank you

tvos - Programatically addTarget action to UIButton -

i tested ton of samples none of them works me. here code: override func viewdidload() { super.viewdidload() let button = uibutton(frame: cgrect(x: 100, y: 100, width: 200, height: 50)) button.backgroundcolor = .green button.settitle("test button", for: .normal) button.titlelabel?.sizetofit() button.addtarget(self, action: #selector(viewcontroller.buttontapped(_:)), for: .touchupinside) self.view.addsubview(button) } func buttontapped(_ sender: uibutton) { print("button tapped.") } what missing? well, following this answer issue .touchupinside . in tvos should .primaryactiontriggered . button.addtarget(self, action: #selector(viewcontroller.buttontapped(_:)), for: .primaryactiontriggered)

css - How can I change size of input control in metro ui? -

how can control size of inputs in metro ui framework? bootstrap has class form-group-sm guess, have metroui similar ? metroui isn't featured bootstrap has simple options inputs : <!-- checkbox --> <label class="input-control checkbox"> <input type="checkbox" checked> <span class="check"></span> <span class="caption">checkbox</span> </label> <!-- small checkbox --> <label class="input-control checkbox small-check"> <input type="checkbox" checked> <span class="check"></span> <span class="caption">checkbox</span> </label> <!-- radio button --> <label class="input-control radio"> <input type="radio"> <span class="check"></span> <span class="caption">radio</span> </label> <!

bash - Finding a symbolic link when you don't know what directory it is in? -

i created symbolic link open files sublime 2 terminal using subl file.txt i have upgraded sublime 3 , looking change link point new version of sublime. i cant seem find link anywhere though. there way show file location using symbolic link? use which subl show system thinks subl is.

python - linear model ordinary least square vs Ridge -

i getting confused when reading scikit-learn documentation , trying compare logisticregression ridgeclassifier. both implementations compute least squares solution using singular value decomposition. while ridgeclassifier uses ridgeregression , therefore imposes l2 regularization, difference logisticregression when penalty set l2 default value

botframework - MicroSoft bot Framework CardAction Buttons were not looking proper in WebChat window -

i working on chatbot using microsoft bot framework , planning embed same website webchat. have used cardactions attachment. these getting displayed in bot emulator, not looking proper(please see example buttons below) in webchat window. (button text 1) button value 1 (button text 2) button value 2 (button text 3) button value 3 is expected behaviour? how can have proper buttons in webchat in facebook / skype bots buttons not supported web chat channel @ moment. true not cards only, prompts well. believe, bot framework team has feature in backlog. meanwhile, if critical project, please consider implement own web chat control using direct line api .

angular - Angular2 - how to trigger an event from the app component to a route -

i new angular2 (haven't had experience angular1) , working on small website. need pretty straight forward. in template of appcomponent, there 2 buttons language selections. have route, let's /products, display list of products retrieved ws (http via service). when press 1 of language buttons, need products list refreshed. make http.get request in productsservice class, , subscribe observable in productscomponent class. how trigger request appcomponent, while still receiving subscription in productscomponent? any appreciated based on description, 2 things. add productcomponent viewchild in appcomponent import {viewchild} '@angular/core'; export class appcomponent{ @viewchild(productcomponent) productcomponent; public reloadproduct(): void { this.productcomponent.reloadproduct(); } } store product information in productservice class in variable. when press language button, call web service , new product , store in productservice cl

Device not recognize by new update of android studio -

i updated android studio version 2.1.3, , i'm having issues kindle fire. kindle not being recognize android. not listed under "connected devices". problem started when decided install android canary 2.2.c. when started giving me issues decided downgrade stable update, problem still remains. kindle updated recently, don't know if can affect. kindle using fire os 5.3.1 system. any ideas of be? or how solve it? thank time. i found problem. following instructions here enabling adb see kindle fire: https://developer.amazon.com/appsandservices/resources/development-tools/ide-tools/tech-docs/05-setting-up-your-kindle-fire-tablet-for-testing my kindle fire updated well, , reason reset configuration disable adb access. went settings -> device options-> developer options -> enable adb. developer options might hidden in kindle fire tap 7 times serial number, , should pop up.

javascript - How to refilter others dc.js charts when brush is off after being on? -

Image
[please, follow image during reading instructions.] have line chart (1.b) used zoom in bar chart (1.a) , select items in scatter plot (2). once brush line chart (1.b), others graphs (1.a , 2) apply filter perfectly. when turn off brush bar chart zoom out, given me whole scope of data back, but scatter plot (2) not make dots appear again. please, see last scenario top bottom. scatter plot keeps previous filter. what reset in case brush off in line chart (1.b)?

MongoDB: query or aggregate to get different measure data into array in one shot -

i have time series document store device's multiple sensor data/1/. in example, deviceid a-1 has 1)geo info("longitude" : 0.6644560403052914, "latitude" : 0.7165033050936503 ), 2)temperature, ("sensortype" : "temperature","sensorvalue" : "14") 3)humidity, ("sensortype" : "humidity", "sensorvalue" : "12") the query based on time range according createdate, how use 1 query or 1 aggregation 3 arrays of geo info, temperature , humidity , how choose index , index type? /1/data structure { "_id" : "7736b113586a4314bfbe036cf6b3e34c", "createdate" : isodate("2016-08-30t16:30:33.007z"), "deviceid" : "a-1", "vendorcode" : "01", "longitude" : 0.6644560403052914, "latitude" : 0.7165033050936503, "sensorlist" : [

html - On hover of child, change background color of parent container (CSS only) -

this common question. gets closed duplicate of question: is there css parent selector? the duplicate job pointing out parent elements cannot targeted css. provides little no guidance original question, may caught in xy problem . in particular case... how can background color of parent changed when hovering child? ...there @ least 1 css solution may solve problem. <div> <a href="#">anchor text</a> </div> although can't select parent elements css, may able accomplish task method. you want background color of parent change when child hovered. consider using spread-radius value of css box-shadow property . by creating huge spread radius, can change color of surrounding area (which no different visually parent element). div { overflow: hidden; /* 1 */ } a:hover { box-shadow: 0 0 0 1000px red; /* 2 */ } /* non-essential decorative styles */ div { height: 150px;

Javascript: Dynamically add functions to object -

i have generalwrapper object calls statically-defined functions in library1 , library2 objects. the aim calling generalwrapper.somefunc() , call library1.somefunc() , library2.somefunc() without me having explicitly create function in generalwrapper called somefunc . i attempt implement in __preamble method below: var generalwrapper = { __modespopulated: false, __validmodes: { // 3 of these spoonfunc: 1, // functions exist knifefunc: 1, // in library1 , forkfunc: 1 // library2 }, __switchmode: function(funcname){ if (funcname in generalwrapper.__validmodes){ console.log("calling function", funcname) generalwrapper.__preamble() library1[ funcname ](); // call mode in library1 library2[ funcname ](); // call mode in library2 } }, /* attach valid modes general wrapper @ runtime */ __preamble: function(){ if (!generalwr