Posts

Showing posts from June, 2014

deployment - Deploy python deb test project using make-deb and dh-virtualenv -

in development use anaconda manage environments. have not yet developed python project production. in context have 2 related questions. first, solution incurs lower technical debt: a. install anaconda on production servers; or b. deploy python deb packages? second, simplest structure of python project folders , files test functionality of make-deb , dh-virtualenv described in last section of nylas blog article? nylas blog (how deploy python code: building, packaging & deploying python using versioned artifacts in debian packages) https://www.nylas.com/blog/packaging-deploying-python/ make-deb: https://github.com/nylas/make-deb dh-virtualenv: https://github.com/spotify/dh-virtualenv for test add requests package standard python 2.7 environment , write 1 module download , save small csv file. test make-deb , dh-virtualenv deploy cloud server or raspberry pi server. want run code verify download app works expected on server. want further develop application , test d...

ios - Semantic Issue, Parse Issue and Apple LLVM 9.0 Error issues in xcode 9 -

Image
i new in ios app development swift 4 , xcode 9.getting semantic issue, parse issue , apple llvm 9.0 error issues during adding admob ads using firebase of pods.everything ok, ads displayed format, however, getting errors during archive project publish in googletoolboxformac , nanopb . don't how facing such kind of error during publishing. do have idea, how solve such kind of error?i expecting suggestions.thanks in advance.

nlp - Similarity between two text documents -

i looking @ working on nlp project, in language (though python preference). i want write program take 2 documents , determine how similar are. as new , quick google search not point me much. know of references (websites, textbooks, journal articles) cover subject , of me? thanks the common way of doing transform documents tf-idf vectors, compute cosine similarity between them. textbook on information retrieval (ir) covers this. see esp. introduction information retrieval , free , available online. tf-idf (and similar text transformations) implemented in python packages gensim , scikit-learn . in latter package, computing cosine similarities easy as from sklearn.feature_extraction.text import tfidfvectorizer documents = [open(f) f in text_files] tfidf = tfidfvectorizer().fit_transform(documents) # no need normalize, since vectorizer return normalized tf-idf pairwise_similarity = tfidf * tfidf.t or, if documents plain strings, >>> vect = tfidfvecto...

javascript - How do I filter out a key from an object? -

i have following object in js. how can select keys except first financial_year , put new empty object? i understand can obj["mainline_revenue"] select individual elements long list , don't want type elements keys individually. var obj = {financial_year: 1, mainline_revenue: 18743, regional_revenue: 2914, other_revenue: 3198, salaries_wages: -6897} var newobj = {} new object this: console.log(newobj) {mainline_revenue: 18743, regional_revenue: 2914, other_revenue: 3198, salaries_wages: -6897} you clone object object.assign use delete removed undesired property: var newobj = object.assign({}, obj); delete newobj.financial_year; of course there other more functional ways achieve this, maybe filtering keys, reducing object: var newobj = object.keys(obj).filter(key => key !== 'financial_year' ).reduce((newobj, currkey) => (newobj[currkey] = obj[currkey], newobj), {}); though approach more suited if had an array of keys wan...

ios - Outlets cannot be connected to repeating content iOS10 -

this question has answer here: outlets cannot connected repeating content ios 5 answers “the constraint outlet tableviewcontroller nslayoutconstraint invalid.” error 1 answer i have uitableview , inside table view set cell. inside cell took couple of item constraints , dragged cell uitableviewcell call , set constraints different screen sizes. when run app gives , error of outlets cannot connected repeating content, although have same set done different tableview , fine , more interesting part error app still runs , fine. class cellclass: uitableviewcell { @iboutlet weak var item1: nslayoutconstraint! @iboutlet weak var item2: nslayoutconstraint! override func awakefromnib() { super.awakefromnib() self.setconstants() } func setconstants () { swi...

ruby - Chef custom resource action properties not working -

i'm having issue custom resource created in new cookbook i'm working on. when kitchen converge on following setup following error: error: nomethoderror: undefined method `repository_url' poiseapplicationgit::resource info development machine: chef development kit version: 2.1.11 chef-client version: 13.2.20 delivery version: master (73ebb72a6c42b3d2ff5370c476be800fee7e5427) berks version: 6.3.0 kitchen version: 1.17.0 inspec version: 1.33.1 here's custom resource under resources/deploy.rb: resource_name :opsworks_deploy property :app_path, string, name_property: true property :app_name, string, required: true property :repository_url, string, required: true property :repository_key, string, required: true property :short_name, string, required: true property :app_type, string, required: true property :app, object, required: true property :permission, string, required: true action :deploy apt_update 'update' # install nginx packa...

python - Return a string of country codes from an argument that is a string of prices -

so here's question: write function return string of country codes argument string of prices (containing dollar amounts following country codes). function take argument string of prices following: "us$40, au$89, jp$200" . in example, function return string "us, au, jp" . hint: may want break original string list, manipulate individual elements, make string again. example: > testequal(get_country_codes("nz$300, kr$1200, dk$5") > "nz, kr, dk" as of now, i'm clueless how separate $ , numbers. i'm lost. def test(string): return ", ".join([item.split("$")[0] item in string.split(", ")]) string = "nz$300, kr$1200, dk$5" print test(string)

Replacement for rectByIntersecting in swift 3 -

i wanted learn more custom gesture recognizers reading ray wenderlich tutorial, planned modify in order learn details , can change learn how each piece works, written in previous version of swift. swift updated of code , able fix rest manually save replacement rectbyintersecting. website , code snippet follows: https://www.raywenderlich.com/104744/uigesturerecognizer-tutorial-creating-custom-recognizers let overlaprect = fitboundingbox.rectbyintersecting(pathboundingbox) as shown in tutorial check make sure circle drawn actual circle , not arc, or s or 8, etc. the error value of type cgrect has no member rectbyintersecting, since removed when swift updated. i wasn't able find far replacement this, wondering if i'm missing easy fix or if should attack if different angle?

android - Unable to load your rules -

Image
i beginner in android trying set rules of database on chatapp on firebase. gives me message unable load rule

gruntjs - Grunt build task for Angular4 Cannot find module '@angular/core/testing' -

i trying setup grunt build task angular 4 project , seeing module load errors when try run tasks. details of steps i've done - 1. went https://angular.io/guide/quickstart , used steps mentioned in quickstart create new angular4 app. tested , ensured working. 2. updated package.json file include following: "grunt": "~0.4.5", "grunt-typescript": "^0.8.0", "grunt-contrib-copy": "~1.0.0", added gruntfile.js following content: module.exports = function(grunt) { grunt.initconfig({ typescript: { base: { src: [ 'src/app/ / .ts', ], dest: 'out/static/app.js', options: { target: 'es5', sourcemap: false, moduleresolution: 'node' } } } }); grunt.loadnpmtasks('grunt-typescript'); //grunt.loadnpmtasks('grunt-contrib-copy'); grunt.registertask("d...

constructor - C# new operate bug? -

Image
public class listtest { public list<int> mylist; public listtest() { mylist = new list<int> { 1, 2, 3 }; } } var listtest = new listtest() { mylist = {4,5,6} }; do know value of listtest.mylist ? it {1,2,3,4,5,6} someone can explain that?? it's not bug, consequence of how { ... } initializer syntax works in c#. that syntax available collection type has add() method. , replace sequence in braces sequence of calls add() method. in example, first initialize, in constructor, value first 3 elements. then, later when assign { 4, 5, 6 } property, calls add() again values. if want clear previous contents, need assign new operator, this: var listtest = new listtest() { mylist = new list<int> {4,5,6} }; by including new operator, both whole new object, add() values.

RabbitMQ queues pile up with messages over a period of time even though there are listeners associated with those queues -

i have situation in rabbitmq setup. scenario below, setup: there 2 virtual machines involved. both vms sending 25mb size messages every 7 seconds in loop. there shovels setup transmitting messages between machines. both machines have listeners consume messages sent other machine. listeners consume messages , comes out. there no processing involved @ listener side. there rabbitmq broker ssl enabled . i using spring rabbitmq . i using simplemessagelistenercontainer listening. my issues: over period of time, after 1.5 days of continuous message exchange, there accumulation of messages in queues. the listeners consumption rate diminishes on period of time , messages pile in queue. some of messages accumulated in queue in unacked state. things want try: increase no. of listeners queue. increase prefetch count listener. my question why messages got accumulated on period of time. was there network disturbance in between. need add parameters listeners ...

How to change type from array to primitive in PostgreSQL? -

i'm trying change column type integer[] integer . table has no row in , i've dropped default. alter table user alter column book_ids type integer using book_ids::integer; error: cannot cast type integer[] integer i found how change type integer integer[] not other way around. arr[1] first element of arr . alter table user alter column book_ids type integer using book_ids[1];

python 3.x - using regex to substitute the half space in two Persian strings in a list? -

the data working on follows: (aj_sim فتنه برانگیز) ) ) ) ) (mv (adj (aj_sim روشن) ) (v (v_pres_pos_3 می گردد) ) ) ) ) ) ) ) there persian words separated space , when split contents of each file, considered separate strings. have find each 2 persian strings after previous 1 " برانگیز"، "فنته" , replace space half-space. must in same list tags. mean change have find these kinds of strings , join them half space , save them previous strings in list same order. here code: import os import codecs import re ###opening files folder in directory matches=[] root, dirs, files in os.walk("c:\\test2"): file in files: if file.endswith(".pts"): matches.append(os.path.join(root, file)) print(matches) print(len(matches)) ###reading files i, f in enumerate(matches): codecs.open(f, "r", "utf-8") fp: text=fp.read().split() #print(text) #print (len(text)) print(type(text))...

reactjs - Using Firebase to make a simple group chat app, alongside an already existing django-react app -

i have basic project uses django backend , reactjs frontend. basically, shows home page when user logs in, , that's it. sign of new users handled through django.admin panel. now, want create group chat users logged in using firebase. here's problem since can't understand workflow on how should proceed. basic idea that, frontend gets username , password backend, frontend posts them firebase firebase sends unique id token frontend, now frontend logged in both django , firebase, users logged in joins in group chat is there guidelines on how should proceed this? have read docs can't understand should doing go through this. you want @ docs firebase.database().ref().on(<event here>) <event here> 1 of firebase database events such on, child_added, value basically you'll doing rendering database ref, say: firebase.database().ref('livechat').on('value', snap => {render snapshot}) every client (to view chat). then, ...

parse.com - How to use momentjs to find number of days between ParseServer object updatedAt -

how find number of days difference between today , parse server object column updatedat using momentjs. not sure whats exact format of updatedat column. if have json representation of parseobject, can create moment object "iso" property. const obj = yourparseobject.tojson() const momentdate = moment(obj.updatedat.iso).fromnow()

c# - With tasks, continueWith and WhenAll(), when continue, when finish task or when finish ConitueWith? -

i have few tasks each 1 has continuewith use result of task. that: task mytask01 = mymethod01async().continuewith((a) => //do somenthing a.result); task mytask02 = mymethod02async().continuewith((a) => //do somenthing a.result); task.whenall(mytask01, mytask02); i know whenall waits until tasks in paramaters done. in case have continuewith , don't know if whenall waits untill continuewith finished or continue when task01 , task02 finish, code continue although continuewith code still running. continuewith returns new task, using task. whenall, in fact waiting tasks returned continuewith , not mymethod01async , mymethod02async . so yes, task. whenall wait code inside continuewith finish.

three.js - Photo Sphere Viewer 3.2.3 -

i used info on webpage http://photo-sphere-viewer.js.org/ i tried usage gives me error on browser console the error it in local server please

How to navigate in Angular 4 with filter url subscribe -

i want change url in browser without notify activatedroute changes, run code in subscribe of url, when component initializing or user click in browser undo/redo ngoninit() { this.form = this.initform(); this.activatedroute.url.subscribe(params => { //run when component loading or user click undo/redo in browser this.form = this.initform(); }); } public submit(): void { let url = this.urlbuilder.build(this.form); //change url in browser , add history, without notify activatedroute changes this.router.navigatebyurl(url); }

java - Why does when I call my method it seems doesnt work like it should? -

so make data mining application apriori algorithm using association rule. when want call method c2() , c3() in swingworker, it's doesn't work should. it's suppose show association rule in text area, it's not. here's method public void c2(){ try{ jtextarea1.settext(""); int n = 0; float bnyab, bnya, bnyb=0; float supp, conf=0; for(int a=0;a<dt.size();a++) { n++; for(int b=0+n;b<dt.size();b++) { bnyab=sql.c2(dt.get(a).getkode_barang(), dt.get(b).getkode_barang()); bnya=dt.get(a).getnilai(); bnyb=dt.get(b).getnilai(); supp=bnyab/integer.parseint(jtextfield1.gettext())*100; if(supp>=float.parsefloat(jspinner1.getvalue().tostring())) { conf=(bnyab/bnya)*100; if(conf>=float.parsefloat(jspinner2.getvalue().tostring())) ...

node.js - Webpack React Error -

i restarted mac, after got errors... babel has switched babel-core, uninstalled , changed loader in webpack babel-core. now when run npm run bundle these errors: /usr/local/lib/node_modules/webpack/node_modules/loader-runner/lib/loadloader.js:35 throw new error("module '" + loader.path + "' not loader (must have normal or pitch function)"); ^ error: module '/users/imac/desktop/fakeeh/node_modules/babel-core/index.js' not loader (must have normal or pitch function) @ loadloader (/usr/local/lib/node_modules/webpack/node_modules/loader-runner/lib/loadloader.js:35:10) @ iteratepitchingloaders (/usr/local/lib/node_modules/webpack/node_modules/loader-runner/lib/loaderrunner.js:169:2) @ runloaders (/usr/local/lib/node_modules/webpack/node_modules/loader-runner/lib/loaderrunner.js:362:2) @ normalmodule.dobuild (/usr/local/lib/node_modules/webpack/lib/normalmodule.js:181:3) @ normalmodule.build (/usr/loc...

php - how do i print data vertically using loops -

Image
i have following problem . print data table name exam having student_id , marks_obtained each student_id and. output follow but want table in different format ----------------------- subject | marks | total ----------------------- toward down side see output but confused in code please me code follow: $roll=$_post['roll']; $exam=$_post['exam']; $int1 = intval(preg_replace('/[^0-9]+/', '', $exam), 10); $student_info="select student_id,name,father_name,mother_name,roll,class_id,birthday,parent_id student roll='$roll'"; $result_student=mysqli_query($link, $student_info) or trigger_error('login info error'); $data_student= mysqli_fetch_array($result_student,mysql_both); $parent_info="select name parent parent_id='$studentparent'"; $result_parent=mysqli_query($link, $parent_info) or trigger_error('login info error'); $data_parent= mysqli_fetch_array($result_parent,mysql_both); $parent...

memory management - Why am I unable to allocate space using malloc in C? -

this question has answer here: c, finding length of array inside function 7 answers why isn't size of array parameter same within main? 13 answers different sizeof results 4 answers find size of string pointed pointer 7 answers i have following function: int* getdifference(char* s1, char* s2){ int* difference = (int*) malloc(sizeof(s1) / sizeof(s1[0]) * sizeof(int)); for(int = 0; < strlen(s1); ++i){ difference[i] = (s1[i] - s2[i] + 26) % 26; } return difference; } if try call using: char* encryptedsignature = "hello"; char* signature = "volvo"...

java - Both click and longclick respond in listview -

this question has answer here: listview click , longclick 1 answer i have implemented both onitemclicklistener , onitemlongclicklistener in listview. - itemclick start new activity; - itemlongclick open popup. when longpress item both listeners react. how set onclick not respond when longpress? you need return true in longclick onclick not called. @ this: how implement onitemlongclicklistener , onitemclicklistener event on listview row in android? this question has been answered on forum. :)

how to use unicode beyond 0xffff in vb.net? -

in vb.net desktop application i'm designing, want user able input text in richtextbox in kind of language, ancient languages. far managed in achieving using chrw() , virtual keyboard of own, codes under 0xffff (65535), chrw() doesn't take codes beyond limit. however, there codes beyond limit want use, ancient greek, cuneiforms, , on. does know how that? thanks!

javascript - Need help in -invoking application Automatically out of many -

Image
here test automation scenario: have application running in 3 environments- test, int , prod. have each of app running against different point of sales(i.e. pos) like- uk, us, german, itali. invoking application in cucumber-selenium suite, have 1st forma url specifying base url+pos+environment+dates in local format based on pos..which seems tedious , time consuming approach. so want keep hardcoded urls stored in static final variables each pos environment. , want use these variables called per environment , pos value passed parameter during run time of cucumber data set script. have formed attached in image- now i'm planning have selenium function open url - public void opensearchpage(string strpos) in function if use- if else getting nasty. wanted use switch case statement below, based on app value passed parameterised in argument i.e. strpos: i tried writing below getting compile errors- expression expected @ switch level , can not resolve symbol 'uk_test' ...

postgresql - How to get sequelize.ARRAY internal datatype -

Image
node seqeulize supports postgres array type. http://docs.sequelizejs.com/variable/index.html#static-variable-datatypes say : namevariations: { type: sequelize.array(sequelize.string), allownull: true, } let's assume model called city. when looking @ city model, see attribute called namevaritions of type "array", couldn't find way in seqeulzie find array internal type (in case seqeulize.string). how can achieved in seqeulize? there way read internal type seqeuzlie model or model instance? the following image shows have available on model attribute:

matlab - Unable to read file 'subjFiles(1).name'. No such file or directory -

i'm using codes called specific function. in line 17 of function error index exceeds matrix dimensions. error in generateexpreport (line 17) checkpvaluesfield = subjfiles(1).name; the function line 20 this: function [] = generateexpreport(copydir,resultdir,params) % syntax methodnames = fieldnames(params.methods); nummethods = length(methodnames); = 1 : nummethods cd(resultdir) numtargets = length(params.methods.(methodnames{i,1}).idtargets); iddrivers = params.methods.(methodnames{i,1}).iddrivers; namefiles = [methodnames{i,1} '*.mat']; subjfiles = dir(namefiles); numsubj = length(subjfiles); significanceondrivers = zeros(numsubj,numtargets); matrixtransferentropy = zeros(numsubj,(numta...

c# - Uncertain if an inherited project is asp.net core -

i must develop on existing project (there no documentation or developers) targets framework 4.5 there tasks return return ok or badrequest [allowanonymous] [route("register")] public async task<ihttpactionresult> register(usermodel usermodel) { if (usermodel == null) { return badrequest(); } //......there other codes return ok("it ok"); } and in startup.cs there configuration public void configuration(iappbuilder app) { var kernel = setupninject(); configureoauth(app); setupsignalr(kernel, app); configurecors(app); setupwebapi(kernel, app); setupstaticfiles(app); } i asp.net mvc developer , not familiar above code. in previous projects there no async task , startup.cs app configuration. i can open project visual studio 2012 , rebuild or run succesful. there no console. is project asp.net core? i impression trying determine framework above code uses. is project asp.ne...

arrays - How can I update values in on the view after they pass through a pipe in angular2 + -

i writing checkout view of shopping cart array displayed items purchased. *ngfor="let x of shoppingarray" i want give user possibility of adding more items list @ last minute somehow total doesn't refresh though update array , subtotals. i update subtotals on array incrementing quantity var affects directly objects in array. (component.ts) addmoreitemsofthistype(a){ this.shoppingarray[a].qt += 1; } then recalculate each subtotal passing each subtotal through pipe giving parameter x.qt incremented quantity. (the pipe multiplies x.price * x.qt) (component.html) {{x.price|totalperitem:x.qt}} the problem global total won't update values have been returned filters. {{shoppingarray|calculatetotalpipe}} calculatetotalpipe loops whole array adding totals, somehow initial total corrrect modifications subtotals don't take effect. is there way refresh shoppingarray calculatetotalpipe generates updated total? is there better approach this? thanks!...

r - Unable to append cluster membership from kmeans to the raw data in Shiny -

i trying small shiny kmeans exercise download csv file , run kmeans on (ignoring required preprocessing steps)---after getting cluster, want append these cluster numbers original data , output in interactive datatable(from dt package)......but running error....code below.... library(shiny) # loading required packages pacman::p_load(amelia,broom,caret,cluster,clustertend,clvalid,corrplot,dbscan,dplyr,dt,data.table,forecast,fpc,fpdclustering,fpp,ggally,ggfortify,ggraph,ggplot2,ggrepel,ggthemes,gmodels,googlevis,gridextra,igraph,knitr,mice,missforest,nbclust,optcluster,pacman,plyr,purrr,qcc,randomforest,rcharts,reshape2,tibble,tidyr,tidyverse,tsa,tseries,vegan,vim,zoo) # add 'caret',`iipr`,'ggthemes','ggraph',igraph,vim,missforest list when using script in spark envir #comparegroups library(markdown) library(imputets) # define ui application ui <- navbarpage( # application title titlepanel("shinyapp "), # sidebar layout input , ou...

Why does adding user to docker user group allows docker to be run as non root? -

docker needs root permissions run. this guide gives instructions managing docker non-root user, adds user docker user group after i'm able run docker commands sudo . can explain why work? you have distinguish between docker command line tool docker , background daemon dockerd . daemon runs root , responsible running containers. command line tool docker gives daemon instructions, do. communication done via unix socket /var/run/docker.sock default. ls -l yields srw-rw---- 1 root docker 0 aug 20 11:22 /var/run/docker.sock you can see user belongs group docker able write socket , able give daemon instructions can executed root permission. you can configure daemon listen on network port instead. can tell command line tool use remote docker daemon via environment variable docker_host . doing can give instructions docker daemons on remote hosts. there point 1 should mention. when add user group using sudo , , execute other commands sudo , sudo not prompt a...

string - In Python, why zipped elements get separated, when added to a list? -

i wanted create names a1, b2, c3 , d4 batches = zip('abcd', range(1, 5)) in batches: batch = i[0] + str(i[1]) print(batch) this produces output expected: a1 b2 c3 d4 however, if initialize list batch_list empty , add each batch it, follows: batch_list = [] batches = zip('abcd', range(1, 5)) in batches: batch_list += i[0] + str(i[1]) print(batch_list) the output goes as: ['a', '1', 'b', '2', 'c', '3', 'd', '4'] why not? ['a1', 'b2', 'c3', 'd4'] by using += operator appending each item in string batch_list . 1 way avoid breaking string wrap in list. batch_list = [] in zip('abcd', range(1,5)): batch_list += [i[0] + str(i[1])] print(batch_list) output ['a1', 'b2', 'c3', 'd4'] btw, it's better use list.append , list.extend methods use += . although code using += shorter, using met...

ipfs - How to design Bigchaindb data store(schema)? -

i’m building poc bdb, , i’m not sure if bdb me, i’m looking @ building users upload set of docs, 1 transaction = 1 file, , transaction viewed user’s followers , collaborate on file i.e comment on or perform other operations on it. i’m aware first upload of file 1 create transaction, signed user(say x)’s private key. the other user(user y) viewing file, , have added comment on it. adding of comment should create operation , transfer operation user x’s file? —> i’m not aware if right way. one file should have operations performed on via metadata in transaction. how achieve this? helpful.

java - Best practice to manage Apache Cayenne "...project.xml" file -

apache cayenne keeps "...project.xml" file within resources directory. file contains password database. problem because [deployment server] password should not visible developers. further, need different user/password , connection different database during development. what best practice manage "...project.xml" when using cayenne? suggestions? edit: instead of putting database connection info (incl. password) xml file, is possible inject info programatically datasource object ? if so, can load info config file when app starts , inject it. yes of course. there "cayenne.jdbc.password" property can used define datasource password in runtime. can applied in 2 alternative ways: as system property on command line: java -dcayenne.jdbc.password=xxxxx via injection: servermodule.contributeproperties(binder) .put(constants.jdbc_password_property, "xxxxx"); this , other config properties documented here .

java - Apache Velocity - Failed to eval script due to slf4j dependencies -

continue previous question i'm failing execute scripting in velocity 2.0, i use jars: velocity-engine-scripting-2.0.jar , velocity-engine-scripting-2.0.jar , commons-collections-3.2.2.jar i'm trying follow developer guide example: scriptenginemanager manager = new scriptenginemanager(); manager.registerenginename("velocity", new velocityscriptenginefactory()); scriptengine engine = manager.getenginebyname("velocity"); system.setproperty(velocityscriptengine.velocity_properties, "path/to/velocity.properties"); string script = "hello $world"; writer writer = new stringwriter(); engine.getcontext().setwriter(writer); object result = engine.eval(script); system.out.println(writer); i'm getting slf4j error when init, i'm using slf4j-jdk14.jar . didn't find solution fir specific error after adding slf4j-api-1.8.0-alpha2.jar class org.apache.velocity.script.velocityscriptengine java.lang.nosuchmethoderror: org.slf4...

d3.js - Convert D3 to Angular component -

i have done now. how can have angular component?? here repo https://github.com/bastiankhalil/line-chart-d3 problem in function tick() should called recursively. <!doctype html> <meta charset="utf-8"> <style> .line { fill: none; stroke: #000; stroke-width: 1.5px; } </style> <svg width="960" height="500"></svg> <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.10.0/d3.js"></script> <script> var n = 40, random = d3.randomnormal(0, .2), data = d3.range(n).map(random); var svg = d3.select("svg"), margin = {top: 20, right: 20, bottom: 20, left: 40}, width = +svg.attr("width") - margin.left - margin.right, height = +svg.attr("height") - margin.top - margin.bottom, g = svg.append("g").attr("transform", "translate(" + margin.left + "," + margin.top + ")...

openCL clCreateProgramWithBinary generates munmap_chunk() error inside a C++ program -

i´m trying fpga altera opencl libraries have use soc opencl. have cross compile application , have done. in fact software has many parts , it´s bit difficult follow. fact if cross compile alone opencl code working program. when insert code inside program munmap_chunk error can´t understand. when use gdb received error when line executed: program = clcreateprogramwithbinary(context, 1, &device, (const size_t *)&binary_size, (const unsigned char **)&binary_buf, &binary_status, &status_ocl); returns error: *** error in `../../bin/linux-arm/hpsfpga1dtest': munmap_chunk(): invalid pointer: 0x00294a98 ***** so can´t info reason why happening. code being executed (i can show function init, code longer). what have done execute program valgrind. gives info, problem don´t quite understand it. valgrind show errors don´t know how fix them. attach valgrind output. ask understanding valgrind in order fix memory issue. lot help!! /***********************/ /* open...

c# - Is .NET Core 2.0 logging broken? -

i can't seem trace level log information outputted after upgrading .net core 2.0 (+asp.net core 2.0). in fact, if dotnet new web project , add code below in startup configure, not trace or debug log messages, information , error messages twice. commenting out .addconsole() call output these (information , error) once - suggesting gets configured automatically console provider default. keep in mind, "file -> new" project experience, there nothing setup in program.cs logging or configuration @ - except i've added. seen things? or should register github issue it. public void configure(iapplicationbuilder app, ihostingenvironment env, iloggerfactory loggerfactory) { loggerfactory.addconsole(microsoft.extensions.logging.loglevel.trace); if (env.isdevelopment()) { app.usedeveloperexceptionpage(); } app.run(async (context) => { var logger = loggerfactory.createlogger("blah...

python - Why am i getting the error that "System (2).py", line 14, in <module> BottomFrame(side = BOTTOM) TypeError: 'Frame' object is not callable" -

from tkinter import* tkinter import tk, stringvar, ttk import random import datetime root = tk() root.geometry("1350x750+0+0") root.title ("stock control system") topframe = frame(root, width = 1350, height = 100, bd = 14, relief = 'raise') topframe.pack(side = top) bottomframe = frame(root, width = 1350, height = 200, bd = 20, relief = 'raise') bottomframe(side = bottom) leftmidframe = frame(bottomframe, width = 600, height = 1000, bd = 14, relief = 'raise') leftmidframe(side = left) rightmidframe = frame(root, width = 750, height = 1000, bd = 14, relief = 'raise') rightmidframe(side=right) lbltitle = label(topframe, font('arial',40,'bold'), text = "stock control system", bd = 10, width = 41, justify = 'center') lbltitle.grid(row=0,column=0) why getting error "frame" not callable? supposed stock management system reason not working... this because instances of frame o...

sql server - Parse Json data and update in sql table via python -

i'm parsing json in python first time couldn't figure out correct way data. i'm accessing json data sql table called "table1" in python parsing data , updating records in " table1 ". sql table id json street_numb street_name route sublocality country ... 12 <json_objects> na na na na na ... 40 <json_objects> na na na na na ... 30 <json_objects> na na na na na ... in above table actual json data not accumulated i'm pasting separately below json {"results":[{"address_components":[{"long_name":"16","short_name":"16","types":["street_number"]},{"long_name":"bhagwan tatyasaheb kawade road","short_name":"bt kawde road","types":["route"]},{...