Posts

Showing posts from September, 2014

How I Can Show/Render Data Binding from Angularjs in a Jquery Onclick? -

i'm working in personal project have small problem when want render data binding angularjs in jquery, code. <div class="claimbutton claimactive"> <a href="{{ product.url }}" target="_blank" onclick="starttimer({{ $index }},{{ product.time }})">claim</a> </div> the principal problem inside here this original code onclick="starttimer(0,5)" when turn in databinding angularjs onclick="starttimer({{ $index }},{{ product.time }})" stop working , no render numbers. i hope me resolve problem. assuming have angular app , controller can <div class="claimbutton claimactive"> <a href="{{ product.url }}" target="_blank" ng-click="starttimer($index,product.time)">claim</a> </div> and in controller $scope.starttimer = function(x,y){ //do code x=$index, y=product.time }

Javascript - Chrome extension - Webrequest - Responsebody -

i want write extension chrome watch xhr calls , found have use webrequest this. i want response-body of request never can find how this. possible? // chrome.browseraction.onclicked.addlistener(function (tab) { var callback = function(details) { var url = details.url; console.log(details); }; var filter = { urls: ["*://safan.dev/*"] }; var ops = ["requestbody"]; chrome.webrequest.onbeforerequest.addlistener( callback, filter, ops ); // }); and manifest: { "manifest_version": 2, "name": "forge of empires", "description": "foe", "version": "1.0", "browser_action": { "default_icon": "icon.png" }, "permissions": [ "webrequest", "<all_urls>" ], "background": { "scripts": ["logic.js"] } }

dialog - on key event executing multiple times android -

i showing dialog in activity in application.when detecting on key event in dialog executing multiple times.i have go previous activity without dismiss dialog.can have idea it? @override public boolean onkey(dialoginterface arg0, int keycode, keyevent event) { if (keycode == keyevent.keycode_back && isclicked==false) { if (globalapp.activity != null) { log.i("activity",""+globalapp.activity); isclicked=true; globalapp.activity.onbackpressed(); dialog_footer.dismiss(); } } return true; } it called twice, once pressing key, , second time releasing it. try this: @override public boolean onkey(dialoginterface arg0, int keycode, keyevent event) { if (event.getaction()!=keyevent.action_down) return true;

c# - How to resolve different services in different controllers? -

i have 2 mvc controllers. both controllers have dependency on ifilecontainer interface. in 1 controller want resolve fsfilecontainer , in second controller want resolve ftpfilecontainer . register: servicecollection.addtransient<ifilecontainer, fsfilecontainer>(); servicecollection.addtransient<ifilecontainer, ftpfilecontainer>(); how resolve container in case? the easiest way use factory instead asp.net core ioc container doesn't support named dependencies or use 3rd party ioc container supports it. public class filecontainerfactory : ifilecontainerfactory { private readonly iserviceprovider provider; public class filecontainerfactory(iserviceprovider provider) { this.provider = provider; } public ifilecontainer createfilesystemcontainer() { // resolve via built in ioc return provider.getservice<fsfilecontainer>(); } public ifilecontainer createftpcontainer() {

sql server - What does "SELECT X=[column] FROM [table] exactly does"? -

i wanted set variable in sql by select @myvariable=mycolumn mytable ... but mistake wrote without @ select myvariable=mycolumn mytable ... it seems valid, there isn't error in syntax, although variable of course isn't set. so such instruction do? this sets myvariable alias mycolumnn . it's same as: select mycolumn myvariable mytable ...

Yii2 get controller/action from url -

how in yii2 controller/action url. attention!!! ask yii2. there answers consern yii1 @ forum. added. find smth yii::app()->geturlmanager()->parseurl(' http://eewee.djn ')); in yii2 added. refferer url anather conrtoller, want parse url yii2 , controller/action. try this! <?php echo yii::$app->controller->id; // controller id ?> <?php echo yii::$app->controller->action->id; // controller action id ?>

command line - Middleman won't init in windows -

Image
i'm new middleman , i'm having big problems when try install on windows 10. keeps giving me errors can't understand @ all. looks cli gem isn't install is. i've attached picture well. 'require': cannot load such file --dotenv try mm-init , mm-build , mm-server

java - Service + activity for playing music -

i created simple music play want play in background, don't know if solution correct: service (for playing music) activity fragment (for control) but when easy play/stop/pause (getcurrentposition , exchange data), there huge problem seekbar runtime. when can send position via bundle, changing seekbar runtime nothing me. can tell me solution? the easiest way declare broadcastreceiver inside service , activity use localbroadcastmanager.getinstance(this).sendbroadcast(intent); send data service. other way bind service activity , data directly. there no conflict between onstartcommand , onbind methods. can start service onstartcommand , bind later.

javascript - Jquery mobile (ListView) trigger create slow when tried to insert large number of rows -

i have found problem , solutions in other pages still cannot perfect one. i looping through array of 200 objects. var stringbuffer = []; for(var = 0; < array; i++) { stringbuffer.push('<input type="radio" class="select_options" data-iconpos="right" onclick ="callclosepopup(event);" name="items" id="radio_' + array[i].conditionid + '" ' + checked + 'value="' + array[i].conditionid+'_' + array[i].description + '"/><label data-corners="false" data-iconshadow="false" style="border-bottom:1px solid rgb(0,0,0)" for="radio_' + array[i].conditionid + '">' + array[i].description + '</label>'); } var combinedhtml = stringbuffer.join("") $("#mylistview").html(combinedhtml).trigger("create"); <=== line consumes lot of time (around 9 seconds on moto g). any ideas

javascript - Conditional ui-view for "active" item in ng-repeat -

scenario: i have list of items rendered within ng-repeat. each item has item template. when 1 of items clicked, item becomes "active". item has different template other items in list. by default, first item in list "active". is possible use ui-router accomplish this? know can use templateurl function state parameters, applied items. if possible, i'd avoid using ng-if/ng-switch since active item have several possible nested states different templates. angular.module("app", ["ui.router"]); angular.module("app") .config(function($stateprovider) { $stateprovider .state("list", { url: "/list", abstract: true, templateurl: "list.html" controller: "listctrl", controlleras: "listc", }) // how configure change template "active" item in list? .state("list.item",

php - Laravel Carbon format method unexpected result -

i date of database: $ticket = array('date' => '05-07-16 16:07:14') # day/month/year in blade.php format date carbon: {{ \carbon\carbon::parse($ticket['date'])->format('d-m-y') }} this returns me -> '16-07-2005' but want '05-07-16' years , days not correct. 2016 year, , 05 day of month (07). why format d-m-y not works me? use createfromformat method in carbon {{ \carbon\carbon::createfromformat('d-m-y h:s:i', $ticket['date'])->format('d-m-y') }}

xaml - Binding Command/Attribute To Element in C#? -

i'm trying implement xlabs cameraviewmodel functionality xamarin forms app. unfortunately, given example uses xaml bind views data, need in code behind. the following code used select picture , it's source. public class cameraviewmodel : xlabs.forms.mvvm.viewmodel { ... private imagesource _imagesource; private command _selectpicturecommand; public imagesource imagesource { { return _imagesource; } set { setproperty(ref _imagesource, value); } } public command selectpicturecommand { { return _selectpicturecommand ?? (_selectpicturecommand = new command( async () => await selectpicture(),() => true)); } } ... } and these commands bound xaml : <button text="select image" command="{binding selectpicturecommand}" /> <image source="{binding imagesource}" verticaloptions="centerandexpand" /> how can apply sa

r - Apply a specific function to a certain subset of a dataframe based on time frequency -

i have problem in figure out how possible apply example mean function subset of dataframe based on time frequency. i explain specific situation: have dataframe reporting data fuel consumption of trucks (having specific plate number) measured @ specific day/time. i'd calculate mean of fuel consumption time series maximum time frequency of 5 minutes (if consecutive events happen 5 minutes each other calculate mean). here example of initial dataframe , subsets of data want obtain: data.frame: columns names respectively plate.number, date.time , fuel.consumption ab 2016-07-03 09:21:10 23.45 ab 2016-07-03 09:22:33 33.65 bc 2016-07-03 09:23:28 56.22 ab 2016-07-03 09:24:13 21.33 bc 2016-07-03 10:32:45 33.42 zf 2016-07-03 10:32:45 28.45 zf 2016-07-03 10:34:1

matlab - Get Normalized Location of Mouse in Figure -

i trying current mouse position of mouse through 'windowbuttondownfcn' given below code : f = figure(1); set(f,'windowbuttondownfcn',@mouselocation) uiwait(f) function mouselocation(source,callback) get(source,'currentpoint') end when click current position of mouse not normalized tried: get(source,'currentpoint','units','normalized') but seem give me error that too many input arguments. you can use hgconvertunits convert between figure's (or graphic object's) current units , normalized units. pt = hgconvertunits(source, [get(source, 'currentpoint') 1 1], ... get(src, 'units'), 'normalized', source); pt = pt(1:2); alternately, can change figure's units normalized , currentpoint returned in normalized units automatically. fig = figure('units', 'normalized'); get(source, 'currentpoint')

javascript - create object with proper format from csv -

i have csv file : name,number,level mike,b1,0 tom,b2,0 ..... i want construct like: matrix: { { name: 'mike', number: 'b1', level: 0 }, { name: 'tom', number: 'b2', level: 0 }, .... } and want able extract properties,for example matrix.name . my problem want search later using ejs file name example. i'm going assume have csv data loaded. if not, you can refer question on how load data application. going there, i'm going assume data stored in variable called csv . need first process each line of data , split values on commas. after that, it's simple creating new object each value , adding object array. var csv = 'name,number,level\n' + 'mike,b1,0\n' + 'tom,b2,0'; // split data individual lines splitting on line break var lines = csv.split('\n'); // i'm going store column names can use them automatically each value // no

mysql - Can I make this SQL query more efficient? -

i have sql query works fine, feel there must more efficient way of writing it. joining 2 tables , b contain coordinates, comparing distances (in metres) between each coordinate. sum/count number of coordinates in table b within set distances of coordinates in table , output result: select a.name, sum(case when st_geodesiclengthwgs84(st_setsrid(st_linestring(a.lat, a.lon, b.lat, b.lon),4326)) < 10.0 1 else 0 end) 10mcount, sum(case when st_geodesiclengthwgs84(st_setsrid(st_linestring(a.lat, a.lon, b.lat, b.lon),4326)) < 50.0 1 else 0 end) 50mcount, sum(case when st_geodesiclengthwgs84(st_setsrid(st_linestring(a.lat, a.lon, b.lat, b.lon),4326)) < 1000.0 1 else 0 end) 1000mcount join b group a.name order 1000mcount desc limit 10; i feel there must way call st_geodesiclengthwgs84(st_setsrid(st_linestring(a.lat, a.lon, b.lat, b.lon), 4326)) once, result , increment each 10m, 50m , 1000m count. any ideas? thanks. try prequerying, data s

sql - what is the Way to get the messages that were displayed in SQLManagementStudio after executing a query in C#(programming) -

Image
this question has answer here: capture stored procedure print output in .net 2 answers i trying derive text in "messages" part string variable in c#.net after executing query program. like, int messag = convert.toint32(command.executenonquery()) which returns no. of rows affected, same way retrieve text "messages" part string variable when executed this. is possible? you can attach event handlers when error or info reported, explained in post . namespace test { using system; using system.data; using system.data.sqlclient; public class program { public static int main(string[] args) { if (args.length != 2) { usage(); return 1; } var conn = args[0]; var sqltext = args[1]; showsqlerrorsandi

Best practices for a microstrategy workflow -

we team of 5 people working microstrategy. share every role, have no worklfow. everybody may build or change attributes , change schema. leads reports not working. furthermore, there no "good" documentation. tried establish documentation sharepoint, there had no workflow. originally, had old project every report attributes constructed newly. did not reuse existing schema object. hence, started new project. realized due lack of understanding , lack of workflow make , made lot of mistakes. feel understand things better (parent child), workflow still horrible. we have development project , lice project, way working now, have lot of problems. particularly, missing version control system killing us. perform changes , forget did. hence, have use backups, destroying useful work on given day so best practices to: * deploy new attributes, facts , reports * ensure old reports work after constructing new attributes , facts * improve documentation * attributes defined o

javascript - How Can I Center My Forms Button? -

i'm using cognito form , works well, thing irritates me "submit" button won't center. i've tried , made text boxes above centered, while submit button still on left hand side. don't see many other options this. https://gyazo.com/bd4a143cefe2a0f764a82bd922f92e6f <div class="cognito"> <script src="https://services.cognitoforms.com/s/kqtsv-uype2bbu47xu3lpw"> </script> <script>cognito.load("forms", { id: "1" });</script></span> </div> you can add below script before end of span tag. <script type="text/javascript"> window.onload = function() { document.queryselector(".cognito .c-action").style="text-align: center;float:none;"; }; </script>

javascript - RegEx for Isracard (Israel Card) -

i need regular expression isracard (israel credit card). would grateful help, or maybe info how make it. format of isracard 8-9 digits. ex. picture of card - http://images.delcampe.com/img_large/auction/000/157/341/572_001.jpg i found validation isracard: <script> var cardvalid=function(cardno){ var sum = 0, inum; for( var in cardno+='' ){ inum = parseint(cardno[i]); sum += i%2?inum:inum>4?inum*2%10+1:inum*2; } return !(sum%10); }; </script> asp vb script isracard credit card number validation (8 or 9 digits) <% function isracardcheck(strnumber) comp1 = "987654321" comp2 = strnumber srez = 0 if len(comp2) < 9 comp2 = "0" & comp2 = 1 9 = mid(comp1, i, 1) b = mid(comp2, i, 1) c = * b srez = srez + c next if srez mod 11 = 0 isracheck = true else isracheck = false end if end function %&

Double click to select white space in PhpStorm -

in sublime can double click whitespace in-between 2 characters in order select white space, e.g. in: $foo = 'bar'; would result in selection of: $foo████████= 'bar'; however in phpstorm selects entire line. is there setting can toggle whitespace can selected double click in same way can double click variable select it. this not possible. there an open issue requesting functionality describe on bug tracker, vote , leave comment see functionality added well. apparently, according comments triple clicking used work done. although posted in 2013 , cannot reproduce on latest version anymore, figure removed somewhere along way.

ios - How to login with mobile number in parse but user should get verification code by text or call on that number? -

i want login in app mobile number , have used parse @ background.there 2 methods getting verification code 1.by call 2.by text on mobile number. you have integrate 3rd party apis sms/telephonic verifications. refer following services:- http://www.numberguru.com/developer http://www.openmarket.com/ http://www.textanywhere.net/

file - Awk and double quoting -

i need awk , double quoting. have text file separated tab values (multiple lines). ex. 22-03-2016 11:25 25 session reconnection succeeded user 10.10.10.10 now want change date notation. want above example 2016-03-22 11:25 (as in %y-%m-%d %h:%m ) i trying use awk (on mac) manually can change date with: date -j -u -f "%d-%m-%y %h:%m" "22-03-2016 11:25" "+%y-%m-%d %h:%m" result: 2016-03-22 11:25 i struggling awk this. having problems quoting. any other ways of doing appreciated! regards, ronald ok, so found solution using sed.. (had switch real linux enviroment.. ok) using command: sed -i.bak -r 's/([0-9]{2})-([0-9]{2})-([0-9]{4})/\3-\2-\1/g' textfile always funny how find answer right after post question....

arrays - Select all values by key from a nested hash -

i want values of each key not nested array. lists = {'value'=>1, 'next'=>{'value'=>2, 'next'=>{'value'=>3, 'next'=>nil}}} def list_to_array(h) result = [] h.each_value {|value| value.is_a?(hash) ? list_to_array(value) : result << value } result end p list_to_array(lists) can please tell me doing wrong? wanted output [1,2,3] [1] in solution, inner list_to_array method call doesn't update current result array, wasn't being updated correctly. i've refactored more stuff make more readable , exclude nil values lists = {'value'=>1, 'next'=>{'value'=>2, 'next'=>{'value'=>3, 'next'=>nil}}} def list_to_array(h, results = []) h.each_value |value| if value.is_a?(hash) list_to_array(value, results) else results << value unless value.nil? end end results end p list_to_array(lis

typescript - Angular2 parameter URL not working when visited directly -

Image
i have configured angular2 routes parameters. when visit /censo/119 or /viaje/119 1 of [routerlink] i've defined works fine. when go directly url http://localhost:3000/censo/119 404. i'm using lite-server development app. am missing configuration? need use different server? this app.routes.ts const routes: routerconfig = [ { path: '', component: censocomponent }, { path: 'censo', component: censocomponent }, { path: 'viajes', component: viajescomponent }, { path: 'censo/:viaje', component: censodetailcomponent }, { path: 'viajes/:viaje', component: viajesdetailcomponent }, ]; and routerlinks <a [routerlink]="['/censo']">censo</a> <a [routerlink]="['/viajes']">viajes</a> <a [routerlink]="['/censo',119]">censo 119</a> <a [routerlink]="['/viajes',119]">viaje 119</a> <router-outlet></r

html - Bootstrap Footer not Sticking to the bottom of the page -

i'm using bootstrap 3.3.5 display footer @ bottom of webpages using .navbar navbar-default class. on pages displaying list of items greater 10 footer being displayed correctly @ bottom of page on pages having less 5 items footer being displayed @ middle of page instead of bottom. html code .. <nav class="navbar navbar-default" style="margin-bottom:0px;padding-botton:0px"> <div class="container-fluid"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#mynavbarbottom"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <div class="collapse navbar-collapse" id="mynav

c++ - Error linking with CUDA code: multiple definitions of `__cudaRegisterLinkedBinary_ -

i have cuda code i'm compiling .a library, , (cuda-related) regular-c++ code app uses it. undergoing intermediate linking. now, on 1 machine (with cuda 8.0 rc) build succeeds, on machine (with maxwell rather kepler card, in case matters) get: /tmp/tmpxft_00001796_00000000-2_ktkernels_intermediate_link.reg.c:25: multiple definition of `__cudaregisterlinkedbinary_66_tmpxft_00007a5f_00000000_16_cuda_device_runtime_compute_52_cpp1_ii_8b1a5d37' cmakefiles/tester.dir/tester_intermediate_link.o:/tmp/tmpxft_0000180b_00000000-2_tester_intermediate_link.reg.c:4: first defined here collect2: error: ld returned 1 exit status cmakefiles/tester.dir/build.make:1766: recipe target 'bin/tester' failed make[2]: *** [bin/tester] error 1 i started removing files what's compiled binary makes calls library code - , if remove of them linking succeed. my questions: under circumstances possible such inconsistent behavior occur? can possibly result of "second linking&quo

ios - Web Service Apps in JSON with UITableView using Swift Language -

i new ios , learning web services. came across tutorial http://www.thedarkdev.com/webservice-swift-ios8-json-uitableview.html . tried program given getting these errors: 1. 'objectforkeyedsubscript' unavailable: use subscripting @ line let text: nsmutablestring = tmpdict.objectforkeyedsubscript(thetitle) as! nsmutablestring let detail: nsmutablestring = tmpdict.objectforkeyedsubscript(thedate) as! nsmutablestring 2. extra argument 'error' in call @ line var jsonsource: nsdata = nsurlconnection.sendsynchronousrequest(urlrequest, returningresponse: response , error: err) 3. use of unresolved identifier 'jsonobjects' @ line for datadict : anyobject in jsonobjects viewcontroller.swift import uikit import foundation class viewcontroller: uiviewcontroller,nsurlconnectiondelegate, uitableviewdelegate { @iboutlet var tabledata: uitableview! let thetitle: nsstring = "title" let thedate: nsstring = "date" let day_thai: nsst

angularjs - How to call from app in Ionic using href? -

i have read many post seems doing wrong. <a href="tel:1234543" class="item item-icon-left" id="number"> <i class="icon ion-earth"></i> call </a> config file <access origin="*"/> <access origin="tel:*" launch-external="yes" /> <allow-intent href="tel:*" /> when run on device button nothing? pointers? just modify code : <a href="tel:+1-1800-555-5555" id="number" class="item item-icon-left"> <i class="icon ion-earth"></i> call </a> config.xml <access origin="tel:*" launch-external="yes"/> hope works :)

spring boot - Actuator /logfile endpoint no longer works with external logback configuration -

i needed logs rolling, have created "logback-spring.xml" file , placed src/main/resources. works flawlessly. the issue actuator endpoint "/logfile" no longer works have removed logging configuration "applications.yml" file. according documentation, either "logging.path" or "logging.file" needs set in order make "/logfile" endpoint work. seem conflict new 'xml configuration. here logback-spring.xml configuration measure: <configuration debug="true" scan="true"> <include resource="org/springframework/boot/logging/logback/base.xml"/> <property name="log_path" value="logs"/> <property name="log_archive" value="${log_path}/archive"/> <appender name="rollingfile-appender" class="ch.qos.logback.core.rolling.rollingfileappender"> <file>${log_file}</file> <rollingpolicy class=&quo

java - save unicode codepoint instead of html entities in mysql using jsp -

i have made necessary changes database variable utf8 character_set_client utf8 character_set_connection utf8 character_set_database utf8 character_set_filesystem binary character_set_results utf8 character_set_server utf8 character_set_system utf8 also added included tag on jsp: <meta http-equiv="content-type" content="text/html; charset=utf-8"> but when non english text entered converted , store in form of html entities i.e #&number format i want enter in unicode codepoint format \u6709 without java code converter program: <%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html> <head> <meta http-equiv="content-typ

c++ - Armadillo - fill a matrix from the values in a column vector -

i go , forth between arma::mat of size m x n , arma::vec of size mn (which column-major linearization of matrix). i can go matrix vector using arma::vectorise , i.e. arma::vec vector = arma::vectorise(matrix); however, cannot find simple way go other way around. insert first m values of vector in first column of matrix, second m values in second column , on. there way efficiently? make memory matrix shared vector using advanced constructors : mat x(4,5); vec v(x.memptr(), x.n_elem, false, false); // changing elements in x or v affect both as long operations don't cause aliasing or change size of either x or v , 2 objects keep sharing memory.

draw - Drawing to NSView within NSMenuItem is darkened -

Image
i drawing coloured circle within nsview contained in nsmenuitem. when so, circle drawn in darker colour 1 specify , when add subview no drawing code, area occupied view drawn in true colour, illustrated image. explain me why happening , how fix it? many thanks, ben.

android - How to use ListFragment with BaseAdpater and Json file -

i have json displaying fine in listview when using customadapter extends baseadpater. in tests, can parse , inflate listview fine when reading json file when not loading fragment. i need move this/display in fragment. fragment extending listfragment. cannot listfragment display. this code fragment: public class activitysearchresultstwo extends listfragment { private listfragment mlistview; public static activitysearchresultstwo newinstance() { activitysearchresultstwo fragment = new activitysearchresultstwo(); return fragment; } public activitysearchresultstwo() { } @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view root = inflater.inflate(r.layout.fragment_session_row, null); return root; } @override public void onactivitycreated(bundle savedinstancestate) { super.onactivitycreated(savedinstancestate); mlistview = (listview) findviewbyid(r.id.list); arraylist<sessions>

PHP SLIM : How to return dynamically generated images -

i trying display dynamically generated image slim controller getting blank screen. thanks. public function texttoimage($request, $response, $args) { // text draw $text = "hello world"; $length=strlen($text); // create image $im = imagecreatetruecolor($length*12, 30); // create colors $white = imagecolorallocate($im, 255, 255, 255); $grey = imagecolorallocate($im, 128, 128, 128); $black = imagecolorallocate($im, 44, 62, 80); $boxcolor=imagecolorallocate($im, 95, 128, 149); $font = 'helvetica.ttf'; imagefilledrectangle($im, 0, 0, $length*9+$capitaladjust, 29, $white); imagettftext($im, 13, 0, 0, 20, $black, $font, $text); $response->getbody()->write(base64_encode($im)); $response = $response->withheader('content-type', 'image/png'); return $response; } base64 encoding $im not create valid png file. try using imgpng , sending raw contents of png file crea

javascript - Can I make channel list with youtube API if I do not own the channel? I don't receive error but nothing display? -

i trying make channel list, make playlist of videos channel of music, not own channel here https://www.youtube.com/channel/uc-9-kytw8zkzndhqj6fgpwq/featured , want retrieve data channel not own, however. i thought succeed when did this: https://www.googleapis.com/youtube/v3/channels?id=uc-9-kytw8zkzndhqj6fgpwq&key=aizasyckheobd9nzsmac77nkqqf403mxnxtz35s&part=snippet,contentdetails but when try put videos on html, nothing shows up, full code: $(document).ready(function() { $.get ( "https://www.googleapis.com/youtube/v3/channels?id=uc-9-kytw8zkzndhqj6fgpwq&key=aizasyckheobd9nzsmac77nkqqf403mxnxtz35s&part=snippet,contentdetails", function(data) { $.each(data.items, function(i,item) { console.log(item); pid = item.contentdetails.relatedplaylists.uploads; getvids(pid); }) } ); function getvids(pid) { $.get( "https://www.googleapis.com/youtube/v3/playlistitems", { part:'snippet&#

php - HTACCESS redirecting sub sites to main site -

my .htaccess .co.uk website. have 2 language sties in directory .pl in folder /language/pl .fr in folder /language/fr these affecting links in sites. can stop pages in foreign language sites being affected. options +indexes rewriteengine on rewritecond %{http_host} ^mysite.co.uk [nc] rewriterule ^(.*)$ http://www.mysite.co.uk/$1 [l,r=301] redirect /oil.html http://www.mysite.co.uk/oils/pages/ind_oils.html redirect /honing.html http://www.mysite.co.uk/pages/mandrels.html redirect /toolingabrasives/heavyduty.html http://www.mysite.co.uk/pages/hd-super-tooling.html redirect /europe.html http://www.mysite.co.uk/pages/misc/distributors.html redirect /toolingabrasives/horizontal.html http://www.mysite.co.uk/pages/mandrels.html redirect /mysite_honing.htm http://www.mysite.co.uk/index.html redirect /honing_abrasives.htm http://www.mysite.co.uk/index.html redirect /oils/pages/extra.html http://www.mysite.co.uk/oils/pages/oil_pages/extra.html redirect /pages/misc/contact_us.html

Running a bash script from within Applescript -

i'm having issue getting bash script execute within applescript. need applescript file prompt username , password bash script runs sudo permissions, doing tasks cannot done administrator, such writing /etc/ . as script (packaged inside .dmg file using platypus) distributed number of users, can't rely on absolute paths, , instead need path of applescript file when runs, sudo permissions, , run bash script within same directory. so far, have been able come with, via posts , other sites, has resulted in osascript complaining can't find bash script. ideas? it seems might work, syntax errors: set wd shell script "pwd" tell application "terminal" set run_cmd "/bin/bash " & wd & "/osx.sh" script run_cmd administrator privileges end tell if script saved application, must include : set mypath path me the variable mypath complete path app. there, have add sub folder, "contents:resources:my_sh

node.js - Having custom validation messages for schema violations in mongodb and nodejs -

my schema following: var mongoose = require('mongoose'); var schema = mongoose.schema; var studentschema = new schema({ name: { type: string, required: [true, 'name must non empty'] }, family: { type: string, required: [true, 'family must non empty'] }, subjects: { type: [string], validate: [{ validator: function(val) { return val.length > 0; }, msg: 'continents must have more or equal 1 elements', errorcode: 25 } ] }, created: { type: date, default: date.now }, }); but when post json without name, see following error object: { [validationerror: validation failed] message: 'validation failed', name: 'validationerror', errors: { name: { [validatorerror: validator "required" failed path name value `undefined`] m

jquery - How can I hide an element? -

i'm trying disable browser 'save password' functionality (my previous question ). that, added new input type="password" field inside form, code: <form method="post" action="yoururl"> <input type="password" style="display:none"/><!-- making "save password" disable --> <input type="text" name="username" placeholder="username"/> <input type="password" name="password" placeholder="password"/> </form> note: using autocomplete=false won't work on modern browsers. please don't suggest it. in fact i'm trying use this approach . well what's problem? when hide useless input display:none , doesn't work (i mean still saving password option there.) . when hide useless input visibility:hidden , works. as know visibility property takes space on page don't want that. how can hide usele

java - How to load child items while click parent item in ExpandableListView -

i new android, have expandablelistview in app. want load child items while click parent item. tried alot not working . please help. my code here: expandablelistadapter listadapter; expandablelistview explistview; list<string> listdataheader; hashmap<string, list<string>> listdatachild; public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view view = inflater.inflate(r.layout.faq, container, false); // listview explistview = (expandablelistview) view.findviewbyid(r.id.faqlist); preparelistdata(); listadapter = new expandablelistadapter(getactivity(),listdataheader,listdatachild); // setting list adapter explistview.setadapter(listadapter); // listview group expanded listener explistview.setongroupexpandlistener(this); return view; } private void preparedata(string s) { log.d("working:","yes"); listdatachild = new hashma

Represent UML diagram in OWL -

Image
i have 2 classes person , vehicle having owns relation between them. there 1 many relation between them 1 person can own many vehicles. person has attribute 'name' (person name) , vehicle has attribute 'name' (brand name). question how model in owl using protege editor? if there attribute on ' owns ' relation saying ' dateofpurchase ' how represents in owl ? object properties in owl describe relation between individuals, not between classes. "borrowed" uri, nothing else. so, need reify each statement such :persona :owns :vehicleb . rdf allows that, protégé not. so, here's workaround: you create 2 object properties :hassubjectofowns , :hasobjectofowns , , each case need describe dateofpurchase , define individual representing statement, , assert : :aownsb :hassubjectofowns :persona; :hasobjectofowns :vehicleb; :dateofpurchase "2014-10-01"^^xsd:date initially you'd need create property chain, in prot

eclipse adt - Android unfourtunately project has stopped error -

i'm creating android app in eclipse adt bundle.when clicked button app connecting web service , getting location values in app.i started app in emulator, while i'm receiving "unfourtunately project name has stopped" warning. i'm checking out logcat.but didn't solve problem. i'm sharing down logcat errors. me please. main activity: public class mainactivity extends activity { public final static string url = "http://10.0.2.2:8081/webservice/services/sqlservice.sqlservicehttpsoap11endpoint/"; public static final string namespace = "http://services.com"; public static final string soap_action= "http://services.com/locationdata"; private static final string method_name = "locationdata"; string str = null; textview t; string longitude; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activ

amazon web services - Terraform stalls while trying to get IP addresses of multiple instances? -

so using terraform provision ec2 instances , openstack instances. trying reference ip addresses of instances creating because need run commands use them (to set consul). after adding references these variables terraform stalls out , absolutely nothing after run terraform apply or terraform plan : here sample of resource block trying run: resource "aws_instance" "consul" { count = 3 ami = "ami-ce5a9fa3" instance_type = "t2.micro" key_name = "ansible_aws" tags { name = "consul" } connection { user = "ubuntu" private_key="${file("/home/ubuntu/.ssh/id_rsa")}" agent = true timeout = "3m" } provisioner "remote-exec" { inline = [ "sudo apt-get update", "sudo apt-get install -y curl", "echo ${aws_instance.consul.0.private_ip} >> /home/ubuntu/test.txt", "echo ${aws_inst

debian - Python 3.5 install pyvenv -

i trying virtual environment repo requires python 3.5. using debian, , can tell, python 3.5 not have aptitude package. after reading posts, recommended download 3.5 source code , compile it. after running make , install, python3.5 installed /usr/local/bin. added $path variable. here ran problems. after ran: $ cd project-dir $ pyvenv env $ source env/bin/activate $ pip install -r requirements.txt i getting issues needing sudo install proper packages. ran: $ pip and turns out pip still using /usr/local/bin version of pip. $ echo $path returned /home/me/project-dir/env/bin:/usr/local/bin:/usr/bin:/bin: ... i assuming because /usr/local path came after virtual environment's path in path variable, using version of pip instead of virtual environments. what best way run correct version of pip within virtualenv? 2 options can think of moving binaries on /usr/bin or modifying activate script in virtual env place virtualenv path after /usr/local. option 1

java - Android Hashmap returning null -

i have expandable listview data stored in hashmap<integer, list<mychildobject>> and when expanding crashes saying list.size() null pointer in adapter.getchildrencount() simply: public int getchildrencount(int groupposition) { return mmap.get(groupposition).size(); } now put break point in ran debugger , saw mmap fine, i'm testing 1 element list of element contains 1 child object. can see in debugger element in fact list size = 1. but testing list<mychildobject> list = mmap.get(0); returns null when can see in debugger mmap has element ( <integer.valueof(0), non null list of objects> ). whats weirder when testing 4 hashmap elements: <0, list> <1, list> <2, list> <3, list> it works fine , i'm able access non null list calling mmap.get(n)... am not using hashmap correctly here integer keys? why unable retrieve elements? odds pretty it's checking integer object boxes , unboxes correctly val