Posts

Showing posts from July, 2015

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...

javascript - Angular compile new dom with directive -

i have angular app in there process add new dom elements. example: $("#thingsappendedhere").append(' <div id="imnewlyappended"> <directive something="someobject" /> </div> '); which produce: <div id="thingsappendedhere> <div id="imnewlyappended"> <directive something="someobject" /> </div> </div> and directive: someapp.directive('directive', function() { return { restrict: 'e', templateurl: 'directive.html', controller: directivecontroller, scope: { something: '=' } } and compilation is: var scope = angular.element('#thingsappendedhere').scope(); var element = angular.element('#imnewlyappended'); $injector.invoke(function($compile) { $compile(element)(scope); }); the pro...

Is there a way to increase the stack size in Twincat 3 -

i getting stack overflow problems , can see happens introductions of new arrays. cannot find option increase stack size on soft plc (twincat) running on machine. any appreciated i realise little late, instead of trying increase stack size, can take steps reduce size of stack need. when calling method or function, try passing in reference existing array , using calculation. if intermediate processing isn't returned directly response, dramatically improve stack management. there 2 way manage in twincat. the easy way create var_in_out variable pass in. works well, should not using if block calls variables other methods. other way pass in reference array , using that. this approach work both returned , intermediate processing type issues.

I can see elements on storyboard from one screen on the other one - Objective C -

im begginer in ios development , have problem dont know how solve. elements 1 screen can been seen on other one, example label shown in 1 screen while on other 1 can se small part of element to, looks wrong layout. dont want that, firsty dont know why happening , secondly, of course, dont know how solve problem. if me, great. have nice day!

jquery - Kendo UI grid: radio button and pagination issue -

i have implemented simple kendo ui grid filtering , pagination. have first column radio button each row, , should able select 1 radio button @ time. however, when change page, current selection gets cleared , when come page, find no radio button selected! this html table: <table id="grid"> <colgroup> <col /> <col /> <col /> <col style="width:110px" /> <col style="width:120px" /> <col style="width:130px" /> </colgroup> <thead> <tr> <th data-field="select">select</th> <th data-field="make">car make</th> <th data-field="model">car model</th> <th data-field="year">year</...

django - How to delete the SQLIte3 database tables and accessing database shell in windows cmd? -

i'm working on django rest framework tutorial , i've covered of tutorial. @ end i've encountered 'operational error - no such column: snippets_snippet.owner_id' . tutorial tells delete database using following commnands: rm -f tmp.db db.sqlite3 rm -r snippets/migrations python manage.py makemigrations snippets python manage.py migrate & python manage.py dbshell but not working. i'm working on windows-7 , doesn't interpret first command. i've tried several other ones - 'python manage.py sqlflush' . i'm working built-in sqlite comes django-1.8, how can access sqlite dbshell? necessary install sqlite3 database manually rather built-in 1 access database utilities? please me fix issue.... download sqlite3 windows , execute sqlite3.exe (double click on "icon" enough). can open database: sqlite> .open example.db

sql - How to aggragate integers in postgresql? -

i have query gives list of ids: id 2 3 4 5 6 25 id integer . i want result in array of integers type: id 2,3,4,5,6,25 i wrote query: select string_agg(id::text,',') ..... i have convert text otherwise won't work. string_agg expect (text,text) this works fine thing result should later used in many places expect array of integers. i tried : select ('{' || string_agg(id::text,',') || '}')::integer[] ... which gives: {2,3,4,5,6,25} in type int4 integer[] isn't correct type... need same type array . for example select array[4,5] gives array integer[] in simple words want result of query work (for example): select * b b.id = (first query result) // aka: = (array[2,3,4,5,6,25]) this failing expect array , doesn't work regular integer[], error: error: operator not exist: integer = integer[] note: result of query part of function , saved in variable later work. please don't take places bypass...

css3 - CSS calc() producing an odd result -

this question has answer here: disable less-css overwriting calc() [duplicate] 5 answers less aggressive compilation css3 calc 3 answers i have following css style on fixed header element width: calc(100% - 17px); i'm working inside of sharepoint, , way sharepoint generates scrollbar on side, header element (100% width) appears on top of scrollbar. account this, i'm trying remove 17px scrollbar. however, when page renders, width ends being 83% , i'm not sure why. unfortunately can't give link page in question because it's in our test environment. ideas why producing result of 83%? edit: should mention i'm using less write styles. checked compiled css document, , producing final output of width: 83%. please read post. has workaround . htt...

javascript - Accessing computed values between view models -

i trying include multiple viewmodels on 1 page, don't want tie these specific page ids know you're able want able use each model potentially more once on page , use with binding. i'm trying read value of self.total in vm1 , self.total in vm2 , i'm getting error: cannot write value ko.computed unless specify 'write' option. if wish read current value, don't pass parameters. reading standard vm1.x variables vm2 seem work fine, knockout complains when trying computed value. javascript: var vm1 = function(parent) { var self = this; self.costa = 1000; self.costb = 500; self.total = ko.computed(function(){ return self.costa + self.costb; }); }; var vm2 = function(parent) { var self = this; self.total = ko.observable(parent.vm1.total); }; var masterviewmodel = function() { var self = this; self.vm1 = new vm1(self); self.vm2 = new vm2(self); }; window.masterviewmodel = new masterviewmodel(); ko.applybindings(win...

java - Include NULL values in Json Response -

i see json response null fields. if set defalut value null in json schema, fields not getting displayed. think, null fields getting filtered internally. ex. "streetaddress": { "line1": "2374 water works rd" "line2" : null }, currently if don't set line2 , not getting appeared in response. getting "streetaddress": { "line1": "2374 water works rd" } pom.xml pojo's generated using maven plugin <plugin> <groupid>org.jsonschema2pojo</groupid> <artifactid>jsonschema2pojo-maven-plugin</artifactid> <version>0.4.11</version> <configuration> <sourcedirectory>${basedir}/src/main/resources/schema</sourcedirectory> <targetpackage>com.dnb.daas.matchplus.product.ng.schema.request</targetpackage> <includejsr303annotations>true</incl...

python - How do I use pywintypes.Unicode()? -

how use pywintypes.unicode in python 3.3.5? import pywintypes pywintypes.unicode("s") this produces error: traceback (most recent call last): file "<pyshell#10>", line 1, in <module> pywintypes.unicode("s") typeerror: must impossible<bad format char>, not str i've seen other code uses look same me, wrong here? tl;dr: it's bug affecting python 3, , don't need pywintypes.unicode(text) in python 3. use text directly if need string , bytes(text, encoding) if need them bytes. the error typeerror: must impossible<bad format char>, not str hints @ bad format char in c++ source, t# , impossible (unknown). thanks eryksun 's comments , looking @ documentation pages of pyarg_parsetuple() python 2 , python 3 , becomes clear bug in win32/src/pywintypesmodule.cpp . pywintypes_export pyobject *pywin_newunicode(pyobject *self, pyobject *args) { char *string; int slen; ...

c++ - How to compile static library with -fPIC from boost.python -

by default, libboostpython.a compiled without -fpic . have make python extension , dynamic library -fpic links static libraries. how can compile static library ( libboostpython.a ) -fpic boost.python ? there couple options use: compile boost source , pass compiler options bjam. e.g. bjam ... cxxflags='-fpic' . compile every boost source file position independent code. use boost in form of shared libraries. in case want ship boost shared libraries along application make sure appropriate version of boost used. can link executable '-wl,-rpath,$origin' flag, when dynamic linker searches shared libraries required executable looks them in directory executable is. see man ld.so more details on $origin .

Crm 2015 custom action not fired plug in -

i new in crm dynamics 2015. try create custom action. in firs step create action in "process" in crm interface. after create project in visual studio class library.i implement ipugin interface. registrated plug in on "message" called custom action name in "process". when try use it don't work. run plug in in debug mode check if plug called not renjith answered correctly. should use codeactivity not iplugin interface derived class. here libraries might out: https://msdn.microsoft.com/en-us/library/gg328515.aspx https://msdn.microsoft.com/en-us/library/dn481600.aspx

c# - Apply bold font to two consecutive rows in a datagridview -

i have 2 consecutive rows in datagridview, both of need bold. have changed text colour lower row red follows. although can't seem find similar bold function. cashbookrowsmarchtotals.rows[1].defaultcellstyle.forecolor = color.red; i made 2 rows bold using following code, wondering if possible apply bold (or other styles) multiple rows/columns @ time? cashbookrowsmarchtotals.rows[0].defaultcellstyle.font = new font(cashbookrowsmarchtotals.font, fontstyle.bold); cashbookrowsmarchtotals.rows[1].defaultcellstyle.font = new font(cashbookrowsmarchtotals.font, fontstyle.bold);

php - Change a highchart x axis Label -

is possible change x axis labels of highchart include thousand separator in dot form? my x axis has following values 10000,20000,30000 need convert 10.000,20.000,30.000 this have: $graph_ep->yaxislabelformat="{value}"; i need change value shown thousand separator. don't know how manipulate value. first set thousandssep , this: highcharts.setoptions({ lang: { thousandssep: "." } }); now, update format: format: '{value:,.0f}' working demo: http://jsfiddle.net/4bvhm97j/ more formatting strings in highcharts in docs .

Android: I click on the button to play the sound -

i'm creating piano app got problem when click on button play many times can't hear sound when click on button again. after click on button many times sounds not heard how solve problem? public class music_piano extends activity { button btn_s_ddo,btn_s_re,btn_s_mi,btn_s_fa,btn_s_so,btn_s_la,btn_s_si,btn_ldo; mediaplayer mp = new mediaplayer(); mediaplayer mp1,mp2; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); requestwindowfeature(window.feature_no_title); getwindow().setflags(windowmanager.layoutparams.flag_fullscreen, windowmanager.layoutparams.flag_fullscreen); setcontentview(r.layout.activity_music_piano); } public void btn_sound_ddo(view v){ mp = mediaplayer.create(this, r.raw.ddo); mp.start(); } public void btn_sound_re(view v){ mp = mediaplayer.create(this, r.raw.re); mp.start(); } public void btn_sound_mi(view v){ mp = mediaplayer.create(this, r.raw.mi); ...

performance - Python Coding Style Dilemma -

there several known python code style rules, considered default , try adhere: wrap lines don’t exceed 79 characters. keep indents 4 spaces long. another common programming advice is avoid global variables in other words, 1 should use functions accept variables parameters , avoid pascal-like procedures read directly higher scope. however, in cases, 1 should break of these rules. example, if functions long parameters lists involved. there 2 separate issues them: first, in heavily indented blocks there little room left. def function(variable1, variable2, variable3, variable4, variable5,\ variable6, variable7, variable8, variable9): return variable1 + variable2 + variable3 + variable4 + variable5 +\ variable6 + variable7 + variable8 + variable9 def... variable1... if variable 2... while variable3... if variable4... variable5... ... ...

bash - Zero a column in a csv file with awk while skipping the header -

i 0 1 column of csv file. let's assume csv file looks this: col1|col2|col3 v | 54| t | 25| f d | 53| f s | 04| t using awk way, gives me want command: awk -f'|' -v ofs='|' '$2=0.0;7' input.csv > output.csv the result col1|0|col3 v |0| t |0| f d |0| f s |0| t but notice column header has been zeroed trying avoid. tried skip first line awk command getting empty file awk -f'|' -v ofs='|' 'nr<1 {exit} {$5=0.0;7}' input.csv > output.csv what missing? just apply rule 2nd line on nr>1 {} : $ awk -f'|' -v ofs='|' 'nr>1{$2=0.0}7' file col1|col2|col3 v |0| t |0| f d |0| f s |0| t why wasn't approach awk -f'|' -v ofs='|' 'nr<1 {exit} {$5=0.0;7}' working? the expression nr<1{exit} never true because nr @ least 1. this means second expression {$5=0.0;7} evaluated. $5=0.0 fine, 7 not printing want to...

android - Does Parse.com API's allow identifying a particular customer? -

how can use parse.com android api's identify particular user ? flurry allows using flurryagent.setuserid , crittercism allows using crittercism.setusername( . parse. have ? possible solution work ? parse.initialize(this, "asdfasdfs", "asdfasd"); parseinstallation.getcurrentinstallation().saveinbackground(); parseinstallation.create(identity == null ? "no identity set" : identity); parse has default user class has 2 unique fields: objectid , username . (the user class has fields such email , password out of box). you can use either objectid or username query specific user. parseinstallation class stores installation details of app user. there installation object per device. used push notifications , managing sessions or can use device specific tasks (again, messages). the installation object created when user created/ signed device. since subclass of parseobject (or pfobject on ios), can store own fields of da...

Get the number of levels of a categorical variable as a single number in Stata -

i trying find way number of levels of categorical variable single number. example if have variable x 4 levels need somehow number. if type levelsof x following 1 2 3 4 can't number 4 there. there way using levelsof or command? various commands give number of distinct values, kind of variable. ("categorical variable" statistical concept, rather stata concept.) perhaps simplest way one-off purposes ask one-way tabulation using tabulate . number of distinct values number of rows in table, returned r(r) . note (1) can suppress table (which useful in program or file) , (2) missing values excluded default: . sysuse auto, clear (1978 automobile data) . qui tab foreign . ret li scalars: r(n) = 74 r(r) = 2 . qui tab rep78 . ret li scalars: r(n) = 69 r(r) = 5 . qui tab rep78, missing . ret li scalars: r(n) = 74 r(r) = 6 an extended review ...

asp.net mvc 5 - View Class Library // Razor Intellisense -

i want create usable view class library, including views using razor. have troubles implement razor intellisense in views. i have done lot of research find solution, including blog : http://blogs.msdn.com/b/webdev/archive/2011/01/20/how-to-get-razor-intellisense-for-model-in-a-class-library-project.aspx , related post: razor in class library, missing intellisense , nothing worked far. the last thing tried adding web.config file in view class library, did not enable razor intellisense. web.config: <?xml version="1.0"?> <configuration> <configsections> <sectiongroup name="system.web.webpages.razor" type="system.web.webpages.razor.configuration.razorwebsectiongroup, system.web.webpages.razor, version=3.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35"> <section name="host" type="system.web.webpages.razor.configuration.hostsection, system.web.webpages.razor, version=3.0.0.0, culture=ne...

How get JSON as response in jax-rs jersey web service? -

package com.webservice.rest.jaxb; import javax.xml.bind.annotation.xmlrootelement; @xmlrootelement(name="employee") public class employee { string name; string id; string location; float salary; public string getname() { return name; } public void setname(string name) { this.name = name; } public string getid() { return id; } public void setid(string id) { this.id = id; } public string getlocation() { return location; } public void setlocation(string location) { this.location = location; } public float getsalary() { return salary; } public void setsalary(float salary) { this.salary = salary; } @override public string tostring() { return "name [id=" + id + ", location=" + location + ", salary=" + salary + "]"; } } here employeewebservice...

localization - What are most actual locale & language ISO standards nowdays? -

can't iso standards actual nowadays locales , languages. can find such info? i want standardize languages , locales in project. i found 639 standard languages, it said obsolete . should use 639-1 then? should use iso 3166-2 country codes then, make locales myself? iso 639 way go language codes: 'superset' of standards language codes different lengths. two-letter language codes, example, can found in iso 639-1. have decide if iso 639-1 covers languages need or not: if not, switch iso 639-2 or 639-3 (although iso 639-3 not cover languages in world yet). the 'obsolete' info saw refers list kept on w3c website: language codes change time time. see this question more detailed answer - although not agree details given there. to build locale combine language , country code (from iso 3166), suggested. 2 letter codes more common 3 letter codes: use them if support locales need.

c++ - Finding a pointer in a list -

i'd find element in list containing pointers. this question quite similar find item in list of pointers , tried in different way , seems working. in linked question people suggested using find_if, lambdas , thing this. isn't enough pass sought pointer std::find? miss out something? here's code used testing, , seems working. run different parameters , got expected results. typedef struct _c { int num; int name; } c; int main(void) { c *new_c = new c(); new_c->num = 2; new_c->name = 1; c *new_b = new c(); new_b->num = 3; new_b->name = 32; c *new_d = new c(); new_d->num = 1; new_d->num = 11; std::list<c *> list; list.push_front(new_b); list.push_front(new_c); std::list<c *>::iterator del_new = std::find(list.begin(), list.end(), new_c); if(del_new != list.end()) std::cout << "found" << std::endl; else std::cout <...

algorithm - Is there a significantly better way to find the most common word in a list (Python only) -

considering trivial implementation of problem, looking faster way find common word in python list. part of python interview received feedback implementation inefficient, failure. later, tried many algorithms found, , heapsearch based solutions bit faster, not overwhelmingly (when scaled tens of millions of items, heapsearch 30% faster; on trivial lengths thousand, same; using timeit). def stupid(words): freqs = {} w in words: freqs[w] = freqs.get(w, 0) + 1 return max(freqs, key=freqs.get) as simple problem , have experience (although algorithms guru or competitive coder) surprised. of course, improve skills , learn better way of solving problem, input appreciated. clarification duplicate status: point find out if there (asymptotically) better solution , other similar questions have picked answer not better. if not enough make question unique, close question, of course. update thank input. regarding interview situation, remain impression hand written ...

Mysql: Update table with count from same table -

i have table like: `url` varchar(255) not null, `cnturl` int(11) default null, 'url' contains urls. in 'cnturl' want store how many times same url inside table (yes, it's redundant, i'm doing speed reasons). so update these values need like: update urltable set cnturl=( select count(t.id) urltable t t.url=urltable.url ); but gives me error: can't specify target table 'urltable ' update in clause i tried well: update urltable inner join ( select count(*) cnt, url urltable ) t on t.url=urltable.url set urltable.cnturl = t.cnt; but gives wrong results (some counts null while others count of records). i tried well: update urltable set cnturl = (select t.cnt (select count(t.id) cnt, url urltable) t t.url=urltable.url) but gives same wrong results (some counts null while others count of records). i guess should more this: update urltable inner join ( select count(*) cnt, url urltable t ...

drop down menu - find all `option select` jquery -

$('#divid').find('input[type=text]'); if above statement find input text. how find select option in same div. you need use option tagname selector: $('#divid').find('option'); or $('#divid option');

microcontroller - SPI not working properly with high micocontroller speed -

i interfacing spi based sensors msp430 micro controller. problem : the micro controller operating @ 20mhz , spi clock 1 mhz. when reducing speed of micro around <4 mhz interface working fine, when increase , junk data spi slave. what precautions need take handle these kind of problems., on msp430, 1 uses usci peripheral in spi mode run interface. peripheral allows selecting source of clock generated spi master controlling divide down of clock match clock rate accepted spi slave. check out ucsselx bits in ucaxctl1 register. depending upon clock source selected, may need prescale generated clock using usci_ax bit rate control registers. sounds question running spi on smclk no prescaling. explain why reducing cpu frequency makes spi peripheral work. better off system point of view keeping smclk @ high frequency , prescaling spi master clock match limits of attached peripheral. deciding how clocks used system issue. need consider source of clocks, i.e. aclk or smclk...

php - Zend2 routes constraints like enum -

i want have enum constraint on variable passed of project's route e.g. variable routevar can optin or optout so lets want have url http://subdomain.exampledomain.com/route/ can 1 of 2 following forms http://subdomain.exampledomain.com/route/ optin http://subdomain.exampledomain.com/route/ optout the route configuration i've put shown bellow , have tried both [optin|optout] , [optin|optout]+ regexes no luck 'route-name' => [ 'type' => 'segment', 'options' => [ 'route' => '/route/:routevar', 'constraints' => [ 'routevar' => '[optin|optout]', ], 'defaults' => [ 'controller' => somecontroller::class, 'action' => 'someaction', ], ], 'may_terminate' => true, ], please note: child route , works fine address expected controller , act...

asp.net mvc - Dialog Jquery not working -

index.cshtml code <link href="~/content/jquery-ui.css" rel="stylesheet" type="text/css" /> <script src="~/scripts/jquery-1.10.2.js" type="text/javascript"></script> <script src="~/scripts/jquery-ui.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function () { $("#finestra").dialog({ autoopen: false }); }); </script> <div> <p> jquery dialog test </p> <div id="finestra" title="test"> <div>content</div> </div> </div> i getting 0x800a01b6 - javascript runtime error: object doesn't support property or method 'dialog' error . have added jquery 1.11.4 reference. checked other similiar questions not find problem causing. public static void registerbundles(bundlecollection bundles)...

python - How Does One Handle Identical Method Names when Using Literate Programming? -

i use literate programming tool write python program. tool of choice noweb. ide emacs. the problem have have classes identical method names. example, python program implements web service clients several web service servers, each of has search service. @ first glance code follows: class wsca: def search(self, client, searchinput): pass class wscb: def search(self, client, searchinput): pass the results of weaving show search defined twice, , not possible see in code wsca.search() called , wscb.search() called. to solve this, 1 option can think of give methods unique names, not see acceptable solution. does have solution problem?

css - Text center ul pagination in div wordpress -

i've been trying center content contains ul pagination. margin-left , margin0right center div, text-align: center won't center content inside. here's code: css /* pagenation */ .article .pagelinks { text-align: center !important; display: table; margin-left: auto; margin-right: auto; width: 240px; position: relative; overflow: hidden; padding: 0; clear: both; } .article .pagelinks ul { list-style:none; text-align: center; margin: auto; padding: 0; } .article .page-numbers li {display:inline;} .article .page-numbers li {display:block; float:left; padding:4px 9px; margin-right:7px; color: #911d23;} .article .page-numbers li span.current {display:block; float:left; padding:4px 9px; margin-right:7px; background-color: #fff; color: #911d23;} and here's link web page in question: http://disa.com.sv/constructora/?page_id=10&paged=2 . how text-align center or center things? try : .article .page-numbers li{display:inline-block}

java - JPA Audit entity direct query -

i query audit entity in jpa environment. at first auditquery , works well, need more advance query witch can't auditquery . now need like this.em.createquery("from entity_aud").getresultlist(); but error : querysyntaxexception: entity_aud not mapped [entity_aud] i understand due don't have entity properties, don't want have entity because audit entity. is there way around it? me ok list of object. you can create native sql query in jpa. replace createquery createnativequery in code: list<object[]> list = this.em.createnativequery("select * entity_aud").getresultlist();

asp.net web api - Hangfire, Autofac and WebApi -

i learned hangfire had no luck far. project uses autofac i've added hangfire.1.4.3 & hangfire.autofac.1.1.0 nuget packages project. followed documentation i've created startup class , registered hangfire there public void configuration(iappbuilder app) { globalconfiguration.configuration .usesqlserverstorage("navigatorconnectionstring"); app.usehangfiredashboard(); app.usehangfireserver(); } after i've updated webapiconfig , registered autofac container in hangfire private static void registerdependencies(httpconfiguration config) { var builder = new containerbuilder(); ... var container = builder.build(); ... config.dependencyresolver = new autofacwebapidependencyresolver(container); hangfire.globalconfiguration.configuration.useautofacactivator(container); } when try run hangfire job like iobject someobject = myobject(); var jobid = backgroundjob.enqueue<imyinterface...

How to resize the image on label widget -

currently, use label widget -image option display image on tk gui following : image create photo plot1 -file new.gif label .la1 -image plot1 -background white it works well. want make image resize user drags gui. for other tk widget, columnconfigure , rowconfigure can realize resize function. how image on label?

c# - Reading file's content and assigning it List <String> -

what trying achieve: want read text file , store in list of strings. use second list of string save if found using regex i dont know how tackle problem have done far. using (streamreader content = new streamreader(@file_to_read)) { list <string> newline = new list <string> (); string line; while (line = content.readline()) != null) //add line list newline.add(line); } lets there text called 'causes' in of lines.what want iterate through list or lines whatever easy , store line in new list. you can filter list this list<string> newlist = newline.where(x => x.contains("your string match")).tolist();

c# - Get sum of ListView column when datapager is used -

i have listview more 6000 rows. using datapager show 100 columns in page. want total of amount column in textbox. subscribed databound event , calculating total there. but, it's giving me total per page. how can total of rows. protected void filterlistview_databound(object sender, eventargs e) { double curtotal = 0; foreach (listviewitem lit in filterlistview.items) { if (lit.itemtype == listviewitemtype.dataitem) { linkbutton lbtotam = (linkbutton)lit.findcontrol("linkbutton22"); if (lbtotam != null) { double curamt = 0; if (!double.tryparse(lbtotam.text, out curamt)) curamt = 0; curtotal += curamt; } } } filtertotalamt.text = curtotal.tostring("n2"); } you can sub item list view , calculate count example shown below. decimal gtotal = 0;...

eclipse - Latest version of cucumber-java and cucumber-junit does not work -

i using cucumber-jvm , selenium webdriver together. have maven project in eclipse , dependency of pom.xml file below: <dependency> <groupid>info.cukes</groupid> <artifactid>cucumber-java</artifactid> <version>1.2.2</version> <scope>test</scope> </dependency> <dependency> <groupid>info.cukes</groupid> <artifactid>cucumber-junit</artifactid> <version>1.2.2</version> <scope>test</scope> </dependency> the content of runcukestest.java file is: import org.junit.runner.runwith; import cucumber.junit.cucumber; @runwith(cucumber.class) @cucumber.options(format = {"pretty", "html:target/cucumber-htmlreport","json-pretty:target/cucumber-report.json"}) public class runcukestest { } i getting error in following lines of code: import cucumber.junit.cucumber; @runwith(cucumber.class) @cucumber.options(format...

php - get google account image using google api -

Image
at first time,i'm trying google account profile picture using google api. have referred refer site. so in google-plus-access.php: <?php require_once 'google-api-php-client-master/src/google/autoload.php'; // or wherever autoload.php located session_start(); $client = new google_client(); $client->setapplicationname("google+ php starter application"); $client->setclientid('my_client_id'); $client->setclientsecret('my_secret_key'); $client->setredirecturi('http://localhost/g-api'); $client->setdeveloperkey('my_dev_key'); $client->setscopes(array('https://www.googleapis.com/auth/plus.me')); //$plus = new apiplusservice($client); $plus = $client -> createauthurl(); if(isset($_request['logout'])) { unset($_session['access_token']); } if(isset($_get['code'])) { echo $_get['code'];...

mysql - selecting one item with two conditions and retrieving in vb.net -

i want retrieve 2 items selected , put in label. here's code. lcommand .connection = connection .commandtext = "select pass officememberprofile usern = 'csprofile1' or usern = 'csprofile2'" lreader = .executereader end lreader while .read label4.text = .item(0) label5.text = .item(1) end while end -expected result: label4.text should contain cspass1 , label5.text should contain cspass2, the end result wrong. retrieving first item. can show me how use while loop , retrieve 2 items in respective labels. thank you each time while runs, gets row of result. result has 1 column. can store in stack , extract them labels with lcommand .connection = connection .commandtext = "select pass officememberprofile usern = 'csprofile1' or usern = 'csprofile2'" lreader = .executereader end dim ...

How to parse json in javascript having dynamic key value pair? -

this question has answer here: how enumerate properties of javascript object? [duplicate] 14 answers i want parse json string in javascript. response like var response = '{"1":10,"2":10}'; how can each key , value json ? i doing - var obj = $.parsejson(responsedata); console.log(obj.count); but getting undefined obj.count . to access each key-value pair of object, can use object.keys obtain array of keys can use them access value [ ] operator. please see sample code below: object.keys(obj).foreach(function(key){ var value = obj[key]; console.log(key + ':' + value); }); output: 1 : 10 2 : 20 objects.keys returns array of keys in object. in case, ['1','2'] . can therefore use .length obtain number of keys. object.keys(obj).length;

android - How do I use a FilteredFilePickerFragment for NoNonsense-FilePicker? -

i've create file picker enable me select files of specific types such "pdf", "ppt", "odt" , more. created filteredfilepickerfragment given here . need use fragment don't know how. here intent in mainactivity: intent = new intent(intent.action_get_content); // set these depending on use case. these defaults. i.putextra(filepickeractivity.extra_allow_multiple, false); i.putextra(filepickeractivity.extra_allow_create_dir, false); i.putextra(filepickeractivity.extra_mode, filepickeractivity.mode_file); // configure initial directory specifying string. // specify string "/storage/emulated/0/", can // dangerous. use android's api calls paths sd-card or // internal memory. i.putextra(filepickeractivity.extra_start_path, environment.getexternalstoragedirectory().getpath()); startactivityforresult(i, file_code); and here filtered fragment import android.support.annotation.nonnull; imp...

html5 - How to merge audio and video file in android -

thanks great mp4parser lib, have few queries related audio video muxing. we used below code in android , tried, not getting expected output, have kept working mp4 file in specific directory , trying no luck. here merged audio , video, audio gets appended video. , appended audio not play increases width of video. any geeks. here code, file sdcard = environment.getdatadirectory(); string videofilepath = environment.getexternalstoragedirectory().tostring()+"/video.mp4"; string audiofilepath = environment.getexternalstoragedirectory().tostring()+"/audio.aac"; file file=new file(videofilepath); h264trackimpl h264track = new h264trackimpl(new filedatasourceimpl(videofilepath)); aactrackimpl aactrack = new aactrackimpl(new filedatasourceimpl(audiofilepath)); movie movie = new movie(); movie.addtrack(h264track); movie.addtrack(aactrack); container mp4file = new defaultmp4builder().build(movie); filechannel fc ...

sql - ORA-00907: missing right parenthesis 00907. 00000 - "missing right parenthesis" *Cause: *Action: Error at Line: 44 Column: 30 -

i executing following query: select * (select * (select distinct r.llobjid dataid, r.drawingid, r.revisionid, r.revisionnumber revision_number, r.revisionlabel, r.minorrevisionlabel, r.revisiontype, p.project project, r.revisionstatus, r.r1i signin_requestor, r.r2i seedfileversion, rt.display_type_name revision_type, rt.can_signin, rs.display_status_name revision_status, a.adntypeid, at.name adn_type, a.requestby, ...

php - Symfony2 and Doctrine findOneById() without loading the associated entities? -

is possible entity without loading associated entities using findonebyid() ? in cases such checking entity exists or not, don't need load of associated entities, example, $entity = $em->getrepository('estatebundle:myentity')->findonebyid($id); if (!$entity) { throw $this->createnotfoundexception('unable find entity.'); } otherwise, think lead performance issue. in cakephp, possible using option recursive . i'm looking such kind of option in symfony , doctrine. think common question, can't find documentation this. edit: removed getreference possibility, no solution question. second possibility change entity fetch="extra_lazy" doctrine lazy in general: assoiciated entity selected lazy default, means gets loaded, when first accessing it. maybe problem not relevant in first place? sure use development mode of symfony. there have option see, database queries executed. edit: can use getrepository("bundle:entit...

control structure - Understanding PHP declare() and ticks -

today looking through php manual , stumbled upon control structure declare . the declare construct used set execution directives block of code this declare supposed do. honest didn't understood it. on reading again found new thing ticks a tick event occurs every n low-level tickable statements executed parser within declare block. value n specified using ticks=n within declare block's directive section. i didn't understand either. mean n low-level tickable statements if there had been sample code, have been easy understand. none found in manual. have found on q1 , increased curiosity , confusion. can , can use this. my actual confusion statement (from linked post) you can declare tick-function checks each n executions of script whether connection still alive or not . when register tick function tick = 20 on php file , execute it, file alive till 20 execution complete(got idea when wrongly considered multithreaded). idea have got, dont th...