Posts

Need help moving a middle initial from the end of a name to the middle using java regex -

i made topic on before , got closed , labeled off-topic. tried reading faqs couldn't figure out why pardon me if off-topic had additional questions on issue. i have field contains full name in following format: first, last (mi.) challenges: the middle initial isn't present entries don't have middle initial listed. some middle initials have period @ end. many of names spanish names can have multiple first , last names splitting field space isn't option. the name field may have white spaces @ end. the middle name may contain accented character (i couldn't find spanish middle names did start accent couldn't sure wouldn't have any). what i've done far: the first thing did used trim() remove padding @ end of field. fname.trim() next, i've split name first , last names following: string[] names = fname.split(","); i need split middle name last name, can following: fname = names[0] + " " names [1] + " ...

Customizing of code generation in IntelliJ IDEA -

im using intellij idea 12. can customise code generated using "refactor" functional? for example want change template of setting generation(encapsulate fields) from: public void setfield(string field) { this.field = field; } to public myclass setfield(string field) { this.field = field; return this; } as far know, can't you're suggesting in intellij. there plugins , however, can generation of fluent interfaces.

html - Full width content middle of 1170px using Drupal Bootsrap -

i'm using drupal bootsrap base theme , i'm building sub theme on top of it. site default 1170 px wide middle of content on same page have browser full width content (max 1400px). since drupal bootsrap theme has container s 1170 wide can somehow make wider middle of div? <div class="main-container container"> <div>normal 1170 wide content</div> <div> full browser width content</div> </div> so container class make whole div 1170 wide. can somehow make wider middle? bootstrap have class stuff? been trying go through documentation haven't find related case this.

Serializing and submitting a form using an AJAX call in JQuery -

i'm having trouble serializing form within mvc.net application using ajax call defined follows: @using (html.beginform("specialnotice", "displays", formmethod.post, new { id = "form" })) the form defined follows , posted following controller: public actionresult specialnotice(string dtype, bool? immediate,specialnoticemodel mod) when use $(formid).submit() works fine, form passed controller , specialnoticemodel populated correct information has been defined in form. however want ajax request instead, because not want form refresh upon submission. ajax call using is: var formdata = $('#form').serialize(); $.post(window.baseurl + 'displays/specialnotice', { dtype: $(displayid).val(), immediate: false, data: formdata }, function () { var device = $('#devicetype').val(); var postnow = '@model.postnow.tostring()'; window.location.href = window.baseurl + 'displays/speci...

android - How to listen EditText changes when changes are made by Keyboard -

i have edittext accepts changes keyboard or seekbar. how can listen changes keyboard? i want know, when changing makes input keyboard, when changing seekbar you need apply addtextchangedlistener(textwatcher watcher) edittext. here tutorial showing how use it: http://karanbalkar.com/2012/10/tutorial-11-using-textwatcher-in-android/

java - Include login methods -

i got entity user , want every method of every controller have access logged user without typing : model.addattribute(userdao.getuser(principal.getusername())); you can implement simple handlerinterceptoradapter add user instance model after handler invoked. class useraddinghandlerinterceptor extends handlerinterceptoradapter { // autowire dependencies... private static final string attribute = "user"; @override public void posthandle(httpservletrequest request, httpservletresponse response, object handler, modelandview modelandview) throws exception { if (modelandview != null && !modelandview.getmodelmap().hasattribute(attribute) { modelandview.addobject(attribute, userdao.getuser(principal.getusername())); } } }

jquery - Forcing jqGrid to use JSON for create/delete/update -

i'm starting use jqgrid display/add/edit/delete data coming rest service using json. reading data works fine, other operations such add,delete cause server error because i'm doing post of parameters using query string server expecting json content: $(document) .ready( function() { $("#list") .jqgrid( { url : 'http://localhost:8888/rest/service', datatype : 'json', mtype : 'get', colnames : [ 'name', 'city', 'country'], colmodel : [ { name : 'name', index : 'name', width : 150, editable : true ...