Posts

Showing posts from April, 2012

regex - How to make the regexp ignore a new line in python? -

i use regex that return(\s+([^"\n;]+))?; in order match return statement in obj-c,but when use through python this: re.sub(r'return(\s+([^"\n;]+))?;',r'{\g<0>}',str(content)) i find match statement //please {return [self funca];} and make code error.how can deal ? i think issue regex has \s matches whitespace. you might want match literal spaces or tabs [ \t] : r'return([ \t]+([^"\n;]+))?;' ( demo ) or - better: r'return[ \t]+[^"\n;]*;' see the regex demo

html - Angularjs - How to 'ng-repeat' a div for full Items -

using angularjs, want create repeat shopping cart items in . . json [{"src": "img/t1.jpg", "itemname": "solid green cotton tshirt", "style": "ms13kt1906", "colour": "blue", "size": "s", "qty": "1", "price": "11.00"}, {"src": "img/t2.jpg", "itemname": "cotton tshirt", "style": "ms13kt1906", "colour": "green", "size": "s", "qty": "1", "price": "11.00"} ] and controller js following .. app.controller('itemcontroller', function($scope, data) { data.list(function(data) { $scope.items = data; }) }); factory following .. .. app.factory('data', function($http){ return { list: function(callback) { $http.get('data.json').success(callback); } }; }); app.js following .. .

javascript - Getting Json element value from the Element ID -

have question while learning javascript , javascript fm. understand how possible access to { element: 1 }, { element: 2},... because inside detailed information array. and next step, need make json format executes like [{name: "myname", surname: "mysurname"}, {name: "myname", surname: "mysurname"}] and need of the { element:1}, {element:2}, .... i'm using nightwatch.js , code right looks : .elements('css selector', 'ul li', function(res){ console.log(res.value) console.log(res.value[1].element) browser.elementidattribute(res.value[1].element, 'li', function(newres) { console.log(newres.value) }) }) this executes [ { element: '1' }, { element: '2' }, { element: '3' }, { element: '4' } ] 2 null here html: <html> <meta charset="utf-8"> <body> <ul class="random"> <li class="

ibeacon - Send eddystone uid frame with hcitool -

i want send eddystone uid frames ibeacons frames , if understand correctly can both hcitool . able send frame using ibeacon debian , displays how send eddystone standard. there conversion chart convert tx power ibeacon (distance 1m) or eddystone(in 0m) other standard? hcitool -i hci0 cmd 0x08 0x0008 1e 02 01 1a 1a ff 4c 00 02 15 e2 c5 6d b5 df fb 48 d2 b0 60 d0 f5 a7 10 96 e0 12 34 00 01 66 00 do understand correctly catching frame in ios or android different each standard? try using transmit eddystone-uid: hcitool -i hci0 cmd 0x08 0x0008 1e 02 01 06 03 03 aa fe 15 16 aa fe 00 e7 00 01 02 03 04 05 06 07 08 09 01 02 03 04 05 06 caveat emptor: have not tested above. let me know if works! if goes well, above send: a 10-byte namespace identifier of 00010203040506070809 a 6-byte instance identifier of 010203040506 a 0 meter tx power level of e7 (-25 dbm). to convert 0 meter tx power level eddystone (e.g. -25 dbm) 1 meter tx poser level ibeacon , altbeacon,

python - Possible bug with `xarray.Dataset.groupby()`? -

i'm using xarray version 0.8.0, python 3.5.1, on mac os x el capitan 10.11.6. the following code works expected. id_data_array = xarray.dataarray([280, 306, 280], coords={"index": range(3)}) random = numpy.random.rand(3) score_data_array = xarray.dataarray(random, coords={"index": range(3)}) score_dataset = xarray.dataset({"id": id_data_array, "score": score_data_array}) print(score_dataset) print("======") print(score_dataset.groupby("id").count()) output: <xarray.dataset> dimensions: (index: 3) coordinates: * index (index) int64 0 1 2 data variables: id (index) int64 280 306 280 score (index) float64 0.8358 0.7536 0.9495 ====== <xarray.dataset> dimensions: (id: 2) coordinates: * id (id) int64 280 306 data variables: score (id) int64 2 1 in [ ]: however, if change 1 little thing, make elements of id_data_array distinct, there error. code: id_data_array

angularjs - How to create dynamic url in Angular Js -

right when hit below url , angularproj.localhost.com it open login page , above url changed angularproj.localhost.com/#/login . admin login now per project requirement , have multiple customers , have logins. so need create seperate urls them. say first customer c1.so url angularproj.localhost.com/c1. and when hit angularproj.localhost.com/c1 in browser should open c1 customer login page. i have tried below no luck. $stateprovider .state('/:customer', { url: "/", templateurl: "app/views/login/customer/login.html", data: { pagetitle: 'example view' } }) trying way. should work. var app = angular.module('tutorialwebapp', [ ' ngroute' ]); /** * configure routes */ app.config(['$routeprovider', function ($routeprovider) { $routeprovider // home .when("/", {templateurl: "partials/home.html", controller: "pagectr

css - How can i add effect hover on span in <a> -

Image
how can add background <span> when mouse hover <span> or <a> . <a href="" class="special"><span class="fa fa-facebook"></span> facebook</a> css selecting elements. here want select span when parent <a> tag hovered. use a:hover > span . #activation:hover > #activated { color:red; } <a id="activation" href="" class="special"> <span id="activated" class="fa fa-facebook">?</span> <span>facebook</span> </a>

emulation - Android Studio emulator can neither install app nor delete it. -

Image
i have problem particular app in android studio. when wanted run app gave error: failure [install_failed_no_matching_abis] , asked this: i clicked ok button uninstall gave error: delete_failed_internal_error error while installing apk i can not uninstall app manually emulator. settings -> app -> in emulator not show application in application list. how can erase app or how can make work on emulator.

python - Patterns for creating and updating related models in django -

assuming have 2 models : class photoalbum(models.model): name = models.charfield(max_length=255) class photo(models.model): album = models.foreignkey(to=photoalbum) photo = models.imagefield(upload_to=".") i wish give user form, on provide "name" of album, , have logic how create album photos given name. assumed need create additional service here: class photoalbumservice: def __init__(self, album): self._album = album self._photos = list(self._album.photo_set.all()) def create(self): # creation logic here # common function creation , updating def update(self): # updating logic here # again common function creation , updating # additional unique logic updating def _update_only_method(self): # called on update def _common_logic(self): # common logic both create , update and in views.py im doing creation: albumservice(album(name="user_provid

Elasticsearch - Dynamic mappings are not available on the node that holds the primary yet -

we have rails application using official elasticsearch gem connect elasticsearch. i did deploy added 1 field (number) index (by editing model + adding as_indexed_json) , query field in search. a few minutes after deploy load spiked hard on 1 of 3 servers in our elasticsearch cluster. , errors starting spamming in our log: dynamic mappings not available on node holds primary yet. searches started very, slow, , cluster failed entirely. we had force restart cluster, , remove code added field/search, , things started work fine. we did not put update mappings index, waiting first model index this. any ideas/pointers appreciated.

python - Using py2neo v3 with google app engine -

i'm trying set backend using py2neo on google app engine. works fine when pushed on dev on app engine, however, unfortunately, doesn't work when use on localhost. first, i've setted home environment variable in python (thanks tip, code works on dev) doesn't fix localhost problem then, i've followed advice "importerror: no module named _ssl" dev_appserver.py google app engine prevents 1 exception rises after. here traceback ft1.1: traceback (most recent call last): file "/users/arnaud/documents/project/app/test/neo4j/test_graph_handler.py", line 13, in test_get_direct_neighbours selection = self.graph_handler.get_direct_neighbours("8") file "/users/arnaud/documents/project/app/neo4j/graph_handler.py", line 20, in get_direct_neighbours labels(l) `relationship`" % self.protect(ean)) file "/users/arnaud/documents/project/app/libs/py2neo/database/__init__.py", line 694, in run retur

python - How to fill matplotlib bars with a gradient? -

Image
i interested in filling matplotlib/seaborn bars of barplot different gradients done here (not matplotlib far understood): i have checked related topic pyplot: vertical gradient fill under curve? . is possible via gr-framework: or there alternative strategies? i using seaborn barplot palette option. imagine have simple dataframe like: df = pd.dataframe({'a':[1,2,3,4,5], 'b':[10,5,2,4,5]}) using seaborn: sns.barplot(df['a'], df['b'], palette='blues_d') you can obtain like: then can play palette option , colormap adding gradient according data like: sns.barplot(df['a'], df['b'], palette=cm.blues(df['b']*10) obtaining: hope helps.

ios - How can i replace a IBOutlet uiview programmatically with a custom view in swift -

it has replacementview uiview in storyboard @iboutlet var replacementview: uiview! connected. i want replace replacementview with replacementview = secondviewcontroller().view but doesn't work. problem? replacementview reference. have change object in view stack. you should keep reference replacementview 's parent. next remove replacementview parentview , add secondviewcontroller().view parentview. i suggest try add secondviewcontroller().view replacementview , add fill constraints. you should remember retain secondviewcontroller, otherwise dealocated before appear. read addchildviewcontroller(childcontroller: uiviewcontroller) uiviewcontroller method.

c# - Null reference exception after POST -

this question has answer here: what nullreferenceexception, , how fix it? 33 answers i have form, gets values model. then, in post data user entered handled , user redirected page. everytime post form, null-reference exeption. make mistake? none of other questions asking didn´t solve problem, that´s why asking again specific code. the exeptions @ foreach loops - model.cart, model.shippingoptionsm etc. @model checkoutviewmodel @{ viewbag.title = "checkout"; layout = "~/views/shared/_layout.cshtml"; } <h2>checkout</h2> <table class="table"> <thead> <tr> <td>#</td> <td>name</td> <td>quantity</td> <td>price</td> <td>total price</td> </tr> </thead>

spring - Forward JSON POST request from one REST API to another -

i have following situation: my rest api one: @restcontroller @requestmapping("/controller1") public class controller1{ @requestmapping(method = requestmethod.post) public void process(@requestbody string jsonstring) throws interruptedexception, executionexception { ............ } } json post request, request1, rest api(controller1): { "key1":"value1", "key2":"value2" } my rest api two: @restcontroller @requestmapping("/controller2") public class controller2{ @requestmapping(method = requestmethod.post) public void process(@requestbody string jsonstring) throws interruptedexception, executionexception { ............ } } json request, request2, rest api(controller2): { "key1":"value1", "key2":"value2", "key3":"value3" } i have several such "primitive" requests. now, expecting json

php - Redirecting links hiding the link name -

i have 2 links. for example - when person clicks on button "click here" - should show www.google.com on link bar, should redirect "www.yahoo.com" , person should not able see "www.yahoo.com". yahoo , google used example. how can that? this ridiculously easy guess cannot hackers big secret. <a href="http://www.google.com" style="text-decoration:underline" onclick="location.href='http://yahoo.com';return false;">click here lured fake banking site</a> although require javascript active on browser

c# - Disable removal of ASPX extension -

i created c# application in visual studio hosted on iis 7.5. accessing application's aspx files directly results automatic removal of extension (the pages rendered correctly). for example, when accessing following url: http://www.example.com/contact.aspx the following url returned server: http://www.example.com/contact i configure application accessing aspx file extension result returned url containing extension. there no <rewrite> tag in web.config. global.asax content: <%@ application language="c#" %> <%@ import namespace="website2" %> <%@ import namespace="system.web.optimization" %> <%@ import namespace="system.web.routing" %> <script runat="server"> void application_start(object sender, eventargs e) { routeconfig.registerroutes(routetable.routes); bundleconfig.registerbundles(bundletable.bundles); } </script> routeconfig.cs content: us

Why are the PHP generated Bootstrap tableheading and columns misaligned? -

Image
here's output: php if ($stmt->rowcount() > 0) { $table = '<div class="table-responsive"><table class="table table-stripped"> <thead> <tr> <th>name</th> <th>title</th> <th>work type</th> <th>genre</th> <th>pdf</th> <th class="fa fa-envelope-o" style="font-size: larger; color: blue; position: relative; padding-right: 24px; " title="send writer email"></th> <th class="fa fa-thumbs-o-up" style="font-size: larger; color: green;" title="request manuscript"></th> <th>rating</th> </tr></thead><tbody>'; foreach ($rows $row) {

json - Get checked items id from custom listview and pass them to new activity android -

i'm developing android app has custom listview checkbox. want pass checked items 1 activity another. how should pass them? , should manage checkbox (to checked items) in custom adapter or activity? note: retrieve data server using json response. here's model : public class groups { public string name; public boolean selected= false; public string getname() { return name; } public void setname(string name) { this.name = name; } public boolean isselected() { return selected; } public void setselected(boolean selected) { this.selected = selected; } public groups() { } } my adapter: public class adaptermainactivity extends baseadapter{ activity activity; private layoutinflater inflater; list<groups> groupslist; public adaptermainactivity(activity activity, list<groups> groupses) { this.activity =

jackson - Post Tracking number in bigcommerce -

i using jackson api converting java json , vice-versa. in bigcommerce there api creating shipment https://developer.bigcommerce.com/api/stores/v2/orders/shipments#create-a-shipment have order_id user. how create shipment using pojo? here code started. public class shipment { @jsonproperty("id") public long id; @jsonproperty("order_id") public long orderid; @jsonproperty("date_created") public string datecreated; @jsonproperty("customer_id") public long customerid; @jsonproperty("billing_address") public address billingaddress; @jsonproperty("shipping_address") public address shippingaddress; } public class address { @jsonproperty("zip") public string zip; @jsonproperty("city") public string city; @jsonproperty("email") public string email; @jsonproperty("phone") public string phone;

dynamic - Dynamically change text values from an input box -

Image
i have text. want able change parts of text using input box. save time won't have ctrl+f , change values manually. i created power point file start. want make simple change script values/attributes (e.g. background color etc) input box shown below : is feature possible on power point? presentation contain html/css scripts user can copy , use on specific platform. want change script values dynamically using text box on side. the reason created ppt file because sites codepen.io not have feature. the alternative create website have input box on left , text on right. i on website using code : <span id="myspan"></span> document.getelementbyid("myspan").innerhtml="value"; but want value come input box. it great if find website or create : i tried find solution. managed create : link so, there parts in html , css code (that included in blockquote) can change through input boxes on top. user can enter text , clic

Error while running Eclipse,Java started but returned exit code=13 -

while running eclipse, found below error :- java started returned exit code=13 below details -startup plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar --launcher.library plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.100.v20110502 -product org.eclipse.epp.package.jee.product --launcher.defaultaction openfile --launcher.xxmaxpermsize 2048m -showsplash org.eclipse.platform --launcher.xxmaxpermsize 2048m --launcher.defaultaction openfile c:\program files (x86)\ibm\websphere\appserver\java\bin\javaw.exe -xmx512m -vm "c:\program files\java\jdk1.6.0_31\bin\javaw.exe" -vm "c:\program files\java\jre6\bin\javaw.exe" -dosgi.requiredjavaversion=1.6 i checked other forums too, didn't appropriate answer.please help

Compact Framework - Upload file via REST -

i looking best way transfer files compact framework server via rest. have web service created using .net web api. i've looked @ several questions , other sites dealt sending files, none of them seem work need. i trying send media files wm 6 , 6.5 devices rest service. while of files less 300k, odd few may 2-10 or megabytes. have snippets use make work? thanks! i think minimum sending file: using (var filestream = file.open(@"\file.txt", filemode.open, fileaccess.read, fileshare.read)) { httpwebrequest request = (httpwebrequest)httpwebrequest.create("http://www.destination.com/path"); request.method = "post"; // or put, depending on server expects request.contentlength = filestream.length; // see note below using (var requeststream = request.getrequeststream()) { int bytes; byte[] buffer = new byte[1024]; // reasonable buffer size while ((bytes = filestream.read(buffer, 0, buffer.length)

asp.net - How can I authorize a SignalR Hub using Azure Mobile Apps Authentication -

i have mobile app using facebook auth through azure. auth works fine apicontrollers [mobileapicontroller] flag. i can't seem find how make signalr hub authorize - authorize attribute blocks access users. articles have found seem old , using deprecated azure mobile services different , not compatible. i have configured signalr client connect long-polling x-zumo-auth header set. i ended making custom signalr authentication attribute. code below else interested. public class hubauthorizeattribute : authorizeattribute { public hubauthorizeattribute() { } public override bool authorizehubconnection(hubdescriptor hubdescriptor, irequest request) { var owincontext = request.gethttpcontext().getowincontext(); claimsprincipal claimsprincipalfromtoken; var options = startup.authenticationoptions; string tokenfromheader = request.headers[appserviceauthenticationhandler.authenticationheadername]; if (!strin

How to read only number from a specific line using python script -

how read number specific line using python script example "1009 run test jobs" here should read number "1009" instead of "1009 run test jobs" a simple regexp should do: import re match = re.match(r"(\d+)", "1009 run test jobs") if match: number = match.group() https://docs.python.org/3/library/re.html

Getting StatusCallback events from Twilio in Java only -

i trying out sms , calls twilio. able send sms , make calls java code. not getting how can status callback in same java code. is there way can status callback events in java code? params.add(new basicnamevaluepair("statuscallback", "https://www.myapp.com/events")); params.add(new basicnamevaluepair("statuscallbackmethod", "post")); params.add(new basicnamevaluepair("statuscallbackevent", "initiated")); params.add(new basicnamevaluepair("statuscallbackevent", "ringing")); params.add(new basicnamevaluepair("statuscallbackevent", "answered")); params.add(new basicnamevaluepair("statuscallbackevent", "completed")); also, there way can give twiml data (the xml voice calls) in function calling function java, instead of giving url twiml/xml file. params.add(new basicnamevaluepair("url", " http://demo.twilio.com/docs/voice.xml ")); callfact

google chrome - How can i list the values of a Node in JSON ? -

say, have json has array of "topics" need list "created_at" values of topics without other data , using chrome console p.s : i'm using jsonview you can loop through objects in array , access property created_at . example var json = { all_topics: [{ "created_at:" "2016-08-08t10:22:03.123z", "name": "topic1" }, { "created_at": "2016-08-08t11:43:06.963z", "name": "topic2" }] } (var topic of json.all_topics) { console.log(topic.created_at); } you can use json.stringify turn javascript object json string, , json.parse turn json string javascript object. var jsonstring = json.stringify(json); ==> {"all_topics":[{"created_at":"2016-08-08t10:22:03.123z","name":"topic1"},{"created_at":"2016-08-08t11:43:06.963z","name":"topic2"

How to import existing RunDeck projects in MySQL back to new RunDeck? -

had rundeck installation configured (by 1 else no longer works , made no documentation) store meta-data in mysql. both running on different vms. lost rundeck application vm. mysql still remains. deployed new rundeck application, , configured use existing mysql. on starting it, got following error in service.log: frameworkexception{message='project not exist: project-redis_scans', resource='frameworkprojectmgr{name=name, basedir=/var/rundeck/projects}'} there 4 projects in total needs imported rundeck. right way? in rundeck-config.properties file check if connection url correct datasource.dbcreate = update datasource.url = jdbc:mysql://localhost:3306/rundeck?autoreconnect=true datasource.username=root rundeck.security.usehmacrequesttokens=false replace localhost ip of vm check if new vm able telnet mysql vm on port 3306

wso2is - How to get user store domain by admin services? -

i want user's domainstore username frameworkutils.prependuserstoredomaintoname(username) in identity.application authentication.endpoint, how it? can use admin service it? does username contain domain name ? abc/username ? if can use util method in [1] retrieve domain name. [1] https://github.com/wso2/carbon-kernel/blob/4.4.x/core/org.wso2.carbon.user.core/src/main/java/org/wso2/carbon/user/core/util/usercoreutil.java#l710

php - How to authenticate login with OTP -

is there way authenticate login in php using 1 time password should in digits , login.php asks on submission of form. once user input login information , submit form. system send otp user email , asks input otp access member area. i have google out ways sms based costs lot. need email based login code authenticate login , secure member area unwanted login attempts. if has php coding please share me. the question is, if want rely on email. worse sms. , if want implement on own. you may want take @ privacyidea (disclaimer: project), can manage kinds of tokens users. sms, email hardware tokens yubikey , smartphone apps google authenticator. there several php examples, since calling rest api: https://github.com/privacyidea/simplesamlphp-module-privacyidea/blob/master/lib/auth/source/privacyidea.php https://github.com/cornelinux/wordpress-strong-authentication/blob/master/strong-authentication.php

Navigate to the page twice (jquery mobile bug ??) -

i had page simple jquery mobile codes this. $(document).on('pageinit', function() { $.mobile.navigate('/home'); }); when load page. instead of redirect 'home' page, redirects 'home' page, redirect page, after redirects 'home' again , end here. how fix issue ? thanks. btw, if set timeout navigate function 1 second example, it'll work correctly. don't know why ?

Cognos Report Keyword Search -

i need provide keyword search option in cognos report. have 4 text box prompts keywords. need solution filter details field based on 4 keywords entered. filter expression tried is: if (?p_details1? not null) ( if (?p_details2? not null) ( if (?p_details3? not null) ( if (?p_details4? not null) (upper([details]) contains (upper(?p_details1?)) or upper([details]) contains (upper(?p_details2?)) or upper([details]) contains (upper(?p_details3?)) or upper([details]) contains (upper(?p_details4?))) else (upper([details]) contains (upper(?p_details1?)) or upper([details]) contains (upper(?p_details2?)) or upper([details]) contains (upper(?p_details3?))) ) else (upper([details]) contains (upper(?p_details1?)) or upper([details]) contains (upper(?p_details2?))) ) else (upper([details]) contains (upper(?p_details1?))) ) else (1=1) if 1 of text box prompts null report returns records. appears ignoring if statements. works if text box prompts have data. cheers. this filter shou

Regex - Find biggest possible match, which would have been found without preceding word checking, or nothing -

i not know exact terminology , therefore unfortunately not find solution particular case. i know how find single word, not proceeded predefined word using negative lookahead. example my goal match biggest possible phrase, matched without added check preceding word. if following comma, not want of matches in group. if no comma ahead, want of them in 1 phrase. my basic idea normal regex , check again if there comma in front of match. can done in 1 pass, though? example (stupid one): house 566 819 , 94841 681 , nice 4571 68484 81981 ideal output: 566 819 4571 68484 81981 i want numbers matched, not directly follow comma (desired matches bold), 1 big match. my current regex case looks this: \b(?!,)\s((\d+\s*)+) it finds 681 because number , no comma in front. unwanted behavior me. i hope explained problem enough. there way achieve goal? the regex (?<=[^,\d]\s|^)(\d+(?:\d+\s*)+) will match longest number , whitespace combo directly preceded ^ (

php - unset object inside an array of objects -

i have problem remove items array object, same code run in other app. after looping array $categories should empty. code bellow removes children categories removes parent category if user pass second parameter true, if parent doesn't have child remove only. //the $id of category removed // $remove_children state if accept removing children categories function remove_category($id = null, $remove_children = false) { if ($this->md->is_category($id) && is_bool($remove_children)) { //get children category $children = $this->get_children_categories($id); if (!$children) { return $this->md->remove($id, $this->categories_table); } else { if ($remove_children && is_array($children)) { unset($children['parent_category']); foreach ($children $child) { $removed = $this->md->remove($child->id, $this->categories_table);

Assign one struct to another in C -

can assign 1 instance of struct another, so: struct test t1; struct test t2; t2 = t1; i have seen work simple structures, bu work complex structures? how compiler know how copy data items depending on type, i.e. differentiating between int , string? yes if structure of same type. think memory copy.

c# - How to use Dapper with Linq -

i'm trying convert entity framework dapper improve data access performance. the queries use in form of predicates "expression>". to give example: i have following code need convert using dapper. what do: public async task<list<tmodel>> get(expression<func<tmodel, bool>> query) { // this.context of type dbcontext return await this.context.set<tmodel>().where(query).tolistasync(); } what i'd do: public async task<list<tmodel>> get(expression<func<tmodel, bool>> query) { using (idbconnection cn = this.getconnection) { return await cn.queryasync<tmodel>(query); } } my google-fu failing me, can please assist. edit: note did find: https://github.com/ryanwatson/dapper.extensions.linq but can't seem figure out how use it. firstly, 1 of authors of dapper said, when asked is there plan make dapper.net compatible iqueryable interfaces? that

javascript - Ionic 2 : using Toast inside an alert handler throws an ExpressionChangedAfterItHasBeenCheckedException -

i tried display toast after user pressed button in alert throws expressionchangedafterithasbeencheckedexception in dev mode. believe it's ionic bug. has experienced same issue ? can confirm i'm not doing mistakes ? here's code : let prompt = this.alertcontroller.create({ title: 'alert displaying toast', buttons: [{ text: 'cancel', role: 'cancel' }, { text: 'display toast', handler: () => { displaytoast(); } }] }); prompt.present(); and displaytoast() : displaytoast() { let toast = this.toastcontroller.create({ message: 'toast displayed inside alert', duration: 2000 }); toast.present(); } to reproduce exception, have display alert multiple times , press 'cancel' or 'display' buttons many times. cheers

c# - write-to not working from AppSettings with Serilog 2.1 -

i used serilog 1.x , following worked there: in code: log.logger = new loggerconfiguration().readfrom.appsettings().createlogger(); in app.config: <add key="serilog:write-to:rollingfile.pathformat" value="c:\temp\myservice\log-{date}.log" /> but serilog 2.1 seems write-to isn't working app.config. when put them straight code works want them app.config. wrong code/app.config? i luckily resolved myself. seems in 2.x version there need serilog:using every sink in app.config. added following use rollingfile , seq: <add key="serilog:using:rollingfile" value="serilog.sinks.rollingfile" /> <add key="serilog:using:seq" value="serilog.sinks.seq" /> and both rolling files , seq works.

xslt - How to move single element of XML into Another Element using XSL -

i want move element id here input xml <collection> <abc> <id>1234</id> </abc> <addedparts name="addedparts" type="unknown" status="0"> <part> </part> <here> </here> </addedparts> </collection> expected output <collection> <abc> </abc> <addedparts name="addedparts" type="unknown" status="0"> <part> </part> <here> <id>1234</id> </here> </addedparts> </collection> the xsl write <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:output method= "xml" version= "1.0" encoding= "utf-8" indent= "yes" /> <xsl:strip

css - Display a popup-menu in front of a table -

Image
i've created menu each table row displayed on hover. working except 1 thing: if hover on last rows menu, menu should popup in front of tables container instead of creating scrollbar inside container.. screenshot of real application example see example here: .container { max-height: 70px; overflow-y: scroll; } table { width: 100%; } .menu-container { position: relative; } .menu-container ul { padding: 0px; margin: 0px; border: 1px solid black; background-color: gray; } .menu-container ul:hover { position: absolute; margin-top: -10px; width: 100%; } .menu-container ul li { display: none; list-style-image: none; margin: 0px; padding: 0px; width: 100%; } .menu-container ul:hover li { color: red; display: block; margin-bottom: 0px; } <div class="container"> <table border="1"> <tbody> <tr> <td> <div class="menu-container&quo