Posts

Showing posts from September, 2012

java - Read/write XML file preserving original attribute order -

i using javax.xml.parsers.documentbuilder parse existing xml file , instance of org.w3c.dom.document . after manipulations on instance, need write file. therefore how can write org.w3c.dom.document object xml file using xmlstreamwriter ? ps: asking this, because think need use xmlstreamwriter in order write xml file without losing attribute orders. attribute orders important because in version tree, because of attribute order changes, don't want see xml file changed. attribute order insignificant per xml recommendation : note order of attribute specifications in start-tag or empty-element tag not significant. therefore, xmlstreamwriter provides no way constrain attribute ordering. in general, xml recommendations consider attribute ordering insignificant, see section on attribute processing in xml normalization recommendation or canonical xml recommendation if application has need attribute ordering.

How can I capture context information when publishing with rebus -

i capture information current user when publishing messages rebus handlers , sagas have transparent , correct access application user information. i'm getting little lost in source code i'm trying set several things: a hook runs when message published , puts current user information header a hook runs in worker when message received , rewrites claimsprincipal.current. a hook runs in worker when processing done , resets claimsprincipal.current. any suggestions appreciated. you can use rebus' events configurer hook messagesent event fired whenever outgoing message sent (i.e. send publish , reply) this: configure.with(...) .(...) .events(e => e.messagesent += automaticallysetusernameifpossible) .(...) and automaticallysetusernameifpossible might this: void automaticallysetusernameifpossible(ibus bus, string destination, object message) { var principal = thread.currentprincipal; if (principal == null) return; var ide...

php - Sort database records by cost but as if the cost was incremented by 1p per day? -

i'm wondering if it's possible add little maths sorting database mysql , php. in short, friend wanting website people pay want service, attention go higher payments, , work down lower ones when has time. the easy way order records amount paid, mean payment of 5p priority on that's been sitting there 20 days, had idea of incrementing amount paid 1p per day. is there way sql statement doesn't involve writing table, or should php array , calculations there? alternatively worth having 2 tables in database, 1 incremented cost, , other keep track of when last updated, avoid having recalculate more once day? i'd try have efficient solution, , while php calculation route seems easiest, i'd have process records @ once , sort them, might quite heavy on server. you can using datediff() : order payment + datediff(curdate(), submitdate) desc

python - How to GroupBy a Dataframe in Pandas and keep Columns -

given dataframe logs uses of books this: name type id book1 ebook 1 book2 paper 2 book3 paper 3 book1 ebook 1 book2 paper 2 i need count of books, keeping other columns , this: name type id count book1 ebook 1 2 book2 paper 2 2 book3 paper 3 1 how can done? thanks! you want following: in [20]: df.groupby(['name','type','id']).count().reset_index() out[20]: name type id count 0 book1 ebook 1 2 1 book2 paper 2 2 2 book3 paper 3 1 in case 'name', 'type' , 'id' cols match in values can groupby on these, call count , reset_index . an alternative approach add 'count' column using transform , call drop_duplicates : in [25]: df['count'] = df.groupby(['name'])['id'].transform('count') df.drop_duplicates() out[25]: name type id count 0 book1 ebook 1 2 1 book2 paper 2 2 2 boo...

android - Volley postparams array -

i've got 1 object containing 2 arrays of integer , want past object in params of post request. { "arrayofinteger1": [ 1, 2 ], "arrayofinteger2": [ 1, 2 ] } i'm struggling method "getparams" hours now, me please? getparams wont work in case because expects map<string,string> output can create json representation of above object , pass jsonobjectrequest(request.method.post, string url, jsonobject yourrequestobject,listener<jsonobject> listener, errorlistener errorlistener) or jsonarrayrequest similar parameters depending upon response expect

java - Song Class, Using abstract class and interface -

what i'am trying program output information of song using tostring on song class. when output it, fine except songtype/genre. still outputting undetermined. abstract class song implements isong //song class { private string name; private string rating; private int id; private songtype genre; public song() { name = " "; rating = " "; id = 0; genre = songtype.undetermined; } public song(string name, string rating, int id) { this.name = name; this.rating = rating; this.id = id; this.genre =song.undetermined; } public void setname(string name) { this.name = name; } public void setrating(string rating) { this.rating = rating; } public void setid(int id) { this.id = id; } public string getname() { return(this.name); } public string getrating() { return(this.rating); } public int getid() { return(this.id); } @override public string tostring() { return("song: " + this.name + ...

wpf - EntityWrapper Confusion -

wpf entity framework 6.0 database first, entities generated tt file. i'm having problems entitywrapper , , can't find useful information it. i have entities, when generated looks this: //generated code public partial class scm_supplierdepot : ipartsentity, inotifypropertychanged { [...] public virtual dms_address dms_address { get; set; } } public partial class dms_address : ipartsentity, inotifypropertychanged { //shortened brevity public system.guid addressid { get; set; } public string streetnumber { get; set; } public string streetname { get; set; } public string apartmentnumber { get; set; } public string city { get; set; } public string stateprovince { get; set; } public string postalcode { get; set; } public string housename { get; set; } public string country { get; set; } public string address2 { get; set; } public string county { get; set; } //inotifypropertychanged [..] } i...

java - Disable Spring's implicit method dependency injection -

Image
i'm using struts develop app, , hello world page worked fine until made extend actionsupport access i18n features. upon doing this, action started returning input result string. unexpected there no validation done @ moment. after debugging, noticed spring decided inject field error map, validation sees something, causing unexpected return value. ] 1 here stack trace: daemon thread [http-0.0.0.0-8080-2] (suspended (breakpoint @ line 79 in actionsupport)) index(actionsupport).setfielderrors(map<string,list<string>>) line: 79 nativemethodaccessorimpl.invoke0(method, object, object[]) line: not available [native method] nativemethodaccessorimpl.invoke(object, object[]) line: not available delegatingmethodaccessorimpl.invoke(object, object[]) line: not available method.invoke(object, object...) line: not available beanwrapperimpl.setpropertyvalue(beanwrapperimpl$propertytokenholder, propertyvalue) line: 1134 beanwrapperimpl.setpropertyvalue(pro...

unity3d - Programming a 2d enemy in c# -

i have been working on enemies in game, feel code clunky , not seem work. put code player script , enemy script. player script follows: edit: sorry not being clear enough, here lines of code not work , want them do: void ontriggerenter2d (collider2d other) { if (other.gameobject.tag == "enemy") { destroy (this.gameobject); } } what want in code when player encounters enemy or object "enemy" tag, touching object destroy or kill player object. void ontriggerenter2d (collider2d other) { if (other.gameobject.tag == "killable") { debug.log ("entering killzone!"); destroy (other.gameobject); instantiate (deadstar, transform.position, quaternion.identity); this.gameobject.setactive (false); } } } this code loosely copied previous game, has bits of it's killzone , made destroy player object when touches object contains script. (the player tagged "...

preg replace - php - strip same tags as parent tag -

how can strip same tags parent tag using preg_replace ? example have tag called <strip> , want strip child tags <strip> example <strip><strip>avoid tag</strip></strip> want become --> <strip>avoid tag</strip> don't know preg_* thats have: preg_replace_callback( '#\<strip\>(.+?)\<\/strip\>#s', create_function( '$matches', 'return "<strip>".htmlentities($matches[1])."</strip>";' ), $content ); this little function apply htmlentities inside <strip> tags , idon't want <strip> tag repeated inside each other thanks please dont user regex html dom, take @ domxpath doc here a shot exemple here : $doc = new domdocument(); $doc->loadhtmlfile($file); $xpath = new domxpath($doc); $elements = $xpath->query("/html/body/*"); foreach ($elements $element) { $nodes = $element->childnodes; fore...

javascript - Debugging Incorrectly Displaying Bars -

my bars should alternate through background, similar done in jsfiddle: fiddle . ends looking like: picture . this code should trick (but doesn't): svg.selectall("g.grid") .data(y.ticks()).enter() .append("g").attr("class", "grid") .select("rect") .data(x.ticks()) .enter() .append("rect") .attr("y", function(d, i, j) { return yscale(i); }) .attr("width", width) .attr("height", (yscale.rangeband())) .attr("fill", function(d, i) { return ((i) % 2) == 1 ? "white" : "lightgrey"; }); and entire code of i'm working with: code and fiddle of code here . you had right except y had wrong elements

html - Fixed position & centering not in center -

i have been learning more css , js lately , made lame website :p. problem have got centering "commercial ip detected" box on last phase of js script. can guys take it, because kind of gave up... :d what used center - inline: style="top: 50%; left: 50%; display: block;" the element position:fixed well like to website: http://baciu.ro/test/mortalkombatx-theme/ link picture of problem: http://i60.tinypic.com/29eq71t.png you should have on centering in css: complete guide chris coyier. otherwise, favorite way kind of fixed element is .element { position: fixed; top: 0; right: 0; bottom: 0; left: 0; width: 200px; height: 200px; margin: auto; } or if there no size defined: .parent { position: relative; } .child { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); } good luck'

tomcat - How to set context path for shared folder via my web application in the HTTP protocol -

i have web application called trainings , has trainings hyperlink in jsp page. whenever click link, should launch trainings. the training launch files available in share folder.(\share folder\training\country\site\launchfile.html) i want set location training page through trainings web application deployed in tomcat server http://trainings:8080/(share folder launch file) i not sure how this.. please me

Need to access session-timeout value in JSP -

i have standard tomcat/spring application, session timeout configured in web.xml : <session-config> <session-timeout>15</session-timeout> </session-config> i need access timeout setting in jsp: properties.prototype.setproperty({ 'sessiontimeout' : "<c:out value='${session.sessiontimeoutinterval}'/>", }); any ideas on how that? possible add filter sets session timeout interval attribute: session.setattribute("sessiontimeoutinterval", session.getmaxinactiveinterval()); but i'd rather avoid adding filter. what better way of making value available in jsp? here 1 way. ${pagecontext.session.maxinactiveinterval}

reactjs - Is there a way to get React to autodefine "keys" for children? -

i'm learning react, , stumbled upon quirk "dynamic children." preamble code example: // render pass 1 <card> <p>paragraph 1</p> <p>paragraph 2</p> </card> // render pass 2 <card> <p>paragraph 2</p> </card> in second render() pass, seems way vdom diffing works deletes second child, transforms text in first "paragraph 2." it's fast, you'll see weird stuff happening if needed state persist on say... second child! so react suggests using "key" attribute tags . vdom diffing surprise-free , you'll see state getting preserved across renders() . my question: there way react set "keys" on own rather doing way suggest? no, there not. the default behavior of react when there no keys specified use naive approach updating components in-place, observed. functionally, equivalent specifying default key according element's index respect siblings. in...

Luatable equivalent in C#? -

i've been looking way make table thing in c# (3.5), still have come empty. want this var myclassvar = new myclass(); myclassvar["hello"]["world"] = "hello world"; myclassvar["hello"][0] = "swapped"; myclassvar[0][0] = "test"; myclassvar["hello"]["to"]["the"]["world"] = "again"; myclassvar[0][1][0][0] = "same above sorta"; i'm trying create type of class parse file format i've created storing data. know of this? public class luatable { private dictionary<object, dynamic> properties = new dictionary<object, dynamic>(); public dynamic this[object property] { { if (properties.containskey(property)) return properties[property]; luatable table = new luatable(); properties.add(property, table); return table; } ...

python - Matplotlib: get colors and x/y data from a bar plot -

i have bar plot , want colors , x/y values. here sample code: import matplotlib.pyplot plt def main(): x_values = [1,2,3,4,5] y_values_1 = [1,2,3,4,5] y_values_2 = [2,4,6,8,10] f, ax = plt.subplots(1,1) ax.bar(x_values,y_values_2,color='r') ax.bar(x_values,y_values_1,color='b') #any methods? plt.show() if __name__ == '__main__': main() are there methods like ax.get_xvalues() , ax.get_yvalues() , ax.get_colors() , can use extract ax lists x_values , y_values_1 , y_values_2 , colors 'r' , 'b' ? the ax knows geometric objects it's drawing, nothing keeps track of when geometric objects added, , of course doesn't know "mean": patch comes bar-plot, etc. coder needs keep track of re-extract right parts further use. way common many python programs: call barplot returns barcontainer , can name @ time , use later: import matplotlib.pyplot plt def main(): x_values = [1,2,3,4...

c# - When exactly do Page.RegisterAsyncTask's get called? -

i running confusing behavior related async code registered on asp.net page registerasynctask, viewstate, , checkboxes, , need know when these async-tasks run relative when viewstate saved. i have few checkboxes inside asp:placeholder control. reading record , populating checkboxes, make placeholder visible. if synchronous - maybe within page_load - well. if registered async task following happens: the checkboxes populated. the placeholder visible. on postback, checkboxes cannot unchecked. is, if checked retain checked status if user unchecked them. seems checkboxes revert initial values. if checkbox checked on client, makes it! unchecking doesn't. this doesn't seem problem textboxes. haven't tried other widgets. i can 'correct' problem setting placeholder visible before register async task. think similar other question grid visiblity: asp:datagrid visibility async? it's turning out difficult , resulting in confusing code try pull visibli...

ios - How to make a switch from one view to the same view? -

i'm creating questionnaire app ios in swift. need 1 view questions. how make 1 generic view , make i'm switching new view swipe when replacing of data on view? alright, think know you're attempting do. possibly this. assuming have custom uiviewcontroller subclass textfields , labels on it; i've named questionaireviewcontroller . let nextvc = questionaireviewcontroller() self.navigationcontroller?.pushviewcontroller(nextvc, animated: true) additionally, you'll want set unwind segues each time create new vc, if needed navigation controller can segue back.

r regression weights not working -

i using mhurdle package in order estimate truncated normal hurdle model. function mhurdle includes "weight" argument supposed work in same way in lm (according mhurdle). when use argument, though, obtain same results in case without weights. i wonder why , also, alternative, if possible modify variables in order include weights before estimating model (the package uses maximum likelihood estimation). (i read on forum once of function resulted in same problem because weights never used in estimation. same here don't know how check , have not been able find question again) this how wrote call function: depvar <- mhurdle (y ~ indvar1 + indvar2 + indvar3 | indvar1 + indvar2 + indvar3 | 0, data = mydata, na.action = na.omit, dist = "tn", weights = mydata$weights) any ideas/suggestions? thanks this cr...

ruby on rails - Passing parameters for Testing Ransack Search output with RSpec 3 -

the first time use ransack searching. have controller this class coursescontroller < applicationcontroller def search @q = post.joins(:events).where(status: true, publish: true) .where("events.status = 'available'") .search(params[:q]) @courses = @q.result.includes(:tagnames).to_a.uniq render :index end end in route.rb, included route get 'posts/autocomplete_tag_or_subcategory', to: 'posts#get_suggestion_keywords', as: :list_suggestion and resources :courses, only: [:search] collection match 'search' => 'courses#search', via: [:get, :post], as: :search end end in view, have form field this = search_form_for @q, url: search_courses_path, method: :post |f| = f.search_field :title_or_description_or_tagnames_title_cont, { data: {autocomplete: list_suggestion...

recursion - PHP recursive function nesting level reached -

good day. have parcer function taker array of string this: ['str','str2','str2','*str','*str2','**str2','str','str2','str2'] and recursivelly elevates level starting asterix this ['str','str2','str2',['str','str2',['str2']],'str','str2','str2'] and function is: function recursive_array_parser($array) { { $i = 0; $s = null; $e = null; $err = false; foreach ($array $item) { if (!is_array($item)) { //if element not array $item = trim($item); if ($item[0] === '*' && $s == null && $e == null) { //we it's start , end if has asterix $s = $i; $e = $i; } elseif ($item[0] === '*' && $e != null) $e = $i; elseif (!isset...

objective c - session invalidated with iOS 8 share extension -

i have 2 targets in workspace ios app (bundle id: com.gotit.iphone.gotit , app group: group.com.gotit.iphone.gotit ) , share extension (bundle id: group.com.gotit.iphone.gotit.got-it , app group: group.com.gotit.iphone.gotit ). i can use share extension without problem (not time) when directly come ios app have error , app crashes : attempted create task in session has been invalidated 2015-07-22 16:31:21.999 iphone[6095:717111] *** assertion failure in -[bdboauth1sessionmanager setdelegate:fortask:], /users/gautier/documents/dev/gotit/ios/iphone/trunk/iphone/pods/afnetworking/afnetworking/afurlsessionmanager.m:449 2015-07-22 16:31:22.001 iphone[6095:717111] *** terminating app due uncaught exception 'nsinternalinconsistencyexception', reason: 'invalid parameter not satisfying: task' *** first throw call stack: (0x1865a02d8 0x1982140e4 0x1865a0198 0x187454ed4 0x100547340 0x1005476d8 0x100549190 0x100522084 0x100520a38 0x1000c94a8 0x1000d9f9c 0x1000d9d8c 0x18b02f...

Ruby On Rails. Destroy Method does not work if link has been voted on *Reddit Clone* -

i able delete links assigned each user, unless voted upon. if link has votes on delete method being called no longer works. here link website deployed on heroku. if sign up. submit link, vote or down , try delete see error experiencing. https://salty-eyrie-2549.herokuapp.com/ edit: after launching app live found code works long app not being hosted locally... strange... this error getting. nomethoderror in linkscontroller#destroy undefined method `name' nil:nilclass extracted source (around line #59): # delete /links/1.json def destroy @link.destroy respond_to |format| format.html { redirect_to links_url, notice: 'link destroyed.' } format.json { head :no_content } rails.root: /users/ipbyrne/firstrailsapp/raddit application trace | framework trace | full trace app/controllers/links_controller.rb:59:in `destroy' request parameters: {"_method"=>"delete", "authenticity_token"=>"3jyyng...

jsf - Primefaces add treenode in database -

i'm using primefaces 5.0 , create treenode draggable (as example detailed in http://www.primefaces.org/showcase/ui/data/tree/dragdrop.xhtml ). i update tree node in database don't understand it. my actual solution first remove database treenode , after add new treenode built user. every item in treenode custom object, getrowkey() method can build new tree index. is best way? thanks.

Outlook IOS SDK login -

i'm trying login outlook using ios sdk, explained here: https://msdn.microsoft.com/en-us/library/hh243641.aspx . login screen, usually, has 2 steps: (1)enter user , password, (2) approve permissions. far works, , can retrieve data want. problem whenever run app again, way retrieve data reconnect. press button, , shows again login screen. tile step (2) presented. approve permissions, , smooth again. should clear because i'm using basic template, , yet user has login again each time app runs. this code: - (void)viewdidload { [super viewdidload]; self.liveclient = [[liveconnectclient alloc] initwithclientid:app_client_id delegate:self userstate:@"genesis"]; } - (void) authcompleted:(liveconnectsessionstatus)status session:(liveconnectsession *)session userstate:(id)userstate { if (session != nil) { self.label2.text = @"you signed ...

c# - Is there a built in way to serialize array configuration values? -

i'm on new asp.net 5 project. i'm trying read array value, stored in config.json file, looks this: { "appsettings": { "sitetitle": "myproject", "tenants": { "reservedsubdomains": ["www", "info", "admin"] } }, "data": { "defaultconnection": { "connectionstring": "server=(localdb)\\mssqllocaldb;database=aspnet5-myproject....." } } } how access c# code? at least beta4 arrays aren't supported in config.json . see asp.net issue 620 . use following config.json : "appsettings": { "sitetitle": "myproject", "tenants": { "reservedsubdomains": "www, info, admin" } } and map class this: public class appsettings { public string sitetitle { get; set; } public appsettingstenants tenants { get; set; } = new appsettingstenants(); } ...

linux - Why isn't PHP's STDIN defined when operating with Apache? -

i operating php version 5.5.24 on centos 6. http://php.net/manual/en/wrappers.php.php seems imply should use defined constant stdin , however, shown when executed apache, not defined. <?php $input = fgets(stdin); notice: use of undefined constant stdin - assumed 'stdin' in /var/www/bidjunction/html/stdin.php on line 2 warning: fgets() expects parameter 1 resource, string given in /var/www/bidjunction/html/stdin.php on line 2 edit. defined cli. let me update title. [michael@devserver ~]$ php -r 'echo(stdin);' resource id #1 [michael@devserver ~]$ per deceze's comment. fwiw, stdin seems defined cli sapi: php.net/manual/en/features.commandline.io-streams.php

vba - create html table and have table header span more than one column -

i sending e-mail excel using outlook. body of e-mail making use of html. i had table working fine. have been asked add header above current header of table. header called "premium / (discount)". code below fine. header span across 2 columns , centre. i using line below not working, why? "<th colspan='2'>premium /(discount)</th> msg = "<table style='font-size: 12pt;'><tr><th>&nbsp</th><th>&nbsp</th><th>&nbsp</th><th>&nbsp</th><th>&nbsp</th><th>&nbsp</th>" & _ "<th colspan='2'>premium /(discount)</th><th>&nbsp</th><th>&nbsp</th><th>&nbsp</th><th>&nbsp</th></tr>" & _ "<tr><th align='left'>fund</th><th>&nbsp;</th>" & _ "<th align='left...

dictionary - object storage in python that allow tuples as keys -

i searching object storage in python allows me store dictionary having tuple s keys. tried shelve , shove , both exit error pass dictionary. there solutions out provide this? for shove, from shove import shove data = shove('file://tmp') ("a",) in data it gives me attributeerror: 'tuple' object has no attribute 'rstrip' . only, if tuple not in data. from shove import shove data = shove('file://tmp') data[("a",)] = 2 ("a",) in data would not throw error. for shelve, import shelve d = shelve.open('tmp/test.db') d[('a',)] = 2 gives me typeerror: dbm mappings have string indices only shelve module python standard library. doc clear : the values (not keys!) in shelf can arbitrary python objects — pickle module can handle ... keys ordinary strings by construction shelve accept strings keys. shove still in beta according documentation pypi, , not see evidence supports other string ...

image processing - ImageProcessing MatLab -

Image
i have video of welding procedure, , every frame need take contours of welded area, , detect edges. unfortunately, images got aren't best quality, tried put several filters , make image enhacement , didn't work take sharp edges. image below: i managed make following code, results terrible. clc clear vid = videoreader('home/simulation/v6_008.avi'); h=ones(3,3)/9; i=1 : mov.numberofframes thisframe = read(vid,i); g = image(thisframe); lsave = sprintf('image.jpg'); saveas(g, lsave, 'jpg') = imread(lsave); a1 = imcrop(a,[150 450 650 300]); a2= imsharpen(a1,'radius',50,'amount',500); b = rgb2gray(a2); c=imadjust(b,[0.6 0.8],[]); c1= imfilter(c,h); c2=adapthisteq(c1,'cliplimit',0.01,'distribution','exponential'); d = edge(c1,'canny',0.1); e=bwareaopen(d,50); imshow(e) end these filters , image enhacements helped little bit, still not enought measurements. so have 2 questions: 1...

python - Examine current messages in Django admin.py -

using django 1.5, python 2.7 is there way can examine messages have been added message object in admin.py file? in admin model, overwriting save_model function, , stop "model changed" message if doesn't meet criteria. from django.contrib import admin, messages class exampleadmin(admin.modeladmin): list_display = ('whatever', 'etc') def save_model(self, request, obj, form, change): obj.save() # want @ messages right here use get_messages . example: from django.contrib import admin, messages class exampleadmin(admin.modeladmin): list_display = ('whatever', 'etc') def save_model(self, request, obj, form, change): obj.save() storage = messages.get_messages(request) message in storage: # examine message here. pass

sql - Select a record that has a relationship with a number of other IDs in a junction table -

i using sqlite 3 database. i have 2 tables many-to-many relationship. result, have junction table persist relationship. below representation of similar have, made data etc. teacher table: +----+------------+ | id | name | +----+------------+ | 1 | teacherone | | 2 | teachertwo | +----+------------| studenttable: +----+------------+ | id | name | +----+------------+ | 1 | studentone | | 2 | studenttwo | +----+------------+ teacher_student (junction table): +-----------+-----------+ | teacherid | studentid | +-----------+-----------+ | 1 | 1 | | 1 | 2 | | 2 | 1 | +-----------+-----------+ what want select teacherid has record linking both studentid 1 , studentid 2. in case, give me teacherid 1. i have tried following sql statement: select t_s.* teacher_student t_s studentid in (1, 2) and returns me records have studentid of either 1 or 2. have searched answer have been unable find has helped m...

My orders in Magento 1.7 account sidebar -

i have problem account details sidebar. can no longer see "my orders" element there. where these items defined? thanks help. the orders menu item can found inside file /app/design/frontend/yourtheme/template/layout/sales.xml failing go through magento fallback in layout folder until find sales.xml possibly extension you've added has removed orders links xml.

wordpress - redirecting a bad post from google with htaccess rewrite -

i have problem several search engines using bad post urls. here 1 of urls: /?lang=frthe-importance-of-multilingual-support-for-consumer-electronicsleading-translation-services-for-french-spanish-english-montreal-toronto-orlando-miami/real-estate-translation-service-provider-french-spanish-montreal-mississauga-quebec-toronto-orlando-miami-florida/ i have tried following rewrite in htaccess file. has not worked. rewritecond %{query_string} lang=frthe-importance-of-multilingual-support-for-consumer-electronicsleading-translation-services-for-french-spanish-english-montreal-toronto-orlando-miami\/real-estate-translation-service-provider-french-spanish-montreal-mississauga-quebec-toronto-orlando-miami-florida\/ rewriterule ^/ / [r=301] what did miss?

Permissions to create Entities in Google Datastore via Cloud Console -

i'm managing project running in google cloud , have team working on it. team-members organized in google group, has permission edit project. each team-member can start instances, create container-engine cluster, etc. it's not possible create datastore entities. when add team-member directly editor project (not via google group), able create datastore entities. managing members via google group, because can give selected team-members permission add team-members without giving them owner-role of project. is there missed? or not possible give project editors added via google group permission create entities in datastore?

Spring:mvc 4.0 nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found -

<jul 22, 2015 7:00:00 pm ist> <error> <http> <bea-101216> <servlet: "dispatcher" failed preload on startup in web application: "test". org.springframework.beans.factory.xml.xmlbeandefinitionstoreexception: line 31 in xml document servletcontext resource [/web-inf/classes/dispatcher-servlet.xml] invalid; nested exception org.xml.sax.saxparseexception: cvc-complex-type.2.4.a: invalid content found starting element 'bean'. 1 of '{" http://www.springframework.org/schema/mvc ":mapping}' expected. i receiving above exception while starting application, please find spring configurations below. xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:aop="http://www.springframework.org/schema/aop" ...

javascript - strange behavior when using Underscore when testing equals condition -

i using underscore.js in project , came across weird behavior. when filter array changes_summary === 2 getting desired result when use same changes_summay === 0 , not getting output. following code: var result={ "data": [ { "id": 956, "changes_summary": 2, "name": "pradeep", "age": 32 }, { "id": 956, "changes_summary": 0, "name": "praveen", "age": 22 } ] } var filtered = _.filter(result.data, function(obj){ return (obj.changes_summary && obj.changes_summary === 2) }); //working when comparing changes_summary 2 not working when comparing 0 console.log(filtered); please let me know going wrong. link jsfiddle attached: jsfiddle the first test — obj.changes_summary — fail when property value 0 because that's falsy value. if you're testing see if property present in...

c# - How do you make a wpf text adornment modal? -

Image
following tutorial able create adornment used wpf user control it's visual. works interaction user control not expected, sits on top of text editor , can still make changes editor directly. how make user control modal acts more form , requires input or removed if click somewhere else in editor?

android - Progress bar not showing progress swiftly -

Image
my progress bar not going swiftly. below code: _progressbar.setmax(30); new countdowntimer(30000, 100) { public void ontick(long millisuntilfinished) { _progressbar.setprogress((int)millisuntilfinished/1000); time.settext(string.valueof((int) millisuntilfinished / 1000)); } public void onfinish() { } }.start(); this progress bar: i'd try using value animator ease 0 30. //ease 0 30 valueanimator valueanimator = valueanimator.ofint(0, 30); //set time length valueanimator.setduration(30000); //control easing type valueanimator.setinterpolator(new linearinterpolator()); valueanimator.addupdatelistener(new animatorupdatelistener() { integer valueanimatorvalue = null; @override public void onanimationupdate(valueanimator animation) { valueanimatorvalue = (integer) animation.getanimatedvalue(); _progressbar...

fluid - Render node in Neos -

i downloaded lelesys.plugin.slideshow plugin project. introduces 2 nodetype prototypes: prototype(lelesys.plugin.slideshow:slideshowcontainer) < prototype(typo3.neos:content) prototype(lelesys.plugin.slideshow:slideshowcontainer) { templatepath = 'resource://lelesys.plugin.slideshow/private/templates/typoscript/slideshowcontainer.html' slideshowcontainercollection = ${q(node).children('slideshowcontainer').children('[instanceof typo3.neos.nodetypes:image]')} slideshowcontaineritemcollection = typo3.neos:contentcollection slideshowcontaineritemcollection { nodepath = 'slideshowcontainer' } properties = ${node.properties} } prototype(lelesys.plugin.slideshow:slideshowitem) < prototype(typo3.neos.nodetypes:image) prototype(lelesys.plugin.slideshow:slideshowitem) { templatepath = 'resource://lelesys.plugin.slideshow/private/templates/typoscript/slideshowitem.html' slideshowcontainerproperty = ${q(node).property('_...

javascript - How to set Array in select -

Image
i'm using selectize.js , have field in kind of search values ​​are set according array. array request , desire set him in select options. how can that? html <div id="wrapper"> <h1>selectize.js</h1> <div class="demo"> <div class="control-group"> <label for="select-tools">tools:</label> <select id="select-tools" placeholder="buscar ag&ecirc;ncia..."></select> </div> </div> </div> this works agenciasapi.getagencias().success(function (data) { var embedded = data._embedded; $scope.listaagencias = embedded.agencias; alert(json.stringify($scope.listaagencias)); }).catch(function (error) { alert("erro ao obter listagem de agencias"); console.log(json.stringify(error)); }); $('#select-tool...

c# - How to repeat it at every X intervals? -

on property checking dns lookup executed @ startup only..how execute @ every x intervals system.net.iphostentry iphe = system.net.dns.gethostbyname("www.google.com"); return (@"images/online.png"); i'm making lot of assumptions here, assume talking keeping wpf form updated "online" status has auto-refresh feature? , doing in mvvm model. if assumptions right, in view model can use system.timers.timer fire @ interval specify, , can execute method specify hooking elapsed event. public class viewmodel{ private static system.timers.timer atimer; public viewmodel() { atimer = new timer(); atimer.interval = 2000; // every 2 seconds // hookup elapsed event atimer.elapsed += dowork; // have timer fire repeated events (true default) atimer.autoreset = true; // start timer atimer.enabled = true; } public void dowork(object source, system.timers.elaps...

Problems uploading codeigniter project from localhost to live server -

i have developed project in codeigniter. want move localhost live server. moved it, website opens first time , when refresh page, shows blank page. tried in browser, there same problem. after 30 minutes when tried open website, opens first time , again on refreshing site, blank page appears. upon closing browser , opening again, page opens first time , after refreshing not work neither goes other pages. i not understand problem. please should me. try .htaccess: <ifmodule mod_rewrite.c> rewriteengine on rewritebase / #removes access system folder users. #additionally allow create system.php controller, #previously not have been possible. #'system' can replaced if have renamed system folder. rewritecond %{request_uri} ^system.* rewriterule ^(.*)$ /index.php?/$1 [l] #when application folder isn't in system folder #this snippet prevents user access application folder #rename 'application' application...