Posts

Showing posts from July, 2015

customization - Editing Dynamics 365 SiteMap with XrmToolBox -

Image
i'm trying edit sitemap on dynamics 365 online instance. i've used xrmtoolbox. here how looks like: i add new area can see @ bottom (new area) nothing appears. have difficulties understand how sitemap works because of clear separation between sales , customer service apps. seems there 2 site maps. show new area on sales part next tile. thanks in advance ! i've found out how works. newly added area showing in dynamics 365 - custom part of left side menu, , not in sales or customer service.

python - Search elements in two arrays in the given range using numpy.where() -

i'm working big arrays of geophysical data. have 2 numpy arrays have sizes 320x340: first xlat contains latitude of every point in grid, second xlon contains longitude of every point in grid. every i, j describes point on ground latitude xlat[i][j] , longitude xlon[i][j] . i have point coordinates p_lat , p_lon , have find closest 4 point given point. first of wrote simple function run through point on x-axis , y-axis, makes 320*340 = 108 800 iterations , works very slow (~0.5 seconds every point): in range(0, lat-1): j in range(0, lon-1): if st_lon >= xlon[i][j] , \ st_lon < xlon[i][j + 1] , \ st_lat >= xlat[i][j] , \ st_lat < xlat[i + 1][j]: return (true, i, + 1, j, j + 1) then found info numpy.where() , wrote code: in range(0, lat): rows = numpy.where((xlon[i] >= st_lon - 0.5) &

amazon ec2 - What does 'cpu' parameter mean in aws container service? -

i'm going register new task in container service t2.medium. saw examples cpu parameter equal 0. i'm trying find out , how many need put here 1 task. all able find according question: http://docs.aws.amazon.com/amazonecs/latest/developerguide/task_definition_parameters.html?shortfooter=true http://docs.aws.amazon.com/amazonecs/latest/developerguide/example_task_definitions.html "the number of cpu units reserve container. container instance has 1,024 cpu units every cpu core. parameter specifies minimum amount of cpu reserve container, , containers share unallocated cpu units other containers on instance same ratio allocated amount. parameter maps cpushares in create container section of docker remote api , --cpu-shares option docker run." a t2.medium has 2 vcpus, has 2,048 available cpu units schedule out. if want single container running on host can budget 2,048 cpu units, no other containers ever placed on host. containers guarant

ios - Use of unresolved identifier countElements -

this question has answer here: string length in swift 1.2 , swift 2.0 [duplicate] 5 answers let newlength = countelements(textfield.text) + countelements(string) - range.length; when i'm running app, shows error of unresolved identifier. it appears attempting use swift 1.0 code in later version of swift. countelements removed in ios 8.3 (with swift 1.2) -- need logged in see release notes in swift 2.0, str.characters.count

Prestashop fatal error on On Sale Module -

i downloaded module roja45: on sale products , it's free , easy find on google. after installation have problem seeing on sale on 1 page. first showing error controller changed name of from: roja45onsaleproducts.php to: roja45onsaleproducts.php , error apeared. in debug see error: fatal error: call private method roja45onsaleproducts::getproductstodisplay() context 'roja45onsaleproductsroja45onsaleproductsmodulefrontcontroller' in /home/psdes/domains/dev/moto-center/modules/roja45onsaleproducts/controllers/front/roja45onsaleproducts.php on line 68 and line 68 in error is: $products = roja45onsaleproducts::$cache_onsale_products; if ($products === null) { $products = roja45onsaleproducts::getonsaleproducts((int) $this->context->language->id, 0, (int) configuration::get('ps_roja45_onsale_products_nbr')); } line 68 just: $products = roja45onsaleproducts::getonsaleproducts((int) $this->context->language->id, 0, (int) confi

python - Django: correct way to specify model (list of tuples) -

i'm not happy current model , wanted ask if there better/preferred way achieve same result. what want? an object contains number of lists. each list contains tuples, first entry being date object, second 1 either float or integer. if delete a, b should deleted. if delete b want have empty list. how tried accomplish it: class timevalueintsequence(models.model): pass class timevaluefloatsequence(models.model): pass class timevalueint(models.model): time = models.datefield() value = models.integerfield() sequence = models.foreignkey(timevalueintsequence, models.cascade, blank=false, null=false) class timevaluefloat(models.model): time = models.datefield() value = models.floatfield() sequence = models.foreignkey(timevaluefloatsequence, models.cascade, blank=false, null=false) class a(models.model): field1 = models.onetoonefield(timevalueintsequence, models.set_null, blank=true, null=true, related_name='field1') field2 =

networking - Creating new network interfaces from a list in ansible task -

i looked on this list , didn't find answer on how create new network interface `ifconfig'. want achieve create interface every string item in variable list, before want delete interfaces excluding 1 ansible-playbook using deploying play. of have idea how approach such task ? the nmcli module best bet among official modules. http://docs.ansible.com/ansible/nmcli_module.html you're going want like: enumerate interfaces list (using either ansible variables or parsing ifconfig output) identify 1 ansible connected over exclude ansible interface list (using jinja2 filters probably) use nmcli remove interfaces in filtered list. use nmcli add interfaces in separate list.

Printing a record in Javascript -

this question has answer here: print content of javascript object? [duplicate] 15 answers i have record contains following. var web = [{ url : "www.facebook.com", content : "social media website." }, { url : "www.reddit.com", content : "a vast forum different topics" }] ; i trying print out url part of record doing following for(var i=0;i<web.length;i++) { alert({"url":web[i].url,"description":web[i].content}) } but getting output [object object] . any appreciated. alert takes string, not object. can decent representation of object string json.stringify . try alert(json.stringify({"url":web[i].url,"description":web[i].content}));

java - Change dns server address for name resolution -

how change address domain name resolution in oracle jdk 8? answer doesn't work, though accepted. result want achieve is: inetaddress.getbyname("google.com") returns ip address server want specify , resolverconfiguration.open().nameservers() returns mentioned server in list.

php - Loop through an array of integers and break every 1000 -

i working activity tracking files. want browse through gpx file , every 1000m milestone. device not record gps track right @ 1000m, 2000m, etc, cannot use $distance % 1000 . want detect each time 1000m milestone has passed, performing action @ milestone after. here example of distance tracked: 0 3 28 … 997 1003 1027 … 1998 2006 … 2989 3001 and on. in example, i'd need perform action when 1003 has been reached, 2006 , 3001. how can trigger event every time data passes multiple of 1000? if data coming in string explode string ever delimiter , loop it. <?php $string = "0 3 28 36 42 66 73 80 103 125 997 1003 1027 2006 3001"; $data= explode( ' ', $string ); $multiple = 1; foreach( $data $value ) { if( (int)$value > ( 1000 * $multiple ) ) { // passed 1000 marker echo $value."\n"; $multiple++; } } output: 1003 2006 3001

android - No resource found that matches the given name [Eclipse] -

i'm trying fix couple errors i'm getting when trying create new android application project in eclipse. the following errors occur: [2016-11-17 15:22:52 - chatter] c:\users\chris\appdata\local\android\sdk\extras\android\support\v7\appcompat\res\values-v23\styles_base.xml:20: error: error retrieving parent item: no resource found matches given name 'android:widget.material.button.colored'. [2016-11-17 15:22:48 - chatter] [2016-11-17 15:22:48 - chatter] c:\users\chris\appdata\local\android\sdk\extras\android\support\v7\appcompat\res\values-v23\styles_base_text.xml:19: error: error retrieving parent item: no resource found matches given name 'android:textappearance.material.widget.button.inverse'. [2016-11-17 15:22:48 - chatter] i have tried following things: imported android-support-v7-appcompat project. created reference. changed project.properties > target android-19 android-21 my project setup: minimum required sdk: api 14 target sd

Perl - can't open file with Win32::OLE -

this question has answer here: convert word doc or docx files text files? 12 answers i'm trying open .docx file using following code: require win32::ole; $docfile = "c:/users/me/documents/file.docx"; $word = win32::ole->getactiveobject('word.application'); unless ($word) { $word = win32::ole->new('word.application', sub {$_[0]->quit;}) or die "oops\n"; } $word->{visible} = 1; $file = $word->documents->open($docfile); $file->printout(); $file->close(); $word->quit(); but following error: ole exception "microsoft word": sorry, couldn’t find file. possible moved, renamed or deleted? (c://users/me/documents/...) how can fix this? why add // path? (needless say, file exist in system , correct path). thanks! i suggest use canonpath file::spec::function normalise

logging - Log levels configuration with Wildfly Swarm -

when developping wildfly swarm based application, how can configure logging levels using properties usable project-stages.yml? in other words, equivalent of "logging.level.com.acme.rest=debug" properties of spring boot? currently know that: "swarm.logging=debug" can used configure all logging levels (not need) a "standalone.xml" used not ops friendly enough loggingfraction can used programmatically configure logging levels (also not need) the documentation mentions "logging.level" not make work far thank time in project-stages.yml can define logging levels (see wildfly swarm reference guide full list of options): swarm: logging: loggers: com.acme.rest: level: debug

java - Selenium_testng_Java_passing data to both @beforetest and @test -

Image
i have testng class 3 test (a,b, c) , class extends base class has @beforemethod , @ aftermethod now want pass browser @ before method , email method below sample data. email has unique every time. one of ways use @parameters annotation. code @beforemethod is- @beforemethod @parameters("browser") public void testmethod1(string browser) { //do task here } code method a- @test @parameters("email") public void a(string email) { //implement test logic here } sample testng sample- <suite name="suite1" verbose="1" > <test name="test1"> <parameter name="browser" value="firefox"/> <parameter name="email" value="an-email-id"/> <classes> <class name="packagename.classname"/> </classes> </test> </suite>

Sharepoint 2013 missing Manage Subscription -

i created new report couple days ago , when went schedule subscription on report button gone. image 1 i checked in central administrator see service stopped looks on. image 2 does have idea be? , isn't permission based since have used multiple accounts full control security.

javascript - PhantomJS - Injected JS Does Not Run After JS Error -

i have phantomjs script looks so: window.settimeout(function() { //give page couple seconds load before injecting our scripts //include our version of jquery our injected js can run page.includejs('//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js', function() { if (!page.injectjs(js)) { console.log("unable inject js @ " + js); phantom.exit(1); } }); }, 2000); the js being injected runs , executes window.callphantom call terminates script. issue js injected onto page dictated end user. end user supply e.g. http://www.google.com or else. it appears if page has js errors, injected javascript not run. since not control content of page, there no way me prevent these js errors. is there way injected javascript run despite previous js errors generated on page?

How do I loop through scraped data, and export the results to a CSV file, with each dictionary as a new row in Python? -

i new coding, , messing around how export scraped data csv. problem my script goes through set of similar pages , extracts data each page , stores dictionary. each dictionary has same keys, different values, i.e. each scraped page has dictionary associated it, although keys same. i export individual dictionaries, once scraped, csv file, each dictionary occupying 1 row, struggling figure out syntax. do need create dictionary of dictionaries? or can each scraped dictionary appended single csv file? cheers, this have far: papers = [] urls = [] dict = {'topics':0,'link':0, 'heading':0,"summary intro":0,"summary text":0, "date":0} in range(1,4): url = str(a) + str(i) + str(c) urls.append(url) pprint(urls) url in urls: print url html = urllib2.urlopen(url).read() soup = beautifulsoup(html) soup.find_all('div', class_="bp-paper-item commons")

cordova - Build cli-6.3.0 version not works for android because of url failed -

build cli-6.3.0 version not works android because of url failed.although used below whitelist plugin code! works build failed cli-6.3.0 here config.xml: ........ <preference name="permissions" value="none"/> <preference name="phonegap-version" value="cli-6.3.0" /> <access origin="*"/> <!-- allow local pages --> <allow-navigation href="http://morehipo.com" /> <allow-navigation href="http://morehipo.com/signalr/hubs" /> .... and here index.html ...... <meta http-equiv="content-security-policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'"> <script src="http://morehipo.com/signalr/hubs"></script> <script type='text/javascript'> window.remote_host = 'http://morehipo.com'; w

Modify batch files to make rails use newer version of ruby? -

would sufficient modify existing batch files reference path rails's ruby.exe, or, missing bigger picture? windows 7 os, running rails s project folder warning: rubydep: warning: ruby is: 2.2.4 (buggy). recommendation: install 2.2.5 or 2.3.1. using rails installer , have rails 4.2.5.1 installed here: c:\railsinstaller , older version of ruby, here: c:\railsinstaller\ruby2.2.0\bin\ruby.exe ...specifically ruby 2.2.4p230 (2015-12-16 revision 53155) [i386-mingw32] i have ruby 2.3.1 installed: c:\ruby23-x64\bin\ruby.exe specifically ruby 2.3.1p112 (2016-04-26 revision 54768) [x64-mingw32] i've updated path c:\ruby23-x64\bin; has precedence rails still invokes version 2.2.4 c:\railsinstaller\ruby2.2.0\bin\ruby.exe when invoke rails s . in rails project i've specified ruby "2.3.1" in c:\users\user_name\rails_project.ruby-version also, if add ruby '2.3.1' project gemfile, error msg , : your ruby version 2.2.4, gemfile specifie

bash - Get index of argument with xargs? -

in bash, have list of files named same (in different sub directories) , want order them creation/modified time, this: ls -1t /tmp/tmp-*/my-file.txt | xargs ... i rename files sort of index or can move them same folder. result ideally like: my-file0.txt my-file1.txt my-file2.txt something that. how go doing this? you can loop through these files , keep appending incrementing counter desired file name: for f in /tmp/tmp-*/my-file.txt; fname="${f##*/}" fname="${fname%.*}"$((i++)).txt mv "$f" "/dest/dir/$fname" done edit: in order sort listed files modification time case ls -1t can use script: while ifs= read -d '' -r f; f="${f#* }" fname="${f##*/}" fname="${fname%.*}"$((i++)).txt mv "$f" "/dest/dir/$fname" done < <(find /tmp/tmp-* -name 'my-file.txt' -printf "%t@ %p\0" | sort -zk1nr) this handles filenames special

android - How can I put a SearchView inside of a ToolBar with a height set to wrap_content without it disappearing? -

i've noticed if place android.support.v7.widget.searchview inside of android.support.v7.widget.toolbar height set wrap_content searchview behaves strangely. appears fine @ first gains focus disappears , no longer takes space in layout. can resolved setting explicit height toolbar i'm trying use wrap_content because use-case requires toolbar resize dynamically. it might worth mentioning searchview still functional after disappears. if add searchview.onquerytextlistener searchview can observe query text indeed being updated type. neither text nor other part of searchview takes space in layout though , if force unobscured in layout still not visible. this kind of seems bug in searchview me. have more insight why it's happening or how work around it? here's working example of issue: <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.coordinatorlayout xmlns:android="http://schemas.android.com/apk/re

python - Connect mysql to django -

i connect django (1.10) localhost (macos x) mysql database (mysql-server) located on distant server (ubuntu 14.04) instead of sqllite3. i made changes in django' settings.py file : databases = { 'default': { 'engine': 'django.db.backends.mysql', 'name': 'etat_civil', 'user': 'root', 'password': '*****', 'host': '172.**.**.58', 'port': '80', } on distant server, installed mysql-server , juste created table. and when run : python manage.py migrate i error : macbook-pro-de-valentin:etat_civil valentinjungbluth$ python manage.py migrate traceback (most recent call last): file "manage.py", line 22, in <module> execute_from_command_line(sys.argv) file "/library/python/2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line utility.execu

c# - Button Click Event Generalization -

Image
how text of button, when click it, in listbox without defining event button. how generalize it. what can loop through buttons on form programmatically , add event handlers each one. put in form's constructor: foreach (var ctrl in this.controls) { if (ctrl button) { ((button) ctrl).click += mainform_click; } } and here's event handler: void mainform_click(object sender, eventargs e) { listbox1.items.add(((button) sender).text); } equalsk's suggestion one: if have other buttons on form don't wish part of behavior, can put buttons do want in panel or other control on form. you'd change foreach in constructor this: foreach (var ctrl in this.panel1.controls)

excel - VBA XML parsing - looping through child nodes -

this first attempt @ parsing xml files using vba, may missing obvious; can print this: <values> <value code="1">a</value> <value code="2">b</value> <value code="3">c</value> </values> using code line: debug.print variable.selectsinglenode("values").xml , values child node of parent variable but can't figure out how loop through values 's children, , print "1a", "2b", "3c" pairs as far can understand, this question uses first child of root, while goal deeper multiple-leveled structure. here can see how use msxml6.0 library parse xml particular example. use example, need add reference msxml6.0 in vba project. i suggest pay particular attention xpath variable '//value' , selectors such .getnameditem("code") --- there many more of these need familiarize in order become fluent in xml parsing. fortunately lo

artificial intelligence - How to form state space tree in a 2 player game same as billiards with alternate game turns -

i trying solve carrom board game ( same billiard game ) using ai techniques forming search tree. since game rule not giving strike turn again after pocketing, state space tree have depth 1 possible shots branches root. best approach solve kind of problems in ai chose best shot. this looks simple minimax algorithm . expand search tree opponents view iteratively , calculate score states. opponent trying minimize score (which best him), try maximize score , choose action leads tree best score.

postgresql - I don't understand explain result of a slow query -

i have slow query (> 1s). here result of explain analyze on query: nested loop left join (cost=0.42..32275.13 rows=36 width=257) (actual time=549.409..1106.044 rows=2 loops=1) join filter: (answer.lt_surveyee_survey_id = lt_surveyee_survey.id) -> index scan using lt_surveyee_survey_id_key on lt_surveyee_survey (cost=0.42..8.44 rows=1 width=64) (actual time=0.108..0.111 rows=1 loops=1) index cond: (id = 'xxxxx'::citext) -> seq scan on answer (cost=0.00..32266.24 rows=36 width=230) (actual time=549.285..1105.910 rows=2 loops=1) filter: (lt_surveyee_survey_id = 'xxxxx'::citext) rows removed filter: 825315 planning time: 0.592 ms execution time: 1106.124 ms the xxxxx parts of result uuid like. did not built database, have no clue right now. here query: explain analyze select lt_surveyee_survey.id -- +some other fields lt_surveyee_survey left join answer on answer.lt_surveyee_survey_id = lt_surveyee_surv

python - How do we define @list_route that accept arguments -

in application have modelviewset 1 @list_route() defined function getting list different serializer. class animalviewset(viewsets.modelviewset): """ viewset automatically provides `list`, `create`, `retrieve`, `update` , `destroy` actions. """ queryset = animal.objects.all() serializer_class = animalserializer // default modelviewset serializer lookup_field = 'this_id' @list_route() def listview(self, request): query_set = animal.objects.all() serializer = animallistingserializer(query_set, many=true) // serializer different field included. return response(serializer.data) the default animalviewset /api/animal/ end point yield serialized data result based on animalserializer definition. { "this_id": "1001", "name": "animal testing 1", "species_type": "cow", "breed": "brahman",

php - Custom field validation when registering. Prestashop -

i have problem when validating customer registration form. it's not working @ all. want validate custom field added reg form. write steps i've done , please tell me problem. i've added custom field in registration form. placed in /themes/theme/authentication.tpl <div class="required form-group"> <label for="user_id_number">id <sup>*</sup></label> <input type="text" onkeyup="$('#user_id_number').val(this.value);" class="is_required validate account_input form-control" id="user_id_number" name="user_id_number" value="{if isset($smarty.post.user_id_number)}{$smarty.post.user_id_number}{/if}" /> </div> overridden address.php (addrescore class) , added field name $definition array. class address extends addresscore { public $user_id_number; public static $definition = arr

swift - Stop updating location when view (map) is not showing -

i have app map loaded after app starts. have views in app. i'd is, whene leave mapview, view, i'd map stop updating self location , than, start updating again self location, when come map view. (self location = user current location). anyone can tell me how please? thanks. you can use locationm.stopupdatinglocation() start updating location override func viewdidappear(_ animated: bool) { super.viewdidappear(animated) locationm.startupdatinglocation() } and stop override func viewwilldisappear(_ animated: bool) { super.viewwilldisappear(animated) locationm.stopupdatinglocation() }

python - Pynistaller error while converting project to exe -

i have few python project has few .py files , few csv files. want convert project exe file can run on pc. using pyinstaller in command line following command pyinstaller --onedir --onefile --name=software "c:\users\*******\pycharmprojects\project\main.py" but throwing error access denied. reference pasting below whole traceback: traceback (most recent call last): file "c:\users\******\appdata\local\programs\python\python35\scripts\pyinstaller-script.py", line 10, in <module> load_entry_point('pyinstaller==3.2', 'console_scripts', 'pyinstaller')() file "c:\users\******\appdata\local\programs\python\python35\lib\site-packages\pyinstaller\__main__.py", line 90, in run run_build(pyi_config, spec_file, **vars(args)) file "c:\users\******\appdata\local\programs\python\python35\lib\site-packages\pyinstaller\__main__.py", line 46, in run_build pyinstaller.building.build_main.main(pyi_config, spec_

.Net Core 1.1.0 NuGet packages fail to install in Visual Studio Mac -

i'm playing around aspnet.core 1.1.0 application in visual studio mac preview , have problems updating/installing nuget packages. if try update eg. microsoft.aspnetcore.diagnostics 1.0.0 1.1.0 fails download , removed package completely. have download , install package 1.0.0 again. same goes microsoft.aspnetcore.server.kestrel. microsoft.entityframeworkcore i'm not able install in version. heres exception output: https://gist.github.com/anonymous/52ceb28b8d9781835b226bcbe9d04d58 i know right out of oven, wondering if other people have experienced same issues , know of workaround/solution. for else having similar problems, here's walk-through: first install .net core 1.1.0: https://www.microsoft.com/net/core#macos the official .net core 1.1.0 installer (as of when written) includes .net core sdk 1.0.0 preview 2. you need .net core sdk 1.0.0 preview 3. download here: https://github.com/dotnet/core/blob/master/release-notes/preview3-download.md cr

sql server - How do I stop a trigger in an infinite loop? -

let's did stupid creating trigger has infinite loop in it. it's not nesting, or recursive; have while loop in apparently isn't exiting. now can't access trigger @ all... can't update it, can't drop it, can't disable it. , none of programs use table it's attached can table because of it. i've exited way out of sql server, when in, have same issue. any way kill trigger? provided have requisite permissions here can do: open / run ssms , connect server in question. change use correct database in ssms, run sp_who2 this gives list of connections, , state. take 1 connection spid# , run dbcc inputbuffer (spid#) if connection running trigger, can kill connection issuing kill spid# then read on why avoid triggers.

Javascript sequences with an array of function calls -

sequence( start, step ) this function takes 2 numeric inputs, start , stop, , returns function of no inputs. resulting function generate sequence of values beginning start , offset step each function call generate next value in sequence. examples var x = sequence( 3, 15 ); [ x(), x(), x() ] => [ 3, 18, 33 ] var y = sequence( 28, -5 ); [ y(), y(), y() ] => [ 28, 23, 18 ] how go solving this? sequence doesn't return function. returns function closure keeps track of start/step values. start, step, , counter bound it. can work them. function sequence(start, step) { var counter = -1; return function() { // function return next element // uses counter, start, step variables closure // notice live outside of inner function counter not reset // every time run function. counter++; return start + step * counter; }; }; var x = sequence(1, 3); var y = sequence(-1, -2); console.log('x()', x(), x(), x()); con

Microservices dependence management - Governance or Domain Driven Design? -

background : international company federation model transforming microservices due chronic monolithic pain. autonomous teams quick deployment highly desirable. in spite of theory, services indeed dependent on each other higher functionality, autonomous (independently developed , deployed). since federation model , decentralized control, cannot impose strict rules - un. without governance platform manage dependencies else due multiple versions in production in different countries, foresee uncontrollable chaos. let's call set of microservices needs collaborate "compatibility set". service can deployed may not satisfy higher functionality in compatibility set. example microservice a-4.3 autonomous, deployed , working perfectly. satisfy businessfunctionality 8.6 must work microservice b-5.4 , microservice c-2.9. (a-4.3 , b-5.4 , c-2.9) form "compatibility set" there 2 approaches dilemma. microservice in real life rubber hits road , learning experience begin

angular - Typescript promise losing values after .then -

i have function within angular2 service returning mock data via promise.resolve when unwrapped .then gives me empty promise object. can see calling function receiving promise payload in __zone_symbole__value property before passed .then inside of .then i seem left empty promise. gettemperaturedata(): promise<any> { let data = this.convertjsontogooglecharttable(temperaturedata_json); let p = promise.resolve(data); return p; } using chrome see p above looks like zoneawarepromise {__zone_symbol__state: true, __zone_symbol__value: "[["date","temperature","lowtemperature"],["05/11/2…",69.02,null],["06/11/2016 23:54:34",69.99,null]]"} the calling code broken 2 lines debug below. gettemperaturedata() { var d = this.dataservice.gettemperaturedata(); d.then(data => this.line_chartdata = data); } when @ d see same p above zoneawarepromise {__zone_symbol__state: true, __zone_symbol__

mongodb find duplicates in array across documents -

having array of emails on document. how find document in same collection shares @ least 1 email in common? essentially have contacts collection , each contact document has array of emailaddresses[]. want make sure no 2 contact documents have email in common document, we're unable find happening. db.collection.aggregate([ {"$unwind" : "$emails"}, {$group : {"_id" : "$emails" , "count" :{"$sum" : 1} }}, {"$match" : {"count" : {"$gt" : 1}}} ]) this result emails dupicate

Couchbase : 'java.io.File android.content.Context.getFilesDir()' on a null object reference -

i using couchbase store database locally on device. have saving database service class. public void savetodatabase(string symbol, list<date> datelist, list<string> closelist){ cbdatabase db = new cbdatabase(db_name, this); // create object contains data document map<string, object> doccontent = new hashmap<>(); doccontent.put(symbol, symbol); doccontent.put(date, datelist); doccontent.put(close, closelist); string docid = null; try { // 1. create docid = db.create(doccontent); assert(docid != null); txt += ("created doc id " + docid + "\n"); txt += ("\n\nretrieve --> "); // 2. retrieve doccontent= db.retrieve(docid); assert(doccontent != null); txt += ("retrieved doc " + string.valueof(doccontent) + "\n"); txt += ("

c# - change some value in array javascript before post to API -

i have array : [{"idalokasiemiten":154,"idorganization":12,"namaorganization":null,"codeemiten":"antm","nameemiten":"aaneka tambang (persero) tbk"},{"idalokasiemiten":0,"idorganization":null,"namaorganization":null,"codeemiten":"adhi","nameemiten":"adhi karya (persero) tbk"}] how change values before post api? i want post api into: [{"idalokasiemiten":0,"idorganization":12,"namaorganization":null,"codeemiten":"antm","nameemiten":"aaneka tambang (persero) tbk"},{"idalokasiemiten":0,"idorganization":12,"namaorganization":null,"codeemiten":"adhi","nameemiten":"adhi karya (persero) tbk"}] here angularjs: // detail alokasi emiten $scope.emit.detaildaftaremiten = []; $scope.additemalokasi = fu

Do exist a list of json-models for webgl? -

i have json 3d model(teapot) learningwebgl it works fine in webgl, can't find site json models. there many sites format such .dae, .obj. converter(from obj json) found in internet don't work right, therefore need json models. may knows sites(or github pages) json 3d models? there's no such thing "json-models webgl" . webgl rasterization library . draw model in webgl requires lots of user supplied code and/or library. code/library interprets whatever files give it. webgl has no concept of "models". so, maybe want models three.js? or maybe want models code on learningwebgl? there's no "models webgl". as learningwebgl in particular haven't looked @ format suspect either want use more common format or need tools convert other formats format used code on learningwebgl.

python - numpy append slices to two dimensional array to make it three dimensional -

i have 5 numpy arrays shape (5,5) . want achieve combine these 5 numpy arrays 1 array of shape (5,5,5). code looks following not work: combined = np.empty((0, 5, 5), dtype=np.uint8) idx in range(0, 5): array = getarray(idx) # returns array of shape (5,5) np.append(combined, img, axis=0) i thought if set first axis 0 append on axis in end shape (5,5,5). wrong here? i have figured out myself: combined = np.empty((0, 5, 5), dtype=np.uint8) idx in range(0, 5): array = getarray(idx) # returns array of shape (5,5) array array[np.newaxis, :, :] combined = np.append(combined, img, axis=0) print combined.shape + returns (5,5,5)

regex - Extract nested fields in sql using REGEXP_EXTRACT -

i using google big query , querying sample records column in table: age=18;cntry=us;coid=9911718;csize=c;func=ops;gdr=f;grp=2099628;grp=85824;grp=1548357;grp=88799;grp=2059383;grp=1937629;ind=78;lang=en;mod=0;occ=511;optout=false;reg=21;s=0;seg=9001;seg=761;seg=541;seg=521;seg=1068;seg=557;seg=546;seg=514;seg=504;seg=183;seg=263;sub=0;tile=1;tile_p=1;title=ic;u=nql8uz5qrt8vcqh5tkcqq697 query: select regexp_extract(col,r'age=(\d+)') age, regexp_extract(col,r'cntry=(\d+)') country, regexp_extract(col,r'gdr=(\d+)') gender table x result: 18 null null i getting age value other values null. great on this. the cntry , gdr values not numeric, consist of letters. you may use \w+ matching 1 or more "word" chars, i.e. letters, digits , underscores: select regexp_extract(col,r'age=(\d+)') age, regexp_extract(col,r'cntry=(\w+)') country, regexp_extract(col,r'gdr=(\w+)') gender table x

python - Why is virtualenvwrapper not adding my environment location to my $PATH -

i trying create django project, using virtualenvwrapper isolate/sandbox different projects. here commands typed far ... memyself@somebox:~/path/to/foo_project$ mkvirtualenv foo using base prefix '/usr' new python executable in /home/memyself/.virtualenvs/foo/bin/python3 creating executable in /home/memyself/.virtualenvs/foo/bin/python installing setuptools, pip, wheel...done. virtualenvwrapper.user_scripts creating /home/memyself/.virtualenvs/foo/bin/predeactivate virtualenvwrapper.user_scripts creating /home/memyself/.virtualenvs/foo/bin/postdeactivate virtualenvwrapper.user_scripts creating /home/memyself/.virtualenvs/foo/bin/preactivate virtualenvwrapper.user_scripts creating /home/memyself/.virtualenvs/foo/bin/postactivate virtualenvwrapper.user_scripts creating /home/memyself/.virtualenvs/foo/bin/get_env_details i installed django in foo env: (foo) memyself@somebox:~/path/to/foo_project$ pip install django collecting django using cached django-1.10.3-py2.py3-

mysql - Simple SELECT SQL statement not working -

select user members admin=1; select user members id=1; the first query not work because there's error in syntax. second works virtually identical. both 'admin' , 'id' int(11), 'id' primary key , set auto-increment. what's wrong here? the error receive is: you have error in sql syntax; check manual corresponds mysql server version right syntax use near 'admin=1' @ line 1 when use keywords or reserved words don't forget add quotes or brackets. select [user] members [admin]=1; select [user] members id=1;

php - mysqli_fetch_array using a foreach loop -

ive got pretty basic table named 'customers' 4 columns: id (primary auto increment) businessname contactname contactemail i call with: $result = mysqli_query($con, "select * customers"); and using mysqli_fetch_array display on page foreach loop: while ($row = mysqli_fetch_array($result, mysqli_assoc)) { echo "<tr>"; foreach ($row $value) { echo "<td>" . $value . "</td>"; } echo "<td><a href='updateform.php?id=" . $row['id'] . "'>edit</a></td>"; echo "</tr>"; } which gives array like: array ( [id] => 1 [businessname] => microsoft [contactname] => bill gates [contactemail] => bill@microsoft.com ) array ( [id] => 2 [businessname] => amazon [contactname] => jeff bezos [contactemail] => jeff@amazon.com ) is possible display results differently based on column (technic

github - Android Studio Git not updating Remote -

i updated android studio 2.2.2 , source files not being updated in remote git repository.however .idea , .gradle folders are. why be? how can source files pushed well? i message @ bottom of android studio push successful pushed 1 commit master/t t being branch twhen check on github on web there no changes.

paypal - empty related_resources in response from credit card payment -

i'm using paypalrestsdk credit card payment. when switch sandbox mode , make request, paypal service return me this: {'update_time': u'2016-11-17t16:47:46z', 'payer': {'payment_method': u'credit_card', 'funding_instruments': [ {'credit_card': {'first_name': u'first_name', 'billing_address': {'city': u'london', 'postal_code': u'123','line1': u'fooo', 'country_code': u'en'}, 'expire_month': u'12', 'number': u'xxxxxxxxxxxx1111', 'last_name': u'last_name', 'expire_year': u'2020', 'type': u'visa'}}]}, 'links': [ {'href': u'https://api.sandbox.paypal.com/v1/payments/payment/pay-1gh35642k7

excel - Match Any Word Inside Cell With Any Word In Range of Cells -

Image
i have list of phrases. check if new terms match list partially word. i'm looking code implement fuzzy matching on list return cell has close match. example data: phrases,terms real term,new words great work,new term check phrase,more phrase example here,great alpha phrase random,beta new desired output: phrases,term,match real term,new words,no match great work,new term,real term check phrase,more phrase,check phrase/phrase random example here,great alpha,great work phrase random,beta new,no match what i've got: i tried using following code match cell if found: =if(iserror(match("*" & b2 & "*",a:a, 0)), "no match", vlookup("*" & b2 & "*",a:a,1,false)) however, code matches entire cell. how can make match word in cell? create fuzzy match. positive input highly appreciated. here (rough , ready) vba solution question. need insert code module in vba editor , can run macro desired o

c++ - Template error C2244 unable to match function definition to an existing declaration using constexpr in Microsoft Visual Studio 2015 -

i'm getting : error c2244 unable match function definition existing declaration while using constexpr . template<int n> constexpr int x() { return n*n; } template<int x, int n> class b { public: int data; }; template<int n> class { public: int f(b<x<n>(), n> b); }; template<int n> int a<n>::f(b<x<n>(), n> b) { return b.data; } int main() { a<10> a; return 0; } if remove constexpr function , replace expression n*n , works fine. gnu c++ compiles , expect, according https://msdn.microsoft.com/en-us/library/hh567368.aspx , constexpr works correctly on visual studio 2015.

Menu Button OpenCart php -

i have tried add custom menu button in 2 different languages i use default template i have edited these files inside opencart main folder: header.tpl on /catalog/view/theme/yourthemefolder/template/common header.php on /catalog/language/english , /catalog/language/yourlanguage header.php on /catalog/controller/common and added these lines 1 <li><a href="http://xxxxxxxx/shop/index.php?route=product/manufacturer"><?php echo $new_gamintojai; ?></a></li> 2 $_['new_gamintojai'] = 'brands'; 3 $this->data['new_gamintojai'] = $this->language->get('new_gamintojai'); i can click on button, there no text. how can fix this? okey have figured out myself. have changed line : $this->data['new_gamintojai'] = $this->language->get('new_gamintojai'); to $data['new_gamintojai'] = $this->language->get('new_gamintojai');