Posts

Showing posts from May, 2013

vim mapping only works with noremap -

i naively wrote this: " fast saving , closing current buffer without closing windows displaying " buffer nmap <leader>wq :w!<cr>:bclose<cr> but not work though there nothing overwriting this: n ,wq :w!<cr>:bclose<cr> " result of `map ,wq` it work though following: nnoremap <leader>wq :w!<cr>:bclose<cr> i feel missing pretty basic here. link full conf: https://github.com/adriengiboire/dotfiles/blob/master/.vimrc it's still messy reworking :) i tested , far can tell breaking because of mapping: nnoremap : ; i believe @ runtime turns map into ;w!<cr>;bclose<cr> the noremap form prevents ,wq mapping mapping characters within it, not translate : ; otherwise. kind of thing noremap exists avoid problems with. the rule follow in general use noremap forms unless know specific reason should not , because there many cases 1 cause problems , hard debug. wiki

facebook - Python Selenium Ubuntu: WebDriverWait will not find element -

i'm new python , selenium, , ran problem. i'm trying make script automatically click on button of facebook page (in pop-up). edit - localhost webpage code: <html> <head> <title>link facebook page</title> <link rel="stylesheet" type="text/css" href="default.css"> </head> <body> <center> <div id="fb_like"> <a href="https://m.facebook.com/adagiotv" target="_blank"><img src="fblogo.png"></a> </div> </center> </body> </html> i have following code: from selenium import webdriver selenium.webdriver.common.by import selenium.webdriver.support.ui import webdriverwait selenium.webdriver.support import expected_conditions ec import time webpage = r"http://localhost/like/" # local web driver = webdriver.firefox() driver.get(webpage) sbox = driver.find_element_by_class_name("fb_like") sbox.cli

JXBrowser - What is globalX, globalY, windowX, windowY in relation to x, y for forwarding mouse events? -

i can find no explanation on these supposed do. there examples on: https://jxbrowser.support.teamdev.com/support/solutions/articles/9000102480-forwarding-mouse-events but 629 , 373 ? can't figure out values for. can same behaviour value those. what if 1 sets windowx , windowy ? what result click? i looking able click , move on google map. possible? the x , y values define mouse event coordinate inside browser content area. the globalx , globaly values define screen coordinate of mouse event. the windowx , windowy deprecated. if set them, doesn't affect anything. for more detailed information working google maps, please take @ article . wiki

python - SSL Error when using local cert to verify -

error message data traceback (most recent call last): file "c:\users\cody.jones\appdata\local\programs\python\python36-32\lib\site-packages\urllib3\util\ssl_.py", line 313, in ssl_wrap_socket context.load_verify_locations(ca_certs, ca_cert_dir) ssl.sslerror: unknown error (_ssl.c:3510) during handling of above exception, exception occurred: traceback (most recent call last): file "c:\users\cody.jones\appdata\local\programs\python\python36-32\lib\site-packages\urllib3\connectionpool.py", line 601, in urlopen chunked=chunked) file "c:\users\cody.jones\appdata\local\programs\python\python36-32\lib\site-packages\urllib3\connectionpool.py", line 346, in _make_request self._validate_conn(conn) file "c:\users\cody.jones\appdata\local\programs\python\python36-32\lib\site-packages\urllib3\connectionpool.py", line 850, in _validate_conn conn.connect() file "c:\users\cody.jones\appdata\local\programs\python\python36-32

azure - Cloud service for webrole running in ARM Resource group -

my understanding far on paas deployment using webroles or worker roles- spinning web roles or worker roles create cloud service manage it. however, in arm resource group, no concept of cloud service, how web & worker roles managed in arm resource group? also tried adding webroles via json outline in vs 2015, no option add webroles. not sure if can deploy webroles via json template? any information of great help. azure resource manager web apps rely on concept of app service plans, rather cloud services. underlying vm(s) service runs on. can specify size , number of servers make app service plan, , deploy on single unit. you create app service plan, run web / worker roles inside (as logic, api, functions) as far web / worker roles concerned, app service plans not draw distinction between two. deploy code , run packaged. see here the concept of cloud services don't exist within azure resource management model. you can find template deploying web app

javascript - When I autoplay an HTML5 video, I can't loop it from a specific point -

i have video want autoplay when page loaded, , loop specific point (16 seconds) when ends. if add "autoplay" in html video doesn't loop @ all. if add "loop" in html video loops disregards eventlistener. if don't add loop or autoplay , play video manually loops @ 16 seconds want to. how can have video autoplay on page load , loop @ 16 seconds? below code have: document.getelementbyid('video1').addeventlistener('ended', function(){ this.currenttime = 16; this.play(); }, false); <video id="video1" width="100%" autoplay > <source src="video1.webm" type="video/webm"> </video> i managed reproduce problem experienced when had code in head tag rather @ bottom. test worked looked this: <!doctype html> <html> <head> <meta charset="utf-8"> <title>html video</tit

android - How to toggle between fragments -

i have app has 1 main activity , 5 main fragments. when mainactivity created create list containing each of 5 fragments. user presented tab bar on bottom of screen he/she can use navigate between fragments. how set when user selects tab, corresponding fragment shown without creating new instance of it ? want change view on screen created fragment. i using bottombar https://github.com/roughike/bottombar calls "ontabselected" interface method when tab pressed. you can use 5 fragments library specified this. layout file should this <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" xmlns:app="http://schemas.android.com/apk/res-auto"> <!-- fragment container, or --> <framelayout android:id="@+id/contentcontainer" android:layout_width="match_parent" android:layout_height="matc

python - Django: How to create a multilingual website -

i wanto create multilingual website in django , tried using django-parler when want add object admin, admin doesn't show translatedfield here part of models: class movie(translatablemodel): translations = translatedfields( synopsis=redactorfield( verbose_name=u'sinopsis', allow_file_upload=false, allow_image_upload=true, ), data_sheet=redactorfield( verbose_name=u'sinopsis', allow_file_upload=true, allow_image_upload=true, ), ) name = models.charfield(verbose_name='nombre', max_length=250) and parler settings: parler_default_language = 'es' parler_languages = { 1: ( {'code': 'es', }, {'code': 'en', }, ), 'default': { 'fallback': 'es', 'hide_untranslated': false, } } wiki

Is it possible to create a read-only version of your Facebook news feed? -

this might sound weird question, i'm wondering how you'd create version of own facebook news feed following characteristics: all posts visible, including activity of friends the reader isn't allowed react to, comment on, or share anything, view this tailored news feed can accessed inputting login information i appreciate understanding this. wiki

javascript - recharts pie chart centering using responsive container -

i'm using recharts create pie charts. when @ example, http://recharts.org/#/en-us/examples/pieresponsivecontainer pie chart can centered using responsivecontainer component. but attempt failed : https://codesandbox.io/s/ll68p643xl . try change size of viewport larger width, pie isn't center anymore. wonder what's wrong here. responsivecontainer makes pie take size of container. if inspect html, see container in fact size of parent. if want center it, can make container not take whole parent, , use css. this: .pie-row .pie-wrap > div { background: red; margin: 0 auto; } and container: <responsivecontainer classname="container" height={70} width='30%'> wiki

java - Android Widget Not Updating More than once -

hi have simple widget showing message unread count , i'm triggering widget update every few seconds (via service , appwidgetprovider) , widgetprovider onupdate called new value every few seconds widget view not updating more once after first update , may cause problem ? here's onupdate code triggered not working more once for (int = 0; < count; i++) { appwidgetmanager manager = appwidgetmanager.getinstance(context); remoteviews remoteviews = new remoteviews(context.getpackagename(), r.layout.notification_widget_count); if (unreadcount > 0) { remoteviews.setviewvisibility(r.id.notification_widget_count_root, view.visible); // remoteviews.setimageviewbitmap(r.id.notification_widget_count_image_text, m.getfontbitmap(context, unreadtext, context.getresources().getcolor(r.color.white), 25)); remoteviews.settextviewtext(r.id.notification_widget_count_text, new date().getseconds()+""); inten

c# - Avoid "file in use by another process" IO exception -

the code have included below writes csv file. if csv file writing happens open in excel, system.io.exception indicates "the file being used process." how can change code program continuing running , wait until csv no longer open in excel? private void timer1_tick(object sender, eventargs e) { int actmonth, actyear, actsecond; system.datetime fecha = system.datetime.now; actmonth = fecha.month; actyear = fecha.year; if (actmonth <= 9) { valorfechaact = system.convert.tostring(actyear) + "00" + system.convert.tostring(actmonth); } else { valorfechaact = system.convert.tostring(actyear) + "0" + system.convert.tostring(actmonth); } actsecond = fecha.second; string label; label = label1.text; string @ = "@"; string filename = valorfechaact + ".csv"; string ruta3 = system.io

r - How to get values with same time with previous days same value -

how replace na s in var_1 same previous days value eg.row 4 has missing value - replace value/na same time in previous day(row 1). similarly row 7 row 3, row 10 row 9 , row13 row 11. can replace na previous value zoo-na.lacf id date var var_1 1 21-01-2014 00:15 22 22 2 21-01-2014 00:30 33 33 3 21-01-2014 00:45 13 13 4 22-01-2014 00:15 na 22 5 22-01-2014 00:30 22 22 6 22-01-2014 00:35 54 54 7 22-01-2014 00:45 na 13 8 23-01-2014 00:15 23 23 9 25-01-2104 01:00 34 34 10 26-01-2104 01:00 na 34 11 27-01-2104 02:00 2 2 12 27-01-2104 03:00 21 21 13 28-01-2104 02:00 na 2 one way use format time, , split on that. use na.locf fill nas , rbind together, i.e. library(zoo) do.call(rbind, c(lapply(split(df, format(df$date, format = '%h:%m')), function(i) { i$var <- na.locf(i$var); }), make.row.names = fals

netsuite - Suitescript 2.0 Utilize different forms for different types of projects -

my company runs several different types of projects , view project record differently depending on type of project being run in selected project record. i have field selects form use, titled "custom form" (this select field) , field our staff enter type of project "custentityjt_fie_pro_projecttype" (also select field). i have created following before load user event script try achieve this: /** * @napiversion 2.x * @nscripttype usereventscript * @nmodulescope sameaccount */ define(["n/record"], function(r) { function beforeload(context) { var currentrecord = context.newrecord; var projecttype = currentrecord.getvalue({ fieldid: "custentityjt_fie_pro_projecttype", }); currentrecord.setvalue({ fieldid: 'customform', value: projecttype }) } return { beforeload: beforeload, } }) when loading project record in edit mode, custom form selection not change, , when loading proje

visual studio 2015 - RESX file in TFS disappeared -

Image
i have resx file in tfs co worker can see can not. when log our online repository, can see file fine (so assuming not permission error) when in source control explorer inside vs not there. result, not grab on latest. as work around can download online repository re-add project. see add. when go check in, asks me resolve conflict. selected take version server checked in , still missing in vs. solution explorer. any appreciated. thanks seems file not added project looking @ in solution explorer . click show files icon in top of solution explorer , should appear in list of files if located in folder of project. there seems inconsistency between coworker's project/solution , yours. either of add missing files project , commit repository. wiki

Python - TensorFlow - ModuleNotFoundError: No module named x -

i'm trying run tensorflow program using python3.6 i'm facing error: modulenotfounderror: no module named 'tensorflow.python.pywrap_tensorflow_internal' i found out should run script directory, other tensorflow's. however, when ran script in terminal directory error: line x: models.object_detection.utils import dataset_util modulenotfounderror: no module named 'models' moreover, here directory looks like: - root - models . - object_detection . . - utils . . + dataset_util.py - my_folder . + my_file.py how can solve issue? thanks. wiki

reactjs - How to get channel messages in Elixir Phoenix to change the state of a React component? -

i'm trying figure out how state of component update based on external event, , in case external event message coming down elixir phoenix channel. so basically, have simple h1 tag , must reflect latest thing comes channel. there 2 interlinked questions: a) how channel component? far have done passing channel prop. b) how handle messages coming channel inside component? "this.state.chan.on" doesn't work, , seems clumsy. import socket "./socket" import react "react" import reactdom "react-dom" socket.connect() // connected, can join channels topic: let channel = socket.channel("topic:subtopic", {}) channel.join() .receive("ok", resp => { console.log("joined successfully", resp) }) .receive("error", resp => { console.log("unable join", resp) }) class helloworld extends react.component { state = { chan: this.props.channel, mess: this.props.message } this

ios - Global vs local resource conflicting location instructions within a bundle? -

i confused seem conflicting instructions whether include localized vs global resources within ios bundle. in "bundle structures" section of "bundle programming guide", states (bold emphasis): an ios application should be internationalized and have a language.lproj folder each language supports. in addition providing localized versions of application’s custom resources, can localize launch images placing files same name in language-specific project directories. even if provide localized versions, however, should include default version of these files @ top-level of application bundle . default version used in situations specific localization not available. that leads me believe should have both global resource resources aren't localized given language and/or region. however, in same programming guide bundle foundation documentation, states: because global resources take precedence on language-specific resources, you should never include both gl

(Eclipse) Implementing syntax colouring for custom language -

so i'm looking @ implementing syntax coloring custom language program @ work. i've found bits , pieces how it... nothing explains in full. i'd prefer without external plugins/framework, custom plugin eclipse if possible. related links i've found: http://www.realsolve.co.uk/site/tech/jface-text.php how can create custom eclipse syntax highlighter https://wiki.eclipse.org/faq_how_do_i_provide_syntax_coloring_in_an_editor%3f thanks. wiki

Format or pass string from PHP (javascript) to jquery timepicker -

i sending datetext first php , mysql. upon response sql server, want echo string javascript (jquery). so far works, cannot pass string callback $.post disabledtime without removing '' beginning , end of string. else works perfect. ideas? onselect: function(datetext, inst) { var selected = datetext; $.post('plik.php?mdate='+selected, function(queryresult){ var disabledtime = queryresult; $('#timepicker').timepicker('option', 'disabletimeranges', disabledtime); }); in plik.php, can pass data json, makes easy use in jquery. don't know actual value is, used placeholder "the value of disabled time". echo json_encode( array( 'disabledtime' => 'the value of disabled time' )); then in js, use json. converted jquery request, based on showing in code: onselect: function(datetext, inst) { va

python - ZeroMQ pattern for Worker processes? -

i'm learning 0mq , having difficulty understanding pattern use use case. i want create server multiple clients connect. server going hand out work items, each work item have go specific client. example, if server picking cards deck, want hearts go 1 worker, diamonds second worker, etc. (the work items events sessions, , need every event single session go same worker.) what pattern use this, , have code shows (in python): context = zqm.context() socket = context.socket(which type?) socket.bind("tcp://*:5555") #wait 4 clients connect (how?) while true: card = getnextcard() if card.suit == hearts: send card worker #1 (how?) if card.suit == diamonds: send card workder #2 etc... basically, how track clients have connected server, , send work items 1 of n clients connected? welcome world of distributed-computing: clients may introduce themselves, once starting connected server, assume server have sub_to_ask4connect = c

How can I use Linq to XML to extract content from webpage in C# or in Xamarin.Android -

Image
i have attached image and content expanded <div> .... </div> using linq xml in c#. tried way not sort out. xdocument.parse(content); // linq xml xelement root = xelement.load(url); ienumerable<xelement> tests = el in root.elements("div") (string)el.element("confused") == "confused" select e foreach (xelement el in tests) console.writeline((string)el.attribute("confused")); if there simple way extract content webpage having kind of structure using other techniques including xmldocument, xmlpullparser or linqtoxml , appreciate. thank you. edited requested: <div class="story-body__inner" property="articlebody"> <figure class="media-landscape has-caption full-width lead"> <span class="image-and-copyright-container"> <i

angular - How to install and use the Jquery DataTable in angular2+? -

i learning angular4. want use jquery datatable plugin in angular application. have no idea how install , use plugin in angular application. can 1 guide me? see manual data-tables. cdn , npm https://datatables.net/manual/installation wiki

ios - UIButton tintColor for disabled and enabled state? -

i have custom class inherits uibutton . thing want accomplish setting tintcolor property based on button's enabled state (i.e enabled or disabled). is there way achieve that? this class: class buttonspostmenu: uibutton { override func awakefromnib() { titlelabel?.font = uifont(name: font_avenirnext_medium, size: 14) tintcolor = uicolor.white } } you override isenabled property achieve that. tintcolor automatically changed according button's isenabled status: class buttonspostmenu:uibutton { //...... override var isenabled: bool { didset{ if self.isenabled { self.tintcolor = uicolor.white } else{ self.tintcolor = uicolor.gray } } } //...... } wiki

Cannot start visual studio 2017 -

i cannot start visual studio professional 2017 after update, appears less 1 second , disappear. i'll try repair, uninstall , install fresh new one, same problem. maybe had same problem ? kind solutions made ? please first check system requirement here: https://www.visualstudio.com/en-us/productinfo/vs2017-system-requirements-vs if system requirement satisfied, remove old cache file disk cleanup, %temp% files. restart system , try install , run. thanks wiki

osx - How to set VS 2017 for Mac XSP Web Server Port to greater than 32767 -

the software used testing dev website i'm working on requires use of port 57912 ( http://localhost:57912 ) work. tried changing xsp server port in vs2017 mac use 57912, however, reverts 32767 (the max value allowed ui). idea how set 57912? vs2017 mac xsp server setting wiki

How can I make changes in an existing NetSuite form or how to write a new form using HTML, Bootstrap & JavaScript? -

i trying create new form using html/ javascript in netsuite. i read of links (creating custom html forms in netsuite on youtube) depicted on how it, when tried on personal account (administrator) not happening, don't have "marketing template" subtab in documents section. i have read suitlets , confusing. these forms supposed pop on netsuite window only. suitelets correct approach create new custom page in netsuite ui. you can pull in custom html, css, , amd-compatible js library wish. more that, you'll need ask more detailed questions. here's video showing example of creating suitelet, although uses suitescript ui apis rather custom html: https://youtu.be/hk2lg-sfz3k wiki

html - How can I change a button Id-tag into class-tag and use getElementByClassName right? -

i need button id several buttons thats why want change class-tag. if not work. not possible use elementbyclassname ? <button class="mybtn">overlay</button> so want change id-tag class-tag. tried change getelementbyid getelementbyclassname. unfortunatly not work. in following have added example w3schools. working id-tag. <!doctype html> <html> <head> <style> /* overlay (background) */ .overlay { display: none; /* hidden default */ position: fixed; /* stay in place */ z-index: 1; /* sit on top */ left: 0; top: 0; width: 100%; /* full width */ height: 100%; /* full height */ overflow: auto; /* enable scroll if needed */ background-color: rgb(0,0,0); /* fallback color */ background-color: rgba(0,0,0,0.4); /* black w/ opacity */ -webkit-animation-name: fadein; /* fade in background */ -webkit-animation-duration: 0.4s; animation-name: fadein; animation-duration: 0.4s } /* overlay content */ .overlay-content { position: fixed; bott

php - Wordpress - Format a post meta (date) -

i want display date of event on revolution slider. managed display date using meta slug, don't format. i have no idea start ! thought of, maybe creating post meta desired date format, update when first date meta updated, seems bit overkill ? i have code add meta , update desired format : but there better way ? function kia_convert_content(){ $events = get_posts(array('numberposts'=>-1,'post_type'=>'pec_events')); foreach( $events $post ) : setup_postdata($post); // old meta $mauvais_format = get_post_meta($post->id,'pec_date', true); // format date date_format($mauvais_format, 'j f y'); //add or update new meta if(metadata_exists('post', $post_id, 'l2v_pec_date')){ update_post_meta($post->id,'new_pec_date',$bon_format); }else{ add_post_meta($post->id, 'new_pec_date', $bon_format, true) } endforeach; } wiki

python - AttributeError: 'module' object has no attribute 'SMAC_optimizer' -

i try run pysmac find input parameters python function minimizing return value. followed example quickstart guide , raises exception: attributeerror: 'module' object has no attribute 'smac_optimizer' import section includes: import pysmac . exception in line: opt = pysmac.smac_optimizer() why raising exception , how can solve it? i've asked developers on github , haven't give answer yet. i've read similar questions on stackoverflow, there no solution. i cloned repository https://github.com/automl/pysmac.git , run python setup.py install . it helps, smac works after that. note: installing pysmac via pip using pip install pysmac caused error. this didn't either: pip install git+https://github.com/automl/pysmac.git wiki

c++ - Program that reads and writes integers to a file -

hello , thank in advance. simple question 1 getting on nerves. want ask integer write file , display every integer. i've learned how either write or display file , i've been successful @ when try both @ time asks me integer , don't display numbers. think may problem related fstream or position of pointer. here program: #include "stdafx.h" #include <iostream> #include <stdio.h> #include <fstream> using std::cout; using std::cin; using std::fstream; using std::endl; int a; int x; int main() { fstream in; in.open("op.txt", std::ios::app); cout << "write integer" << endl; cin >> x; in << " " << x; while (in >> a) { cout << << endl; cout << in.tellg(); } in.close(); return 0; } there few things need fixed: in.open("op.txt",std::ios::in | std::ios::out | std::ios::app); here why

line numbers - How do you synchornize Fortify report with updated source code? -

my project's source files have changed since last fortify scan made. audit workbench shows issues using new source files causing mismatch. mismatch persists after run scan again fortify project. seems way re-align reported issues correct source code perform scan in new fortify project. not desirable since have re-audit issues have been audited in original project. is there way fortify re-assign line numbers stored issues match changes made in source files? there 2 different things going on here. 1) when open fpr, audit workbench on current hard drive see if source code resides on (it knows absolute file paths of code scanned). if finds source code, use display when issue selected instead of using source code has inside of fpr (i assume because of performance). since have modified source code after scan, need select tools -> extract source code... menu , extract source code temporary location (you can delete later). when happens, audit workbench use code dis

ios - React-native application out itself when run in the simulator -

so i'm making simple app using react-native, , server-side using nodejs, have no problem while running nodejs while opening application in simulator, after time try display data api front-end application in react-native goes out home screen of simulator , have tried several times still so, i've checked in back-end no problem @ all wiki

java - Scala, Spring or Hadoop as an Api service? -

i starting new java application - , current code base taking on - appears have been built jetty , writing out html markup directly servlet itself. package root.web; import javax.servlet.http.httpservletrequest; import javax.servlet.http.httpservletresponse; public class html { public static string gethead(int pin,boolean due, string fname, string lname){ string head = ""; head += "<!doctype html>"; head += " <html>"; head += " <head>"; i interested in re-building application using scala, spring or hadoop - keen discuss links, tutorials develop quick , secure api. "login system" user filling in forms - , having data these forms stored in mysql table , displayed charts/tables/lists. so keen build frontend using reactjs - , have java application provide api service. -- login service -- forgot password, session handling, account changes - crud of sorts -- us

c# - how to get clicked item in my another page -

my book class public class book{ public string title { get; set; } public string bookcover{ get; set; } } public class bookmanager { public static list<book> getbook() { var bookid= new list<book>(); bookid.add(new book{ title = "fruits", bookcover= "assets/1.jpg" }); bookid.add(new book{ title = "food", bookcover= "assets/2.jpeg" }); return bookid; } } my mainpage xaml <gridview itemssource="{x:bind bookid}" margin="0,0,49,121" itemclick="gridview_itemclick" isitemclickenabled="true" > <gridview.itemtemplate> <datatemplate x:datatype="local:book"> <grid height="186" width="155"> <image stretch="fill" source="{x:bind <gridview itemssource="{x:bind bookcover}" margin="

ios - Update new APNS certificate to GCM -

Image
generated new certificates in apple developer centre. it's weird couldn't upload certificates gcm , couldn't see update button developer website. it shows error {{ controller.errormessage }} how do that? here's screenshot of google developer you have import gcm project firebase console (there won't changes, see answer here ) , update certs there. while importing, advise toigrate app(s) start using fcm. wiki

php - Remove last \" from link with preg_match_all -

next link example returns 2 links both end \" . there no links end \" in example text. when run below preg_match_all() function in wordpress site. i need fix , links not end \" here text example retrieve links from: $banner_link = '<a href="https://mobico.nl/telefoon/?tt=26156_1144596_250041_&amp;r=" target="_blank" rel="nofollow"><img src="http://ti.tradetracker.net/?c=26156&amp;m=1144596&amp;a=250041&amp;r=&amp;t=html" width="300" height="250" border="0" alt="" /></a>'; preg_match_all('!https?://\s+!', $banner_link, $matches); $all_urls = $matches[0]; print_r($all_urls[0]); echo '<br>'; print_r($all_urls[1]); here result both end \" https://mobico.nl/telefoon/?tt=26156_1144596_250041_&r= \" http://ti.tradetracker.net/?c=26156&m=1144596&a=250041&r=&t=html \" i

python 3.x - Pygal Module Not Working -

in trying run simple code has outputs histogram, keep getting following error: traceback (most recent call last): file "c:\tmp\die_visual.py", line 1, in <module> import pygal file "c:\users\christopher\appdata\roaming\python\python36\site-packages\pygal\__init__.py", line 33, in <module> pygal.graph.bar import bar file "c:\users\christopher\appdata\roaming\python\python36\site-packages\pygal\graph\__init__.py", line 24, in <module> .__about__ import * # noqa: f401,f403 modulenotfounderror: no module named 'pygal.graph.__about__' i have moved file requires pygal same directory , same error. this code have entered. import pygal die import die # create d6. die = die() # make rolls, , store results in list. results = [] roll_num in range(1000): result = die.roll() results.append(result) # analyze results frequencies = [] value in range(1, die.num_sides+1): frequency = results.count(value

Gemfire - Crud Repository - findBy Implementation -

we using single gemfire cluster non production environment , geting regionname dynamically using @resources. use need override crud operation. got struck implementation logic findbyfirstnameandlastname(string firstname,string lastname). can share actual implementation of findby in crudrepository. appreciate help. public list<user> findbyfirstname(string firtstname) throws queryexception { list<user> user = new arraylist<>(); try { selectresults<user> results = (selectresults) userregion .query("select * /" + userregion.getname() + " d d.firtstname='" + firtstname+"'"); user.addall(results); } catch (functiondomainexception | typemismatchexception | nameresolutionexception | queryinvocationtargetexception e) { throw e; }

database - Could not find records in nighter success nor error folder in informatica -

can 1 me resolve below issue we working migration project, migrating windows unix. in dev environment there code developed someone.we made changes per unix. ran workflow in unix dev environment, records loaded in error folder. the same code has been migrated unix test environment. same have tested in test environment(unix) same file. records(6 records) suppose go error folder in unix in windows environment. records (total 6 records) reading source in test env. not loading(6 records) in error file success file. total '0' records showing. connections , paths correct. please me fix. wiki

sql server - Full-Text Item Count 1 on Table with 8986 records -

using query select fulltextcatalogproperty(cat.name,'itemcount') [itemcount], fulltextcatalogproperty(cat.name,'mergestatus') [mergestatus], fulltextcatalogproperty(cat.name,'populatecompletionage') [populatecompletionage], fulltextcatalogproperty(cat.name,'populatestatus') [populatestatus], fulltextcatalogproperty(cat.name,'importstatus') [importstatus] sys.fulltext_catalogs cat i see itemcount | mergestatus | populatecompletionage | populatestatus | importstatus ------------------------------------------------------------------------------- 1 | 0 | 872792723 | 0 | null itemcount 1 on table 8986 records! if perform simple freetext query: select * freetexttable(table, column, 'word') it return 1 record. but if perform classik like query select * table column '%word%' it return 332 records. i have added first time full-text index on existi

R: default value using other argument modified when other argument modified -

when defining default argument y r function being equal other argument x . ex: function(x,y=x) . found if change other argument ( x ) before using default argument ( y ), changes value of y. i understand has "delayed copying until modified" desired behavior? hereafter full example: oh_my <- function(x, y=x){ x <- rev(x) y <- rev(y) # value of y here rev of initial x! print(y) } oh_my(1:5) [1] 1 2 3 4 5 an easy solution be: ok <- function(x, y=null){ if(is.null(y)){ y<-x } x <- rev(x) y <- rev(y) print(y) } ok(1:5) [1] 5 4 3 2 1 but fact default obvious in first option (including in automatically generated files). an other solution be: pfiouu <- function(x, y=x){ y <- rev(y) # value of y here rev of initial x! x <- rev(x) print(y) } pfiouu(1:5) [1] 5 4 3 2 1 but seems awkward me pfiouu , oh_my give different results 2 exchanged lines not mention expli

Excel Office JS filter data -

in excel user can select range , hit ctrl + shift + l show filters. trying equivalent behavior office.js add-in. the closest have come adding table on range want filter , adding filter table. there seem couple of significant problems however. first, adding table way 30000+ rows slow , using tables larger that. if ctrl + shift + l on range size instantaneous. additionally, when add table, office.js stylizes range. not want new styling range want filter added. my current code looks this: await excel.run(async ctx => { const table = await getorcreatedatatable(ctx, "costdata", new excelrange(this.stateservice.headerrow)); //see below const validationcolumn: excel.tablecolumn = table.columns.getitemornullobject("validation"); validationcolumn.filter.applycustomfilter(`*${searchstring}*`) await ctx.sync(); }); export const getorcreatedatatable = async(ctx: excel.requestcontext, tablename: string, headerrow: excelrange): promise <

Google Voice Integration to App: Google unable to open my application -

Image
i trying search app using google voice command like: "search on app_name". and using app pluto ( https://play.google.com/store/apps/details?id=com.tamal.voicesearch ). problem voice search working 2 weeks (for other apps). not working in of devices in working. more interestingly in these devices voice search working application flipkart. one weird solution : i spend complete day on researching on issue , cleared data of google app , uninstall updates , started working on samsung s4 device (android version: 5.0.1 , google app version 7.8.22.21 ), please check attachment. in other 2 devices moto g4 (android version: 7.0.0) , nexus 5 (android version: 6.0.1) still not working (even after clearing data , uninstalling updates of google app). if "search on pluto", doing web search. i have researched didn't explanation or solution behavior yet. not understanding inconsistency @ all. using following documentation same: https://developer.android.com/guide/c

c# - Multiple RegEx negation matching -

i have following regex patterns: "[0-9]{4,5}\.fu|[0-9]{4,5}\.ng|[0-9]{4,5}\.sp|[0-9]{4,5}\.t|jgb[a-z][0-9]|jni[a-z][0-9]|jn4f[a-z][0-9]|jnm[a-z][0-9]|jti[a-z][0-9]|jtm[a-z][0-9]|niy[a-z][0-9]|ssi[a-z][0-9]|jni[a-z][0-9]-[a-z][0-9]|jti[a-z][0-9]-[a-z][0-9]" ===> matches 8411.t or jnid8 "[0-9]{4,5}\.hk|hsi[a-z][0-9]|hmh[a-z][0-9]|hcei[a-z][0-9]|hcei[a-z][0-9]-[a-z][0-9]" ==> matches 9345.hk or hceiu9-a9 ".*\.si|sfc[a-z][0-9]" ==> matches 8345.si or sfcx8 how can obtain regex negation of these patterns? want match strings match neither of these 3 patterns: e.g. want match 8411.abc, not of aforementioned strings (8411.t, hceiu-a9, 8345.si, etc.). i've tried (just exclude 2 , 3 instance, doesn't work ): ^(?!((.*\.si|sfc[a-z][0-9])|([0-9]{4,5}\.hk|hsi[a-z][0-9]|hmh[a-z][0-9]|hcei[a-z][0-9]|hcei[a-z][0-9]-[a-z][0-9]))) the main idea here place patterns (?!.*<pattern>) negative lookaheads anchored @ start of str

scala - VarArgs A* vs Seq[A] parameters to function -

i'm using scala 2.11 . if create function : def func1 (a: int* ) : int = a.reduce(_+_) i call using func1(1,2,3,4) // 10 func1(seq(1,2,3,4) : _*) //10 which fine. but when try define function literal : val func2:(int*) => int = _.reduce(_+_) i error saying : <console>:5: error: type mismatch; found : int* => int required: seq[int] => int lazy val $result = instance.`func2` why want seq[int] in second case not in first though definition same? how varargs being passed in first case such reduce able invoked on them? scala makes distinction between methods , functions. func1 method parameter repeated , , desugared under hood simple seq . on other hand, your func2 function, , repeated parameters not allowed in context. if compiler expects function given method instead, performs eta-expansion. example, method def(s: string) = s turned function (s: string) => s . i'm saying make point distinction between methods , function

javascript - In Three.js Is there a way to produce a trail that slowly fades over time? -

i looking produce effect similar following example: https://threejs.org/examples/?q=trails#webgl_trails however, make old trail fade background on time -- rather persist increasingly messy screen. it seems following code allow draw on previous frames without clearing them: renderer = new three.webglrenderer( { preservedrawingbuffer: true } ); renderer.autoclearcolor = false; but unsure how make each frame fade background new frames drawn on top. seems painting on screen transparent color work, i'm not sure how approach that. you take example showed above, , create faint black plane sits directly in front of camera: // make highly-transparent plane var fadematerial = new three.meshbasicmaterial({ color: 0x000000, transparent: true, opacity: 0.01 }); var fadeplane = new three.planebuffergeometry(1, 1); var fademesh = new three.mesh(fadeplane, fadematerial); // create object3d hold camera , transparent plane var camgroup = new three.object3d(); var

javascript - Show PlotLine value on yAxis Highcharts -

Image
i'm working highchart's char bar, wonder if theres way show value of average line (plot line), show value in ' yaxis ' or on mouse hover show dialog exact value of plot line. i show average line, can't read exact value on graph. this plotlines highchart plotlines: [{ color: 'red', value: avg, // insert average here width: '1', zindex: 2 // not stuck below regular plot lines }] you should able show label: plotlines: [{ color: 'red', value: avg, // insert average here width: '1', zindex: 2, // not stuck below regular plot lines label: { text: avg, textalign: 'left', x: -40 } }] reference wiki

(Discord.py) (Python) NoneType object error when trying to add roles -

i trying have bot discord able add roles. able create roles, fails when try , have give role somebody. here code: await client.send_message(message.channel, 'type in name of role have. cannot role exists.') rolemessage = await client.wait_for_message(author = message.author) rolename = str(rolemessage.content) await client.create_role(client.get_server('insertserveridhere'), name = rolename, colour = discord.colour.orange(), hoist = true, mentionable = true) userrole = discord.utils.get(message.server.roles, name = rolename) await client.add_roles(message.author, userrole) i have tried looking @ other samples of code give people roles, , seem pretty similar. don't know problem is. whenever run it, says: attributeerror: 'nonetype' object has no attribute 'id' it says on line adds role. edit: userrole appears problem on add_roles line, don't know why. edit 2: reason changing server id different 1 , ch

c# - aspnet_compiler.exe is not able to find a dependent virtual directory -

i creating web application storing common user controls called commoncontrols. has directory structure looks this: commoncontrols.csproj |_ controls |_ patient |_ patientnoteslist.ascx i have web app called backoffice has following folder structure: backoffice.csproj |_ doctors |_ patientnotes.aspx both backoffice , commoncontrols in same sln, called ui.sln. patientnotes.aspx (from backoffice) uses patientnoteslist.ascx control (from commoncontrols) follows: <%@ register src="~/commoncontrols/controls/patient/patientnoteslist.ascx" tagprefix="cc" tagname="patientnoteslist" %> when compile in vs2015, no errors , able run backoffice application no issue, , have confirmed patientnotes.aspx page in fact using patientnoteslist.ascx control. when compile ui.sln via msbuild, succeeds, in line compilation in vs2015. however, in our msbuild scripts each project in sln compiled using aspnet_compiler (after sln compilation)

javascript - Get dom element by ID in WebView UWP -

i intend content of dom element website, cant use var html = await client.getasync("http://example.com/test.html"); as specific dom element populated after js executed can use webview host content won't solve problem can't use htmldocument.getelementbyid method (string) either under system.windows.forms namespace isn't supported in universal windows platform! option invokeasync await webview5.invokescriptasync("dosomething", null);   as seen in scenario 5 of xaml webview control sample fires events , won't in getting dom element (or source code once js execution done). //the app c# uwp, not winjs you can use htmlagilitypack library query dom downloaded. see example here or search more, there plenty. alternatively, can run javascript need , returns string containing id. see, invokescriptasync returns string can contain javascript returned. f.e., this how dom javascript: var result = await this.webview.invokescriptasync(

javascript - How to do render only after http request completed in ReactJS -

i need render function of component called after request componentdidmount function completed. componentdidmount(){ let ctx = this; apiservice.get('/busca/empresa/pagina').then(function(response){ if(response.data.empresa){ ctx.setstate({company:response.data.empresa}); ctx.getproducts(); ctx.verifyauthentication(); } }, function(error){ notification.error('http status: ' + error.response.status + ' - ' + error.response.data.mensagem); }); } the problem when open page render function invoked before componentdidmount completed. returning function else condition (rendernotvalidatecompany) , returning rendervalidatecompany after updating this.state.company. render(){ if(this.state.company){ return this.rendervalidatecompany(); }else{ return this.rendernotvalidatecompany(); } } is possible rendering called when componentdidmount completed in react? thanks! l