Posts

c# - How to create a dialog result in maham? -

i'm trying create code show dialog result: var result = this.showmessageasync("proceed?", "info", messagedialogstyle.affirmativeandnegative); if (result == messagedialogresult.affirmative) { this.hide(); } but compiler on line if (result == messagedialogresult.affirmative) , show me message: you can not apply == operator operands of type 'task ' , 'messagedialogresult' in example used operator, doing wrong? showmessageasync() seems asyncronous method, meaning returns task<t> instead of t . so can either await task this: var result = await this.showmessageasync("proceed?", "info", messagedialogstyle.affirmativeandnegative); or can result of it: var result = this.showmessageasync("proceed?", "info", messagedialogstyle.affirmativeandnegative) .result; not if want await task, must in method marked async

php - Call to undefined function wp_mail -

hi im using function wordpress in cron webpage , throwing error on email fatal error : call undefined function wp_mail() in /home/meusite/public_html/wp-content/themes/escotec/page-cron.php on line 33 here code foreach($inscricoes $key => $item){ $emailsent = false; $emailto = "$item->getemail()"; //echo "..1"; $subject = '[escotec]: dados para pagamento de inscrição '; $body = "parabéns $inscricao->nome, sua inscrição no curso ".$item->getturmas()[0]->getcurso()->getnome()." foi efetuada. <p>para concluir o pagamento da inscrição clique no link abaixo ou cole-o diretamente na barra de endereços de seu navegador: </p><br>"; $body .= "<a href=\"http://escotecnordeste.com.br/pagamento/?email=".$item->getemail()."&pedido=".$item->getpagamentoid()."\" target=\"_blank\">http://escotecnordeste.com.br/pagamento...

Counting occourences of a variable in an array filled with objects in JavaScript / Angular -

lets have array filled objects this: {conversation_id: 38 id: 99 is_seen: 1 message: "hej kristina" timestamp: "2015-07-08t10:50:49.000z"' } now wish find out how many of these objects has value is_seen set 1 , conversation_id set 38 . i solve using foreach loop, looking solution cleaner , maybe more efficient. my application angularjs application , i'm looking either native javascript or angular ways solve this. you can use native array.filter() function: var countofseenitems = my_array.filter(function (el) { return el.conversation_id == 38 && is_seen == 1; }).length;

mysql - switch from auth_user to CustomUser in Django 1.7 -

i had been using auth.user user model. changed user model custom.customuser. there various models made during use of auth.user. every tables in database of mysql has created column name user_id or has constraint of foreign key 'auth_user'. due lots of problem occuring. other working fine. auth_user_model pointing 'custom.customuser' table , every new user being stored in customuser. there way of changing reference of existing tables auth_user custom_customuser. using django 1.7 not support south (as far know). you'll need update models point settings.auth_user_model, mentioned. here's example: your_field = models.foreignkey(settings.auth_user_model, related_name='yourmodel_yourfield') then, you'll need use django's internal migrations. andrew godwin, wrote south, core contributor django, should familiar using south: documentation: https://docs.djangoproject.com/en/1.8/topics/migrations/ if you're upgrading 1.7, worth maki...

ggplot2 - How to generate a map with density based on value, not amount of points in R? -

Image
i using following data set: head(trip_3) tip lon lat 1 0 -73.866 40.741 2 10.0 -73.906 40.707 3 1.2 -73.706 40.738 4 2.0 -73.946 40.640 5 0 -73.946 40.625 6 1.5 -73.986 40.602 i able generate following map present points high , low average tip values: i have achieved following code: nyc_map + geom_point(data=as.data.frame(trip_3), aes(x=lon, y=lat, fill=tip), size=3, shape=21, alpha=0.6, position="jitter") + scale_fill_continuous(low="white", high="#ff0033") now want map presenting areas (density) high , low tips not using points - want this: but counts amount of points, not bases on tip value. great achieve have described earlier. code used: nyc_map + stat_density2d(aes(x=lon, y=lat, fill = ..level..), size=3, bins=10, data=as.data.frame(trip_3), geom="polygon") how make stat_density2d rely on tip, not amount of points? try geom_contour. allows specify third variable z. geom_contour dra...

WSO2 API Manager adding extra server node -

if have wso2 api manager running , want add node (say have 2 , want add third), seems api xml files not propagated synapse-configs directory. is there way synchronize apis new node? similarly, if have wso2 api manager running on shared database , delete instance keep db, there way restore apis db? thanks. if have wso2 api manager running , want add node (say have 2 , want add third), seems api xml files not propagated synapse-configs directory. is there way synchronize apis new node? deployment synchronizer provides capability synchronize deployment artifacts across nodes of product cluster. cluster perform correctly, nodes must have same configurations. all carbon-based products, including wso2 api manager use deployment synchronizer (depsync) ensure same status maintained across nodes in cluster. maintains central repository of <apim_home>/repository/deployment/server folder, deployment configurations stored carbon-based products, , uses ...

mysql - Arithmetic operations between SQL select results -

hi need part of bigger script: select group_concat(distinct concat('(sum(case when columna = "' ,columna, ' "then 1 else 0 end))/(select total hd_totals columna = "' ,columna, ' ") "' ,columna, ' "')) table inner join..... the problem can't / operation because gives error, if select output single value. don't know how use aliases or store in variable because it's rather complex (to me) environment i'm creating here... what : use cast have decimal type, , use coalesce prevent null values? select group_concat(distinct concat('coalesce(cast((sum(case when columna = "' ,columna, ' "then 1 else 0 end)) decimal(10,4)),0)/coalesce(cast((select total hd_totals columna = "' ,columna, ' ") decimal(10,4)),0.01) "' ,columna, ' "')) table inner join..... note : there arbitrary constant 0.01 prevent dividing 0. more importa...