Posts

Showing posts from September, 2010

azureservicebus - Azure stream analytics doesn't list custom endpoints in IoT Hub Source Input -

i have iot hub custom endpoints sink data service bus queues. since implemented custom routing through custom endpoints in iot hub & service bus queues. when try create azure stream analytics (asa) job, input panel in azure portal not list custom endpoints consumer groups work default messaging endpoint. is there way let asa pick messages off service bus queues or custom endpoints in iot hub not need modify custom routing have. thanks , looking forward thoughts. yes, azure stream analytics (asa) can access these endpoints. not exposed when select iot hub input in asa. if want access these endpoints in asa, need point asa input service bus or event hub hosting these routes. let me know if works you. thanks, js

How to implement a MPI filter on C code? -

i trying implement mpi of filter code below, i'm facing difficulties doing it. how should done?: filter code: int a[100000][100000]; int b[100000][100000]; (int i=1; i<(100000 - 1); i++) (int i=1; j<(100000 - 1); j++) b[i][j] = a[i-1][j] + a[i+1][j] + a[i][j-1] + a[i][j+1] - 4*a[i][j]; this have tried while following 6 functions of mpi: int myrank; /* rank of process */ int numprocs; /* number of processes */ int source; /* rank of sender */ int dest; /* rank of receiver */ char message[100]; /* storage message */ mpi_status status; /* return status receive */ mpi_init( & argc, & argv); mpi_comm_size(mpi_comm_world, & numprocs); mpi_comm_rank(mpi_comm_world, & myrank); if (myrank != 0) { dest = 0; mpi_send(message, strlen(message) + 1, mpi_char, dest, 15, mpi_comm_world); } else { (source = 1; source < numprocs; source++) { mpi_recv(message, 100, mpi...

javascript - JS simultaneous execution in Safari -

i have serious problem way safari executing javascript, , renders animations. in first video snapshot, see execution of animation needed on chrome (same result in firefox), happens expected, sequential lines growing 1 after in right order. http://quick.as/jvv2srykz the second 1 same animation in safari. http://quick.as/nqlmhdgyd i can't what's wrong script , why such difference in behaviour between safari , chrome/firefox. here js written animation on scroll growing lines effect , smoothscroll anchor. feels happening @ same time in safari, if js executed differently in other browsers. idea on issue ? thank you. /** * @function datesobjectbuilder * * @param collection {htmlcollection} * * [1]. adds list elements. * [2]. adds cards elements. * [3]. adds dates. * [4]. adds offests cards elements. * [5]. calculate offset aside (date list) - header height. * [6]. calculates list item spacing. * [7]. adds difference between cards offsets. */ const datesobje...

java how to split string from the Value1 + value2 = Value3 -

i want split value1 , value2 string value1 + value2 = value3(which retrieving excel). don't required value3 string. can 1 please answer. object[] caliculation = readcalitable.readexcelbycolname("calculations"); (int = 0; < caliculation.length; i++) { system.out.println(caliculation[i]); string[] firstvalue = caliculation[i].tostring().split("\\+"); try this: string[] values = caliculation[i].tostring().split("[+=]"); this split 3 values array of 3 elements... values[0] // value1 values[1] // value2

c# - How can I use IDataErrorInfo to validate child objects from the parent class? -

i have class, datamodel , has bunch of objects of same class, inputitem . inputitem class has nullable decimal property, value , want validate in datamodel class ( not in inputitem class). because validation of 1 inputitem object depends on value in another inputitem object. i'd use idataerrorinfo purpose, haven't been able make work (this code allows me bind values in inputitem , doesn't perform validation). my datamodel class: using system.componentmodel; public class datamodel : idataerrorinfo { public inputitem item1 {get; set;} public inputitem item2 {get; set;} public inputitem item3 {get; set;} //... more inputitem objects public string error { { return string.empty;} } public string this[string propertyname] { { string result = string.empty; switch (propertyname) { case "item1": case "item1.value": ...

how to do an if like statement or equivalent in XSLT -

is possible write out xml based on "if" "like" statement or equivalent of in xslt? i have element named "cust_code" if element starts "he" want write out, otherwise jump next. is possible? if statements exist in xslt. <xsl:if test="..."> ... </xsl:if> but simple if , no alternative. if want equivalent if ... else ... or switch ... case ... , need use following: <xsl:choose> <xsl:when test="..."> </xsl:when> <xsl:otherwise> </xsl:otherwise> </xsl:choose> you can have many when cases necessary. links: w3school - if , w3school - choose . as having element starting specific string, @ function starts-with . can find example in this answer (just omit not main answer, tests find strings not starting particular string). can @ this answer more information.

c# - the SMTP server requires a secure connection or the client was not authenticated. The server response was 5.5.1, Authentication required -

i have been trying application send email on hour now, , i've tried i've found online still exception mentioned in title of question. here code used: smtpclient client = new smtpclient(); client.host = "smtp.gmail.com"; client.port = 587; client.credentials = new networkcredential("sender email", "sender email password"); client.enablessl = true; client.usedefaultcredentials = false; client.deliverymethod = smtpdeliverymethod.network; mailmessage mail = new mailmessage(); mail.from = new mailaddress("sender email", "sender"); mail.to.add(new mailaddress("my email")); mail.subject = "test"; mail.isbodyhtml = true; mail.body = sb.tostring(); client.send(mail); i have allowed access less secure apps on account. have tried enabling 2fa , generating application specific password, exception st...

excel - VBA, importing large data from multiple workbooks into mastersheet -

my code opens file picker , selects files , particular column im interested in combining master worksheet. i pick several .csv files , bring in column of choosing . issue have are, 1) these files large, 400kb. 2) run time error 1004, copy area , paste area not same size , shape. running out of space on excel sheet? when debug error on line copyrng.copy destrng my end goal see , count , see unique values col c(perhaps other columns) workbooks. option explicit dim wsmaster workbook, csvfiles workbook dim filename string dim file integer dim r long public sub consolidate() application .screenupdating = false .enableevents = false end application.filedialog(msofiledialogopen) .allowmultiselect = true .title = "select files process" .show if .selecteditems.count = 0 exit sub set wsmaster = activeworkbook dim copyrng range, destrng range dim firstrow long file = 1 .selecteditems.count fil...

php - How to create Math Table with this? -

i'm trying create simple math table (times). i'm bit confuse how it. can create this. echo "<table>"; ($i = 1; $i <= 11; $i++ ) { $k=1; echo "<tr>"; if($i==1) echo "<td>x</td>"; else{ $k=$i-1; echo "<td>$k</td>"; } echo "<td>".$k ."</td>"; ( $j = 2; $j <= 10; $j++ ) { echo "<td>".$k * $j."</td>"; } echo "</tr>"; } echo "</table>"; here above x 1 2 3 4 5 6 7 8 9 10 1 1 2 3 4 5 6 7 8 9 10 2 2 4 6 8 10 12 14 16 18 20 3 3 6 9 12 15 18 21 24 27 30 4 4 8 12 16 20 24 28 32 36 40 5 5 10 15 20 25 30 35 40 45 50 6 6 12 18 24 30 36 42 48 54 60 7 7 14 21 28 35 42 49 56 63 70 8 8 16 24 32 40 48 56 64 72 80 9 9 18...

r - Sparklyr handing categorical variables -

sparklyr handling categorical variables i came r background , used categorical variables being handled in backend (as factor). sparklyr quite confusing using string_indexer or onehotencoder . for example, have number of variables has been encoded numerical variables in original dataset categorical. want use them categorical variables not sure doing correctly. library(sparklyr) library(dplyr) sessioninfo() sc <- spark_connect(master = "local", version = spark_version) spark_version(sc) set.seed(1) exampledf <- data.frame (id = 1:10, resp = sample(c(100:205), 10, replace = true), numb = sample(1:10, 10)) example <- copy_to(sc, exampledf) pred <- example %>% mutate(resp = as.character(resp)) %>% sdf_mutate(resp_cat = ft_string_indexer(resp)) %>% ml_decision_tree(response = "resp_cat", features = "numb") %>% sdf_predict() pred the prediction model n...

acumatica - Use custom column field in mobile selector -

Image
i have created custom field called 'usralternateids' used filtering in selector fields in page this: and want same fields used in mobile app selecting inventory item using field 'alternateids'. this did use field in selector inventory item not working. is there else missing? looks should using alternateids instead of usralternateids in mapping file. either sample below should add alternative ids column inventory item lookup on mobile device when placed in acumatica website \app_data\mobile\ folder: by using xml file: <?xml version="1.0" encoding="utf-8"?> <sm:sitemap xmlns:sm="http://acumatica.com/mobilesitemap" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"> <sm:folder displayname="sales orders" icon="system://cash" isdefaultfavorite="true" type="hubfolder"> <sm:screen displayname="sales orders" icon="system://cas...

android - Camera preview not working on layout using ConstraintLayout/Guidelines -

Image
i'm trying create custom barcode scanner ui using zxing android embedded ( https://github.com/journeyapps/zxing-android-embedded ), camera preview not render anything, rectangle , laser rendered. is there known issue or mistake in code? activity <android.support.constraint.constraintlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.fcagroup.abtrace.activities.scanneractivity" android:id="@+id/fullscreen_content" android:descendantfocusability="beforedescendants" android:focusableintouchmode="true"> <android.support.constraint.guideline android:layout_width="wrap_content" android:layout_height="wrap_con...

Django DetailView get_context_data -

i'm new in django. there html page (project_details) should show title , tasks of project, shows title of project, not tasks. tasks exists, problem filter!!! views.py the error here from .models import project,task django.views.generic import listview, detailview class projectslist(listview): template_name = 'projects_list.html' queryset= project.objects.all() class projectdetail(detailview): model = project template_name = 'projects_details.html' def get_context_data(self, **kwargs): context = super(projectdetail, self).get_context_data(**kwargs) ## context list of tasks of project## ##this error## context['tasks'] = task.object.filter(list=project) <---->here ((work task.object.all() )) return context models.py class project(models.model): title = models.charfield(max_length=30) slug = autoslugfield(populate_from='title', editable=false, always_update=true) class task(models.model): ti...

amazon web services - Terrafrom custom DSL Warp -

i able make custom dsl based on set of ther dsl, further explain myself show problem: we have base dsl defines new vpc on aws, code has necessary network settings witha subnets settings, dmz style, security groups, etc currently have base code variables set, if team needs set new network settings, copy code, update varibales.tf needs. this works point when need update base terraform syntax, becomes tedious , error prone pass changes accross existent networks. at woudl make custom dsl wrap code, in example: resource "fancy_aws_network" "network" { base_cidr = "172.31.0.0/16" use_dmz = true subnet_per_az = true } can guide me in right direction?

javascript - Need to display/hide Divs when clicked sequentially -

ii revised script found on line struggling display way want. not sure how modify script accomplish following. when web page opens shows: click on links below find mayor of city states when user clicks on states, shows: select state alabama texas california when user clicks on alabama following shows: select city birmingham auburn montgomery when user clicks on birmingham following shows: the mayor of birmingham alabama william bell <!doctype html> <html> <head> </head> <body> <p><b>click on links below find mayor of city</b></p> <p id="demo" onclick="myfunction('mydiv')">states</p> <div id="mydiv"> <p><b> select state</b></p> <p id="demo" onclick="myfunction('mydiv2')">alabama</p> <p id="demo" onclick="myfunction(mydiv3')">texas</p> <p ...

python - Low precision,recall, f1-score and accuracy for minority binaryclass case with scikit learn? -

first of all, thank help. i'm developing empirical study of dimensionality reduction methodologies classification problems final degree project in university, , purpose, using medical dataset in order predict if patient has disease or not( binaryclass case,0 or 1). my dataset imbalanced , i'm applying oversampling , different dimensionality reduction algorihtms. i'm comparing performance obtained classification algorithms before , after processing dataset, , applying dimensionality reduction algorithms, i'm interested in obtain classification report, minority class obtains pretty bad score , i'm wondering why. how can improve if i'm doing wrong? this 1 code: from sklearn.metrics import f1_score # prepare models models = [] models.append(('dtc', decisiontreeclassifier())) models.append(('etc', extratreesclassifier())) models.append(('lr', logisticregression())) models.append(('lsvc', linearsvc())) models.append(('nn...

How do I compile pydev 5.9 debugging optimizations? -

i'm using eclipse neon. when starting pydev debug configuration, pydev checks whether debugging optimizations available. if not, displays message in console: warning: debugger speedups using cython not found. run '"/var/lib/something/python_env/bin/python2.7" "/home/user/.p2/pool/plugins/org.python.pydev_5.9.0.201708101613/pysrc/setup_cython.py" build_ext --inplace' build. this command supposed compile optimizations make them available pydev. however, of version 5.9, appears impossible. the following error message. previous versions of pydev compiled without error cython. [~]$ "/opt/anaconda/bin/python2.7" "/home/jack/eclipse_neon/plugins/org.python.pydev_5.9.0.201708101613/pysrc/setup_cython.py" build_ext --inplace running build_ext building '_pydevd_bundle.pydevd_cython' extension gcc -pthread -fno-strict-aliasing -g -o2 -dndebug -g -fwrapv -o3 -wall -wstrict-prototypes -fpic -i/opt/anaconda/include/python2.7 -...

php - WordPress look - Can't get else to work -

have been trying time solve don't see problem is. this code <?php //get post ids posts start letter a, in title order, //display posts global $wpdb; $char_k = 'a'; $postids = $wpdb->get_col($wpdb->prepare(" select id $wpdb->posts substr($wpdb->posts.post_title,1,1) = %s order $wpdb->posts.post_title",$char_a)); if ($postids) { $args=array( 'post__in' => $postids, 'post_type' => 'encyklopedi', 'post_status' => 'publish', 'posts_per_page' => -1, // 'caller_get_posts'=> 1 ); $my_query = null; $my_query = new wp_query($args); if( $my_query->have_posts() ) { // echo 'list of posts titles beginning letter '. $char_a; while ($my_query->have_posts()) : $my_query->the_post(); ?> <p><a href="<?php the_permalink() ?>" rel="bookmark" title="permanent link <?php the_title_attribute(); ?...

asp.net - Angular template NOT core -

i'm looking angular template visual studio 2017 not want use core libraries requires me rebuild re-usable libraries etc., , never host website on non microsoft platform (likely put azure only). it nice if sign / sign in included. i've tried "convert" core project classic asp .net website "hack" mentioned on encountered many issues any suggestions appreciated maybe find suitable template in sidewaffle extension ( http://sidewaffle.com/ )

arrays - How to add item to a list of arraylist that filled before in java -

i have booklist below public static arraylist<list<string>> bookslist = new arraylist<list<string>>(); and filled shown below, bookslist.add(arrays.aslist("coders @ work", null)); bookslist.add(arrays.aslist("code complete",null)); bookslist.add(arrays.aslist("the mythical man month",null)); bookslist.add(arrays.aslist("don't make me think",null)); bookslist.add(arrays.aslist("the pragmatic programmer",null)); i want add item list of specific row of arraylist bookslist.get(0).add("buyed"); bookslist.get(0).add(0,"buyed"); but doesn't work. how add more items? or there better way handle situation? you cannot add or remove elements of list created arrays.aslist() . its javadoc states indeed : returns fixed-size list backed specified array. to able add new elements after list created, wrap fixed size list in new arraylist . for example : bookslist.a...

SharePoint branding and permissions issue -

i've downloaded html template , wanted use custom master page intranet site, i used design manager convert template (index.html) master page & created page layout. works fine site collection admin; problem want rest of users able join , check intranet site. when give user 'read' permission (site visitors), goes wrong, layout's corrupt , page rendering going crazy. once give same user contribute (site members) or edit permission site goes normal ... can 1 ? thanks in advance...

Extending User Model Django, IntegrityError -

i trying extend user model create profile model. following code displays form additional fields specified location , bio . when submit form original username , first_name , last_name , email , , password fields stored in database @ http://127.0.0.1:8000/admin , none of custom fields stored in profile section added admin . following error: integrityerror @ /accounts/register/ not null constraint failed: accounts_profile.user_id request method: post request url: http://127.0.0.1:8000/accounts/register/ django version: 1.11.2 exception type: integrityerror exception value: not null constraint failed: accounts_profile.user_id exception location: /library/frameworks/python.framework/versions/3.6/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py in execute, line 328 python executable: /library/frameworks/python.framework/versions/3.6/bin/python3.6 models.py: from django.db import models django.contrib.auth.models import user django.db.models.signals import ...

asp.net - Is it possible to publish aspnet core to shared linux server? -

i searched lot find source how publish.net core projects free hosting (shared) servers. couldn't find it. don't talk publish linux vm servers. free web servers not have console. they? i know use ftp solutions.i couldn't find article publish aspnet core linux public server via ftp. is possible? in general, enable port 22 on hosting site's config, scp published project copy there, run dotnet restore , dotnet run on remote server ssh -t . particular company mentioned, 000webhost, allows ssh on paid tier, , looks focused on php , mysql anyways. suggest aws instance, or other full server hosting company, , move app there.

python - Is this correct tfidf? -

i trying tfidf document. dont think giving me correct values or may doing thing wrong. please suggest. code , output below: from sklearn.feature_extraction.text import tfidfvectorizer books = ["hello there first book read wordcount script.", "this second book read wordcount script. has additionl information.", "just third book."] vectorizer = tfidfvectorizer() response = vectorizer.fit_transform(books) feature_names = vectorizer.get_feature_names() col in response.nonzero()[1]: print feature_names[col], '-', response[0, col] update 1: (as suggested juanpa.arrivillaga) vectorizer = tfidfvectorizer(smooth_idf=false) output: script - 0.269290317245 wordcount - 0.269290317245 - 0.269290317245 read - 0.269290317245 - 0.269290317245 - 0.269290317245 book - 0.209127954024 first - 0.354084405732 - 0.269290317245 - 0.269290317245 there - 0.354084405732 hello - 0.354084405732 information - 0.0 ... output after update 1: script - 0.256536...

How to write jQuery or JavaScript equivalent for CSS -

i have jquery equivalent css when tab clicked shows content. now, i'm able css only. have same function jquery or javascript. for example, when sun clicked, shows "it sunday" , when mon clicked, shows "it monday" , on. how can have same functionality jquery or javascript? @import url('https://fonts.googleapis.com/cssfamily=open+sans:400,600,700'); * { margin: 0; padding: 0; } body { padding: 2px; background: #e5e4e2; } .tabinator { background: #fff; padding: 1px; font-family: open sans; margin-top: 10px; } .tabinator input { display: none; } .tabinator label { box-sizing: border-box; display: inline-block; padding: 5px 0.6%; color: #ccc; margin-bottom: -1px; margin-left: -1px; font-family: courier; font-weight: bold; } .tabinator label:before { content: ''; display: block; width: 100%; height: 15px; background-color: #fff; position: absolute;...

testing - Zyp Package R Trend Analysis -

i want test trend in autocorrelated data. want go zyp package , code below zyp.trend.dataframe(indat, metadata.cols, method=c("yuepilon", "zhang"), conf.intervals=true, preserve.range.for.sig.test=true) my code looks this: zyp.trend.dataframe(ts.kendall, 1,"zhang") but error error in [.data.frame (indat, , (1 + metadata.cols):ncol(indat)) : undefined columns selected i not sure metadata.cols stands thought it's column want test trend? correct? df got 1 column yeah thats 1 want test. would cool if can me :)

r - Sapply function confuses me -

it's basic question , sure, there lot of examples in google.. not understand small bunch of code.. v <- seq(50, 350, = 1) > vk voltage^0 voltage^1 voltage^2 voltage^3 -1.014021e+01 9.319875e-02 -2.738749e-04 2.923875e-07 plot(x = v, exp(exp(sapply(0:3, function(x) v^x) %*% vk)), type = "l"); grid() i tried behind after playing lot function but.. cannot apply ideas line. far got believe can tell: sapply function applies body each element of vector or list or similar. in case v. point confuses me "0:3" part (which seems amount of elements of vk) , end of function %*% vk. when same on own different numbers vk summed , used coefficient exp(exp(v^x)). here in case makes no sense. furthermore: googling read sapply yields vector. due fact code above generates plot 2d-vector result? sapply(0:3, function(x) v^x) > sapply(0:3, function(x) v^x) [,1] [,2] [,3] [,4] [1,] 1 50 2500 125000 [2,] 1 51...

java - How can I refactor a method with an unknown Class as a parameter? -

Image
i want make method reusable i'm not sure how provide parameter work in following context: service.getposts() // method called, i.e. getposts() should vary depending on class parameter for (post object : postresponse.getresults()) { // want post class come parameter list<post> objects = postresponse.getresults(); // want class passed list come same parameter method call: retrievedata(mcardadapter, post.class); method: private void retrievedata(final cardadapter mcardadapter, final class classparam) { retrofitservice service = servicefactory.createretrofitservice(retrofitservice.class, retrofitservice.service_endpoint); service.getposts() .subscribeon(schedulers.newthread()) .observeon(androidschedulers.mainthread()) .subscribe(new subscriber<postresponse>() { @override public final void oncompleted() { setrefreshingfalse();...

plot - How can we keep the default axis values but just turn them to percentages in R? -

Image
i'm wondering how can keep default y-axis values r in plot turn them percentages? specifically, if need use axis() how should specify " at = " in axis() keep default tickmarked values? an example here: x = rbinom(10, 100, .7) plot(x) here thought might work didn't: plot(x, yaxt = "n") tk = par("yaxp") axis(2, @ = seq(tk[1], tk[2], l = tk[3]), labels = paste0(seq(tk[1], tk[2], l = tk[3]), "%")) this job you: plot(x, yaxt="n") axis(2, at=axticks(2), labels=paste0("%", axticks(2))) below, can see result of plot(x) , solution above side side: set.seed(123) x = rbinom(10, 100, .7) plot(x) plot(x, yaxt="n") axis(2, at=axticks(2), labels=paste0("%", axticks(2)))

css - styling the attribute img -

can style img in data attribute data-vc-parallax-image? if use fades img bg. doesn't create img tag. [data-vc-parallax-image="../wp-content/uploads/-woman-cleaning-the-floor-with--1.jpg"]{ opacity:0.4; } <div data-vc-full-width="true" data-vc-full-width-init="true" data-vc- parallax="1.5" data-vc-parallax-o-fade="on" data-vc-parallax-image="../wp- content/uploads/-woman-cleaning-the-floor-with--1.jpg"> <p>content</p> </div> no, cannot (as far know). as see, using wordpress visual composer plugin. can style image in photoshop (for example) , upload desired opacity (transparency). saved png of course.

spring - Nested exception is javax.persistence.EntityNotFoundException -

i'm using spring boot , and spring data in project , have 2 classes: class mission implements serializable { private static final long serialversionuid = 1l; @id @generatedvalue( strategy = generationtype.identity ) private long id; private string departure; private string arrival; private boolean isfreewayenabled; @onetomany( mappedby = "mission" ) private list<station> stations; // getters , setters } and second class : @entity public class station implements serializable { private static final long serialversionuid = 1l; @id @generatedvalue( strategy = generationtype.identity ) private long id; private string station; @manytoone( fetch = fetchtype.lazy ) @jsonbackreference private mission mission; //getters , setters } methode add mission: public mission addmision( mission mission ) { // todo auto-generated method stub // mission mission = getmissionbyid( mission...

How to fix "Headers already sent" error in PHP -

Image
when running script, getting several errors this: warning: cannot modify header information - headers sent ( output started @ /some/file.php:12 ) in /some/file.php on line 23 the lines mentioned in error messages contain header() , setcookie() calls. what reason this? , how fix it? no output before sending headers! functions send/modify http headers must invoked before output made . summary ⇊ otherwise call fails: warning: cannot modify header information - headers sent (output started @ script:line ) some functions modifying http header are: header / header_remove session_start / session_regenerate_id setcookie / setrawcookie output can be: unintentional: whitespace before <?php or after ?> the utf-8 byte order mark specifically previous error messages or notices intentional: print , echo , other functions producing output raw <html> sections prior <?php code. why happen? to understand why hea...