Posts

Showing posts from April, 2014

csv - R code suddenly stopped working in tidy text -

i trying word analysis on data in r. imported 1 column of data text responses survey r using read.csv. named 1 of columns "text" . code working fine few days ago , giving me error. code entering: library(dplyr) library(tidytext) a1<-read.csv("/users/laura/documents/a1.csv") colnames(a1)= c("text") a1<-a1%>%unnest_tokens(word, text) the error getting says this: error in check_input(x) : input must character vector of length or list of character vectors, each of has length of 1. my data didn't change, code i'm using didn't change. :( don't understand why happening , new r... there package need load maybe had loaded before , didn't realize it? here link data: https://www.dropbox.com/s/amg12jp9qx98slz/a1.csv?dl=0 thanks help i used data provided on dropbox , following code seems running me no problems. maybe try reading in not csv? library(dplyr) library(tidytext) library(readr) a1

ORACLE query using NOT IN too many values -

i have oracle query below: select * wa_ga_tbl_activity a, wa_ga_tbl_users u a.userid_fk = u.userid , (a.groupid_fk = 'gr0001' or u.groupid_fk = 'gr0001') , a.userid_fk != 'us0007' , (a.activityid) not in(select activityid_fk wa_ga_tbl_accessactivity userid_fk = 'us0007' the first logic check in wa_ga_tbl_activity when userid != us0007 . , want user details in not in : not in(select activityid_fk wa_ga_tbl_accessactivity userid_fk = 'us0007' when userid_fk = us0007 i tried this: select * wa_ga_tbl_activity a, wa_ga_tbl_users u a.userid_fk = u.userid , (a.groupid_fk = 'gr0001' or u.groupid_fk = 'gr0001') , a.userid_fk != 'us0007' , (a.activityid) not in(select s.userid, s.dateadded, w.activityid_fk wa_ga_tbl_users s, wa_ga_tbl_accessactivity w s.userid = w.userid_fk , w.userid_fk = 'us0007') got error: ora-00913: many values sample data table wa_ga_tbl_activity activityid | activityname

c++ - Intel icpc and C++14: How to constexpr std::complex? -

in calculations use imaginary unit , think compiler should able simplify these operations @ compile time reducing things like a + b --> std::complex(a,b) of course above simplified , expressions more complex (pun intended). in c++14 can use complex literals that, whereas in c++11 using constexpr std::complex variable. however, both of these methods fail intel c++ compiler icpc error messages comments in source. how can work around these glitches? #include <complex> auto test1(double a, double b) { // error #1909: complex integral types not supported using namespace std::complex_literals; auto z = + 1i*b; return z; } auto test2(double a, double b) { // error: calling default constructor "std::complex<double>" not produce constant value constexpr std::complex<double> i(0,1); auto z = + i*b; return z; } auto test3(double a, double b) { // can optimized others? std::complex<double> i(0,1); auto z = + i*b; retu

jquery - Slide div out of screen and other div into screen at the same time -

Image
i'm building mobile web app (apk not link) , know how compile. i'd give real app feel (effects). i have far: is there way make whole div slide left while div slides right fill in place when click category? i'm looking simple code so, i'll take anything. thanks! based on comment here basic code started. $('.button').click(function() { if ($(this).hasclass('button-right')) { $('.block1').css('marginleft', '-100%') } else { // hasclass button-left $('.block1').css('marginleft', '0%') } }) html, body { height: 100vh; margin: 0; padding: 0; background-color: green; } div { display: flex; height: 100%; } .container { position: relative; display: flex; flex: 1; } .blocks { display: flex; justify-content: center; align-items: center; flex: 1; min-width: 100%; transition: 0.3s ease; } .block1 { margin-left: 0; ba

asp.net - Adobe PDF not showing on IIS7 -

Image
i got code below working on local (using source code) fine. when published on iis7 pdf not showing anymore.. there problem iis or ?. . . spent many days on problem. dim strpath = server.mappath("~\reports\generatedreport.pdf") my_rpt.exporttodisk(exportformattype.portabledocformat, strpath) dim file = new system.io.fileinfo(strpath) dim process = new process() if file.exists process.startinfo.useshellexecute = true process.startinfo.filename = strpath process.start() else 'no report found end if as can notice in picture below see adobereader running not displaying on screen. when "not showing" assuming want pdf opened on client, not server. send file browser. process.start() start process server-side, if apppool allowed start process, open pdf on server. below how send file server client. string strpath = server.mappath("~/reports/generatedreport.pdf"); //read file disk , convert byte array byte[] bin = file.r

How to install Python Modules -

i want install pyserial python, don't know how. have tried stuff pip, doesn't recognise install command. how install it? first have install pip follow link .then can use pip install pyserial or can download pyserial gituhub , run python setup.py install

Google Chrome Extension Using With UDP -

i want develope basic extension. extension should communicate on udp. extension messaging. want create client. because create server in java. client can sent message server , server can message client. i @ chrome developer page. these documents not date. create basic client this: // values var address = null; var connect = null; var disconnect = null; // udp-object var echoclient = null; // ------------------------------------------------------------------------------------------------------------------- window.addeventlistener("load", function() { // input: address.val address = document.getelementbyid("address"); // button: connect.val connect = document.getelementbyid("connect"); // button: disconnect.val disconnect = document.getelementbyid("disconnect"); // button: connect.func connect.onclick = function(ev) { if(address.value != ""){ echoclient = newechoclient(address.value);

Does Meteor Android APK contains images from public folder? -

i newbie meteor android apk. wanted know whether meteor android apk contains images public folder? or apk made of components? don't want apk heavy i.e of bigger size (more 20mb). planning build offline meteor android apk , if public folder images going there in offline application blunder me result in increased size apk. please suggest. in advance!

YouTube API V3 not returning "statistics" part for /videos endpoint -

i stopped getting "statistics" part, 06-april-2017, working fine , several videos not getting "statistics" part. when make call, https://www.googleapis.com/youtube/v3/videos?part=statistics&key=validkey&id=3cxixdghuyw fyi, tried getting "statistics" part here, not receiveing it. https://developers.google.com/youtube/v3/docs/videos/list same issue well, has opened issue @ google's issue tracker here

python - How to sort tuple twice -

for example, a = [(4, 3), (6, 3), (2, 1), (3, 1)] how sort tuple twice without using itemgetter ? want sort first key = a[1] , second key = a[0] . this, a = [(6, 3), (4, 3), (3, 1), (2, 1)] just reverse sort: sorted(a, reverse=true) for new list or a.sorted(reverse=true) to sort list in-place. tuples compared lexicographically, first first element, second in case of tie. sorting first second element, first, result in exactly same order if first sorted second element , sorted resulting list first: >>> operator import itemgetter >>> = [(4, 3), (6, 3), (2, 1), (3, 1)] >>> sorted(a, key=itemgetter(1), reverse=true) [(4, 3), (6, 3), (2, 1), (3, 1)] >>> sorted(sorted(a, key=itemgetter(1), reverse=true), key=itemgetter(0), reverse=true) [(6, 3), (4, 3), (3, 1), (2, 1)] >>> sorted(a, reverse=true) [(6, 3), (4, 3), (3, 1), (2, 1)] if input has tuples more 2 elements elements must ignored, can still use itemgetter()

elasticsearch update from 0.90 to 1.7 ruby on rails code does not work anymore -

hello people need ruby on rails. yesterday updated elasticsearch 0.90 1.7 , received error caused by: org.elasticsearch.index.query.queryparsingexception: [published-entities-production] no query registered [text_phrase_prefix] my autocomplete code not working anymore def self.autocomplete str tire.search(entity.index.name, :query => {:text_phrase_prefix => {:name => str}}).results.collect |result| unicodeutils.downcase(result.name, :lt).gsub(/[^\p{word}]+/u, ' ').gsub(/ +/, '').strip end.uniq end please me solve problem. /usr/share/elasticsearch/data exists

how to achieve C# struct behavior in java -

as per msdn standard struct value type, java cannot have struct can use class instead of struct. concern use class instance value type similar c# struct. can 1 suggest me how achieve struct value type behavior in java? class program { static void main(string[] args) { demo d = new demo("value", "name"); demotes(d); console.writeline(d.value);//prints "value" output console.writeline(d.testvalue);//prints "namechanged" output } public static void demotes(demo d) { d.value = "valuechanged"; d.testvalue.name = "namechanged"; } } public struct demo { public string value; public test testvalue; public demo(string value, string name) { value = value; testvalue = new test(name); } } public class test { public string name; public test(string name) { name = name; } } in above code, need pass custom

python: write 'backslash double-quote' string into file -

i've got input file string containing double quotes in it, , want generate c-style header file python. say, input file: hello "bob" output file: hello \"bob\" i can't write code obtain such file, here's i've tried far: key = 'key' val = 'hello "bob"' buf_list = list() ... val = val.replace('"', b'\x5c\x22') # tried: val = val.replace('"', r'\"') # tried: val = val.replace('"', '\\"') buf_list.append((key + '="' + val + '";\n').encode('utf-8')) ... keyval in buf_list: lang_file.write(keyval) lang_file.close() the output file contains: hello \\\"bob\\\" i had no problems writing \n , \t strings output file. it seems can write 0 or 2 backslashes, can please ? you need escape both double-quote , backslash. following works me (using python 2.7): with open('temp.txt', '

File Handling Support in Charm++ -

does charm++ support file handling? mean can perform file operation(read/write) in charm++? if yes, please give simple example of file handling better understanding. you can kind of file i/o in charm++, though may have take care synchronize parallel file accesses (if doing parallel i/o, say, elements of chare array). options doing i/o essentially: 1) i/o dedicated object. can reduce , broadcast data , object, , use serial i/o method want. since charm++ built-on message-driven execution paradigm, i/o object scheduled when has work do. 2) i/o objects. can either use charm++'s built-in asynchronous parallel i/o library "ckio" directly chare array elements, or can use mpi-io, hdf5, or whatever other parallel i/o library want. latter, want use charm++'s mpi interoperability features , i/o charm++ "group" or "node group" there 1 i/o actor per pe or node. of course can i/o subset of objects, , have choice of using single global file or

javascript - How to auto open a chat in XMPP chat client Converse.js -

i want integrate xmpp chat website. tried create bare bone chat, should auto login , auto open chat window. can auto login, nothing after that. the whole code below. why not auto open chat window? <body> <script> converse.initialize({ show_controlbox_by_default: true, allow_muc: false, show_controlbox_by_default: true, auto_login: true, authentication: 'login', jid: 'kelvin@xmpp.mydomainhere.com', password: 'kelvin', websocket_url: 'wss://xmpp.mydomainhere.com:5280/websocket' }); console.log("000"); converse.plugins.add('myplugin', { initialize: function () { this._converse.chats.open('jacky@xmpp.mydomainhere.com') var msg = converse.env.$msg({ from: 'kelvin@xmpp.mydomainhere.com', to:'jacky@xmpp.mydomainhere.com',

javascript - How get range of current week date like this format (March 20.2017)? -

march 20.2017 (monday) march 21.2017 (tuesday) march 22.2017 (wednesday) march 23.2017 (thursday) .... use date.js library. such things should yourself the cdn path of library: https://cdnjs.cloudflare.com/ajax/libs/datejs/1.0/date.min.js var date= date.monday().tostring('mmmm dd.yyyy') date += "\n"+date.tuesday().tostring('mmmm dd.yyyy') date += "\n"+date.wednesday().tostring('mmmm dd.yyyy') date += "\n"+date.thursday().tostring('mmmm dd.yyyy') date += "\n"+date.friday().tostring('mmmm dd.yyyy') date += "\n"+date.saturday().tostring('mmmm dd.yyyy') console.log(date) <script src="https://cdnjs.cloudflare.com/ajax/libs/datejs/1.0/date.min.js"></script>

ios - How can I get Google contact list from swift 3? -

i'm trying contact list swift 3? i've try following url contacts google i've got 401. that's error. . please me how solve it. https://www.google.com/m8/feeds/contacts/default/full/?access_token=[token]&alt=json&callback=? try this: if uiapplication.shared.canopenurl(_your_url_) { uiapplication.shared.open(_your_url_, completionhandler: { (success) in print("success") // prints success }) }

swift - Multiple cells for a single UICollectionView -

in collection view, cell class must have different appearance different kinds of data in array. i looking way create multiple cells , choose different 1 according input data, example : internal func collectionview(_ collectionview: uicollectionview, cellforitemat indexpath: indexpath) -> uicollectionviewcell { let cell1 = collectionview.dequeuereusablecell.. as! kind1 let cell2 = collectionview.dequeuereusablecell.. as! kind2 // here choose different 1 each kind of data return cell1 } i trying understand if : how , if right way in terms of memory ? is design? how go making different layout of single cell? ( creating views , hiding them seems bad approach) you need this internal func collectionview(_ collectionview: uicollectionview, cellforitemat indexpath: indexpath) -> uicollectionviewcell { if (data.kind == kind1) { let cell1 = collectionview.dequeuereusablecell.. as! kind1 return cell1 } else { let ce

karma jasmine - Testing a public method that calls subscribe on private property angular -

i'm in process of learning angular 2 , working on unit tests app. have service that's similar following: @injectable() export class modalservice{ private onclose = new subject<boolean>(); public subscribeonmodalclose(closehandler:any):void { this.onclose.subscribe(closehandler); } } i'm not sure how should go testing subscribeonmodalclose() . i'm thinking should make sure .subscribe() gets called when actual method gets called. i'm not sure how check that, considering onclose$ private property. any appreciated.

Can I assign a string that ends with a multiple whitespace line in a bash shell variable? -

i got problem storing lines in bash shell variable. there file contains string this. $ vim a.txt ------we-are-in-vim------ first line second line -------end-of-file------- this file has 2 empty lines placed on end of it. when cat file, can see blank printed! $ cat a.txt first line second line $ well. now, can imagine can put in bash variable. let's try! $ var=`cat a.txt` $ echo "${var}" first line second line $ ok. did not rap cat command's output double quotation! ;) $ var="`cat a.txt`" $ echo "${var}" first line second line $ ok. let's try printf built-in variable assignment feature! $ printf -v var "`cat a.txt`" $ echo "${var}" first line second line $ ....ok let's try mapfile command! $ mapfile < a.txt var $ printf '%s' "${var[@]}" first line second line $ the mapfile command worked, same cat! $ var2=`printf '%s' "${var[@]}"` $ echo

python - Centralizing Flask routes -

my colleague place routes web server in single routing file instead of spreading them around on bunch of functions. how in java/play: get /recovery controllers.application.recovery() /signup controllers.application.signup(lang="sv") /<:lang>/signup controllers.application.signup(lang: string) is feasible/easy in flask? yes, easy: from flask import flask import controllers.application app = flask(__name__) routes = '''\ /recovery controllers.application.recovery /signup controllers.application.signup /<lang>/signup controllers.application.signup''' route in routes.splitlines(): method,path,func = route.split() app.add_url_rule(rule=path, view_func=eval(func), methods=[method]) app.run()

logging - Solr. How to check that update request processor is invoked during document update -

i have following configuration in solrconfig.xml: <updaterequestprocessorchain name="classification"> <processor class="solr.classificationupdateprocessorfactory"> <str name="inputfields">title_s</str> <str name="classfield">category_s</str> <str name="algorithm">bayes</str> </processor> <processor class="solr.logupdateprocessorfactory" /> <processor class="solr.runupdateprocessorfactory" /> </updaterequestprocessorchain> <initparams path="/update/**"> <lst name="defaults"> <str name="update.chain">add-unknown-fields-to-the-schema</str> <str name="update.chain">classification</str> </lst> </initparams> so, according solr documentation, new documents sh

android - Unable to instantiate application: java.lang.ClassNotFoundException: -

the issue occurs if: i run app android studio , app runs properly then delete app , tried install debug.apk .../app/build/outputs/apk/debug.apk my os ubuntu 16.04, oracle jdk but on windows 7 works properly(apk can installed .../app/build/outputs/apk/debug.apk , runs properly) this error occurs: fatal exception: main process: com.example, pid: 21084 java.lang.runtimeexception: unable instantiate application com.example.myapp: java.lang.classnotfoundexception: didn't find class "com.example.myapp" on path: dexpathlist[[zip file "/data/app/com.example-1/base.apk"],nativelibrarydirectories=[/data/app/com.example-1/lib/arm, /vendor/lib, /system/lib]] @ android.app.loadedapk.makeapplication(loadedapk.java:676) @ android.app.activitythread.handlebindapplication(activitythread.java:6289) @ android.app.activitythread.access$1800(activitythread.java:221) @ android.app.activitythread$h.handlemessage(activitythread.java:1860) @ android.os.handler.dispatc

physics - Relationship between raw audio and corresponding spectrogram length -

i want cut piece of audio smaller pieces of length x. constraint that, after performing stft on pieces, spectrograms should have exact length y. knowing sample rate, how can figure out how long raw audio pieces need be? edit: ok, know stride, window_size , sample_rate of stft function. want write equation like size_spectrogram = alpha * size_input_audio. what relationship can use?

rust - How to pass a member function of a struct to another struct as callback -

i want pass member function of struct struct. sorry, poor english, can't more details. use std::thread; struct struct1 {} impl struct1 { pub fn do_some(&mut self, s: &str) { // use s modify self } } struct struct2 { cb1: box<fn(&mut struct1, &str)>, } fn main() { let s1 = struct1 {}; let s2 = struct2 { cb1: box::new(s1.do_some), // how store do_some function in cb1 ? }; } you close! refer method or other symbol use :: separator , specify path said symbol. methods or associated functions live in namespace of type, therefore path of method struct1::do_some . in java use . operator access those, in rust . operator used on existing objects, not on type names. the solution is: let s2 = struct2 { cb1: box::new(struct1::do_some), }; however, possibly improve type of function bit. box<fn(...)> boxed trait object, don't need if don't want work closures. if want refer "normal

Escaping quotes and delimiters in CSV files with Excel -

Image
i try import csv file in excel, using ; delimiters, columns contains ; and/or quotes. my problem : can use double quotes ignore delimiters specific string, if there double quote inside string, ignores delimiters until first double quote, not after. don't know if it's clear, it's not easy explain. i try explain example : suppose have string this a;test : use double quotes around string, ignore delimiter => works. now if string contains delimiters , double quotes : trick doesn't work anymore. example if have string this; is" a;test : added double quotes around string ignore delimiters first part (the delimiter in part this; is correctly ignored, since there double quote after, excel doesn't ignore next delimiter in a;test part. i tried best clear possible, hope you'll understand problem. when reading in quoted string in csv file, excel interpret pairs of double-quotes ("") single double-quotes("). so "this

Android Studio | How do I scale the image in ToggleButton? -

Image
i have implemented togglebutton use image instead of text how scale them i have tried using scaletype not work ic_toggle.xml (i have tried using scaletype here not work) <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_checked="false" android:drawable="@drawable/ic_signal_p1"/> <item android:state_checked="true" android:drawable="@drawable/ic_signal_p2" /> </selector> fragment_deviceitem_list.xml <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <togglebutton android:id="@+id/scan" android:la

c# - Prevent encoding of RestSharp parameters -

i'm trying call oauth2 api scope parameter set t o read,usercp . restsharp encodes parameter &scope=read%2cusercp instead should &scope=read,usercp i have not yet found way disable encoding single parameter. here's code: var request = getrequest("index.php?oauth/token", method.post); request.addparameter("client_id", clientid); request.addparameter("client_secret", clientsecret); request.addparameter("grant_type", "password"); request.addparameter("username", username); request.addparameter("password", password); request.addparameter("scope", "read,usercp"); //request.parameters.add(new parameter //{ // contenttype = "application/json", // name = "scope", // value = "read,usercp" //}); var response = await restclient.executetaskasync<authenticateresponse>(request); if (response.statuscode != httpstatuscode.ok &&

c# - Google maps closes immediately after opening -

i have problem google maps. supposed show me map opens map , closes it. map open in onpickaplacebuttontapped immediatly jumps onactivityresult closing map. private void onpickaplacebuttontapped(object sender, eventargs eventargs) { var builder = new placepicker.intentbuilder(); startactivityforresult(builder.build(this), place_picker_request); } protected override void onactivityresult(int requestcode, result resultcode, intent data) { if (requestcode == place_picker_request && resultcode == result.ok) { getplacefrompicker(data); } base.onactivityresult(requestcode, resultcode, data); } have configured app using google placesapi, if not refer ( https://developers.google.com/places/android-api/start#configure app) , create api key & enable google places api on console. you can explore logcat error on these lines, make sure not select filter in logcat

javascript - DOM: Observing changes of bounding rectangles -

is possible observe changes of screen position , size dom elements? mutationobserver doesn't seem react changes caused scrolling or resizing - don't affect dom elements' properties, in reality alter onscreen bounding rectangle. i haven't been able find elegant/"standard" way this, other responding onresize , onscroll events of parent elements.

Yoeman angular 2 : Uncaught ReferenceError: angular is not defined and page loads without style -

im using angular yoeman. and scaffolded angular 2 application using 'yo angular' command. 1) everytime scafold angular , why index.html inside app folder , need manually move index.html in root folder. 2) , when run cmd: npm run serve, need change path of: href="app/styles/main.css"> in index.html src="app/scripts/app.js" 3) when server starts, uncaught referenceerror: angular not defined in app.js file have contents as: angular .module('myangularapp', [ 'nganimate', 'ngaria', 'ngcookies', 'ngmessages', 'ngresource', 'ngroute', 'ngsanitize', 'ngtouch' ])

oop - C++ Erase-remove idiom with object -

edit: @holt helped me, solution pass instance of engine if hascollided non-static: std::bind(&engine::hascollided, this, ball, _1); i have function returns true or false whether brick hit ball. i want erase brick hit vector. managed idiom working simple vector of numbers , bool function, strange errors when try same vector of objects. private members: ball ball; std::vector<brick> bricks; collision check: bool engine::hascollided(ball& object1, brick& object2) { //do checks return 1; } my attempt: using namespace std::placeholders; auto f = std::bind(hascollided, ball, _1); bricks.erase(std::remove_if(bricks.begin(), bricks.end(), f), bricks.end()); error happens in predefined_ops.h right here: template<typename _iterator> bool operator()(_iterator __it) { return bool(_m_pred(*__it)); } }; and compiler spits out 92 errors. please me fix that example error: required '_forwarditerator std::__remove_if(

excel - Preapre string with special characters -

i taking columns names excel sheet , 1 of column names getting follows: recorded by" & vblf & "fo staff for excel columns names have list in program reflect in excel check if match or not. column giving me mentioned string. problem don't know how prepare string have same text comparison. saying how prepare string string shown above? if possible explanation. edit: didn't mentioned 1 thing. store reflected values in xml config file. serialize columns names (the same column values in excel). program deserialize xml file , load array of items. array compared array of excel columns comming directly excel. to exact string in question, need double double quotes: dim coltext = "recorded by"" & vblf & ""fo staff" edit: it's not elegant, remove double quotes deserialised string: coltext.replace("""""", """")

jquery - Javascript onChange event not firing in Input type file -

i using javascript file inside 'scripts' folder checking validation such file size uploading image. however, change event not firing. mistake in code? var filelogo = ""; $(document).on("change", "#idfilelogo", function(e) { var file_size = $(this)[0].files[0].size; if (file_size > 1000141) { $("#txtfilelogo").attr("placeholder", "upload image"); var message = "image size greater 1mb."; showerrormesssage(message); return false; } filelogo = $(this).val(); var ext = filelogo.split('.').pop(); if (ext == "x-png" || ext == "jpeg" || ext == "gif" || ext == "jpg") { $("#txtfilelogo").attr('placeholder', $(this).val().split('\\').pop()); } }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <input type="text

jmeter java.io.IOException -

i have fired https url on browser , same in jmeter. want run few url's thorugh jmeter found difference when run thorugh jmeter. broswer result- request url:https://testurl.com request method:get status code:302 found on firing url, in browser, login screen when fire same url through jmeter, giving exception below- response code: non http response code: java.io.ioexception response message: non http response message: unable tunnel through proxy. proxy returns "http/1.1 503 service unavailable" this happens when website target behind load-balancer ha-proxy or nginx. load balancers use host http header know backend request must redirected. add "host: testurl.com" header http request putting http header manager underneath. suggest record browser traffic capture headers browser sending remote server.

erlang - Memory corruption due to erl_interface libraries that are implemented in C -

this question has answer here: how force abort on “glibc detected *** free(): invalid pointer” 4 answers in application i've erlang node periodically communicates c-node every 1 second gather periodic data such alarm , performance. the c-node implemented in such way that, consists of 2 threads, main thread receives requests erlang node , passes message worker thread. worker thread serves queries , replies erlang node. reply erlang node data collected in cnode need converted erlang format (in case list of tuples) using function erl_format . the problem observed here is, after running approximately 45 minutes, i'm incurring glibc error complains memory corruption. what probable cause this? i'm using 3.9 version of erl_interface libraries compiled thread safe options(such _reentrant) please find below log got glibc complains possible memory c

How to test data polling on AngularJS with Jasmine? -

i have trouble test data polling in controller controller logic looks this $oninit() { this.requestrootlocations(); this.startdatapolling(); } private startdatapolling() { this.stop = this.$interval(() => this.requestrootlocations() , this.data_polling_interval); } private requestrootlocations() { this.locationsservice.requestrootelements().then(function (locationitem) { ... this.entitylist = (locationitem["locations"] instanceof array) ? locationitem["locations"] : []; }.bind(this), function () { console.log("error on loading locations data."); }); } update: http request in service: public requestrootelements() { return this.$http.get(this.api + "locations").then((response) => response.data); } this works fine expected. the test case looks this it("should call http request on intervals", function () { ctrl.$oninit(); $httpbackend.whe

MS Access Disable Right Click on Specific Text Box -

i'm using access 2013 , have created custom right click menu copy\cut paste (as deployed users using runtime , doesn't exist out of box). however, within form need disable custom right click 1 specifc text box - possible? thanks, michael its ok worked out. for on enter event added: shortcutmenu = false and lost focus event added: shortcutmenu = true

css - manipulating repeat linear gradient -

i want recreate line pattern similar uber's brand website: https://brand.uber.com/ - in particular repeating lines can see in background: http://prntscr.com/etius6 to so, thought of using repeating-linear-gradient css. .container { background-image: repeating-linear-gradient(90deg, #d8d8d8, #d8d8d8 1px, white 0, white 16.666666667%); min-height: 5000px; max-width:904px; margin:0 auto; } <div class="container"> </div> , here's fiddle: https://jsfiddle.net/jz7ag7l1/ it works want tweak bit. want eliminate first bar, try makes gradient disappear or weirdly becomes thinner, leaving bars now.. background-position has no effects well. any great, thanks if inner div not problem, hiding left grey line behind , outer div overflow:hidden works: .container .inner { background-image: repeating-linear-gradient(90deg, #d8d8d8, #d8d8d8 1px, white 0, white 20%); min-height: 5000px; margin-left: -1px; }

jquery - Issue with Flexslider 2 not showing in accordion -

i have 2 flexsliders on homepage, first loading , behaving needed pages main slider @ top, however, second 1 in jquery accordion tab , although viewport etc... loads , relevant information seems loading. slider works upon opening of accordion tab when flexslider set fade when set slide viewport etc... appears , fills space none of images visible until have clicked chrome tab , return page , visible while slider set slide? please help, in advance thanks

custom data attribute - Why does Safari fail to access this.dataset.something in my code? -

class menuitem extends htmlelement { constructor() { super() this.menuitemid = this.dataset.menuitemid this.name = this.dataset.name this.price = this.dataset.price this.imgurl = this.dataset.imgurl this.count = this.dataset.count console.trace(this.dataset) console.trace(this.dataset.count) } } the weird thing this.dataset outputs: domstringmap count: "0" imgurl: "https://s3-ap-southeast-1.amazonaws.com/ghm-pos/assets/nasi_goreng.jpg" menuitemid: "asdf009" name: "nasi goreng" price: "8.20" but this.dataset.count outputs null anyone know why?

c# - VTK- missing semicolon error -

i building vtkgdcm c# wrappers on visual studio 2010. @ following line got possibly missing semicolon error. header file. vtkstringarray.h vtk_newinstance vtkarrayiterator * newiterator() ; any appreciated.

2 different css bundles based on folder location (compiled from less \w webpack) -

we developing webapplication custom cms dashboard in react. our basic folder structure looks this: src -client -app -less ... -cms -less ... -server -webpack-config -development -client.js -server.js -production what trying achieve sounds simple: struggling getting work. the less-files in app/less && cms/less should each bundled seperate css file. this way can load correct css file based on main component gets loaded in react (app / cms dashboard ). styling our cms totally different our app. our current webpack config client: var path = require('path'); var webpack = require('webpack'); var htmlwebpackplugin = require('html-webpack-plugin'); var extracttextplugin = require('extract-text-webpack-plugin'); var htmlcompressionplugin = require('html-compression-webpack- plugin'); module.exports = { cache: true, entry: path.resolve(__dirname, '

hibernate - How to get actual entity type from JPA based entries without fetching all object -

i need actual entity type jpa based entries without fetching object. example there 2 entities - superuser extends user. and want id type 1 com.company.domain.superuser 2 com.company.domain.user situation: user @table(name = "users") @discriminatorvalue(value = "user") @inheritance(strategy= inheritancetype.single_table) @entity public class user implements serializable { private static final long serialversionuid = 1l; @id @generatedvalue(strategy=generationtype.auto) private long id; public long getid() { return id; } public void setid(long id) { this.id = id; } } super user @discriminatorvalue(value = "superuser") @entity public class superuser extends user implements serializable { private static final long serialversionuid = 2l; } current entries data insert users(dtype, id) values('superuser',1); insert users(dtype, id) values('user',2); i'm tryi

php 7 - Accessing variable under PHP 7 different? -

this used before: $langs[$language->lang_code]->$fieldname[1] under php 7 thats not working, looks must write: $langs[$language->lang_code]->{$fieldname[1]} is so?

c# - Xamarin.Forms upload image to server directory -

i have upload image application php web service tried code: private void upload(mediafile mediafile) { try { byte[] data = readfully(mediafile.source); var imagestream = new bytearraycontent(data); imagestream.headers.contentdisposition = new contentdispositionheadervalue("attachment") { filename = guid.newguid() + ".png" }; var multi = new multipartcontent(); multi.add(imagestream); var client = new system.net.http.httpclient(); client.baseaddress = new uri("url"); var result = client.postasync("api/manageimage", multi).result; } catch (exception e) { } } php: <?php $uploads_dir = 'image/'; //directory save file comes client application. if ($_files["file"]["error"] == upload_err_ok) { $tmp_name = $_files["file"]["tmp_name&q

airflow - Specify parallelism per task? -

i know in cfg can set parallelism, there way per task, or @ least per dag? dag1= task_id: 'download_sftp' parallelism: 4 #i fine downloading multiple files @ once task_id: 'process_dimensions' parallelism: 1 #i want make sure dimensions processed 1 @ time prevent conflicts 'serial' keys task_id: 'process_facts' parallelism: 4 #it fine have multiple tables processed @ once since there no conflicts dag2 (separate file)= task_id: 'bcp_query' parallelism: 6 #i can query separate bcp commands download data since small amounts of data you can create task pool through web gui , limit execution parallelism specifying specific tasks use pool. please see: https://airflow.apache.org/concepts.html#pools

SonarQube 6.3 OutOfMemoryError scanning large XML file(s) -

i'm scanning folder of xml files (total 472mb) containing several small big files. couple of them around 70/80mb. using: sonarqube-6.3 sonar-scanner-3.0.0.702-windows microsoft server 2012 rs2 14g ram, multi core xeon xml plugin using 27 active rules. env var sonar_scanner_opts = -xmx10g combined java memory use during scanning of complete folder rise , rise, leading to: *java.lang.outofmemoryerror: java heap space dumping heap java_pidblabla.hprof ... heap dump file created [i.e. 314342113 bytes in 4.624 secs]* is there way fix this, or should focus on decreasing size of xmls?

angularjs - Table styling with LESS -

this question styling table created inside angularjs directive. have array of objects passed directive html file. directive creates table , shows each object of array in row. now question: there self-defined json field in each object called name . styling done less technology , want have thick separating line behind each row when 'name == david' . please consider condition can different example when 'rowid%3 ==0' , etc. general question how can access objects in less file , how can make conditional styling inside less. i'm making lot of assumptions since didn't include code or markup, in angular basic, simple problem, , independent of whether using less, sass, or plain css: <table> <thead> <tr> <th>col 1</th> <th>col 2</th> <th>col 3</th> </tr> </thead> <tbody> <tr ng-repeat="item in vm.items track $index" ng-class="{

jenkins - Nexus returns error 502 (Bad Gateway) when publishing artifacts -

i've completed installation of sonatype nexus 3.2.1-01 , i'm trying publish artifacts using jenkins job , nexus artifact uploader 2.9 plugin. the upload starts fine: 100 % completed (572 kb / 572 kb). but throws the error: return code is: 502, reasonphrase:bad gateway. both jenkins , nexus servers run behind reverse proxy believe source of issue. the apache log seems suggest request not replied nexus: [thu apr 06 18:50:46.128569 2017] [proxy:error] [pid 10327] (32)broken pipe: [client some_ip:57928] ah01084: pass request body failed 0.0.0.0:8081 (0.0.0.0) [thu apr 06 18:50:46.128649 2017] [proxy_http:error] [pid 10327] [client some_ip:57928] ah01097: pass request body failed 0.0.0.0:8081 (0.0.0.0) some_ip () this virtualhost config in apache sonar server: <ifmodule mod_ssl.c> <virtualhost *:443> serveradmin some@email.com servername some.website.com serveralias nsome.website.com documentroot /srv/www/nexus/public_html/

python - How to allow for multiple instances of a displayed image MUDBALL in Pygame -

i have mudball image displayed on screen adding all_sprites group. mudball should triggered multiple times using shoot() method of trump class instead appears once @ the beginning of game , not displayed anymore. guess need code more instances of mudball don't know how. don't recieve error 1 meager displaying of mudball instead of multiple. have print "shoot function" statement printed showing shoot() being called still 1 image displayed. please appreciated. have been encouraged include complete version of code. import pygame pg class game: def __init__(self): # initialize game window, etc pg.init() pg.mixer.init() self.screen = pg.display.set_mode((width, height)) pg.display.set_caption(title) self.clock = pg.time.clock() self.running = true self.font_name = pg.font.match_font(font_name) self.load_data() def load_data(self): # load high score self.dir =

steam - Is it possible to create a dashboard overlay application for SteamVR with UE4? -

i trying determine if possible replace default steam dashboard own "lobby" kind of application, made unreal engine. i found applications acting overlays, using openvr api, never seem replace existing overlay rather fit inside (to add functionalities), openvr advanced settings . feasible replace steam menu own ? it event better if use unreal engine create such dashboard application, far, unable create else scene application it.

vue.js - VueJs, difference between computed and watched properties? -

on vue.js documentation there example below: var vm = new vue({ el: '#demo', data: { firstname: 'foo', lastname: 'bar', fullname: 'foo bar' }, watch: { firstname: function (val) { this.fullname = val + ' ' + this.lastname }, lastname: function (val) { this.fullname = this.firstname + ' ' + val } } }) the above code imperative , repetitive. compare computed property version: var vm = new vue({ el: '#demo', data: { firstname: 'foo', lastname: 'bar' }, computed: { fullname: function () { return this.firstname + ' ' + this.lastname } } }) what situations when watchers more suitable computed properties? how should decide choose? documentation keeps saying more "generic" not put purpose. computed properties a computed property sample: computed: { val () { return this.somedataproperty * some

android - Can't solve the selected radio button puzzle in recycler view to add the value of all items? Any help will be appreciated -

Image
i have added radio buttons dynamically in recyclerview . want total price selected radio buttons of recyclerview . somehow can't understand puzzle. appreciated. just checked first when u clicked on button clicked or not position if not add price , display total amount. this clicked.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { if(clicked.ischecked()){ amountwithsecdepo = string.valueof((model.no_of_days*model.charge_per_day)+(model.deposit_amount)+100); setanimation(getresources().getstring(r.string.rs_sysmbol)+" "+string.valueof(amountwithsecdepo)); }else { int temp = (ordermodel.o_duration_days * model.charge_per_day) + 100; setanimation(getresources().getstring(r.string.rs_sysmbol)+" "+string.valueof(temp)); } } });

android - how to call a fragment method in an activity -

i have dialog method in fragment, want call main activity fab. i tried call it, got error; attempt invoke virtual method 'android.view.layoutinflater android.support.v4.app.fragmentactivity.getlayoutinflater()' on null object reference editprofiledialog() dialog method in fragment tried call in main activity. public class edit_fragment extends fragment { private editpresenter meditpresenter; public edit_fragment() { // required empty public constructor } @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); } @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { // inflate layout fragment view view = inflater.inflate(r.layout.edit_profile_fragment, container, false); butterknife.bind(this, view); meditpresenter = new editpresenter(this); meditpresenter.oncreate(); return view; } public void editprofiledia