Posts

Showing posts from August, 2010

Java multithreading: Jboss container threads generating MPSC case -

suggest me use concurrent data structure between concurrentlinkedqueue vs linkedblockingqueue vs linkedtransferqueue below scenario: jboss container's thread generating objects needs store in static data structure(queue) , 1 consumer thread reading static data structure(queue), retrieving head object queue , doing needful. i want non blocking put operation don't have control on producer threads generated container based on request landing on it. my choise linkedblockingqueue have below quires: is put operation in linkedblockingqueue threadsafe, if multi producer threads concurrently inserting elements in blockingqueue need synchronize put operation. what level on concurrency in linkedblockingqueue?

networking - Can't reach internal address from inside a CoreOs Vagrant box -

i'm running coreos inside vagrant box. i'm using stock configuration described coreos . i can ping external address google. unfortunately can't reach address that' inside companies network. pinging internal address windows host works fine. colleague has got no problems calling internal addresses inside vagrant box. when calling ifconfig have 2 entries listed suspect cause (since colleague doesn't have two): flannel0: flags=4305<up,pointopoint,running,noarp,multicast> mtu xxx veth071c08e: flags=4163<up,broadcast,running,multicast> mtu xxx do know , how can remove them? i have removed flannel interface , service fleet service vagrant's user-data file , can reach internal addresses well.

c++ - Qt::Popup window type automatically closes on X11/i3.. is this behavior guaranteed? -

is guaranteed when user clicks outside of popup in parent window, popup closes and/or can modify behavior or influence somehow? see behavior in x11 i3 window manager. i have functionality popup seems provide: modal regard parent (i.e if user clicks somewhere in parent window.. popup won't let through, instead trigger event can handle myself.. example closing popup explicitly). edit i found usual "closeevent" can used reject closing of popup. it's still mysterious me whether or not "modal"-y behavior guaranteed , auto-closing guaranteed.

python - NoReverseMatch in url in django app -

i have url , everythis should ok error. this url: url(r'^/(?p<genre>%s)$' % '|'.join([g.code g in genre.objects.all()]), eventlistview.as_view(), name='genre'), here error message: reverse 'genre' arguments '()' , keyword arguments '{u'genre': ''}' not found. 0 pattern(s) tried: [] in line of html code: <a {% if genre == view.genre %} class="active" href="{% url 'events' %}" title="{% trans 'reset filter' %}"{% else %} href="{% url 'genre' genre=genre.code %}"{% endif %}>{{ genre.name }}</a> my view: class eventlistview(pagecontextmixin, listview): model = booking page_context_kwargs = {'selected': reverse_lazy('events')} template_name = 'events/event_list.html' def get_queryset(self): filter_ = {'eventlist': true} # , 'season__in': settings.events_seasons}

sql - Count rows using group by and display all rows MYSQL PHP -

i have sql table this: id fname cat address status 1 bash wedding venue abc 2 bash wedding venue bcd 3 jash wedding venue abc 4 hash wedding venue bcd 5 rash wedding card bcd i want fetch results having cat value wedding venue , count duplicate fname. query using this, , working fine. select *, count(*) counts table cat='wedding venue' , status='a' group fname; output: id fname count(*) cat address status 1 bash 2 wedding venue abc 3 jash 1 wedding venue abc 4 hash 1 wedding venue bcd is there possible way display output this: id fname count(*) cat address status 1 bash 2 wedding venue abc

Why are newly added APIs annotated with @hide in Android framework still added to current.txt after a make update-api? -

i'm android framework developer. i'm inspecting codes adding new public apis aosp, , make sure these public apis hidden, keeping current.txt same aosp. now have encountered problem confuses me. know, public apis @hide annotated not added current.txt, generated after make update-api, there seems exception here. we have codes out of frameworks/base, compiled framework.jar specifying source files in android.mk, below: local_src_files += \ $(call all-java-files-under,../../flyme/frameworks/base/core) \ $(call all-java-files-under,../../flyme/frameworks/base/media) \ $(call all-java-files-under,../../flyme/frameworks/common/media) \ $(call all-java-files-under,../../flyme/frameworks/common/core) what confuses me is, new public apis added these codes output current.txt, no matter using @hide or not. have thought droiddoc not able remove @hide stuff codes out of frameworks/base i'm not sure this. lot!

c# - Approaches to Serializing an Object Graph with Circular References -

let's suppose want implement serializer (c#) sake of practice, , want said serializer not fail on circular references. the apparent solution serialize objects not yet encountered , skipping objects were. accomplished hashing instances (in 1 way or another). the proposed solution bids question: "what defines object's identity?" 1 - leave gethashcode , equals methods. acceptable solution- conserves time on serialization , conserves memory on de-serialization. however, not desirable outcome, since many instances may have same identity yet used different things in serialized domain, de-serializing them later on same instance violate domain logic. so, author of such serializer, must leave caller make such decisions. one approach solve hash collection per said type, , distinguishing between serialized , non serialized instances iterating collection , invoking referenceequals on each contained element. works, sub-optimal - performance wise. another approach p

java - Which transcoding is used here? -

i have http request header may contain non ascii characters. my typical example following : apache send web server following header firstname=jérémy when receive in java web server, have following key/valye pair firstname=[jᅢᄅrᅢᄅmy] obviously, restore initial text. don't know transcoding used. hence question : transcoding used, , how can original text ? my web server uses wisdom framework, based on vert.x

php - How to get rank according to count in mysql -

Image
i getting issue fetching rank according count. i have 2 tables : 1)images 2)images_like now if images_like have no entries showing "null" in ranks. please check query , output : select im.id, rank (select image_id, @rownum := @rownum + 1 rank, count(*) cnt images_like, (select @rownum := 0) r group image_id order `cnt` desc) d right join images im on d.image_id = im.id i need display 3 not null .... thanks in advance !!!!! try : select im.id, d.rank ( select t.image_id, @rownum := @rownum + 1 rank ( select image_id, count(*) cnt images_like group image_id order `cnt` desc) d ) t, (select @rownum := 0) r ) d right join images im on d.image_id = im.id

c# - LINQ to SQL multiple tables left join -

i have stored procedure dynamic query s working fine in case when not creating return type edmx. trying use linq same stored procedure getting bit difficult newbie. can me on this. here code sql: create procedure [dbo].[usp_getproductlist_searchformanytoone] @orgid bigint, @ownerid bigint, @orderlist nvarchar(max) begin -- -- set nocount on added prevent result sets -- -- interfering select statements.\ set nocount on; declare @sql nvarchar(max) = '' set @sql = 'select productid = ii.productid, invitemid = convert(bigint,0), name = p.name, primaryimageid = p.primaryimageid,productnumberlabel = p.productnumberlabel,productnumber = p.productnumber, category = isnull(c.name,''''), qty = isnull((sum(ii.[quantityonhand]) - sum(ii.[quantitysold])), 0.00), saleprice= isnull(p.saleprice, 0.00), enteredquantity=(case when (isnull((sum(ii.[quantityonhand]) - sum(ii.[quantitysold])), 0.00) > 1) 1.00 else isnull(

json - Implement a http server with RESTful http API -

i've started learn backend development, focus on http server mainly. i'm new this, it's little out of focus me, , use advice. for example, if try implement this a http server runs on linux/windows a private rest api allows post json object, plus login mechanism, authorised user can post. implement public rest api allows same json object and here question: can use nodejs , express implement these? know little them. need database implement login mechanism? there similar tutorial or best practise can study from? regards ben yes, can use nodejs this. not necessarily. need way authorise users. common use database store username/email , password, using third-party service this, example facebook or google yes, there lot of tutorials , best practices on subject. question broad link relevant material, terms can use google "nodejs rest api" "rest api best practice". passport.js place start getting authorising users. rest-api, closer n

javascript - Align selected tags to right Kendo Multi-Select? -

Image
i using kendo multi-select implementing tag based selector component. in that, default selected tag appear left aligned. can see picture have attached is there way configure them right aligned?? try adding style in page: .k-multiselect ul li.k-button { float:right; } or use class if don't want change behaviour of multiselect widgets in page.

elasticsearch - ES search without wildcards not getting results with analyzer -

after reading official documentation , q&a here still can't elasticsearch search partial words without wildcards. i've got ~470k entries of companies , want accomplish kind of autocompletion when starting enter company name. the index gets created this: { "lei-index" : { "aliases" : { }, "mappings" : { "record" : { "properties" : { "legalname" : { "type" : "text", "analyzer" : "legalname_analyzer", "search_analyzer" : "legalname_search" } } } }, "settings" : { "index" : { "number_of_shards" : "5", "provided_name" : "lei-index", "creation_date" : "1478597987141", "analysis" : { "filter" : {

Cosinus of an array in Python -

i want obtain results of cosine each value. import numpy np import math t = np.arange(0, 20.5, 0.5) print(math.cos(t)) i 'typeerror: length-1 arrays can converted python scalars' error. you want apply operation every element of array rather entire array. solution math >>> import numpy np >>> import math >>> t = np.arange(0, 20.5, 0.5) >>> print([math.cos(element) element in t]) [1.0, 0.8775825618903728, 0.5403023058681398, 0.0707372016677029, -0.4161468365471424, -0.8011436155469337, -0.9899924966004454, -0.9364566872907963, -0.6536436208636119, -0.2107957994307797, 0.28366218546322625, 0.70866977429126, 0.960170286650366, 0.9765876257280235, 0.7539022543433046, 0.3466353178350258, -0.14550003380861354, -0.6020119026848236, -0.9111302618846769, -0.9971721561963784, -0.8390715290764524, -0.4755369279959925, 0.004425697988050785, 0.4833047587530059, 0.8438539587324921, 0.9977982791785807, 0.9074467814501962, 0.59492066

ios - How to change UIScrollView Indicator color? -

when use uicolor.blue changing, when try apply rgb, not reflected in scrollview indicator. func scrollviewdidscroll(_ scrollview: uiscrollview) { let verticalindicator: uiimageview = (scrollview.subviews[(scrollview.subviews.count - 1)] as! uiimageview) verticalindicator.backgroundcolor = uicolor(red: 211/255, green: 138/255, blue: 252/255, alpha: 1) // verticalindicator.backgroundcolor = uicolor.blue } i think problem here verticalindicator.backgroundcolor = uicolor(red: 211/255, green: 138/255, blue: 252/255, alpha: 1) change verticalindicator.backgroundcolor = uicolor(red: 211/255.0, green: 138/255.0, blue: 252/255.0, alpha: 1). the result of division 211/255 type of integer return 0 or 1 (in case think 0).

PHP Login/Authentication/Sessions/API/Token -

i need develop secure login system. i have api layer, , plan create token table. i'll send username/password (post) api , generate unique token (one time token limited time), return token in json. my questions are: what should saved in sessions while user logged in. want store little possible information. should save token only? safe? i don't want store access levels , user info in session, need these info each time via token.. think? advice! any other advice develop more secure login system. thank in advance. since you'd keep sessions logged in identification, encounter problem: clients can't kept session. for example, cell phones, web-based app. i'm creating similar project. , solution creating table named session (or whatever want), keeps usertoken (randomly generated), userid , tokenexpire . once user logged in, create record @ session table, , return token user (encoded json ). user keeps token own, , attached token on e

php - Get Last XML Child from Tree of All Same Name Children -

i'm struggling parse xml structure: <browsenodes> <browsenode> <browsenodeid>6388960011</browsenodeid> <name>road bike frames</name> <ancestors> <browsenode> <browsenodeid>1266090011</browsenodeid> <name>bike frames</name> <ancestors> <browsenode> <browsenodeid>3403201</browsenodeid> <name>cycling</name> <ancestors> <browsenode> <browsenodeid>706814011</browsenodeid> <name>outdoor recreation</name> <ancestors> <browsenode> <browsenodeid>3375301

html - Changing a color when hovering -

i working on exam html/css, , have question - we're supposed make website fonts, , want have index page want have 1 of fonts showcased r/r roboto and font colored in white, while seperator colored in blue color, want seperator turn white, while rest of text turns blue. for have this: a:hover { color: #00ebff; transition: } <a href="roboto.html"> <h1>r<span style="color: #00ebff" class="spacer">/</span>r</h1> <h2>roboto</h2> </a> and cant life of me figure out how it. you're along right line, need more specific in selector separator element. following css should achieve need: a:hover { color: #00ebff; } a:hover span.spacer { color: #fff !important; } please note using !important rule here essential, since you're using inline styles. however, better define style .spacer in css file too: a .spacer { color: #00ebff } a:hover

php - Store variable in Session -

i want store user_level mysql db of user submits form in $_session code this: <form id='login' action='<?php echo $fgmembersite->getselfscript(); ?>' method='post' accept-charset='utf-8'> <fieldset > <?php if(isset($_post['submitted'])) { session_start(); if($fgmembersite->login()) { $mysqli = new mysqli('host', 'name', 'psw', 'db'); if ($result = $mysqli->query("select user_level users username='$username'")) { $_session['user_level'] = $result; } $fgmembersite->redirecttourl("loginhome.php"); } } ?> <legend>login</legend> <input type='hidden' name='submitted' id='submitted' value='1'/> <div class='short_explanation'>* benötigte fe

java - How do I take out a specific card from a deck image? -

i want take out card deck image. how can without downloading every single card separately? don't want initialize 52 cards in class. right now, randomize colour , value , finds picture in source folder. possible take 1 card out single deck image? bild = imageio.read(new file("source folder/" + colour + value + ".png")); you should initialize them don't have hands. you should create 1 image contains every single card , load it. bufferedimage class provides getsubimage(int x, int y, int w, int h); , returning piece (a card) of bufferedimage. you can populate array of card while looping through image of deck. for(int = 0; i<4; i++){ for(int j = 0; j < 13; j++){ deckarray[13 * + j] == image.getsubimage(i * cardwidth, j * cardheight, cardwidth,

ruby on rails - Update method is passing id in a weird way -

somehow, update method after editing passing id "show" here @ parameters being passed when "update"\ started patch "/owners/show.3328" 127.0.0.1 @ 2016-11-08 12:28:29 +0200 processing ownerscontroller#update parameters: {"utf8"=>"✓", "owner"=>{"name"=>"kamal ghool", "phone"=>"05222123123", "email"=>"kamal057@gmail.com", "notes"=>"", "customer_id"=>"", "phone2"=>"", "address1"=>"omar ben khattab st", "city"=>"umm el fahem", "zipcode"=>"30010"}, "commit"=>"עדכון לקוח", "id"=>"show"} user load (0.9ms) select "users".* "users" "users"."id" = $1 order "users"."id" asc limit $2 [["id", 1], [&qu

How to Get Excel 64bits path from regedit under windows7 64 bits? -

could has excel64bits installed on win7/64bits tell me how ecel path regedit? i have excel 32bits installed on pc , looking path 64bit version don't have press windows+r , write regedit , hit enter and press ctrl+f type "excel" can find registry element value "c:\program files\microsoft office\office14\excel.exe"

ios - Getting the error NSCFDictionary objectAtIndex while displaying data in Uitableview -

i new ios , when implementing fetch data api , getting -[__nscfdictionary objectatindex:]: error. code: request dispatching -(void)jobtakefive{ [mbprogresshud showhudaddedto:self.view animated:yes]; //nsurlrequest *request = [nsurlrequest requestwithurl:[nsurl urlwithstring:[nsstring stringwithformat:@"http://www.json-generator.com/api/json/get/cucmzxkuoa?indent=2"]]]; nsurlrequest *request = [nsurlrequest requestwithurl:[nsurl urlwithstring:[nsstring stringwithformat:@"http://www.json-generator.com/api/json/get/cpviemqesy?indent=2"]]]; nslog(@"%@",request); nsurlconnection *conn = [[nsurlconnection alloc] initwithrequest:request delegate:self]; if (conn) { responsedata = [[nsmutabledata alloc] init]; }else{ } } response handling , parsing - (void)connection:(nsurlconnection *)connection didreceiveresponse:(nsurlresponse *)response { [responsedata setlength:0]; postresponce = [[nsm

unity3d - Unity Object Collision occurring without objects colliding -

Image
in game player avoid obstacles , move towards goal, when play game in device started colliding game. i tried collide in editor not issue anymore. here picture detail info alt text this player passing aside of obstacle in device triggered collision not colliding object. what issue, have no idea what's going on.. i using oncollision2d check collision. edit: here rigidbody2d inspector

c# - How to use multiple connection string to connect different database using EntityFramework Core using the default dependency injection -

how use multiple connection string connect different database using entity framework core using default dependency injection. not able call different db context access different objects in different database under same db server using ef core , .net core. appsettings: "data": { "externaldbconnection": { "connectionstring": "data source=testserver;initial catalog=testdb1;integrated security=false;user id=user;password=8888;" }, "internaldbconnection": { "connectionstring": "data source=testserver;initial catalog=testdb2;integrated security=false;user id=user;password=8888;" } } startup.cs: public void configureservices(iservicecollection services) { // add framework services. services.addmvc(); services.addentityframework().adddbcontext<testdb1>(options => options.usesqlserver(configuration["data:externaldbconnection:connectionstr

uipageviewcontroller - UIPageController - Detect Current Page If swipe Cancelled (SWIFT 3.*) -

i have uipagecontroller correctly detects previous or next pageindex upon scroll the problem have of need solution is... example:- user scrolls left or right decides cancel during swipe... remains on current page. the pageindex changes pending page(next page) , not actual current page.. my code achieve above statement :-- func pageviewcontroller(_ pageviewcontroller: uipageviewcontroller, willtransitionto pendingviewcontrollers: [uiviewcontroller]) { if let itemcontroller = pendingviewcontrollers[0] as? pagecontentviewcontroller { nextindex = itemcontroller.pageindex print("page index = \(nextindex)") } } func pageviewcontroller(_ pageviewcontroller: uipageviewcontroller, didfinishanimating finished: bool, previousviewcontrollers: [uiviewcontroller], transitioncompleted completed: bool) { currentindex = nextindex print("current page = \(currentindex)") } func pageviewcontroller(_ pageviewcontroller: uip

SQL Server - parameter sniffing -

Image
i've read many articles parameter sniffing, it's not clear if or bad. can explain simple example. is there way automatically detect wrong plan assigned specific statement? thanks in advance. it can bad sometimes. parameter sniffing query optimizer using value of provided parameter figure out best query plan possible. 1 of many choices , 1 pretty easy understand if entire table should scanned values or if faster using index seeks. if value in parameter highly selective optimizer build query plan seeks , if not query scan of table. the query plan cached , reused consecutive queries have different values. bad part of parameter sniffing when cached plan not best choice 1 of values. sample data: create table t ( id int identity primary key, value int not null, anothervalue int null ); create index ix_t_value on t(value); insert t(value) values(1); insert t(value) select 2 sys.all_objects; t table couple of thousand rows non clustered index on val

php - Storing data offline until online is connected -

i planning on making web app feedback. device used on isn't connected online. the idea have store input offline until reaches connection. device in question ipad , target database mysql. ive seen web storage wondering offline site altogether 1 refresh page accident , no connection fail. ideally use php,mysql , html5. thinking originaly store data i'm local storage use ajax keep pinging connection. i'm looking elegant way of doing without suffering data loss. suggestions appreciated! this absolutly possible modern browser. can use service workers make page avalible offline, can load , refresh site offline. storage can use webstorage or indexeddb sayed. , detecting internet connection, there events provided browser. this concept called progressive webapps, example can @ google io page of year

python - check if list of strings is found exactly n times -

i'm struggling synthesise several answers i've been reading come close i'm trying do, , can't formulate google-fu that'll me existing answer! know it's simple i'm @ loss now. very similar this question , want find several strings i've read tuple occurr in file, however, want lines each string matched only once . any , all don't fit bill far can tell. what i've got far close, line.count giving me numbers of occurrences each line, it's wrong in 2 ways: firstly, line.count under 1 somehow given line? i know i'm doing wrong how i'm iterating/searching each key and/or using == 1 test, can't figure out. the tuple of strings i'm looking is: ['ag49', 'ag51', 'agbd', 'aght', 'agjn', 'agkc', 'agnp', 'agti', 'lg01', 'lg33', 'lg45'] and example lines of file search (they have 2 many tens of entries (og_1000 below longest line/mo

python - Using Jinja2 for unqiue div ID's during loop? -

i can't seem figure out way around issue.. i have template takes inputs few different tables in database. tables contain x amount of info. in order show info onclick i'm using bit of javascript hide div contained in. however, div id={{ row.id }} gets populated during forloop in jinja. thought working @ first until realized {{ row.id }} can same different {{ row.id }} if coming different table.. exmaple; {% row in packages %} # packages 1 of tables <div id="{{ row.id }}"> {{ row.price }} {{ row.date }} ..etc </div> <button onclick="togglediv("{{ row.id }}">show content</button> other stuff in between... {% entry in services %} # services 1 of tables <div id="{{ entry.id }}"> # possible entry.id + {{ loop.index }} ? i'm not positive make unique tho. {{ entry.price }} {{ entry.date }} ..etc </div> <button onclick="togglediv("{{ entry.id }}">show content</button> so iss

xcode - get value from website in mac OS 10.12.1 & iOS 10.1.1 -

getting error since latest update. can't data returned https website. please help code: func getvaluefromwebsite(_ url: string, showerror: bool) -> string { var xml:string = "" let url = url(string: url) let request = nsmutableurlrequest(url: url!) let session = urlsession.shared session.sendsynchronousrequest(request: request) { data, response, error in xml = string(data: data! data, encoding: string.encoding.utf8)! xml = xml.replacingoccurrences(of: "\"", with: "") xml = xml.replacingoccurrences(of: "\r\n", with: "") } return xml }

php - Compare a $_SESSION with a variable -

i want compare $_session['email_of_user'] variable $r. i've got code: if ($result = $mysqli->query("select email users user_level = 1 ")) { $r = mysqli_fetch_array($result); } print_r($r); print_r($_session); if ($_session['email_of_user'] == $r) { /*something should happen, doesn't */} in print_r correctly displayed , email of $_session same $r . why if ($_session['email_of_user'] == $r) not working? mysqli_fetch_array fetch result row associative, numeric array, or both. comparing array email. should use if ($_session['email_of_user'] == $r['email'])

javascript - ECharts automatic height -

Image
is possible create echarts line chart without specifying it's container height - make responsive actual data. the number of items in y axis can vary. by default, when don't define height of container, 0 , chart not visible. in example there 6 items (months) in y axis, if wanted show 12 months in same container, without making bars 50% narrower? if know how many rows or bars going have, can use calculate height of container. for example, if each row 31px , fixed height of graph header & footer 200px use: var chartheight = datavalues.length * 31 + 200; $('#graph-container').css({'height': chartheight});

Glassfish V4 Error - The lifecycle method [start] must not throw a checked exception -

i following error while deploying app glassfish v4 . have read on error , refers @postconstruct method , not implement on application. application deploys fine on glassfish v2. error timestamp nov 8, 2016 12:41:42.279 log level severe logger javax.enterprise.system.core name-value pairs {levelvalue=1000, timemillis=1478601702279} record number 855 message id complete message exception while deploying app :the lifecycle method [start] must not throw checked exception. related annotation information: annotation [@javax.annotation.postconstruct()] on annotated element [public void org.apache.activemq.broker.brokerservice.start() throws java.lang.exception] of type [method] lifecycle method [start] must not throw checked exception. related annotation information: annotation [@javax.annotation.postconstruct()] on annotated element [public void org.apache.activemq.broker.brokerservice.start() throws java.lang.exception] of type [method] @ org.glassfish.apf.impl.ann

Error:(2, 0) Plugin with id 'com.github.dcendents.android-maven' not found in android -

i use following library add material design android project https://github.com/boxme/squarecamera but after importing module, following error. how can fix it error:(2, 0) plugin id 'com.github.dcendents.android-maven' not found. update buildscript dependencies build.gradle file located in your_project/build.gradle classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.3.0' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' // line need add } } hope you

cmd - Wix installer failing when trying to run a console command -

i'm trying add custom action wix installer, 1 runs console command. fragment looks this: <customaction id="adddbcleanuptask" property="cmd" execommand= "[systemfolder]cmd.exe /c &quot;schtasks /create /sc daily /tn &quot;foo\databasecleanup&quot; /tr abc.exe /f&quot;" execute="deferred" return="check" impersonate="no" /> </fragment> and how call it: <installexecutesequence> <custom action="adddbcleanuptask" after="installfiles"/> </installexecutesequence> i run installer console line msiexec /i mypackage.msi /l*v log.txt so log file. when run installer, runs fine until encounters task, error message , installation rolls back. relevant lines in log file not helpful: action 13:38:56: adddbcleanuptask. msi (s) (7c:80) [13:38:56:158]: executing op: customactionschedule(act

jquery - on page load event $.ajax function sends ajax request. while we looks the url in the Global.asax file it is different Url -

$(function () { $.ajax({ url: "mysettings/changepassword", type: "post", success: function (response) { $('#view-settings').html(response); hideflywithmessage("loaded"); } }); } when above code executed send request "mysettings/index/mysettings/changepassword" url. it shows in console window. if place slash(/) @ beginning, ajax url treat hostname/yoururl so, change url below $.ajax({ url: "/mysettings/changepassword", ..... });

python - Return a string indicating what type of imbalance exists in a binary search tree -

having added new node avl. kind of rotation need fix it? need write fuction takes binary tree , returns string saying type of imbalaced exist class node: """ node in bst. may have left , right subtrees """ def __init__(self, item, left=none, right=none): self.item = item self.left = left self.right = right class bst: """ implementation of binary search tree """ def __init__(self, lst=none): self.root = none if lst != none: x in lst: self.add(x) def recurse_add(self, ptr, item): if ptr == none: return node(item) elif item < ptr.item: ptr.left = self.recurse_add(ptr.left, item) elif item > ptr.item: ptr.right = self.recurse_add(ptr.right, item) return ptr def add(self, item): """ add item correct position on tree """

delphi - Update many projects to use a common VCL style -

i have been asked way update our application , add vcl sytle of components. the application made of many different programs (more 200) manually updating each 1 long , tedious task. so know if there way update of these projects each uses same vcl style ? right now, there no styling applied @ all. if planning add vcl styles support large set of projects have build custom tool or script, try these options. option 1, embedding vcl style resource in exe : using option need modify @ least 2 files per project , .dpr file set current vcl style , .dproj file need reference vcl style file embed style resource. option 2, using vcl style external file , using option need modify .dpr file set current vcl style adding necessary code load style external file. to modify .dproj file can use automation tool or scripting language supports xml. for modify .dpr file need build custom application ideally using delphi parser delphiast or castalia-delphi-parser adding necess