Posts

Showing posts from February, 2013

user interface - Unity3d - How to parent a worldspace GUI to a car? -

how can attach worldspace ui onto car object? i'm using ui image rotational fill speedometer, how attach image car? i've made work setting position , rotation of car, moves it's position when turning, while still being rotated correctly. help? code: vector3 basepos = relevantparent.transform.position; vector3 tweakedpos = basepos; tweakedpos.x = tweakedpos.x + xoffset; tweakedpos.y = tweakedpos.y + yoffset; tweakedpos.z = tweakedpos.z + zoffset; transform.position = tweakedpos; transform.localrotation = relevantparent.transform.localrotation; https://docs.unity3d.com/scriptreference/recttransform.html recttransform, world space canvas has know position, rotation , on, inherits transform. transform can set parent object. so grab recttransform worldspace canvas , set it's parent cars transform. recttransform recttransform; recttransform.parent = transform; //transform of car.

python - How can I extract the audio embeddings (features) from Google’s AudioSet? -

i’m talking audio features dataset available @ https://research.google.com/audioset/download.html tar.gz archive consisting of frame-level audio tfrecords. extracting else tfrecord files works fine (i extract keys: video_id, start_time_seconds, end_time_seconds, labels), actual embeddings needed training not seem there @ all. when iterate on contents of tfrecord file dataset, 4 keys video_id, start_time_seconds, end_time_seconds, , labels, printed. this code i'm using: import tensorflow tf import numpy np def readtfrecordsamples(tfrecords_filename): record_iterator = tf.python_io.tf_record_iterator(path=tfrecords_filename) string_record in record_iterator: example = tf.train.example() example.parsefromstring(string_record) print(example) # prints abovementioned 4 keys not audio_embeddings # first label can parsed this: label = (example.features.feature['labels'].int64_list.value[0]) print('label 1

explain the seekbar listener in android -

in below please explain parameters passed listeners.that in sbar1.setonseekbarchangelistener(new seekbar.onseekbarchangelistener()) . thank you package com.example.centum.seekbar; import android.support.v7.app.appcompatactivity; import android.os.bundle; import android.widget.edittext; import android.widget.seekbar; public class mainactivity extends appcompatactivity { edittext etext1; seekbar sbar1; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); etext1=(edittext)findviewbyid(r.id.et2); sbar1=(seekbar)findviewbyid(r.id.sb2); sbar1.setonseekbarchangelistener(new seekbar.onseekbarchangelistener() { @override public void onprogresschanged(seekbar seekbar, int i, boolean b) { etext1.settextsize(i*5); }

.net - Access to UserManager in Asp.Net Core 2.0 -

i reference usermanager of identity, because create test user seed data. i context: var context = new mycontext(serviceprovider.getrequiredservice<dbcontextoptions<apicontext>>()) but need reference usermanager because need use create user in static seeddata class. i use asp.net core 2.0. is possible it? i pretty sure can use thru constructor injection. add identity startup.cs public class usersrepository { public usersrepository(usermanager<users> usermanager) { _usermanager = usermanager; } public void foo(){ _usermanager.dosomething(); } } it works me fine.

angular - ngFor with localStorage -

i got problem ngfor, im doing ngfor 1 array in order create cards images, array contains urls, when add new url card image show when reload url gone array <div class="card" *ngfor="let url of array"> and got add url in array this.array.push(url); so told need localstorage wont loose data did this test1=localstorage.setitem("arrayurl", json.stringify(this.array)); local = json.parse(localstorage.getitem("arrayurl")); after did <div class="card" *ngfor="let url of local"> but not working because images not being displayed when adding array, have add url array or localstorage or where? , how manage create thoose card images ngfor , make them permanently

How to load a GeoJSON layer on a MapBox GL JS map? -

i need load geojson feature collection layer (points) in mapbox gl js map. i've tried use html / javascript code <!doctype html> <html> <head> <meta charset='utf-8' /> <title></title> <meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' /> <script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.39.1/mapbox-gl.js'></script> <link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.39.1/mapbox-gl.css' rel='stylesheet' /> <style> body { margin:0; padding:0; } #map { position:absolute; top:0; bottom:0; width:100%; } </style> </head> <body> <div id='map'></div> <script> mapboxgl.accesstoken = '<put mapbox key here>'; var map = new mapboxgl.map({ container: 'map', style: 'mapbox://styles/mapbox/light-v9', cente

azure - Retrieving function app settings on commandline includes removed items -

i'm downloading app settings via batch file. use command: func azure functionapp fetch-app-settings myfuncapp it works great. noticed if delete key/value pair in azure, save it, , redownload app settings, still includes deleted pair. tried few more times, , each time, deleted values still show when download app settings. known issue? or there i'm missing in regards downloading app settings? the cli doesn't merge these settings. can take @ code here , grabs app settings azure , adds or updates local values match azure. if have value locally doesn't exist in azure, it'll leave alone. you can either delete manually file local.settings.json or can use command func settings delete <settingname>

php - Notice: Array to string conversion when inserting a stdClass into a stdClass -

i trying insert data database stdclass reason, notice notice: array string conversion in data.php on line 47 . i'm creating 2 stdclasses , 1 each vehicle , 1 general contains of them. when i'm trying insert vehicle's stdclass general 1 notice. here code (notice wrote line 47 is): $data = new stdclass(); while($row = mysqli_fetch_array($tresult)) { $vehicle = new stdclass(); $vehicle->name = $row['name']; $vehicle->position = $row['position']; $data->$row['name'] = $vehicle; //line 47 } what missing here? thank you try assign way, because have interpolate variable $data->{$row['name']} = $vehicle

Card-flip functionality in Django Quiz website -

i new django. technically first project. i building quiz web app in django, using tomwalker's quiz app present questions on card, when user answers question card shall flip , show explanation of question , correct answer. how populate backside of card answer explanation, after user submits his/her answer? in current implementation, when user clicks on submit button (to submit answer), page reloads next question , flip side of card not shown. questions.html template body: <body> {% load i18n%} {% if question %} <form action="" method="post"> {% csrf_token %} <section class="container"> <div class="card""> <div class="front"> <p> <small class="muted">{% trans "question category" %}:</small> <strong>{{ question.category }}</strong> </p>

mysql - What data scheme should I use for school website to handle the data of all students and staff along with their daily attendance? -

i new in dynamic web developing , working on school website can hold necessary data (including students' details, staff's details, transport routes, news, events, attendance, photos , other necessary data ). getting confused type of schema should use store data. because if use single table students i won't able handle daily attendance (separate each lecture/session), because in 1 row student's detail stored . will have create different table each person (students , staff) ? or if there other way achieve please let me know. hope have got problem. appreciated. in advance... based on op's comment could please tell me attendance ? or give me basic idea of how store attendance. , thats asking for. you want have table similar this... create table studentattendance(studentid int, attendancedate datetime, attended bit); have concatenated primary key on studentid , attendancedate way insert 1 record per day indicating whether student in attendance.

google chrome - Does the browser rearrange HTML if it violates some conditions -

i have template dynamically generating html <span> <p> words words words </p> <div> <span>text</span></div> </span> but when check rendered html, more <span><span> <p>words words words</p> <div><span>text</span></div> yes, browsers able "fix" broken code quite nowadays. problem here: nesting block elements inside inline elements. please change outer span div! if need fixing - please tell more template, js or php code? post code if possible.

logging - Tomcat logs explained -

i have tomcat installed on windows. in tomcat log directory have various logs: catalina localhost manager host-manager commons-daemon localhost_access_log tomcat8-stderr tomcat8-stdout i have been trying find out each 1 of logs coming , gets configured. nothing useful in tomcat documentation. i know logging.properties deals catalina, localhost, manager, , host-manager rest - have no clue. can help? localhost_access_log configured via access log valve. in server.xml relevant <valve> element. the remaining 3 (commons-daemon, tomcat8-stderr , tomcat8-stdout) generated tomcat service wrapper. renamed commons daemon executable. docs should have more info basics follows: commons-daemon - service wrappers own log file tomcat8-stderr - redirected output stand error service warpper process tomcat8-stdout - redirected standard out service wrapper process

bash - Cron Job with Java.jar creates no File -

i have simple java application on ubuntu 16.04 server. application generates prices.txt file. file generated if start directly with: java -jar tankstellenlogger.jar if schedule cron doesn´t create file , have no idea why? file running because in cron see log.txt want have other output, thats not all. crontab -e # m h dom mon dow command * * * * * /home/dominik/startlogger.sh > /home/dominik/log.txt startlogger.sh #!/bin/bash java -jar /home/dominik/tankstellenlogger.jar "prices.txt" possibly being written directory other you're expecting. try adding bottom of "startlogger.sh": pwd ls prices.txt 2>&1 that should print working directory "/home/dominik/log.txt" check whether "prices.txt" there. if info doesn't show in "log.txt", may permissions problem.

crystal reports - If number is not null -

i have function returns last instance of "percent" field last few values null. need not include these null values , return recent/last not null value. have changed setting default values null , {command.percent}<> 0.00 still returns 0.00 sounds job isnull() configure shared variable store latest value passes through it, only update value when not(isnull({yourvalue})) . when reach end of report, you'll recent/last nonnull value.

html - Using a PHP include for <head> to provide CSS is giving mixed results -

i want use php include section. have index.php , head.html in have usual stuff: title, etc plus link bootstrap cdn, , custom css file. upon testing, styles bootstrap work fine custom overrides aren't. under impression custom css files automatically override bootstrap? has worked me in past when linking them traditionally on every page of website. however, want use php includes save time. i've played around order of things (i.e. bootstrap first, custom css first etc), i've tried linking custom css file separately (outside include) can't figure out. any ideas? my code below: index.php <!doctype html> <html> <head> <?php include("includes/head.html");?> </head> <body> <div class="jumbotron paral paralsec"> <h1 class="hero-heading display-3 text-dark">some text.</h1> </div> </body> </html> head.html <meta charset="utf-8"> <

Gap Analysis/Report for CSV in Python 3.6.2 -

start end mm0001 mm0009 mm0010 mm0020 mm0030 mm0039 mm0059 mm0071 good afternoon, wanted create code in python in 3.6.2 allow me gaps in rows of consecutive numbers, such one. output screen missing numbers in format similar below: mm0021 mm0029 mm0040 mm0051 mm0052 mm0058 i've created code program based on answer found around here, don't believe it's complete, being done in python 2.7 believe. used basis trying do. import csv open('thedata.csv') csvfile: reader = csv.reader (csvfile) line, row in enumerate(reader, 1): if not row: print 'start of line', line, 'contents', row any appreciated. import csv def out(*args): print('{},{}'.format(*(str(i).rjust(4, "0") in args))) prev = 0 data = csv.reader(open('thedata.csv')) print(*next(data), sep=', ') # header line in data: start, end = (int(s.strip()[2:]) s in line)

directshow - Video editing with direct show in C#, .net and winforms -

so, have program has file browser, project system, , have basic direct show video player, , have been researching how video editing part working. have idea of how work, don't know direct show. have heard direct show editing services, can't find proper documentation c#, , don't know first thing c++. ideas?

Security error in OSX Safari for local html file -

Image
facing peculiar problem security while running local html file in osx safari. [error] not allowed load local resource: file://secure.myshopmatemac.com/servicejs/components/?source‌​=mm-1643&version=2.0‌​&isn=800 global code (script element 1:1:735) i sharing screenshot better understanding. it of great if me understand why problem , possible way solve problem.

ios - '-[UITextField date]: unrecognized selector sent to instance 0x7f89277121c0' -

i'm learning ios development on xcode 8.3.3 , ios 10.3 using swift 3. i'm trying create account creation form field shows uidatepicker when user performs on touchup on date of birth uitextfield: @ibaction func showdatepicker(_ sender: uitextfield) { let datepicker = uidatepicker() datepicker.datepickermode = uidatepickermode.date datepicker.maximumdate = calendar.current.date(byadding: .year, value: -16, to: date()) dateofbirth.inputview = datepicker datepicker.addtarget(self, action: #selector(self.datepickervaluechanged), for: uicontrolevents.valuechanged) } @objc func datepickervaluechanged(_ picker: uidatepicker) { let dateformatter = dateformatter() dateformatter.datestyle = dateformatter.style.medium dateformatter.timestyle = dateformatter.style.none dateofbirth.text = dateformatter.string(from: picker.date) } when execute above, error: terminating app due uncaught exception 'nsinvalidargumentexception', reason: &

Excel VBA Compare cell value to list and overwrite value in separate sheet -

in workbook have, users either manually enter account code or select 1 list , account codes placed in column c (c7:c446) in sheet called "je". account codes ####### - ### - ## - ######. in column d (d7:d446) in sheet "je", there formula captures last 6 digits of account code. in sheet called "required_refs", there list of 6 digit codes in column a. if value in d column in sheet "je" equals of values in column of "required_refs" sheet, value in d column cell overwrite cell value in cell d1 in separate sheet called "references" (i know may have been confusing, sorry) example : if value of d25 matches of values listed in column of sheet "required_refs", upon double clicking red colored f25 cell, put value of d25 (of sheet "je"), , put in cell d1 on sheet "references". i've taken crack @ best know how. i've placed code in sheet je: private sub worksheet_beforedoubleclick(byval target

c# - Visual Studios 2015 NuGet Ghostscript Installation Error -

i can't seem figure out how fix installation error gsdll32 i running 64 bit windows , visual studios 2015. thing can think of nuget trying install 32 bit dll on 64 bit version of visual studios. can't seem confirm error else. need ghostscript convert pdfs jpgs on website. if have alternative ghostscript let me know. visual studios installed ghostscript.net fine. fails on ghostscript itself. pm> install-package ghostscript -version 9.2.0 attempting gather dependency information package 'ghostscript.9.2.0' respect project 'wilcox_fresh', targeting '.netframework,version=v4.6.1' gathering dependency information took 845.32 ms attempting resolve dependencies package 'ghostscript.9.2.0' dependencybehavior 'lowest' resolving dependency information took 0 ms resolving actions install package 'ghostscript.9.2.0' resolved actions install package 'ghostscript.9.2.0' retrieving package 'ghostscript 9.2.0' 'nuge

javascript - How do I get access to my container/store in this top level file? -

i'm getting started react/redux , have everthing working fine redux when test it. however, not able connect actual application. i assume should use connect() , don't know how/where to. // libraries import react 'react'; import reactdom 'react-dom'; // redux import { provider } 'react-redux'; import store './redux/store'; import './redux/test.js'; import {connect} 'react-redux' class app extends react.component { constructor(props, test) { super(props); } render () { return ( <div id = 'contents'> </div> ) } } const app = document.getelementbyid('app'); reactdom.render( <provider store={store}> <app></app> </provider> , app); you need connect component app. by example let's assume have value in reducer named reducer in store : // libraries import react 'react'; import reactdom 'react-dom';

android - how to simulate a button click on an app icon/shortcut -

i wonder how possible simulate button click launch app through shortcut? have seen automation apps such automagic (perhaps tasker) this. using accessibilityservices? if yes, how call such shortcut -do use "performglobalaction()"? edit: after emulate/simulate click on button or shortcut apps such tasker can do. instance, google assistant cannot opened programatically (see how start google assistant programatically? ) due permission denail. however, can opened clicking on shortcut on screen opened according following instructions: https://www.ytechb.com/how-to-get-google-assistant-on-any-android-lollipop-device-without-root/ with tasker can add action opens shortcut. wondering how tasker programatically. you can launch android app using intent . launch intent application can use context.getpackagemanager().getlaunchintentforpackage(string packagename); if not null, app installed on device , can launch it. if want list of other apps on device can use con

php - Form validation output not working -

i have form , form working: receive details on e-mail. when click submit, redirects blank page text: "request submitted successfully. contact soon.". what show green box saying form submitted successfully, on same page websites do, , not redirect... i using bootstrap :) mailer.php code: <?php $tipoin = $_post['tipoin']; $tipologia_input = $_post['tipologia_input']; $sender_name = $_post['nome']; $sender_email = $_post['email']; $phone = $_post['telefone']; $slider_value = $_post['slider_value']; $mail_body = $_post['message']; $body = $sender_name." sent new message you<br><br> name: ".$sender_name."<br>email: ".$sender_email."<br>phone: ".$phone."<br>tipo: ".$tipoin."<br>tipologia: ".$tipologia_input."<br>slider value: ".$slider_value."<br>message: ".$mail

javascript - How to sum only numbers in array with different value types with reduce? -

i need sum numbers of array reduce don’t know how. this code , attempt: let arr = [1,2,3,4,6,true,"dio brando", false,10,"yare yare"]; let sum = arr.reduce((a.b)=> typeof.a =="number" && typeof.b =="number"? a+b :false) console.log(sum); you need make following changes: (a.b) should (a, b), it's function parameters there's no such thing "typeof.a", should "typeof a" i've rewritten more helpful variable names explain what's going on in reduce. const arr = [1,2,3,4,6,true,"dio brando", false,10,"yare yare"]; const sum = arr.reduce( (sumsofar, nextvalue) => { if ( typeof nextvalue === "number" && isfinite(nextvalue) ) { return sumsofar + nextvalue; } //skip otherwise return sumsofar; }, 0); //sum starting 0 console.log(sum);

html - Flex items in a row rendering at different widths -

Image
i created 3 boxes using css flexbox in html chrome rendering boxes different sizes. drag border of browser make view smaller. thanks help! codepen: https://codepen.io/labanino/pen/rganlp body { font-family: arial; font-size: 2rem; text-transform: uppercase; } .flex { height: 200px; display: flex; flex-direction: row; } .flex>section { flex: 1 1 auto; display: flex; justify-content: center; flex-direction: column; text-align: center; } .flex>section:nth-child(1) { background: brown; margin-right: 20px; border: 1px solid #999; } .flex>section:nth-child(2) { background: pink; margin-right: 20px; border: 1px solid #999; } .flex>section:nth-child(3) { background: green; margin-right: 0; border: 1px solid #999; } <div class="flex"> <section>brown</section> <section>pink</section> <section>green</section> </div>

javascript - What is the best way to do this..? -

i making android app using cordova. have cordova barcode scanner plugin on app meant scanning ids. once id scanned , result given need on url ( https://example.org/people/home.html?id=123456789 ). problem have, website doesn't have "?id=1233456789" have query (?frn=). cannot attempt place result id in url, frn , ids stored in sql db together. app, don't think can place db , query id , plug id in url. so question is: smartest/best way find frn using result given result/id? again, don't want connect db app, want use webservice or something. what script tag contains if helps: <script> function scan() { cordova.plugins.barcodescanner.scan( function (result) { console.log(result.text) var barcode_res = (" id\n" + "result: " + result.text); window.alert("id result: " + result.text); /

Regex pattern to split verilog path in different instances using Python -

i have software parses verilog paths , in charge of mapping such paths sequence of objects. problem find regular expression split verilog paths in sequences of instance names. verilog paths sequences of verilog identifiers concatenated dots. each identifier instance name. "." relationship in a.b.c means that, in module hierarchy, parent , b 1 of children of a. c 1 of children of b. each verilog path identifies unique instance in module hierarchy. pseudocode: verilog identifier verilog identifier b verilog identifier c path instance c of parent b child of a: a.b.c now, issue verilog identifiers can sequence of " letters, digits, underscores (_) , dollar signs ($). first character of identifier can letter or underscore " stated in page: http://verilog.renerta.com/source/vrg00018.htm with situation python able split path writing: >>> path = "a.verilog.path" >>> print path.split(".") ['a', 'veri

Spy dataLayer from Google Analytics with Puppeteer and Mocha / Sinon (or similar) -

so, trying make automatic tests on google analytics calls headless chromes + puppeteer + mocha + sinon can't manage read datalayer value sinon spy. this have far. window undefined. test class proxy pass puppeteer calls inner browser. const { test } = require('../browser'); const sinon = require('sinon'); const datalayername = 'datalayer'; const assert = sinon.assert; describe('tests analytics', () => { let spy; it('find home analytics', test(async (browser, opts) => { const page = await browser.newpage(); await page.goto(`${opts.appurl}`); spy = sinon.spy(window.datalayer, 'push'); assert.called(spy); assert.calledwith(spy, [ 'fail me', ]); spy.restore(); })); }); this browser class: const puppeteer = require('puppeteer'); /** * thin wrapper use singleton of * browser puppeteer creates */ class browser { setup(done

jmeter - HC[34]CookieManager does not append my login cookies -

environment: jdk8, jmeter: 3.2 i using hc4cookiemanager (the option available). snapshot of test plan i issue request basic auth , auth cookies back. unfortunately server not set domain (domain=;). as result (i think) hc4cookiemanager entirely ignores cookies result cannot perform operations on server. i see error in logs: 2017-09-12 13:06:41,190 error o.a.j.p.h.c.hc4cookiehandler: unable add cookie org.apache.http.cookie.malformedcookieexception: blank value domain attribute @ org.apache.http.impl.cookie.rfc2109domainhandler.parse(rfc2109domainhandler.java:61) ~[httpclient-4.5.3.jar:4.5.3] @ org.apache.http.impl.cookie.publicsuffixdomainfilter.parse(publicsuffixdomainfilter.java:113) ~[httpclient-4.5.3.jar:4.5.3] @ org.apache.http.impl.cookie.cookiespecbase.parse(cookiespecbase.java:113) ~[httpclient-4.5.3.jar:4.5.3] @ org.apache.http.impl.cookie.defaultcookiespec.parse(defaultcookiespec.java:145) ~[httpclient-4.5.3.jar:4.5.3] @

postgresql - Add postgres to a Codenvy Stack Recipe (dockerfile) -

i new codenvy user. attempting build "stack" in codenvy run postgres. i creating stack using following recipe. (using https://github.com/eclipse/che-dockerfiles/blob/master/recipes/ubuntu_jdk8/dockerfile starting point) this recipe creates codenvy server containing eclipse che, maven, , tomcat. i need add ant , postgres configuration. able add ant. current challenge adding postgres configuration. here current recipe. from eclipse/stack-base:ubuntu expose 4403 8000 8080 9876 22 label che:server:8080:ref=tomcat8 che:server:8080:protocol=http che:server:8000:ref=tomcat8-debug che:server:8000:protocol=http che:server:9876:ref=codeserver che:server:9876:protocol=http env maven_version=3.3.9 \ ant_version=1.10.1 \ java_home=/usr/lib/jvm/java-1.8.0-openjdk-amd64 \ tomcat_home=/home/user/tomcat8 \ term=xterm env m2_home=/home/user/apache-maven-$maven_version env ant_home=/home/user/ant-$ant_version env path=$java_home/bin:$m2_home/bin:$ant_home/b

javascript - Cannot push project to Heroku "no default language detected" -

i trying push project heroku , receiving error "no default language detected". project built on node , structure follows: project/ .gitignore procfile server/ package.json index.js ...etc in procfile (since package.json not located in project root) have following line of code: procfile: web: node index.js i pushing running: git push heroku master where error "no default language detected" , despite best google/so searching efforts, cannot find proper solution past this. missing here? your package.json must in root directory. can change structure of project or try push subdirectory of project running: git subtree push --prefix server heroku master

saas - Multi-tenant Data Models -

i've been reading on multi-tenant design pattern , had few questions data model options use case. want build saas allows users add, update, , read large datasets. i'm targeting niche industry don't expect many users, maybe 15 20. however, each tenant require unique schema anywhere between 5 tables 10 tables depending on specific needs. records in hundreds of thousands. the article linked above talks 3 different data models can used multi-tenant, , i'm wondering pros , cons of each use case. i assume need database-per-tenant since schemas need quite different each other, costly. possible on shared database-single since don't need worry more 20ish tenants?

ruby on rails - Prevent has_many lookup during json serialization -

i have query this @templates = template.find_by_sql("select templates.*, jsonb_agg(fields.*) fields templates left join fields on templates.id = fields.template_id group templates.id ") inside model defined has_many relationship has_many :fields, dependent: :destroy inside controller render result with render json: @templates the resulting json formatted expected rails additional unnecessary queries: template load (0.6ms) select templates.*, jsonb_agg(fields.*) fields templates left join fields on templates.id = fields.template_id group templates.id rails_1 | field load (0.3ms) select "fields".* "fields" "fields"."template_id" = $1 [["template_id", 1]] rails_1 | field load (0.4ms) select "fields".* "fields" "fields"."template_id" = $1 [["template_id", 2]] rails_1 | field load (0.3ms) select "fields".* "fields" "fields&q

html - SVG color hover - can't find any solution -

for days i've been trying solve this, want make color change @ hover on svg ( with css ), i've found lots of tutorials (in , out of stack) none of them working me. can tell me can do? svg code: <?xml version="1.0" encoding="utf-8"?> <!-- generator: adobe illustrator 19.1.0, svg export plug-in . svg version: 6.00 build 0) --> <svg version="1.1" id="layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewbox="-58 251 500 500" style="enable-background:new -58 251 500 500;" xml:space="preserve"> <style type="text/css"> .st0{fill:#ffffff;} </style> <path id="svgbutton" d="m-328,271.1c-127,0-229.9,102.9-229.9,229.9s-455,730.9-328,730.9s-98.1,628-98.1,501s-201,271.1-328,271.1z m-139.2,580.8 c-10.3,24.4-25.1,46.3-43.9,65.1c-18.8,18.8-40.7,33.6-6

Aggregate function in r is not working on my dataset -

sample dataset date playerid revenue promo dayofweek 01/01/2017 146123 0 b sunday 01/01/2017 219378 0 b sunday 01/01/2017 198614 0 b sunday 02/01/2017 292640 30 monday 02/01/2017 139562 10 monday 02/01/2017 124967 20 monday 02/01/2017 107954 20 monday 03/01/2017 28391 10 b tuesday 03/01/2017 184388 21 b tuesday 03/01/2017 264222 20 b tuesday 03/01/2017 184857 0 b tuesday 04/01/2017 79788 40 wednesday i wanted aggregate table dayofweek, , sum revenue each day of week, count number of players using playerid such final output looks this: players revenue promo dayofweek 3 0 b sunday 4 80 monday 4 51 b tuesday 1 40 wednesday i have been trying aggregate dataset attached above attempts unsuccessful. can help, please? here code below. aggdata <-aggregate(mydata, by=list(dayofweek,revenue, promo, playerid),

Requesting content from IIS Webapp over Tomcat Spring app through Kerberos security -

so go straight point. i have 2 machine in same domain. 1 machine contacts on http client spring app on tomcat machine b. spring tomcat app contacts iis application (exchange ews api), calculates data , retrieves machine client. for security reasons defined use kerberos authentication. can call independently spring app endpoint , iis app endpoint machine , gets authenticated through kerberos , retrieves data. the problem when contact spring app contacts iis app error spring tomcat app unauthorized 401. i tried pinging iis app machine b , goes ok well. some information: tomcat on machine b started local service user. i kerberos log on machine b while executing defined call error: error code: 0x7 kdc_err_s_principal_unknown this strange because added setspn -r machine-b . not sure next , real issue is.   

c++ - Taking the address of a literal, not a `constexpr` -

strictly according rules of c++14, @ least ones given cppreference.com , isn't line (1) constant expression? constexpr const int* addr(const int& ir) { return &ir; } constexpr const int* tp = addr(5); // (1) it's true not address constant expression , because &ir isn't address of static object ( &ir address of temporary in context, cannot known in compilation-time). but core constant expression because doesn't violate of back-listed rules of core constant expression , has no back-listed rules getting address of object. no, addr(5) not constant expression, , therefore posted code ill-formed. yes, correct addr(5) core constant expression. i can see why might think cppreference page alone core constant expressions, integral constant expressions, converted constant expressions, literal constant expressions, reference constant expressions, , address constant expressions types of constant expression. true definition given in c++14 [

postgresql - Python date string to postgres usable date -

Image
issue: stored dates text in postgres table, , want convert on actual dates, again in postgres. im not sure if there better way or im doing wrong. have pulled bunch of data postgresql database in text format. result need go through , clean up. running issues data. need convert format postgresql can use. went pulling python , trying convert , kick back. best way this? having issue datetime.strptime.. believe i've got directive correct no go. :/ import psycopg2 datetime import datetime # connect postgresql database conn = psycopg2.connect( "dbname='postgres' user='postgres' host=10.0.75.1 password='mysecretpassword'") # create new cursor cur = conn.cursor() cur.execute("""select "hash","date" nas """) # commit changes database mydate = cur.fetchall() rows in mydate: target = rows[1] datetime.strptime(target, '%b %d, %y, %h:%m:%s %p %z') here postgres query can conver

sql server 2008 - PDI Check if a value exist in table and retain value for error notification purpose -

i doing loading vouchers sql server 2008 using pentaho. i have voucherinfo table having fields, vouchername, voucherid, start date , end date, voucher information. vouchermember table having fields, voucherid, memberid. show vouchers members entitled to. i want load data vouchermember table if voucherinfo has field voucher want load in, if vouchertable not have, want retail value , send email user voucher deos not exist in voucherinfo table. i have read database lookup , filter rows can achieve cannot retain value. is there way in pentaho do?

ASP.NET (C#) - ListView -

Image
in past, worked on listviews (.net 2.0) using custom template field trying achieve here following i working on .net 4.6 so list shows items above , on mouse-hover few options show shown in following screenshot i have trigger option different things - how can in asp.net, may please have code references. cheers p.s. rough example of how creating list item template (as requested) <asp:listview id="listview1" runat="server" datasourceid="sqldatasource1"> <alternatingitemtemplate> <table > <tr> <td ><asp:image id="image1" imageurl='<%# bind("url") %>' runat="server" width="98px" /> </td> <td><h2><asp:label id="_label" runat="server" text ='<%# bind("title") %>'></asp:label></h2>&l

python - Discord target user ID -

i wondering if there way convert someones username id requested upon different user. when user requests elses id, type in name , returns specified users id. i'm totally new python , stackoverflow, helpful thank you. edit: since creating individual user files each user use users id name them, need convert someones username id. for can save username in dict in python create dictionary username key i.e. desc={"ali":123,"mathew" :1234} so print desc["mathew"]; print 1234 id of mathew

Auto git fetch when the Android studio (IntelliJ) is idle -

i use git fetch have latest information server. git fetch won't change code base , not take time , network traffic. when go toilet or else auto git fetch . there way this? enabling automatic fetch in intellij asked before. see issue idea-24057 , idea-100846 check out gittoolbox : has auto fetch functionality. feature not seem available in native intellij alone (ie: need find third-party plugin) it indeed nice if work because configuration options in file | settings | version control | background ignored git , doesn't seem indicated in ui or help. also, people coming atlassian sourcetree expect happen automatically. messes merging remote branches because remote branches not date automatically (something sourcetree users used to). hampers (full) adoption of idea.

ios - Crash and Received memory warning -

i have below loop download files server ipad 3 device. running hundred of files, got error , app crash. console shown me "received memory warning. same logic running on ipad air passed. can adivse how resolve problem. ipad 3 -> ios 9.3.5 ipad air -> ios 10.3.3 func download() { (index, subjson): (string, json) in serverjson! { (_, subjson): (string, json) in subjson { let filepath = subjson["path"].stringvalue let nupdated = subjson["updated"].stringvalue if let oupdated = localjson?[index].array?.filter({ $0["path"].string == filepath}).first?["updated"].stringvalue { if (oupdated == nupdated) { dispatchqueue.main.async { () -> void in self.progressview.progress = float(self.count) / float(self.totalcount) }