Posts

Showing posts from 2010

html - Comunication betwen two *.php -

i have login.php , register.php. in header.php can see loged user. can not find way how logout. next server.php if (isset($_get['logout'])){ session_destroy(); unset($_session['username']); header("location:homepage.php"); } and next header.php have <!doctype html> <?php include('server.php'); ?> <?php if (isset($_session['username'])): ?> <p> welcome <?php echo $_session['username']; ?></p> <a href="homepage.php?logout='1'">logout</a> <?php endif ?> <?php if (!isset($_session['username'])): ?> <p><?php echo "you not loged" ?></p> <?php endif ?> and looking find way "you not loged". , no s

visual studio code - How can I get "Go to Next Error or Warning" to work, or get my errors to show up in "PROBLEMS" tab? -

this more of 2 part question need find 1 of answers fix problem. the first question want ask how can "go next error or warning" keybind work when i'm in built in terminal mode? have .bat file builds .cpp file, , when run .bat file built in terminal , there syntax errors present, terminal displays errors. can ctrl-click on error , take me line in .cpp file, can not keybind (default f8) work , take me error. f8 in terminal mode repeats last command given. i've tried changing keybind ctrl-r, prints out "^r" in terminal mode. there way keybind work in terminal mode? my second question involves "problems" tab (ctrl-shift-m default). have researched, "go next error or warning" keybind take first problem listed in problems tab, can't problems tab show errors. know there errors in .cpp file trying compile, because when run build.bat file, shows me errors in terminal window, same errors not show in problems tab. there way fix , problem

How can I upload a file from AngularJS application to Firebase Hosting -

i using firebase hosting host angularjs application. using ng-file-upload grab user-uploaded image form have in application. want store user-uploaded image in folder on firebase hosting. cannot use firebase storage because need pre-determined, direct link image resource in various parts of platform. thought maybe use firebase functions upload file , store in firebase hosting. keep running cross-origin errors. could explain how structure firebase function can upload image firebase hosting? understand, firebase function not hosted @ same location rest of firebase hosting content, not sure if makes difference. firebase hosting exclusively versioned, deployed static content. cloud storage firebase right product you. when need "pre-determined direct link" mean need able know url before upload completes? if not, can use getdownloadurl() in firebase cloud storage sdk. if need know url in advance, following: upload file cloud storage using firebase sdk. create

c# - Xamarin MVVM Custom Model Properties? -

say have readonly model... [datacontract] public partial class person { [datamember] public virtual string lastname { get; set; } [datamember] public virtual string firstname { get; set; } } a view... <?xml version="1.0" encoding="utf-8"?> <contentpage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:class="theapp.apage" backgroundcolor="#03264a" padding="0,0,0,0"> <contentpage.content> <stacklayout backgroundcolor="transparent"> <listview itemssource="{binding personsearchcollection}"> <listview.itemtemplate> <datatemplate> <viewcell> <label text="{binding firstname}&quo

arcgis - implement a legend control for wpf -

i'm building app in wpf using v100.1 sdk .net. i've seen samples , references legend control in other sdks , 10.2.7 sdk, i'm not sure if same information available in v100 sdk. searching through api can't see legend except showinlegend property on layer. does know if it's possible create full featured legend similar 'content' pane in arcgis online using wpf v100 sdk?

python - Get class with highest score -

i use following code predictions. for node_id in top_k: score = predictions[0][node_id] human_string = label_lines[node_id] print('%s (score = %.5f)' % (human_string, score)) the above code prints predictions scores classes. however, how label highest score? here's solutions using max score, key = max((v, k) k, v in predictions[0].items()) print('{} (score = {:.5f})'.format(label_lines[key], score))

javascript - massive.connectSync not a function -

why error, massive.connectsync not function when run server.js. works on mac, not windows. please solve enter code here error var express = require("express"); var app = express(); var http = require('http'); var massive = require("massive"); var connectionstring = "postgres://massive:@localhost/marketspace"; // connect massive , db instance. can safely use // convenience sync method here because on app load // can use loadsync - it's alias var massiveinstance = massive.connectsync({connectionstring : connectionstring}) // set reference massive instance on express' app: app.set('db', massiveinstance); http.createserver(app).listen(8080); synchronous functions no longer supported, , connect function no longer exists, it's promises way: var express = require("express"); var app = express(); var http = require('http'); var massive = require("massive"); var connectionstring = "post

ios - UITableViewCell containing UIStackViews use lots of memory -

usually, app uses around 50mb of ram @ most, noticed ram usage on 100mb. this happens on uitableviewcontroller . have prototype cell uiimageview , , beside it, uistackview contains 2 labels, , uistackview containing uiimageview , uilabel . after investigating, found uitableviewcell , , more when have uistackview within it. when load more cells, memory goes higher. i'm not doing modification cell in cellforrowat: , , i've tested separate cell make sure, , had same issue. instruments shows there no memory leaks. i'm using xcode 9 beta 5 , swift 4. override func tableview(_ tableview: uitableview, cellforrowat indexpath: indexpath) -> uitableviewcell { let cell = tableview.dequeuereusablecell(withidentifier: "mycell", for: indexpath) return cell } it seems if issue code using dynamic cell heights in uitableview . so, has been fixed.

java - How to share properties between class instances and other possible users of those properties? -

say there multiple classes { c1 , c2 , ...} implement interface i , containing, among other things, methods called getcolor() , getname() , , move() . every instance of c1 returns same value when getcolor() , getname() called, same c2 , of other classes implement i . move defined per class, too, affected instance variables , may not behave same way per instance. implementations of getcolor() , getname() in c1 class might like: public color getcolor() { return color.red; } public string getname() { return "c1!!!"; } all objects implementing interface i can added , drawn screen. suppose, however, way in objects added, through different screen, buttons on it. when 1 of buttons clicked, signals application type of object associated clicked should added screen. if goal label button associated c1 string returned c1 's getname() , color button color returned c1 's getcolor() , 1 instantiate new instance of c1 , , retrieve name , color customize

python - subprocess.call requiring all parameters to be separated by commas -

i used able subprocess.call(["command","-option value -option value"]) , work there change command work things in quotes, have change subprocess call command this: subprocess.call(["command","-option","value","-option","value"]) is there can work other way again in python? the os.system("command -option value -option value") works same did before. you'll need specify shell=true subprocess.call interpret string. see note in subprocess.popen constructor documentation (the subprocess.call method takes same arguments subprocess.popen constructor).

Android Fragment Inheritance -

edit: in fixing problems pointed out @editpandaforce, stumbled upon problem. basefragment lines in logcat not fragment, ones leading one. oncreateview not called in fragment yet. i having 2 problems android app i'm writing. first, have fragmentfoo inheriting abstract basefragment. oncreateview() executes basefragment code. fragmentfoo.oncreateview() not execute @ all. second, databasehandler db returning null in function fragmentfoo.loadstuff(), not null in basefragment.oncreateview(). oncreateview() called before loadstuff() is. i'm guessing 2 related , i'm missing critical in inheritance relationship. here code: fragmentfoo: public class fragmentfoo extends basefragment { private long flserial; @override protected void setupfragment() { stitle = "view foo"; idlayout = r.layout.fragment_foo; } @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) {

java - ThreadLocal source code Confusion -

public class app { public static void main( string[] args ) { threadlocal<string> threadlocal = new threadlocal<string>(); threadlocal.set("string1"); threadlocal.set("string2"); threadlocal.set("string3"); system.out.println("=============="); system.out.println("++ " + threadlocal.get()); system.out.println("++ " + threadlocal.get()); } } output ============= ++ string3 ++ string3 see set method in source code, specified thread,its threadlocalmap can hold on 1 map entry? sample shows, map.set(this, value); here "this" var "threadlocal", "string3" override previous value. mistake this? public void set(t value) { thread t = thread.currentthread(); threadlocalmap map = getmap(t); if (map != null) map.set(this, value);// here "this" var "threadlocal"

xmlhttprequest - POST parameters not seen by ResourceRequest.getParameter -

in liferay 7 have servlet can serve resource: @override public void serveresource( resourcerequest resourcerequest, resourceresponse resourceresponse) throws portletexception { // parameter log.info("text:" + resourcerequest.getparameter("text")); // debug info log.info("parameters:" + collections.list(resourcerequest.getparameternames())); log.info("resourcerequest:" + resourcerequest); log.info("private:" + resourcerequest.getprivateparametermap()); } i call post, here request seen wireshark: post /web/guest/home?p_p_id=nico_my_portlet_myportlet_instance_8bdmsytib7r1&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_resource_id=addresurl&p_p_cacheability=cachelevelpage http/1.1 host: localhost:8080 user-agent: mozilla/5.0 (x11; ubuntu; linux x86_64; rv:54.0) gecko/20100101 firefox/54.0 accept: */* accept-language: en-us,en;q=0.5 accept-encoding: gzip, deflate con

cryptojs - React-Native Crypto-js Cannot Decrypt String on iPhone 7 Plus Simulator -

in react-native ios project, trying use crypto-js decrypt string below code: import * cryptojs "crypto-js" let key = "samplekey" let key = "sampleiv" let decryptedstring = cryptojs.aes.decrypt(string, cryptojs.enc.base64.parse(key), { iv: cryptojs.enc.base64.parse(iv)}).tostring(cryptojs.enc.utf8) this decryption method works on ios simulator except iphone 7 plus (ios 10.3). see simulator error image here any idea on cause?

python - How to make an index combining values of lists nested in tuples? -

i'm having hard time achieving need achieve wondering if here me :-) i've seen example 11.4. (list membership) on http://openbookproject.net/thinkcs/python/english3e/lists.html , it's quite close goal in ways. the project is: starting list of tuples refering ( key , [ list of values ]) my_list = [('a',[0]), ('b',[1]), ('c',[2]), ('a',[3])] i'd scan 'my_list' in order append nested lists, combining lists of values 1 key , : my_list = [('a',[0, 3]), ('b',[1]), ('c',[2])] i succeeded combine values manually i'd automate , can't find how so! ^^ for now, here i've got : # my_input == 'a b c a' #splitting input list >>> raw_list = my_input.split() >>> raw_list ['a', 'b', 'c', 'a'] #getting enumeration each entry #### (in order of appearance, important!) #### >>> enum_list = [(b,[a]) a, b in enumerate(raw_list)]

php - File upload using curl is not working -

i trying upload file using curl in symfony uploading not working, code given below. public function filepassingaction(request $request, $guid) { $ch = curl_init(); curl_setopt($ch, curlopt_url, "http://192.168.0.41/lis/web/app_dev.php/interface/file-upload"); curl_setopt($ch, curlopt_header, false); curl_setopt($ch, curlopt_returntransfer, true); curl_setopt($ch, curlopt_post, true); curl_setopt($ch, curlopt_postfields, array( 'file' => '@'.$this->getparameter('directory1').'/file.pdf', )); $result = curl_exec($ch); curl_close($ch); ($result); return new jsonresponse($result); } receiving action public function fileuploadaction(request $request) { $file = $request->files->get('file'); // generate unique name file before saving $filename = md5(uniqid()) . '.' . $file->guessextens

node.js - Not able to connect Python client with Nodejs server -

i trying connect python client nodejs server. python client showing error message. this server program: server.js var app = require('express')() , server = require('http').createserver(app) , io = require('socket.io').listen(server); server.listen(3000); io.sockets.on('connection', function (socket) { console.log('connected'); }); here client program: hub.py from socketio_client import socketio socket = socketio('localhost', 3000) when run hub.py shows following error: traceback (most recent call last): file "hub.py", line 3, in <module> socketio('localhost', 8002, loggingnamespace) socketio: file "/usr/lib/python3/dist-packages/socketio_client/__init__.py", line 331, in __init__ resource, hurry_interval_in_seconds, **kw) file "/usr/lib/python3/dist-packages/socketio_client/__init__.py", line 51, in __init__ self._transport file "/usr/lib/pytho

How to write unit tests supporting Javascript 6 modules -

my javascript codebase based on new es6 modules . so have javascript files example: export class myclass { constructor() { this.list = []; } add(el) { this.list.push(el); } } as module, import file in other javascript files this: import * lists "./myclass"; and inside html page, following syntax has used: <script src="myclass.js" type="module"></script> unit testing i need framework testing code. problem using javascript 6 modules, modern frameworks karma have problems import files not modules: module.exports = function(config) { config.set({ files: [ 'src/**/*.js', 'test/**/*.js' ], ... }) } above example of karma.conf.js . in specific case of karma, runner not import files modules, injection in page fails. what unit test frameworks can use testing javascript 6 modules? you can check out jest , it's facebook's test framework allows run tests on n

selenium - Protractor tests fail to start on Safari Sierra and throwing driver.version: unknown, SessionNotCreatedError error -

protractor version: 5.1.2 safari version: 10.1.2 i have enabled 'allow remote automation' safari -> develop , started safari driver cmd using following command: /usr/bin/safaridriver -p 8844 now, trying run protractor tests using protractor conf.js. tests fail start following logs: build info: version: '3.5.1', revision: '9c21bb67ef', time: '2017-08-16t21:10:06.092z' system info: host: 'dyn-49-127-9-116.its.monash.edu.au', ip: 'fe80:0:0:0:479:1a15:751b:51d6%en0', os.name: 'mac os x', os.arch: 'x86_64', os.version: '10.12.6', java.version: '1.8.0_144' driver info: driver.version: unknown [15:28:40] e/launcher - sessionnotcreatederror: not create session: must enable 'allow remote automation' option in safari's develop menu control safari via webdriver. (warning: server did not provide stacktrace information) command duration or timeout: 32 milliseconds build info: version: '3

ios - moreNavigationController is always nil in UITabBarController -

i'm trying customize title of more button in uitabbarcontroller i'm doing app in language. subclassed uitabbarcontroller able access tabbarcontroller property. unfortunately, it's nil wether put in viewdidload or viewdidappear(_) . thoughts on how can edit it? import uikit class controllervc: uitabbarcontroller { let uimanager = uimanager() override func viewdidload() { super.viewdidload() } override func viewdidappear(_ animated: bool) { if let tabbaritem = tabbarcontroller?.morenavigationcontroller.tabbaritem { let deselectedimage = tabbaritem.image let selectedimage = tabbaritem.selectedimage tabbarcontroller!.morenavigationcontroller.tabbaritem = uitabbaritem(title: "بیشتر", image: deselectedimage, selectedimage: selectedimage) } else { uimanager.showactivityindicator(self) } } } the problem not morenavigationcontroller . problem tabbarcontroller . class uitabbarcontroller . tab bar contr

c - Error accessing 64bit DLL function -

i have created 64bit dll file using microsoft visual studio 2015. visual c --> win32 project. the code squaremain.c follows : long _stdcall square(long a) { return a*a; } the code defile.def follows : library "square" exports squareforexl=square i have build dll using configuration manager settings set platform , active solution platform x64 64bit dll. i have access dll functions through excel vba7. function in vba follows : private declare ptrsafe function squareforexl lib "c:\math.dll" (byval x long) long sub square() dim b long b = 5 dim c long debug.print b c = squareforexl(b) debug.print "square : " & c end sub while trying access dll function squareforexl() in code above, shows following error msgbox: run time error '53': file not found :"c:\math.dll" i have tried placing file in different location directories, in systems folder. i have compiled , execute

javascript - Delete key/value pair from json array obtained from ajax response if key is found -

i fetching data 1 list in sharepoint , storing in json array pass onto function create new item in sharepoint list.the first function is: $.ajax({ url: somesharepointlisturl, type: "get", headers: {"accept": "application/json;odata=verbose"}, success: function (data) { var array = new array(); (var i=0; i< data.d.results.length; i++) { var it=data.d.results[i]; array.push({ alllinks: it.alllinks, linkurl: it.linkurl.url }); } datacharts=json.stringify(array); alert(datacharts); adddefaultlinks(datacharts); }, error: function (data) { alert(data.responsejson.error); } }); the item stored in list as: [{"name":"name1","url":"http://www.name1.com"},{"name":"name2","url":"http://www.name2.com"}] second functi

python - Object Detection using Tensorflow -

i following tensorflow object detection tutorial oxford-iiit pets dataset: https://github.com/tensorflow/models/blob/master/object_detection/g3doc/running_pets.md i have generated "frozen_inference_graph.pb" latest checkpoint. how can test inference graph - "frozen_inference_graph.pb" , pet labels - "pet_label_map.pbtxt" on image. i have tried using jupytor notebook nothing gets detected in image. have used following python code detecting "dog" , "cat" nothing gets detected. python code given below: import os import cv2 import time import argparse import multiprocessing import numpy np import tensorflow tf utils import fps, webcamvideostream multiprocessing import queue, pool object_detection.utils import label_map_util object_detection.utils import visualization_utils vis_util path_to_ckpt = os.path.join('frozen_inference_graph.pb') path_to_labels = os.path.join('pet_label_map.pbtxt') num_classes = 37 lab

makefile - tar: file changed as we read it -

i using make , tar backup. when executing makefile, tar command shows file changed read it . in case, the tar package ok when warning comes up but stops tar command following backup the file showing warning in fact doesn't change -- strange warning comes up the files showing warning come randomly, mean, everytime run makefile, files showing warning different --ignore-failed-read doesn't help. using tar 1.23 in mingw i changed computer win7 64 bit. script works in old win7 32 bit. tar version not new 1.23. how can stop tar's warning stop backup following warning? edit-2 : might reason as said above, bash shell script worked in old computer. comparing old computer, msys version different. version of tar command. in old computer, tar 1.13.19 , 1.23 in new computer. copied old tar command without copying dependency msys-1.0.dll new computer , renamed tar_old. , updated tar command in shell script , run script. ok. so, seemed problem tar command. sure th

Accept a finite number of HTTP requests in Python app -

i new python , want build application can accept number of http requests, go on parse these requests , process data stored in body. i have found lot of tutorials rest apis , ways create servers indefinitely accept incoming requests, however, not seem practice me start such server force stop after short amount of time. in addition, need compare data within request bodies determine when stop accepting requests, , had trouble storing data between request handler calls using flask. my question this: what practice accepting http requests in python, amount of requests received depends on data in each request body (such when requirement met, program can stop accepting connections , go on process stored request data) try use flask.g store request counter, http://flask.pocoo.org/docs/0.10/api/#flask.g if counter reach upper limit , shutdown flask how stop flask application without using ctrl-c sorry, misunderstand, flask.g threadlocal in java, different between requests.

Convert lat,lon to xyz in awe.js -

can tell me how convert lat,lon xyz , show point of interest using awe.js in web browser setting lat=x,lon=y ,z=0 (unknown) poi not appearing in correct direction var locations=[ {lat:31.491104, lng:74.332338}, {lat:31.488433, lng:74.347187} ]; for(var i=0;i<locations.length;i++){ var l=locations[i]; var x=l.lat; var y=l.lng; var z=0;//unknown how find awe.pois.add({ id:'poi-'+i, position: { x:x, y:y, z:z } }); // add projections each of pois awe.projections.add({ id:'p-'+i, geometry:{ shape:'cube', x:20, y:20, z:20 }, rotation:{ x:20, y:20, z:0 }, material:{ type: 'phong', color:0xff0000, }, }, { poi_id: 'poi-'+i }); }

java - Exception encountered during context initialization - cancelling refresh attempt -

warning: exception encountered during context initialization - cancelling refresh attempt org.springframework.beans.factory.beancreationexception: error creating bean name 'registrationcontroller': injection of autowired dependencies failed; nested exception org.springframework.beans.factory.beancreationexception: not autowire field: com.concept.userservice com.concept.registrationcontroller.userservice; nested exception org.springframework.beans.factory.cannotloadbeanclassexception: cannot find class [com.concept] bean name 'userservice' defined in servletcontext resource [/web-inf/spring-servlet.xml]; nested exception java.lang.classnotfoundexception: com.concept can please might cause .i new spring framework warning: exception encountered during context initialization - cancelling refresh attempt org.springframework.beans.factory.beancreationexception: error creating bean name 'registrationcontroller': injection of autowired dependencies failed; neste

tinkerpop - How can I use gremlin-console to remotely create and access variables? -

i remotely connect gremlin server using gremlin-console(which janusgraph), when create variable , access it, doesn't work. ultimate goal use gremlin-console create index... gremlin> :remote connect tinkerpop.server conf/remote.yaml ==>configured localhost/127.0.0.1:8182 gremlin> :remote console ==>all scripts sent gremlin server - [localhost/127.0.0.1:8182] - type ':remote console' return local mode gremlin> = "b" ==>b gremlin> no such property: class: script3 type ':help' or ':h' help. you can't use variables subsequent requests, because console default sessionless. every request executed in own transaction , no state shared between 2 different requests. however can configure console use session appending session keyword connect argument: gremlin> :remote connect tinkerpop.server conf/remote.yaml session ==>configured localhost/127.0.0.1:8182-[15dc7030-0e5b-4b4b-a997-9d2cf519ebb2] gremlin> :

ruby on rails 4 - Background jobs occur very frequently and eat memory -

i'd optimize notification system, here how works now: every time change occurred on application, we're calling background job (sidekiq) in order compute values , notify users via email. this approach worked while, got memory leak there lot of actions , had 30-50 workers per second need refactor this. what is, instead of running worker immediately, store in array , perform bit later. but i'm afraid cause problem, "delayed" problem. i'm looking forward hear more approaches , solutions well. thanks in advance so found 1 interesting solution: i'm storing values redis directly key - value , value dataset data i'd need later computation. i'm using simple cron job, occurs service responsible reading data redis , computing them. optimized sidekiq workers work when cron executed, works fine , faster before. i'm still eager hear if there other approach/solution. thanks

installation - Plan and Implementation of Caching on File Server -

can please tell me procedure , requirement if want setup caching file server? have never implemented such thing , don't have clear idea how implement it, step step (main) procedure , requirement highly appreciated. scenario: selecting "documentation" option application end user can see files or document (mainly pdf , xml) on application screen name (metadata) of files fetched database. when user click on file name on screen request goes database , database call documentum server actual files kept. documentum work through documentum web services (back-end of documentum) job. actual file opened or downloaded. in process if customer has 10-15 documents takes more time load , want speed process. information: application , documentum hosted on linux , database on aix. files static. all files have unique id. average size of files 3 mb. if new version of same data created kept on same directory versioning. (same file not edited) some questions: is method

local - Installing Bosh Lite on Windows 10 -

i tried following guide install bosh lite on windows 10 machine: https://bosh.io/docs/bosh-lite if download bosh-cli-2.0.28-windows-amd64.exe , open it, opens command prompt , closes it. the second problem is, console commands linux/ubuntu. what i´m doing wrong? possible bosh light 2 running on windows machine. i have say, i´m newbie stuff, task can done or whould have use linux? greetings marcel update: ok, understand must installed on console. complete tutorial including console comands linux. know tutorial windows or how translate linux commands in windows? tutorial: bosh.io/docs/bosh-lite

Falsh Format XML &amp; from c# -

Image
hi everybody, can find solution problem, xml format & amp; want &, "12" , want 12, code: static void main(string[] args) { string[] lines = file.readalllines(@"h:\epgvividtvaugust2017.csv", encoding.getencoding("windows-1252")); int id = 1; var doc = new xdocument( new xdeclaration("1.0", "utf-8", null), new xelement("event_information", new xattribute("data_set_type", "replace"), new xelement("service", new xattribute("name", "tv"), str in lines let columns = str.split(';') select new xelement("event", new xattribute("start", columns[0] + " " + columns [1]), // new xattribute("duration", columns[5]), new xelement("short-event-descriptor", new xattribute("language", "deu"), new xelement(&q

sass - Undefined variable: "$gray-lighter" in DatePicker CSS -

i building , deploying liferay theme through liferay-theme-generator have sass 3.4.22 version. have datepicker.scss version 2.0 in css folder. when building having error build/_css/datepicker.scss (line 117: undefined variable: "$gray-lighter".) in build folder, _variables contains variable $gray-lighter there. hope can give me light here. just update this, able fix issue adding import of variables of bootstrap _variables.scss class in custom.scss. hope can others when running issue. cheers!

Angular set css style for :host in ngOnInit -

i don't know how set css style :host {} in ngoninit in component. can use renderer set this? example: <app-a *ngfor ="let in alist" [a] = "a"></app-a> in ngoninit app-a wanna set width height style percent :host of app-a component when in rendered ngfor? can it? many thanks. you set styles in declarative way in component decorator: @component({ styles: [':host { display: block; }'] }); export class appcomponent {} but if need ngoninit , can insert host element , use renderer: export class appcomponent { constructor(private host: elementref, private renderer: renderer2) { } ngoninit() { this.renderer.setstyle(this.host.nativeelement, 'display', 'block'); }

angular - AngularFire2 orderByKey and startAt -

i have following database structure: { "users" : { "ap1-axlksd9aslkdjj0991" : { "enabled" : true, "color" : "red" }, "ap1-a778asduasdj8as8da" : { "enabled" : true, "color" : "blue" }, "ap2-asd88asd8asd8has8d" : { "enabled" : true, "color" : "red" } } } i'm trying users have key starting "ap1-" follows: import { injectable } '@angular/core'; import { angularfiredatabase, firebaselistobservable } 'angularfire2/database'; import * firebase 'firebase/app'; import { observable } 'rxjs/observable'; @injectable() export class firebaseservice { // // database userlist: firebaselistobservable<any>; public constructor( public afdb: angularfiredatabase) { } getusers() { return this.userlist = this.afd

android - okhttp3 - ssl connection to server -

i sending , post requests server using okhttpclient (okhttp3). how can secure connection ssl , identify myself self signed certificate? thanks! for self signed ssl certs check here . link contains code samples add self signed sll android. self cert using okhttp3 , check here hope may you.

javascript - Goggle Tag Manager not working on link clicks -

Image
i facing weird issue in google tag manager not able track links below markup <a onclick="javascript:some_method(event, url, 'param')">test</a> wherever, in code kind of markup, link tracking not working. is there special need track links javascript: notation? trigger looks below: tag looks below: any assistance please? you have problem trigger condition. click classes - matches css selector - .last-td a not work because click classes variable contains string value of class attribute dom element. you have 2 different ways solve problem: 1) need add class a link. example: <a onclick="javascript:some_method(event, url, 'param')" class="this-is-my-last-td-link">test</a> then condition work: click classes - equals - this-is-my-last-td-link 2) can change condition click element - matches css selector - .last-td a without changing markup update based on discus

MySql no output by date -

Image
i dont know how solution table1 table2[ ][] the sql select penjualan.tgl_penjualan, sum(total_jual) totaljual, max(b.total_beli) totalbeli penjualan join (select tgl_pembelian, sum(total_beli) total_beli pembelian group tgl_pembelian) b on penjualan.tgl_penjualan = b.tgl_pembelian group penjualan.tgl_penjualan order penjualan.no_penjualan desc why 2017-07-26 no output? the output output sql please try once last date 2017-07-27 instead of 2017-07-26 .(i don't have valid reputation that's why commenting here.).

java - Closing socket when stopping Nifi costom processor -

i've been working @ custom nifi processor (extends abstractprocessor) pretty supposed same puttcp customized own server. receives flowfile , sends data content server through socket. using: import java.net.socket; newsocket = new socket(servername, port) newsocketout = newsocket.getoutputstream(); newsocketreader = new bufferedreader(newinputstreamreader(newsocket.getinputstream())); the problem when stop processor never triggers onunscheduled() or onstopped() leaves sockets unclosed since supposed close them. have onscheduled() works fine. ideas on how sockets close when stop processor or why onunscheduled() or onstopped() never triggers?

codeigniter - Authorize.Net working process description -

i downloaded library authorize.net , did in controllers: public function chargecreditcard($amount='20') { $merchantauthentication = new anetapi\merchantauthenticationtype(); $merchantauthentication->setname(login_id); $merchantauthentication->settransactionkey(transaction_key); $refid = 'ref' . time(); $creditcard = new anetapi\creditcardtype(); $creditcard->setcardnumber("4111111111111111"); $creditcard->setexpirationdate("1226"); $creditcard->setcardcode("123"); $paymentone = new anetapi\paymenttype(); $paymentone->setcreditcard($creditcard); // preparing order data transaction $order = new anetapi\ordertype(); $order->setdescription("new item"); //create transaction $transactionrequesttype = new anetapi\transactionrequesttype(); $transactionrequesttype->set

devops - SonarQube webhook sending empty JSON after build -

Image
i working on sonarqube integration our project management application. that, have use sonarqube web hooks trigger application. i set hook , after every build sonar sending empty json in post body. how configure data , proper response hook. as discussed json payload correctly sent in post http request.

java - Exception evaluating SpringEL expression: "profesor.post" when trying to display posts that belong to currently logged user in Spring -

i using spring , have application profesors can post posts. trying display posts belong 1 profesor posting them or logged in. between profesor , posts classes have bidirectional relationship one-to-many trying achieve this: profesor.java @entity public class profesor extends user { @onetomany(mappedby = "profesor", fetch = fetchtype.lazy) private list<post> post; //getters , setters } post.java @entity public class post { @manytoone(fetch = fetchtype.lazy) @joincolumn (name="profesor_id", referencedcolumnname="id", unique=true) private profesor profesor; //getters , setters } and trying display this index.html <tr th:each="post : ${profesor.post}"> <td class="message" data-th-text="${post.message}"></td> i got error in console el1008e: property or field 'post' cannot found on object of type 'java.util.arraylist' - maybe not public? or 1 in bro

Broadleaf commerce: Dynamic pricing - can not ordering the custom filter -

i working demo site (v 5.2) , trying implement dynamic price. i add mydynamicskupricingfilter , mydynamicskupricingserviceimpl following guideline: https://www.broadleafcommerce.com/docs/core/current/broadleaf-concepts/pricing/dynamic-pricing-configuration for ordering filters, in mydynamicskupricingfilter override getorder() method return number 700 000. have filter proceeded before filter blcartstatefilter has order number 1000 0000. however, debug show blcartstatefilter , bltranslationfilter proceeded before mydynamicskupricingfilter. ....blcartstatefilter, order 1000000.... ....bltranslationfilter, order 1000000.... ....mydynamicskupricingfilter 700000.... what wrong implementation? many thanks!

javascript - Creating a heatmap from polygons with leaflet -

i trying create heatmap leaflet using polygons data. data stored geojson. have been trying find plugin creating heatmap, seem work points , not polygons. writing in javascript. so far have tried using plugins http://leafletjs.com/plugins.html#heatmaps . does have suggestions or direction? thanks in advanced.

How to return 404 with Spring WebFlux -

i'm having controller 1 (in kotlin): @restcontroller @requestmapping("/") class customercontroller (private val service: customerservice) { @getmapping("/{id}") fun findbyid(@pathvariable id: string, @requestheader(value = if_none_match) versionheader: string?): mono<httpentity<kunderesource>> = return service.findbyid(id) .switchifempty(mono.error(notfoundexception())) .map { // etag stuff ... ok().etag("...").body(...) } } im wondering whether there better approach throwing exception annotated @responsestatus(code = not_found) i lie use routefunction instead of @restcontroller when spring 5 stable. define handlerfunction handle request, , declare routefunction map request handlerfunction: public mono<serverresponse> get(serverrequest req) { return this.posts .findbyid(req.pathvariable("id"))

java - Maven Ban Transitive Dependencies in parent pom to include in child application -

i have exclusion in parent pom jcifs jar. not want change parent pom affects many applications, possible me include jar in child application parent pom added dependency. if approach <bantransitivedependencies> <excludes> <exclude>org.x.y:jcifs</exclude> <exclude>*:jcifs</exclude> </excludes> </bantransitivedependencies>

php - need the result of mysqli query as a json array from this phpscript -

this php script $con = mysqli_connect(host,user,pass,db); if($_server['request_method']=='get') { $qry_check="select * `tb_user`"; $stmt = $con->prepare($qry_check); if ($stmt->execute()){ echo "success"; }} else echo "fail"; } ?> when run query on mysqli online server result have attached below need result json array when call json url, hanks in advance, enter image description here enter image description here try this <?php $con = mysqli_connect(host,user,pass,db); if($_server['request_method']=='get') { $stmt = $con->prepare("select * tb_user"); if ($stmt->execute()) { $users = array(); $user=$stmt->get_result(); while($row = $user->fetch_assoc()){ $users[]=$row; } $stmt->close();

scala - How to fetch Kafka Stream and print it in Spark Shell? -

Image
first built sbt in folder in following way val sparkversion = "1.6.3" scalaversion := "2.10.5" resolvers += "spark packages repo" @ "https://dl.bintray.com/spark-packages/maven" librarydependencies ++= seq( "org.apache.spark" %% "spark-streaming" % sparkversion, "org.apache.spark" %% "spark-streaming-kafka" % sparkversion

php - Laravel 5 – querying items by many-to-many related model -

i've got following many-to-many relation: attendees - attendee_tag - tag now want filter attendees based on tag value, i've created solution, works well: $attendees = attendee::wherehas('tags', function ($q) { $q->where([ ['attendee_tag.tag_id', '=', '6'], ['attendee_tag.value_string', '=', 'summer ticket'] })->with(['tags' => function($q) { $q->select('tags.id', 'value_type', 'attendee_tag.value_string', 'attendee_tag.value_int'); }])->paginate($pagination); but can't figure out, how filter attendees based on more 1 tag ... i've tried this, doesn't work: $attendees = attendee::wherehas('tags', function ($q) { $q->where([ ['attendee_tag.tag_id', '=', '6'], ['attendee_tag.value_string', '=', 'summer ticket'] ])->where([ [