Posts

Showing posts from May, 2011

How does Angular compiler process multiple template reference variables with the same name -

i want start contributing angular, have idea feature, want template compiler issue warning if template contains 2 template variables of same name. think managed close source files responsible: https://github.com/angular/angular/blob/master/packages/compiler/src/view_compiler/view_compiler.ts couldn't quite find spot, understandably. there here can guide me ? you need _assertnoreferenceduplicationontemplate method: _assertnoreferenceduplicationontemplate(result: templateast[], errors): void { const existingreferences: string[] = []; result.filter(element => !!(<any>element).references) .foreach(element => (<any>element).references.foreach((reference: referenceast) => { const name = reference.name; if (existingreferences.indexof(name) < 0) { existingreferences.push(name); } else { const error = new templateparseerror( `reference "#${name}" defined

python - EasyGui diropenbox() give error 'module' object has no attribute 'askdirectory' -

i have python script calling easygui. script worked fine on previous computer. have new computer , trying upgrade script not error easygui. here offending code. indir = diropenbox("set input directory of geo-tagged images. directory store output kml file.") here error message. python errors: traceback info: file "c:\gtemp\geotaggedimagestokmlandcsvforlinuxandios\geotaggedimage2kml_csv.py", line 150, in <module> indir = diropenbox() error info: 'module' object has no attribute 'askdirectory' why code throw error? note-earlier in code call easygui textbox , works believe installation fine. python 2.7 windows 7 easygui_0.98.1-py2.py3-none.any.whl installed. removing easygui 0.98 , installing 0.97 fixed problem.

html - h2's are not in the same vertical line -

i make 2 h2's in 1 vertical line, first letter on same horizontal position. here's html, body { height: 100%; } .login { margin: 0; padding: 0; background-image: url(https://static.pexels.com/photos/279315/pexels-photo-279315.jpeg); background-position: center center; background-repeat: no-repeat; background-attachment: fixed; background-size: cover; height: 100%; width: 100%; } #hdtxt { font-family: 'titillium web', sans-serif; font-size: 48px; font-weight: 600; text-align: center; padding-top: 50px; } #mail { font-family: 'titillium web', sans-serif; font-size: 38px; font-weight: 400; text-align: center; padding-top: 50px; padding-right: 700px; } #pwd { font-family: 'titillium web', sans-serif; font-size: 38px; font-weight: 400; text-align: center; padding-top: 50px; padding-right: 700px; } <script src="https://ajax.googleapis.com/ajax

javascript - React Native - Login Screen - DrawerNavigator -

i want have login screen not in drawernavigator. upon logging in, want navigate new view in drawernavigator. (i don't want login view part of drawernavigator), normal mobile app. drawer shouldn't available until you've logged in. how can acheive this?

algorithm - Merge Sort in Java not working as expected. Trying to do it without a while loop -

i've been working on day , have no idea why isn't working. sort duplicating elements , sorting of array can't see causing this. tried trace couldn't follow it. import java.io.filenotfoundexception; import java.util.arrays; public class main { public static void main(string[] args) throws filenotfoundexception { int[] array = new int[10]; for(int = 0; < array.length; i++) { array[i] = (int) (math.random()*5); } int[] temp = array.clone(); int l = 0; int r = array.length-1; system.out.println("unsorted "+arrays.tostring(array)); mergesort(array, temp, l, r); system.out.println("sorted "+arrays.tostring(array)); } public static void mergesort(int[] array, int[] temp, int p, int r) { int q = (p + r)/2; if(p < r) { mergesort(array, temp, p, q); mergesort(array, temp, q+1, r); merge(array, temp,

java - Division of String -

i want know how divide string , seperate 2 variables, 1 char , other integer example: if "c 365" string char variable 'c' , integer variable 365 the char can extracted charat . int , use substring take string third character (the first char , second space), , parse it: string str = "c 365"; char ch = str.charat(0); int = integer.parseint(str.substring(2));

elasticsearch - Rails Searchkick has_many indexing and searching -

i able search customer_id, name, lastname, , kids id, name, lastname , "birthdate" the searching id must exact , is. searching names or lastname has misspelling distance 2 , works. want search kid_birthdate match exact (mispelling, distance 0) so far whenever search birthdate results returned misspelling distance 2. don't know how search exact dates. rails 5.1.0.rc1 elasticsearch-5.0.3 searchkick-2.2.0 class customer < activerecord::base include searchable def search_data attributes.merge avatar_url: avatar.url, kids: kids end has_many :kids ... end class kid < activerecord::base belongs_to :customer def reindex_customer customer.reindex async: true end ... end module searchable extend activesupport::concern included search_results_per_page = 10 def self.elastic_search(query, opts = { page: 1 }) # regex accept string contains digits or dates regexp = /(\d+)|(^(0[1-9]|1\d|2\d|

encryption - Java/Kotlin Encrypt AES key with private and public key -

so lately saw video computerphile said when using encryption should using aes keys , encrypt key public , private key. means: have public key else, , own private key. the reason behind encrypting own private key is, verifies message has comming me, because no 1 else has private key, encryption public key can work on messages comming me. problem after first encryption, byte array outcomming becomes long , cant encrypt time. there way around this? this code: val akey = generateaeskey() val kg = keypairgenerator.getinstance("rsa") kg.initialize(2048) val own = kg.genkeypair() val strange = kg.genkeypair() string(akey.encoded).encryptrsa(strange.public).encryptrsa(own.public) fun generateaeskey(): key { val generator = keygenerator.getinstance("aes") generator.init(128) return generator.generatekey() fun string.encryptrsa(key: key): string { val encryptcipher = cipher.getinstance("rsa/ecb/pkcs1padding") encryptcipher.init(cipher.encrypt

c++11 - memory_relaxed and VarHandler -

in https://shipilev.net/blog/2016/close-encounters-of-jmm-kind/#myth-barriers-are-sane author wrote: of course, without keeping reads in order, result 1, 0 trivially achievable. not make interesting test case. actual test clever that: uses new varhandles "opaque" access mode, inhibits these optimizations , exposes reads hardware in same order:[3] and [3]: this sounds similar c/c++11 std::atomic(…​, memory_order_relaxed), modeled after. convenient hardware concurrency testing, in example. i not sure author means because says which inhibits these optimizations , exposes reads hardware in same order whileas memory_order_relaxed allows every reordering (it doesn't give special guarantees in memory ordering).

oracle11g - Oracle in array parameter and output array -

i have task create oracle function accepts input array parameter , returns array, called in asp.net. have far, code compiles don't know how test in toad, , might need improvements, can provide guidance on how call function sending array? additional feedback welcome. create or replace package pii_xref_pkg type array_onecol table of varchar2(10); function getssn ( p_valuelist in array_onecol ) return sys_refcursor; end pii_xref_pkg; / create or replace package body pii_xref_pkg function getssn(p_valuelist in array_onecol) return sys_refcursor t_refcursor sys_refcursor; begin open t_refcursor select piiref.* pii_xref piiref left outer join table(p_valuelist) u on u.column_value = piiref.value (u.column_value not null or p_valuelist(1) null); return t_refcursor; end getssn; end pii_xref_pkg; / ***note: using oracle 11g.

rstudio - Plot values are not being generated by my code using R studio, plotly in R, and 'parcoords'. -

i'm having trouble plotly in r , 'parcoords'. i'm trying plot using colorscale defined persona. persona has values of 1 through 4 , expect each number have it's own color. plot scales fine there no lines representing values each variable. here code options(viewer=null) p <- df %>% plot_ly(type = 'parcoords', line = list(color = ~persona, colorscale = list(c(0,'red'),c(0.5,'green'),c(1,'blue'),c(1.5,'yellow'))) , dimensions = list( list(range = c(15,55), label = 'rescuer count', values = ~rescuercount), list(range = c(15,50), label = 'rescuer share', values = ~rescuershare), list(range = c(5,95), label = 'avg serviced zip codes', values = ~avgservzips), list(range = c(10,925), label = 'avg number of rescues', values = ~

c++ - Cmake generator expressions -

i'm trying long time understand benefit of generator expressions such $<xxx:yy> in cmake, when , how use them. can explain examples. many thank in advance cmake first parse cmakelists.txt files in project - named "configuration phase" - , generates build environment - named "generation phase". so generator expressions generator know: the name , path of target outputs (mainly when cross-compiling , in multi-configuration environments) or more target property generator evaluates mingle compiler/linker calls here examples use generator expressions in project: copying files next executable (in multi-configuration environments can't use variables cmake_current_binary_dir ) add_custom_command( target library1 post_build command ${cmake_command} -e copy "$<target_file:library1>" "$<target_file_dir:mainproject>/$<target_file_name:library1>" ) cmake post-build-e

angular2 forms - How to add PrimeNG accordion tab dynamically -

how add primeng accordiontab dynamically angular2 application ? content 1 .ts public addtab(){ let temp = new accordiontab(this.ref); //this not refresh ui } enter code here the total number of tabs depends on user input , need add them program dynamically. ? suggestions ??

html - How to change buttons from bootstrap3 to 4 -

i have been using kind of button in bootstrap 3. action update or modify row in table. i use bootstrap 4, button not rendering correctly. know have changed, how can fix this? this code button: <button type="button" class="btn btn-default"> <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> </button> instead of glyphicons bootstrap 4 recommends using font-awesome. can read more migrations here . while migration documentation states btn-default btn-secondary , have button rendered have want use btn-light . here's updated code it. <button type="button" class="btn btn-light"> <i class="fa fa-pencil fa-2x" aria-hidden="true"></i> </button> here's code in working codeply project .

batch file - Quit command prompt after exiting Electron app -

is there way close command prompt after command line program ends? i have electron app starting batch file following commands: start npm start after exiting electron app, command prompt remains open. i've tried adding exit end of batch file, not work. i recommend implementing goto placeholders in batch file script can follow defined path or workflow. similar answer here... batch - if, elseif, else if need run command initiated batch file can use /c flag close new window once command completed. see answer here... bat file: open new cmd window , enter code in there also...here's example had lying around allows user input if require multiple tasks within batch script. included 2 examples /k flag allows windows remain open, , /c flag closes initial command prompt. @echo off :start cls @echo select action: @echo. @echo 1= task 1 (new cmd /c, start npm -l) @echo 2= task 2 (new cmd /k, start npm -l) @echo. set /p userinp=enter choice: set userinp=%u

Neo4j cypher Recommendations Query Performance Issues -

i'm working on product recommendation query should return products recommend current customer based on finding similar customers based on viewing similar products , suggesting other products similar customers have viewed. our business in consignment have 1 of every product i'm working larger dataset in similar views vs purchases. expectation query should able run in under second given being run against little on 10k products , 10k users in our development environment. i'm unsure if query needs tuning, linux/java/neo4j config or both. have experience in this? match (currentuser:websiteuser{uuid: 'ea1d35e7-73e6-4990-b7b5- 2db24121da9b'})-[:viewed]->(i:websiteitem)<-[:viewed]- (similaruser:websiteuser)-[r:viewed]->(similaritem:websiteitem {active: true}) return similaritem.designer, similaritem.title, similaritem.brandsize, similaritem.sku, similaritem.shopifyproductid, similaritem.url, similaritem.price, count(distinct r) score order score desc l

spring - SpringBootTest doesn't share context -

i've noticed @springboottest empty parameters use integration tests creates new context each test class. in documentation said @springboottest replacement @contextconfiguration , know shares context among test classes unlike @springboottest . is there way behavior wish? i tried 1.5.6 , 1.5.7 versions. thank you

c++ - How to construct any object from variadic constructor parameters? -

i experimenting making own containers, , writing emplace method vector class. first, here forward functions: template<typename t> t&& forward(typename remove_reference<t>::type& arg) { return static_cast<t&&>(arg); } template<typename t> t&& forward(typename remove_reference<t>::type&& arg) { static_assert(!internal::is_lvalue_reference<t>::result); return static_cast<t&&>(arg); } they identical std ones. now here emplace method: template<typename t> template<class... args> void myvector<t>::emplace(args&&... args) { add(forward<args>(args)...); } this gives me error "function not take 2 arguments", because add isn't designed work variadic arguments. instead in place: template<typename t> template<class... args> void myvector<t>::emplace(args&&... args) { if(size >= capacity) {

javascript - Issue with obtaining input form for chat system -

currently having issues making chat system. it's been long day, brain has been half off when trying code this. in short, i'm trying make chat system using php , jquery framework javascript. after discovering solely using php wouldn't work, read use ajax prevent reloading page when trying send message (reloading page results in chat username being reset). i've written code, , i've tried obtaining value input form in main code, believe issue here. portion of code i'm affecting follows: <!-- chat box --> <div class="content" style="width:700px;"> <div class="container" style="height:500px;border-top-right-radius:3px;border-top-left-radius:3px;border-bottom:0px solid black;overflow-y:scroll;"> <script type="text/javascript"> var msgdisp = new xmlhttprequest(); msgdisp.open("get","chatlog/log.txt"); var lines = ms

javascript - Observable subscribe timing issue -

i have service in component, service has method returns string value server. service: getorderbarcode(): observable<string> { return this.http.get(this.baseurl + 'barcode/getbarcode') // .map(this.extractdata); .map(res => res string ) } component: let barcodeservice = this.barcodeservice.getorderbarcode(); debugger; barcodeservice.subscribe(result => order.orderbarcode = result); console.log(order.orderbarcode); // rest of logic however, when .subscribe called not binding value @ point, after debugging found applies value after executing in class, how can around issue? update based on comments , link question service method: getsomething(callback: (data) => void) { debugger; return this.http.get(this.baseurl + 'barcode/getbarcode') // .timeout(1000) // .map(this.extractdata); .map(res => res string) } component: let = this.barcodeservice.getsomething((data) => { debugg

koa - How to apply middleware to all routes? -

how want apply middleware paths in koa-route, e.g. router1.use( (ctx) => { console.error("hello 0 ..."); console.log(ctx.url); } router1.all( (ctx) => { console.error("hello 0 ..."); console.log(ctx.url); } it comes path += str.slice(index, offset) ^ typeerror: str.slice not function hints ? thanks! i hope it, router1.use(/(.*)/, (ctx) => { console.error("hello 0 ..."); console.log(ctx.url); }

android - I can't receive the email I programed to send -

i new android studio. want send email automatically android tablet, not app such gmail. several tutorials, such sending email , asynctask. here code. public class sendingdata extends appcompatactivity implements view.onclicklistener { // webview webview; // string newurl; //simpledateformat formatter = new simpledateformat("yyyy.mm.dd 'at' hh"); //date present = new date(); //string filename = formatter.format(present) + ".txt"; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_sending_data); init1(); strictmode.threadpolicy policy = new strictmode.threadpolicy.builder().permitall().build(); strictmode.setthreadpolicy(policy); button mail2 = (button) findviewbyid(r.id.button2); mail2.setonclicklistener(this); } @override public void onclick(view v) { new asynctask<void, void, void>(){ @override public void

URL Rewriting (Wordpress) -

actually have wordpress page url this http://www.website.com/gallery/?person=mike and transform to http://www.website.com/gallery/mike i tried in .htaccess rewriterule ^gallery/?person=$ gallery/%{query_string} [nc,l] but doesn't work

regex - Email address verification and syntax reverification with java -

how perform email address validation? used following regular expression doesn't cover cases: [a-z0-9._%+-]+@[a-z0-9.-]+.[a-z]{2,4} any appreciated. you can try code snippet email syntax validation, full disclose, sample code take my company's email verification api. /** valid email pattern. */ private static pattern validemail = null; static { /* * want allow strange characters in emails? * well, that's rfc2822 seems allow... */ string atom = "[a-za-z0-9!#$%&'*+-/=?^_`{|}~]"; string domain = "(?:[a-za-z0-9](?:[-a-za-z0-9]*[a-za-z0-9]+)?)"; validemail = pattern.compile("(^" + atom + "+" + "(?:\\." + atom + ")*)" + "@((?:" + domain + "{1,63}\\.)+" + domain + "{2,63})$", pattern.case_insensitive); } ... try { matcher matcher = validemail.matcher(emailaddress); if (!matcher.matches()) {

swift - Is there anyway to access only the value of a dictionary in a child? -

in firebase database swift, there way access value (as string) dictionary. each child has key:value pair. example: users |-- bob |-- bob@gmail.com: "bobbbby" is there way access "bobbbby" string? new swift appreciated. example firebase database docs taken directly https://firebase.google.com/docs/database/ios/read-and-write let userid = auth.auth().currentuser?.uid ref.child("users").child(userid!).observesingleevent(of: .value, with: { (snapshot) in // user value let value = snapshot.value as? nsdictionary let username = value?["username"] as? string ?? "" // <<< line let user = user.init(username: username) // ... }) { (error) in print(error.localizeddescription) } updated you if need multiple fields under user: ref.child("users").child("bob").observesingleevent(of: .value, with: { (snapshot) in let value = snapshot.value as? nsdictionar

python - Something's not quite right with my template tags -

is if statement? works, not correctly. no error comes , display number associated each word value won't display correct word , front end. <p class="accent list-text">i'm a:</p> {% if request.user.userprofile.user_type == 1 %} <p class="profile-info list-text">designer</p> {% elif request.user.userprofile.user_type == 2 %} <p class="profile-info list-text">designer</p> {% else %} <p class="profile-info list-text">both</p> {% endif %} models.py: from django.db import models django.utils import timezone django.contrib.auth.models import user users.choices import * django.db.models.signals import post_save django.dispatch import receiver # create models here. class userprofile(models.model): user = models.onetoonefield(user, on_delete=models.cascade) first_name = models.charfield(max_length=50,default='user') join_date = models.datetimefield(default=ti

datetime - change default width of datetimefield wtforms -

trying change default dimensions of datetimefield. etime = datetimefield(label='window end time(utc)', validators=[validators.inputrequired()], format="%a %d%b%y %h:%m", default=datetime.utcnow) tried add: render_kw={'class': 'form-control', 'rows': 5,'cols':40} but no change in dimension, after rendering on html page. there way tweak default dimension of datetimefield

ruby - Jekyll not serving locally - 'could not find jekyll' -

i have little-to-no experience ruby, have been managing maintain jekyll site github. however, unknown reason, when cd website's directory , run jekyll serve following error: could not find 'jekyll' (>= 0) among 7 total gem(s) (gem::missingspecerror) here full error message: /usr/local/cellar/ruby/2.4.1_1/lib/ruby/2.4.0/rubygems/dependency.rb:308:in `to_specs': not find 'jekyll' (>= 0) among 7 total gem(s) (gem::missingspecerror) checked in 'gem_path=/users/amin/.gem/ruby/2.4.0:/usr/local/lib/ruby/gems/2.4.0:/usr/local/cellar/ruby/2.4.1_1/lib/ruby/gems/2.4.0', execute `gem env` more information /usr/local/cellar/ruby/2.4.1_1/lib/ruby/2.4.0/rubygems/dependency.rb:320:in `to_spec' /usr/local/cellar/ruby/2.4.1_1/lib/ruby/2.4.0/rubygems/core_ext/kernel_gem.rb:65:in `gem' /usr/local/bin/jekyll:22:in `<main>' trying gem env gives this, looks little messy: rubygems environment: - rubygems version: 2.4.5 - ruby version:

mysql - SQL query not returning any data -

so i'm having issue trying return records have 2 conditions not equal. i have 3 tables: person, student, , instructor. i'm trying return list of persons neither students or instructors. here tables (they populated values fit criteria): create table person ( name char (20), id char (9) not null, address char (30), dob date, primary key (id) ); create table instructor ( instructorid char (9) not null references person (id), rank char (12), salary integer, primary key (instructorid) ); create table student ( studentid char (9) not null references person (id), classification char (10), gpa double, mentorid char (9) references instructor (instructorid), credithours integer, primary key (studentid) ); and here answer/query: select person.id, person.name, person.dob person right join student on person.id = student.studentid right join instructor on person.id

c# - how to join tow combobox data -

i have 2 combo box 1 , data load 2 different table first combobox code is > oledbcommand cmd = new oledbcommand("select empno,ename emp", con); oledbdatareader dr = cmd.executereader(); while (dr.read()) { combobox1.items.add(dr[1].tostring()); } result: king blake clark and second combobox code is > oledbcommand cmd1 = new oledbcommand("select unitid,unitname > tableunit", con); > oledbdatareader dr1 = cmd1.executereader(); > while (dr1.read()) > { > combobox2.items.add(dr1[1].tostring()); > } result: accounting research sales operations how can have load data join both result (combobox1+combobox2) combobox3 such king accounting blake research you can merge 2 combobox content in third combobox in following way : for (int = 0; < (combobox1.items.count < combobox2.i

php - Retrieving data (dates) from mysql to disable days from datapicker -

i'm still new php/script , know on what's process on how retrieve dates mysql , implementing on jquery datapicker. my goal highlight , disable dates based inside database within datepicker. i'm not entirely sure on how it, i've searched everywhere nothing wanted. thank much! the current system i'm developing right event scheduling, want clients have ability check reserved schedules or availability website. have data in mysql, need retrieve it. so far i've came have disabled dates before present time using data picker. html <link href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" rel="stylesheet" /> <script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.min.js"></script> <script type="text/javascript" src="http://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script> <label for="job">day of event</label>

Azure Application Proxy, Pre-authentication, SPA - Accessing the access token -

i'm using azure application proxy pre-authentication enabled azure active directory. working expected, getting prompted login , being redirected site (spa) via proxy connector. is there way receive access token in single page application, can used interact graph api validate membership rights?

python - OpenCV overwrites my original image when drawing a line with cv2.line(...) -

Image
i'm using cv2.line(...) draw lines on existing image. i've broken down simple example. don't understand why original image lost on first call cv2.line(...) , same doesn't appear happen on second call. # show original image (bgr color map) misc.imshow(vis) # draw first line display, original image lost cv2.line(vis, (10, 10), (300, 300), color=(0, 255, 0), thickness=4) misc.imshow(vis) # draw second line, somehow previous image wasn't lost time cv2.line(vis, (50, 100), (250, 200), color=(0, 255, 0), thickness=4) misc.imshow(vis) results imshow : the expected result original image 2 lines draw on top of it. the problem occurred because image represented float32 image pixel values in range [0,1], whereas color set (0,255,0), forcing image integer representation rounded [0,1] values integers. changing color value (0,1.0,0) fixes problem.

python - How to prevent tkinter button command from executing immediately the program is run -

this question has answer here: why button parameter “command” executed when declared? 4 answers so i'm working on, again code in this question ... im wondering how go doing this: from tkinter import * tkinter import messagebox mb # ... def info(text): mb.showinfo(text) # ... helpmenu.add_command(label="version", command=info("not yet realesed")) # ... what automaticly executes info() . how can prevent this? you need use lambda function prevent info() being executed automatically: helpmenu.add_command(label="version", command=lambda: info("not yet realesed"))

php - Mysql query dinamic rows as fields -

i have website uses php , mysql. these tables: users: id | name ---+--------- 1 | yamato 2 | joshua 3 | rebecca 4 | brian 5 | clark ....and more tasks: id | name ---+--------- 1 | visit 2 | travel 3 | office 4 | customer meeting this table registers user's activities: activities id | user_id| task_id | date ---+--------+---------+----------- 1 | 1 | 1 | 2017-05-02 2 | 1 | 2 | 2017-05-01 3 | 2 | 2 | 2017-05-03 4 | 3 | 3 | 2017-05-04 5 | 4 | 4 | 2017-05-05 6 | 1 | 1 | 2017-05-06 7 | 1 | 1 | 2017-05-07 ...and more what trying count number of activities user, this: name | yamato | joshua | rebbeca | brian | clark |...and more ------------------+---------+--------+---------+-------+-------+- visit | 3 | 0 | 0 | 0 | 0 | travel | 1 | 1 | 0 | 0 | 0 | office | 0 | 0 |

powershell - AWS EC2 Install Chrome as user data -

i trying automate installation of chrome along few other other tasks using powershell in user data. installation of chrome fails, because needs powershell in elevated mode. following snippet of code: <powershell> #change timezone c:\windows\system32\tzutil /s "aus eastern standard time" #install chrome $path = $env:temp; $installer = "chrome_installer.exe"; invoke-webrequest "http://dl.google.com/chrome/install/375.126/chrome_installer.exe" -outfile $path\$installer; start-process -filepath $path\$installer -argumentlist "/silent /install" -verb runas -wait; remove-item $path\$installer #set chrome default browser $chromepath = "${env:programfiles(x86)}\google\chrome\application\" $chromeapp = "chrome.exe" $chromecommandargs = "--make-default-browser" & "$chromepath$chromeapp" $chromecommandargs </powershell> can please advise, how can achieved? thanks in advance.

unity3d - Unity -- Camera Child of Player Rotates Uncontrollably -

i have camera want stay @ times @ same position player. did making child of player, since when did through script player got ahead of camera. have camera rotating mouse. however, when made camera child of player, player , camera don't stop rotating, continue when mouse motionless. want camera rotate when mouse moving. code (js): #pragma strict var player : gameobject; function start () { player = gameobject.find("player"); cursor.visible = false; } function update () { //transform.position = player.transform.position; transform.rotate(input.getaxis("mouse y") * -2, input.getaxis("mouse x") * 5, 0); transform.rotation.eulerangles = new vector3(transform.rotation.eulerangles.x, transform.rotation.eulerangles.y, 0); //player.transform.rotation = transform.rotation; } first commented out line now-unnecessary code moves camera player, second line 1 causing problems. if remove it, camera rotates fine player can't turn

python - Recursive Py Program Returning j=none when j==1? -

recursive py program returning j=none when j==1? not make sense base case specified j must equal 1 , not call function again. import sys y=10 def decrease(j): if j==1: print('j =' + str(j) + '(1)') print('returning j') return j else: print('j =' + str(j) + '(not 1)') print('decreasing j') j = j-1 print('calling decrease j') decrease(j) y=decrease(y) print('complete') print(y) you forget return decrease(j) @ end of second branch. usually when encounter unexpected none returned function, check first branches end return statement. without it, function returns none

reading stdin containing newlines in matlab -

stdin can read in matlab using input function demonstrated in this post . instance: printf "1\t2\n" | matlab -nojvm -nodesktop -nosplash -r "str=input('','s')" trying read data multiple newline characters fails because first 1 signals end of input command: printf "1\t2\n3\t4\n" | matlab -nojvm -nodesktop -nosplash -r "str=input('','s')" str = 1 2 >> 3 4 | error: unexpected matlab expression. i have tried other possibilities including fscanf(0,...) , fscanf('',...) , fopen(0,'r') , , fopen('','r') , no avail. wish read lines of tab-separated data piped process, ideally directly cell array, or string can parse myself. of course loop on input until end of stream, wondering whether there not way gather input @ once.

Oracle XE ODBC 32-bit Access on new workspace -

i using odbc 32-bit (oracle in instantclient_12_2) in windows use ms access 2013 32-bit access oracle express database. created new schema , workspace, don't see tables in odbc connection. the tns service name 127.0.0.1. using same user , password old , new workspaces.

networking - non blocking tcp client socket in ruby failed -

trying create tcp socket in non-blocking manner, failed. idea? $ ruby nonblock_sock.rb /home/tom/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/socket.rb:1207:in `__connect_nonblock': operation in progress - connect(2) block (io::einprogresswaitwritable) /home/tom/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/socket.rb:1207:in `connect_nonblock' nonblock_sock.rb:6:in `<main>' here code snippet #not working yet, require 'socket' socket = socket.new(socket::af_inet, socket::sock_stream, 0) sockaddr = socket.pack_sockaddr_in(80, 'localhost') socket.connect_nonblock(sockaddr); change to: require 'socket' socket = socket.new(socket::af_inet, socket::sock_stream, 0) sockaddr = socket.pack_sockaddr_in(80, '127.0.0.1') #this socket.connect_nonblock(sockaddr) if recall correctly, 1 needs pass ip instead of hostname( localhost ) while creating address . this, connect_nonblock should raise einprogress connecting in non-block

php - if else construct issue in value attribute of html -

public function getemployeeid() { if (!isset($_session["email"]) || !isset($_session["passwrd"])) { header("location:index.php"); // cannot access page without login. } if (empty($_post)){ $_session['ids'] = ""; $query = mysqli_query($this->connection, "select max(employeeid) employeeid employees") or die("query execution failed: " . mysqli_error()); while ($row = $query->fetch_assoc()) { // push id array. $_session['ids'] = $row["employeeid"]; } } } the above code snippet bring latest registered employee id database. ------------------------>-------------------- public function updatesalary(){ if (!isset($_session["email"]) || !isset($_session["passwrd"])) { header("location:index.php");

python - list wasn't removed correctly using list.remove() method -

binary watch trying valid set through following approach. all_comb still includes result such [8, 4, 2, 1, 0.32, 0.16, 0.08, 0.04, 0.02, 0.01] it seems check function removes part of list contains [8,4] , [0.32, 0.16, 0.08, 0.04] i've been stuck on while. appreciated. ` upperlst = [8, 4, 2, 1] lowerlst = [0.32, 0.16, 0.08, 0.04, 0.02, 0.01] lst = upperlst + lowerlst ` `def all_com(lst, num): new_lst = [] l in range(len(lst) + 1): subset in itertools.combinations(lst, l): new_lst.append(list(subset)) return new_lst def remove(lst): """check if lst valid combinations""" upper = all(x in lst x in [4, 8]) lower = all(x in lst x in [0.32, 0.16, 0.08, 0.04]) return upper or lower or false def check(lst): """check combinations valid""" l in lst: print("not removed lst", l) if remove(l): print('removed list: ',

javascript - Multiselect enable option does not work in jQuery -

$(document).ready(function() { $('#fruits').multiselect({ name: 'fruits', columns: 1, placeholder: 'fruits' }); $('#fruits').multiselect('disable'); $("#changestatuss").click(function() { $("#fruits").multiselect('enable'); }); }); <div class="dropdown"> <p class="filter-text">fruits</p> <select name="fruits" multiple id="fruits"> <option value="mango">mango</option> <option value="apple">apple</option> <option value="orange">orange</option> </select> </div> <input type="button" id="changestatuss" value="try me" /> when run disable option works fine, dropdown gets disabled, enable option on event trigger not happening. tried other posts same problem still no use

c - Can the select function be used in windows for input with timeout? -

the windows documentation mentions select function using sockets, gnu c documentation mentions can used input file descriptor. can select function used in windows input stdin? here simple program written using c select function can compile gcc #include <cstdio> #include <ctime> #include <sys/types.h> int input_timeout (int filedes, unsigned int seconds) { fd_set set; struct timeval timeout; /* initialize file descriptor set. */ fd_zero (&set); fd_set (filedes, &set); /* initialize timeout data structure. */ timeout.tv_sec = seconds; timeout.tv_usec = 0; /* select returns 0 if timeout, 1 if input available, -1 if error. */ return select (filedes + 1, &set, null, null, &timeout); } int main (void) { fprintf (stderr, "select returned %d.\n", input_timeout (fileno(stdin), 5)); return 0; } here similar program written windows compiles cl #include <winsock2.h> #pragma comme

python 3.x - why the print fucntion don't work? -

** why don't print methods work in function total? thx! ** def main(): firstage = int(input('enter age:')) secondage = int(input("enter best friend's age:")) def total(firstage,secondage): response = sums(firstage,secondage) print(response) def sums(num1, num2): result = int(num1 + num2) return result main() because not calling total function inside main function change main function add total function inside this def main(): firstage = int(input('enter age:')) secondage = int(input("enter best friend's age:")) total(firstage,secondage)

Error in method getUriForFile - java.lang.IllegalArgumentException: Failed to find configured root that contains /storage/emulated/0/Android/data/ -

i've been working on simple android application takes picture , stores in app's directory. i've followed android developpers tutorials i'm still getting error. i've seen lots of questions error in stackoverflow, none of them seen fix error. this logcat error get: fatal exception: main process: com.example.victormaruca.gpstesting, pid: 31539 java.lang.illegalargumentexception: failed find configured root contains /storage/emulated/0/android/data/com.example.victormaruca.gpstesting/files/pictures/jpeg_20170914_014854_-551864997.jpg @ android.support.v4.content.fileprovider$simplepathstrategy.geturiforfile(fileprovider.java:712) @ android.support.v4.content.fileprovider.geturiforfile(fileprovider.java:401) @ com.example.victormaruca.gpstesting.mainactivity.dispatchtakepictureintent(mainactivity.java:124) @ com.example.victormaruca.gpstesting.mainactivity.access$000(mainactivity.java:43) @ com.example.victormaruca.gpstesting.mainactivity$3.onclick(mainacti

SMTP Implicit TLS and Explicit TLS using Indy 10.6.2.5341 in Delphi -

a bit of odd 1 here, when setting "usetls" utuseexplicittls , connecting mail server on implicit tls port, first attempt allows connection , sends email, subsequent attempts on port correctly fail. just wondering if has ideas on how avoid false positive on initial connect , send. the check handle non-standard ports may getting used user's mail server. pretty examples i've seen assume correct information provided. below code portion handles (excluding error logging): function sendtestemail(emailaddress: string): boolean; var emailmessage: tidmessage; begin idsmtpemail.authtype := satdefault idsmtpemail.username := ...; idsmtpemail.password := ...; idsmtpemail.port := 465; idsmtpemail.iohandler := tidssliohandlersocketopenssl.create(idsmtpemail); idsmtpemail.usetls := utuseexplicittls; tidssliohandlersocketopenssl(idsmtpemail.iohandler).ssloptions.method := sslvtlsv1_2; try // connect idsmtpemail.connect('smtp.gmail.com');

ios - How to display a UItableView in UicollectionViewCell? -

so have collection view 3 cells, each of has tableview in it. obviously, each collection view cell has load it's table view different data table view cells. my first thought make collection view delegate , datasrouce of table view, so, datasource need know collection view cell being loaded. also thought of making separate class ds , delegate both collection view , table view, again, i'm stuck on how tableview ds know collection view cell it's being loaded from. any thoughts? edit: after make assignment, datasource field nil. missing here? func collectionview(_ collectionview: uicollectionview, cellforitemat indexpath: indexpath) -> uicollectionviewcell { guard let cell = collectionview.dequeuereusablecell(withreuseidentifier: reuseidentifier, for: indexpath) else { return uicollectionviewcell.init() } cell.backgroundcolor = uicolor.clear cell.thetableview.datasource = requestedtabledatasource.init() cell.thetableview.delega

java - Maven - Dependency on module for Checkstyle not working -

project link: https://github.com/randomquestion/multimodulemavencheckstylesample i have simple maven project multiple modules. i'm following this maven guide enable checkstyle on it. created common module named build-tools (as per guide) , added checkstyle configuration in root pom file. i'm running weird issue. when create new maven project scratch, mvn clean install seems work fine including checkstyle. rename checkstyle file , update pom.xml new name, build starts failing error could not find resource <new checkstyle file name> . after that, can never build again. problem seems dependency on build-tools module in root pom not working. ├── build-tools │   ├── build-tools\ (1).iml │   ├── pom.xml │   ├── src │      └── main │       └── resources │      └── default-checkstyle.xml ├── pom.xml root pom.xml: <modules> <module>build-tools</module> </modules> <properties> <checkstyle.config.location>defa

symfony - PHP Warning: PHP Startup: Unable to load dynamic library -

i have run symfony on ubuntu 16.04 returned start error. , ran php --ini command in cmd php warning: php startup: unable load dynamic library '/usr/lib/php/20151012/php_curl.dll' - /usr/lib/php/20151012/php_curl.dll: cannot open shared object file: no such file or directory in unknown on line 0 php warning: php startup: unable load dynamic library '/usr/lib/php/20151012/php_mbstring.dll' - /usr/lib/php/20151012/php_mbstring.dll: cannot open shared object file: no such file or directory in unknown on line 0 php warning: php startup: unable load dynamic library '/usr/lib/php/20151012/php_pdo_pgsql.dll' - /usr/lib/php/20151012/php_pdo_pgsql.dll: cannot open shared object file: no such file or directory in unknown on line 0 php warning: php startup: unable load dynamic library '/usr/lib/php/20151012/php_pgsql.dll' - /usr/lib/php/20151012/php_pgsql.dll: cannot open shared object file: no such file or directory in unknown on line 0 configuration file