Posts

Showing posts from March, 2011

extjs - Change color of the field when condition is satisfied -

for example, have textfield input type 'email'. have set default color of field pink. if input in proper email format, want textfield's color changed white. how do that? the eg code: xtype: 'textfield', labelwidth : 250, fieldstyle: 'background-color : #f5a9a9', vtype : 'email', fieldlabel: 'email address' in case first need check weather input value email or not. using var fieldvalidation = ext.form.field.vtypes.email(val); if fieldvalidation true input value email. once verified input value change our background color. this.setfieldstyle("background-color : #ffffff") your code : { xtype: 'textfield', fieldstyle: 'background-color : #f5a9a9', vtype : 'email', fieldlabel: 'email address', validator : function(val){ var fieldvalidation = ext.form.field.vtypes.email(val); if(fieldvalidation == true){

elasticsearch - Kibana 5.x - Sorting options (asc & desc) are not aviable -

after inserting data elasticsearch can't sort results in kibana discover view. test data inserted using curl and/or logstash. both variants did not lead success. i using current versions (5.2) of elk stack. the picture below shows result table without sorting options (desc or asc), instance, 'time' or 'message' field. result table without sorting option furthermore, can seen on left in picture inserted data have no indexed fields. why can't sort results? thanks help!

ruby on rails 4 - Broken FB-omniauth after bundle update, invalid credentials -

the oauth data doesn't go controller action. can't understand what's wrong. there 1 more auth provider in controller , works core absolutely same. devise 3.5.10 rails 4.2.4 devise.rb config.omniauth :facebook, figaro.env.fb_app_id, figaro.env.fb_app_secret, callback_url: 'https://chotam.ru/users/auth/facebook/callback', scope: 'email, publish_actions' class users::omniauthcallbackscontroller < devise::omniauthcallbackscontroller def facebook logger.error "fb here" # it's no output here on request!!! logger.error(request.env['omniauth.auth']) result = user.find_for_facebook_oauth(request.env["omniauth.auth"], current_user) @user = result[:user] status = result[:status] if @user token = request.env["omniauth.auth"]["credentials"]["token"] @user.account.update_attribute(:fb_token, token) if status[:redirect] == 'added'

Select2 Tags with predefined (often used) -

i want use select2 multiple tags option fetch ajax. under select field want list used ones. on click should added select2. https://select2.github.io/examples.html#programmatic (set california , alabama) it's not working tags.

diskspace - Docker - free up space after removing all images & containers -

i have deleted images/containers ubuntu@ubuntu:/var/lib/docker$ docker images repository tag image id created size ubuntu@ubuntu:/var/lib/docker$ docker ps -a container id image command created status ports names but notice there still 15gb inside /var/lib/docker ubuntu@ubuntu:/var/lib/docker$ sudo du --max-depth=1 -h . 12g ./volumes 104k ./aufs 4,0k ./containers 1,3m ./image 4,0k ./trust 4,0k ./swarm 2,6g ./tmp 108k ./network 15g . questions: how can free space? is safe remove things inside /var/lib/docker ? try (from docker 1.13): docker system df it shows size of: images containers local volumes and remove local volumes using: docker volume prune for older dockers try: docker volume rm $(docker volume ls -q)

javascript - Make translation function not translate result again -

i have made simplified version of translation tool similar google translate. idea build simple tool minority language in sweden called "jamska". app built function takes string textarea id #svenska , replaces words in string using regexp. i've made array called arr that's used in loop of function dictionary. each array item looks this: var arr = [["eldröd", "eillrau"], ["oväder", "over"] ...] . first word in each array item in swedish, , second word in jamska. if regexp finds matching word in loop replaces word using code: function translate() { var str = $("#svenska").val(); var newstr = ""; (var = 0; < arr.length; i++) { var replace = arr[i][0]; var replacewith = arr[i][1]; var re = new regexp('(^|[^a-z0-9åäö])' + replace + '([^a-z0-9åäö]|$)', 'ig'); str = str.replace(re, "$1" + replacewith + '$2'); } $("#jamska").val(str);

python - Heroku flask app - Not able to scrape data -

i trying make 1 program can scrape site. achieve method implementing in heroku , flask. app.py from flask import flask import requests bs4 import beautifulsoup datetime import datetime app = flask(__name__) @app.route('/') def homepage(): r = requests.get('https://www.google.com') soup = beautifulsoup(r.content) l = soup.find_all('a') the_time = datetime.now().strftime("%a, %d %b %y %l:%m %p") return """ {time} \n\n\n {text} """.format(time=the_time,text = l) if __name__ == '__main__': app.run(debug=true, use_reloader=true) but after deploying , going site, giving error , in log find this: at=error code=h10 desc="app crashed" method=get path="/favicon.ico" host=young-chamber-36373.herokuapp.com request_id=68c83de9-1945-416c-8858-f9ff3d6ee496 fwd="171.77.135.239" dyno= connect= service= status=503 bytes= protocol=https so doing w

android - Program a 'Back' button to return to the previous activity -

i new please kind. have searched , read lot i'm totally confused. have number of activities 1 thru 10. can go activity 4 both activity 3 , 8. 'back' button on activity 4 returns me activity 3. want take me previous activity (3 or 8), please. here current java code: public class player_new extends appcompatactivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_4_new); intent intent = getintent(); string message = intent.getstringextra(mainactivity.extra_message); } public void sendbackmessage(view view) { intent intent = new intent(this, 3.class); startactivity(intent); } } tia john activity a: startactivity(new intent(a.this, b.class); in activity b @override public void onbackpressed() { finish(); }

php - preg_math getting url within the text -

i have test in users having taggings need url href text have text hello world <a class="red" contenteditable="false" href="http://domainname.com/demo/forums/profile/test.name">test </a>&nbsp;this creating problem //i need test.name url $text = $post_data->discussion; $name = preg_match_all('#\bhttps?://[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|/))#', $text, $match); print_r($name); can me out unable failed in making regex you can check anchor tag, way you'll url (maybe string contains separate urls). $str = 'hello world <a class="red" contenteditable="false" href="http://domainname.com/demo/forums/profile/test.name">test </a>&nbsp;this creating problem'; preg_match_all("/<a.*?href\s*=\s*['\"](.*?)['\"]/", $str, $res, preg_set_order); foreach($res $key => $val) { ec

webstorm - Why doesn't pug take this script tag as closed? -

i'm trying "translate" html file pug, , have this: extends layout block content script. system.import('main.js').catch(function (err) { console.error(err); }); the thing is, if press enter @ end of file, instead of taking script tag closed , taking me previous indent level, webstorm acting if i'm still writing code inside script tag. how can force close tag, or doing wrong?

activex - How to create a custom control element for MS Visio -

i have several visio drawings , need same commandbutton same macro in every 1 of drawings. idea create custom preset commandbutton can drop on drawing don't have fiddle caption , behavior haven't found solution yet. i looked creating com add-in since i'm new coding , have order visual studio workstation couldn't try out see if it's right thing i'm looking for. any pointers appreciated

sql - Excel table to Access query connection, [Microsoft][ODBC Microsoft Access Drive] too few parameters. expected 1 -

i'm trying create table in excel, takes data access query. i'm unable find query listed under data->from access. i'm using data->from other sources -> data connection wizard -> odbc dsn. on final step throws error [microsoft][odbc microsoft access drive] few parameters. expected 1. i not post full query @ moment, long i post subquery part (with formatting) , throws error. can take , pinpoint problem. all queries have work in access. need results export excel, whole reporting vba tool there. (i know can make select , create table, not elegant , simple update) thank time. have nice day select employees.persno, employees.employee_name, employees.reporting_month, employees.gender_key, employees.start_date, employees.business_unit, employees.position_id, employees.position, employees.local_band, employees.ps_group, employees.wage_amount, val(employees.bonus) [bonus_%], val([employees].[commissions_(%)]) [commisions_%], employees.wage_type,

Connecting to apache phoenix using JDBC and Java -

i have small java program in try establish connection remote phoenix server have running. package jdbc_tests; import java.sql.connection; import java.sql.drivermanager; import java.sql.resultset; import java.sql.sqlexception; import java.sql.statement; public class phoenixtest { static final string jdbc_driver = "org.apache.phoenix.jdbc.phoenixdriver"; static final string ip = "<placeholder>" static final string port = "<placeholder>" static final string db_url = "jdbc:phoenix://" + ip + ":" + port + "/"; public static void main(string[] args) { connection conn = null; statement st = null; try { class.forname("org.apache.phoenix.jdbc.phoenixdriver"); system.out.println("connecting database.."); conn = drivermanager.getconnection(db_url); system.out.println("creating statement...");

angularjs - multiple textareas using angular ui-tinymce not displaying when using two controllers -

i using ui-tinymce angular 1.5 , using in 2 different locations on page coming 2 separate controllers. work on 1 textarea @ at time. if move both textareas same controller display correctly. or if delete 1 textarea other displays. there special needed make ui-tinymce work 2 controllers on 1 page? injecting ui-tincymce both controllers. thank i ran same issue , determined reason because directive starts id numbering @ 0 each controller. (see var generatedids = 0 in angular.tinymce.js on or around line 8). more under-the-hood knowledge of angular explain why directive "resets" every controller, root issue directive reusing ids. fix came modify angular.tinymce.js replace: attrs.$set('id', id_attr + '-' + generatedids++); with attrs.$set('id', id_attr + '-' + string(new date().gettime()); it's not ideal fixed issue immediately. gettime() milliseconds since jan 1 1970, counts quite rapidly (meaning, chances of collision

c# - How to retrieve correct value of date only field in SharePoint 2013 workflow -

i new sharepoint 2013 workflows years of general c# , other sharepoint experience. my problem timezones. developing list workflow in visual studio 2013 has take actions based on value of date field of current item in list. retrieving value of field using getdynamicvalueproperties , assign variable. if check value, can see not correct 23:00 on day before 1 set list item. assuming because no matter being date field, behind scenes still being stored in regular datetime object. because of this, date calculations 1 day off (because use date part). have noticed timezone specific classes , methods cannot used within workflow. is there way can correctly retrieve date part of field value without hardcoding offsets? preferably looking solution not include workarounds , hacks , works in environments. background information: have execute tasks n days before date @ given time (e.g. 8 am). second part tricky too, time part 1 hour off because of this. looking solution too. manage

SQL Converting Time to Half Hour Increments and Extracting only HH:MM -

i need show report counts sessions in half hour increments 24 hour period. used following case statement , works convert minutes in date field. case when datepart (mi,"tablename.name") < 30 dateadd(hh, datediff(hh, 0, "tablename.name")+0, 0) else dateadd (mi, 30, dateadd(hh, datediff(hh, 0, "tablename.name")+0, 0)) end, now having trouble pulling out hh:mm. tried this, gives me 2 additional columns. datepart(hh,"tablename.name") 'start_hour', datepart(minute,"tablename.name") 'start_min' try this: cast(datepart(hour,"tablename.name") char(2)) + ':' + cast(datepart(minute,"tablename.name") char(2)) start_time

javascript - Access value from datalist inside table -

i trying value of datalist within table cell. have function loops through each cell of table value: function gettablecontents() { //gets table var otable = document.getelementbyid('projectstable'); var projectnames = []; //gets rows of table var rowlength = otable.rows.length; //loops through rows (i = 1; < rowlength; i++){ //gets cells of current row var ocells = otable.rows.item(i).cells; //gets amount of cells of current row var celllength = ocells.length; //push html content of each cell array projectnames.push(ocells.item(0).innerhtml); } //loop through each stored cell , check whether project exists in database for( = 0; < projectnames.length; i++){ checkuser(projectnames[i]); } } the line gets value of cell returns html of datalist not actual value. can value different way using : document.getelementbyid("listofprojects").value; however

apache - Ignite LoadCache method parameters -

i using .net platform. wrote code read data sql database using apache ignite. if use loadcache method load data persistent store throws exception. code below. knows exception? iignite ignite = ignition.start(new igniteconfiguration { springconfigurl = "my-file.xml", binaryconfiguration = new binaryconfiguration(typeof(categories)) }); var cache = ignite.getcache("northwnd"); cache.loadcache(null,typeof(int),typeof(string)); error: unhandled exception of type 'apache.ignite.core.cache.store.cachestoreexception' occurred in apache.ignite.core.dll additional information: provided key type not found in store or cache configuration [cache=northwnd, key=binaryobject [idhash=456514415, hash=38265930, typeid=87]]

appcompat - What libraries are required for Facebook Audience Network on Android? -

i'm using android facebook sdk 4.20.0. r.txt file contains 1500 entries, of them referring android-support-v7-appcompat library. is appcompat required in order show facebook ads? i didn't find in documentation .

sonata - Item "AdminBundle\Entity\Prize:000000046fa222" has been successfully created -

hi want sonata have item using 'name' label. not same. i put in admin class public function tostring($object) { if (!is_object($object)) { return ''; } if (method_exists($object, '__tostring') && null !== $object->__tostring()) { return (string) $object; } $cname = explode('\\', get_class($object)); return end($cname); } but give same name. want have label 'name' of each entity you need override __tostring() magic method in entity class public function __tostring(){ return $this->name; }

angular - Ionic 2 : Error with test and images -

i try test ionic 2 app jasmine , karma. when run 'npm test' have error : c:\xampp\htdocs\myapp>npm test > ionic-hello-world@ test c:\xampp\htdocs\myapp > karma start ./test-config/karma.conf.js webpack: compiled successfully. webpack: compiling... ts-loader: using typescript@2.0.9 , c:\xampp\htdocs\myapp\tsconfig.json 28 03 2017 14:24:17.950:warn [karma]: no captured browser, open http://localhost:9876/ error in ./src/pages/login/login.html module not found: error: can't resolve './assets/images/fr.svg' in 'c:\xampp\htdocs\myapp\src\pages\login' @ ./src/pages/login/login.html 1:1614-1647 @ ./src/pages/login/login.ts @ ./src/app/app.component.ts @ ./src/app/app.component.spec.ts @ ./src \.spec\.ts @ ./test-config/karma-test-shim.js error in ./src/pages/login/login.html module not found: error: can't resolve './assets/images/ch.svg' in 'c:\xampp\htdocs\myapp\src\pages\login' @ ./src/pages/login/login.html 1:1832-

c - Recursive mpi spawns (spawn from spawn) -

the problem quite simple: manager spawns x workers. each worker spawns 2 more workers if condition met. works fine long workers don't spawn anymore (so condition not met, or if first "original" worker spawns; hangs other workers). manager code: int main(int argc, char *argv[]) { int myrank, numworkers, tag = 3, sum = 0, k = 1; mpi_status status; mpi_comm workercomm; numworkers = atoi(argv[1]); mpi_init(&argc, &argv); mpi_comm_rank(mpi_comm_world, &myrank); mpi_comm_spawn("project_child", mpi_argv_null, numworkers, mpi_info_null, 0, mpi_comm_self, &workercomm, mpi_errcodes_ignore); (int = 0; < numworkers; i++) { //sends 1,2,3... workers k=i+1; mpi_send(&k, 1, mpi_int, i, tag, workercomm); } (int = 0; < numworkers; i++) { //receives int worker mpi_recv(&k, 1, mpi_int, i, tag, workercomm, &status); sum += k; } printf("%d \n", sum); mpi_comm_free(&workercomm); mpi_finalize()

unity3d - How to get the ray that faces Camera? -

two days i'm trying proper ray camera. i have script simulate recoil of gun rotates camera of built-in firstpersoncharacter of unity. rotates simple cam.transform.rotate(x, 0, 0); can't manage ray there, cam.transform.forward horizontal if camera not rotated , cam.viewporttoworldpoint doesn't work neither. do guys have idea how work ? when rotate camera cam.transform.rotate(0,y,0) rotate camera around y-axis. means camera remains horizontal, rotates left , right (probably not best way simulate recoil). to rotate camera vertically in way resembling recoil, should lerp camera.transform.forward camera.transform.up coefficient, 0.5f or something. update, example code: if (input.getkeydown(keycode.space)) { var direction = vector3.lerp(camera.main.transform.forward, camera.main.transform.up, 0.1f); camera.main.transform.lookat(camera.main.transform.position + direction); var ray = new ray(camera.main.transform.position, di

node.js - return value from promise Sequelize -

i'm working sequelize, i'm having trouble requisition's return. this got far: var m = messagem.findall({}).then((mensagens)=>{ console.log(mensagens); // have reponse :d return mensagens; }); console.log(m); promise { _bitfield: 2097152, _fulfillmenthandler0: undefined, _rejectionhandler0: undefined, _promise0: undefined, _receiver0: undefined, _boundto: messagem } what doing wrong? any appreciated! you cannot return value promise resolution handler (well, can, result of resolution or rejection of promise returned .then() method itself, in example). in case m promise need use such. instead of: console.log(m); you have do: m.then(console.log); or this: console.log(await m); if inside function declared async keyword. see this answer more info that. see other answers promises .

java - Why eclipse need JAVA_HOME -

i reading articles how jvm works, , tested if change jre eclipse(installed jres), code executed in jvm. question why eclipse needs have java_home set in environment variables. eclipse use jre in form if select in eclipse(installed jres) eclipse not require java_home set, info you, many many tools can find on web use inter under hood oracle tools, never run if computer has no idea located, java_home variable in enviroment, you( , tools use) can execute things javac or java without telling every time in pc .

javascript - return array response to destination file jquery ajax php -

am trying populate fields automatically behalf of user typed in particular input field. eg: want populate automatically username , age when type fullname , trouble when receive data in array() can use single element either in age field or in username field, want :: $.ajax({url: "/php/autofill.php?query="+query, success: function(result){ $("#ajax").html(result); }}); can fetch below? $.ajax({url: "/php/autofill.php?query="+query, success: function(result){ $("#ajax").html(result.username); //or $("#ajax").html(result.age); }}); i know code dirty, want way anyhow, looking answers

c# - Filtering ion custom paging for radgrid -

i use radgrid , apply custom paging it. data current page of grid gotten. challenge face when using filter option existed in radgrid want apply of data not displayed

css - Two identical HTML documents but one isn't showing style rules? -

i'm using iis test php scripts small blog project i'm working on. created html , css before setting server, i've run problem makes no sense. when changing style rules in css files, rules apply html file when opened clicking on directly folder, not when navigating through localhost iis link. when accessing through local server, css rules not applied, it's same single html file should affected, , in 1 case , other isn't. why happening? quirk of iis or something? i've noticed new rules don't affect pages on server unless explicitly embedded in tag in html file, doesn't make sense because have style rules external files applied them, they're ignoring new rules. edit: tried copying new folder , loading server way, , new css rules apply, looks iis loading old version of either html or css file.

chromecast - Google Cast Session Stop Unexpectedly with error code 2005 -

i implementing google cast sdk v3. saw onsessionended(with error code 2005) called unexpectedly in between video playing. due session got ended , video stop casting. not able understand why onsessionended being in between video playing. using default application id google chromecast.

How to configure a proxy in a .Net Core Console App -

in previous .net console applications can avoid proxy 407 errors including following in app.config : <system.net> <defaultproxy usedefaultcredentials="true"/> </system.net> .net core console app not have app.config - how can same? specifically azure documentdb documentclient . it looks azure -oriented team didn't implement such feature. here link recent github issue azure ad library , states that currently adal .net doesn’t support webproxy configuration. please configure proxy @ system level. httpclient used adal should able use it. production team has planned add function in future version, don’t have estimation time. as far 1 can see, there no such feature available in microsoft.azure.documents.client namespace or in microsoft.azure.documents namespace, have resolve on system level. can create github issue or contact team on msdn or email . as general .net core app, can use httpclienthandler cla

ios - Value of variable not changing in observeSingleEvent -

the variable num changes want inside observesingleevent, after changes empty value. how value of num change?? var num = int() firdatabase.database().reference().child("menus/day1").observesingleevent(of: .value, with: {(snap) in print(snap) if let snapdict = snap.value as? [string:anyobject]{ self.num = snapdict["date"] as! int print(num) //returns number want } }) print(num) //returns empty value if num == 5 { print("number 5") else { print("number not 5") //goes } any work need values coming firebase must done within completion handler (the with part of method call). use/manipulate num value firebase, need use within completion handler. var num = int() firdatabase.database().reference().child("menus/day1").observesingleevent(of: .value, with: {(snap) in print(snap) if let snapdict = snap.value as? [stri

spring integration - ClassCastException: com.fasterxml.jackson.databind.node.MissingNode cannot be cast to com.fasterxml.jackson.databind.node.Arraynode -

i have reader maps data instagram system. when performing junit test ran classcastexception. test class has following code: public class instagramtojsonmappertest extends abstractmappertest { private instagrammapper instagrammapper; private boolean printresult = true; @before public void setup() { super.setup(); instagrammapper = new instagrammapper(128); } private void comparejson(string unmapped, string mapped) throws exception { jsonnode unmappedjson = loadjson(unmapped); jsonnode mappedjson = loadjson(mapped); message<jsonnode> msg = messagebuilder.withpayload(unmappedjson).build(); message<jsonnode> resultmsg = instagrammapper.map(msg); jsonnode result = resultmsg.getpayload(); if(printresult) { system.out.println("processed: " + result); system.out.println("expected: " + mappedjson.tostring()); } assert.asserttrue(jacksonutil

ruby on rails - database cleanup with capybara -

i'm using capybara, minitest, database_cleaner gem, i'm curious database cleaner not cleanup database after running test, test running well, user created , can login successfully, re-run test same data, , said email taken, meaning: database_cleaner not running below test require "test_helper" require "database_cleaner" feature 'register new user' scenario 'register', js: true databasecleaner.strategy = :transaction databasecleaner.start visit '/sign_up' within '#new_user' fill_in 'user name', with: 'user4' fill_in 'email', with: 'user4@gmail.com' fill_in 'password', with: 'password4' fill_in 'password konfirmasi', with: 'password4' click_button 'sign up' end databasecleaner.clean page.must_have_content 'user setting & info' end end and below gemfile testing group

hibernate update for a one to many relationship when associate table gets more rows -

entity @table(name = "service") public class service implements serializable { /** constant serialversionuid. */ private static final long serialversionuid = 1l; /** serviceid. */ @id @sequencegenerator(name = "service_seq", sequencename = "service_seq", allocationsize = 1, initialvalue = 1) @generatedvalue(strategy = generationtype.sequence, generator = "service_seq") @column(name = "service_id", columndefinition = "number(10)") /** description. */ @column(name = "description", columndefinition = "varchar(500)") private string description; @onetomany(targetentity = serviceaddress.class, mappedby = "service", cascade = cascadetype.all, orphanremoval = true) private set<serviceaddress> serviceaddressset; } @entity @table(name = "address") public class serviceaddress implements serializable { /** constant seri

How to insert words in 2D array with delimiters? Using BASH script -

in text file have this: worda|wordc wordb|wordd i have array: arr=(worda|wordc wordb|wordd) arr[0]=(worda wordc) arr[0][0]=(worda) arr[0][1]=(wordc) arr[1]=(wordb wordd) arr[1][0]=(wordb) arr[1][1]=(wordd) edit: if not possible, how can have array: arr1=(worda wordb) arr2=(wordc wordd) as mentioned bash not support true 2d arrays, can simulated using associative arrays. something seems work ok in tests: a=$'a|c\nb|d' echo "$a" && echo declare -a array ifs=$'\n' read -r -d '' -a arr1 <<<"$a" #declare -p arr1 ((i=0;i<"${#arr1[@]}";i++));do ifs="|" read -r -a arr2 <<<"${arr1[$i]}" ((k=0;k<"${#arr2[@]}";k++));do array[$i,$k]="${arr2[$k]}" done done declare -p array output: a|c b|d declare -a array='([0,0]="a" [0,1]="c" [1,0]="b" [1,1]="d" )' so h

jquery - on calling javascript file from angular 2 project -

i had written calendar control in jquery wanted use in angular 2 project. i've learned other answers on topic can use jquery's getscript api call external javascript files. my calendar.component.ts looks this: import { component, oninit, afterviewinit } '@angular/core'; import { auth } '../auth.service'; declare var $:any; declare var customcal:any; @component({ selector: 'app-calendar', templateurl: './calendar.component.html', styleurls: ['./calendar.component.css'] }) export class calendarcomponent implements oninit { private year : number; mycal : any; constructor(private auth : auth) { } ngoninit() { } ngafterviewinit() { this.year = 2017; $.getscript('./app/calendar/zapcalendar.js', function(){ console.log("got call'd back"); this.mycal = new customcal(2017);

Using PHP google client to get YouTube playlist (server-side oauth) -

i using php google_client youtube playlist data on web (a server-side oauth ,without user check ) error: redirect_uri_mismatch , message the redirect uri in request, http://localhost/youtube/oauth2callback.php , not match ones authorized oauth client. visit https://console.developers.google.com/apis/credentialsoauthclient/112609190871896620853?project=756606231401 update authorized redirect uris. here http://localhost/youtube/index.php code <?php require_once 'vendor/autoload.php'; session_start(); $client = new google_client(); $client->addscope('https://www.googleapis.com/auth/youtube'); $client->setauthconfigfile('youtube-762b39a4f0b5.json'); if (isset($_session['access_token']) && $_session['access_token']) { $client->setaccesstoken($_session['access_token']); $youtube = new google_service_youtube($client); $playlists = $youtube->playlists->listplaylists("snipp

Disk out of space on Azure Web app on Linux -

i having trouble building , deploying new docker containers on azure web app on linux. error logs claiming out off space, , when looking @ disk usage through kudu can see i'm indeed out of space. />df -h gives: filesystem size used avail use% mounted on none 29g 28g 0 100% / /dev/sda1 29g 28g 0 100% /etc/hosts have deployed several docker containers in web apps before , removed them aswell seems still taking space. creating new app service plan without deployed gives 5.7g of free space. can't seem run docker commands kudu terminal i'm not able check how many images , can't figure out how clean space. sodu isn't available. have ideas how free space? your disk indeed full of docker images. have cleared them off; should unblocked. this known issue have fix soon. iterating , deploying new containers common scenario, , goal should abstracted away , should not have worry this.

c# - Could not establish secure channel for SSL/TLS -

i have wcf service setup use server , client certificate : servicehostfactory.createservice<myappclientservice>($"https://localhost:{serversettings.smartcardsslport}/myapp5service/sll") .useprotobuf() .addservicebehavior(new customservicebehavior_clientservice()) .addauthorizationpolicy(new customauthorizationpolicy_clientservice()) .usesecureconnection(environmentsettings.secureconnection) .usethrottling() .start(endpointservice.createnethttpsbinding(true)); await servicehandler.registerclientservicetoconsul(myappservices.clientserver_smartcard, serversettings.smartcardsslport); public servicehostbuilder<t> usesecureconnection(secureconnectionsettings settings) { if (settings != null && settings.enabled) { console.writeline("setti

iphone - ERROR | [iOS] file patterns: The `source_files` pattern did not match any file -

i renamed existing library github, changed , things working fine apart it's not validating library - pod spec lint kjcircularslider.podspec trunk push. checked folder structure , looks perfect, can me can actual issue? here library if want check folder structure - kjcircularslider here podspec file. pod::spec.new |s| s.name = 'kjcircularslider' s.version = '0.1.0' s.summary = 'circular slider - slide 0 100 in circular shape' # description used generate tags , improve search results. # * think: do? why did write it? focus? # * try keep short, snappy , point. # * write description between desc delimiters below. # * finally, don't worry indent, cocoapods strips it! s.description = <<-desc todo: add long description of pod here. it's circular slider, provides circular shape slide around 0 100 percent, can use when required circular shape on slider rather traditional ios line shape slide

reactjs - React virtualized table custom rowRenderer state -

i trying create custom rows on table own state. unfortunately, rowrenderer property on table component must proptypes.func , not full react component have access lifecycle methods , state . there reason this, or there alternative method me able have stateful component each row? see https://github.com/bvaughn/react-virtualized/blob/master/source/table/table.js#l167 i should mention understand these row components may unmounted when scroll off screen. ok that, long can have state when in viewport. you can return class component (with lifecycle hooks) function prop rowrenderer . eg function rowrenderer(props) { return <rowcomponent {...props} /> }

ios - Load data from a plist to two TableViews -

Image
i having trouble load data property list. take look… directory.plist : i wanna show of this, right here on main.storyboard : but keys position e name appear on first tableviewcontroller , keys functionary , imageface , phone have appear on second tableviewcontroller . to this, made this: added appdelegate following: func application(_ application: uiapplication, didfinishlaunchingwithoptions launchoptions: [uiapplicationlaunchoptionskey: any]?) -> bool { if let url = bundle.main.url(forresource: "directory", withextension: "plist"), let array = nsarray(contentsof: url) as? [[string:any]] { shared.instance.employees = array.map{employee(dictionary: $0)} } return true created struct this: struct employeedetails { let functionary: string let imageface: string let phone: string init(dictionary: [string: any]) { self.functionary = (dictionary["functionary"] as? string) ?? "" self

c++ - Changing linked list into template -

i've written linked list stores informations students. how can change template, have store ints or other type? have overload methods in linked list class, cause take 6 arguments? mean, method inserting @ end(for student data) looks this: void insertatend(int index, string name, string surname, int yearofstudy, string fieldofstudy, string specialty); and if want store ints, this: void insertatend(int data); so if want use templates adding students , example integers, should this? template <class t> class llist{ void insertatend(int index, string name, string surname, int yearofstudy, string fieldofstudy, string specialty); void insertatend <t data>; } here implementation of student , linkedlist class: class student { public: int index; string name; string surname; int yearofstudy; string fieldofstudy; string specialty; student *next; //pointer next item student(); }; student::student() { next = 0; } class llist {

activerecord - Select sum and dynamic where statement query in Rails 4 -

i have below statement in controller , want know how rewrite in rails 4 entry.find(:all, :conditions => [@conditions.keys.join(" , "), *@conditions.values],:group => "user_id", :select => "sum(time_spent) total_spent") the condition has user_id information in "user_id=?" . the statement trying find entry particular user id , sum time spent user id , group user id. for example can use it realations = entry.where(user_id: [1, 2, 3]).select("sum(time_spent) total_spent").group(:user_id) after have relation can work realations.each |i| puts i.total_spent end

How can I calculate the number of months between YYYYMM integer values in PostgreSQL? -

how can calculate number of months between 2 yyyymm integer values in postgresql? data: | date1 | date2 | |--------|--------| | 201608 | 201702 | | 201609 | 201610 | desired output: | date1 | date2 | monthsbetweeninclusive | monthsbetweenexclusive | |--------|--------|------------------------|------------------------| | 201608 | 201702 | 7 | 6 | | 201609 | 201610 | 2 | 1 | i have looked @ postgresql date function documentation i'm unable find solution operates on yyyymm integer values. with t(d1,d2) (values(201608,201702),(201609,201610)) select *, ((d2/100*12)+(d2-d2/100*100))-((d1/100*12)+(d1-d1/100*100)) t;

git - File included in .gitignore gets deleted from time to time with no apparent reason -

i have file ignored .gitignore, time time file dissapears. file's inclusion in .gitignore present in branches don't think switching branches deleting it. idea may happen this? i think file tracked @ point it's untracked , ignored because depends on environment , each installation needs own version. there no deploy script may deleting it. edit: realized master's .gitignore had global reference env.php , staging's .gitignore had local reference subdir/env.php , maybe issue. based on description, looks file included in branches before including row in .gitignore if archive committed before adding exception, there until remove explicitly. review (and delete) file repository avoid problem in future. regards andoni

visual studio - How to get a list of AppV virtual processes using C# -

i trying list of virtual processes started microsoft appv using c#. i tried using powershell in c# error: system.management.automation.commandnotfoundexception: 'the 'get-appvvirtualprocess' command found in module 'appvclient', module not loaded. more information, run 'import-module appvclient'.' the weird thing if use powershell command line, works fine , lists virtual processes. so in c# did a: ps.commands.addcommand("get-command"); and shows get-appvvirtualprocess listed command: the result: function get-appvvirtualprocess 1.0.0.0 a i tried loading module in c# manually using: initialsessionstate initial = initialsessionstate.createdefault(); initial.importpsmodule(new string[] {@"c:\program files\microsoft application virtualization\client\appvclient\appvclient.psd1" }); and ps.commands.addcommand("import-module").addargument("appvclient"); but still gives me same error me

html - Why ID has stronger meaning than Class in CSS styling even if declared before the Class -

this question has answer here: css: understanding selector's priority / specificity 4 answers if declare in css file(or inside <style> </style> tags) firstly id of element , classname of same element, id styling applied, regardless fact classname latest 1 in order. i want know why happening , if has naming, please tell. just make more clear, take @ example, please: div { height:100px; width:150px; border:1px solid #000; margin:0 auto; } #theid { background:#090; } .theclass { background:#00f; } <div id="theid" class="theclass"></div> this complicated world of "specificity"... id's more specific classes , take precedence on them. because id's have unique on every page...so nature specific. classes can appear multiple times. learning how works fundamental coding c

c - Char array subscript warning -

when use char array subscript in example: int main(){ char pos=0; int array[100]={}; for(pos=0;pos<100;pos++) printf("%i\n", array[pos]); return 0; } i getting warning using char array subscript: warning: array subscript has type ‘char’ [-wchar-subscripts] which ok, because have warning enabled. gcc manual says: -wchar-subscripts warn if array subscript has type "char". common cause of error, programmers forget type signed on machines. warning enabled -wall. so warning should prevent of using negative array index. question is, why warning active on char , not on other signed types? thank you. this because int signed. char doesn't have to. char can signed or unsigned, depending on implementation. (there 3 distinct types - char , signed char , unsigned char ) but what's problem? can use values 0 127. can hurt me silently? oh, yes can. //depending on signedess of char, //eith

ios - Why is this data not displaying in my Swift 3 table -

so i'm trying parse json data retrieved server , display nicely in table, ive followed suggestions here: uitableview example swift , managed example working. however data im parsing table remains blank. can see im going wrong? import uikit import swiftyjson class logsviewcontroller: uiviewcontroller, uitableviewdelegate, uitableviewdatasource { let animals: [string] = ["horse", "cow", "camel", "sheep", "goat"] var arraycount:int = 0 struct item { let name : string let locktime : string let type : string } // cell reuse id (cells scroll out of view can reused) let cellreuseidentifier = "cell" var items = [item]() @iboutlet weak var textuodate: uistackview! override func viewdidload() { super.viewdidload() // register table view cell class , reuse id self.tableview.register(uitableviewcell.self, forcellreuseid