Posts

Showing posts from August, 2015

android - Keep service running in background even user clear memory -

i have service follows: public class service extends service { private static final string tag = "myservice"; @override public void oncreate() { super.oncreate(); log.d(tag, "oncreate"); } @override public ibinder onbind(intent intent) { return null; } public void ondestroy() { toast.maketext(this, "my service stopped", toast.length_long).show(); log.d(tag, "ondestroy"); } @override public int onstartcommand(intent intent, int flags, int startid) { intent intents = new intent(getbasecontext(),mainactivity.class); intents.setflags(intent.flag_activity_new_task); startactivity(intents); toast.maketext(this, "my service started", toast.length_long).show(); log.d(tag, "onstart"); return start_not_sticky; } } it worked well, , can check service running when go application setting. howe

java - liferay portlet spring mvc form is empty -

i have problem. form submit empty. public class customer implements serializable{ private static final long serialversionuid = 1l; private string firstname; private string middlename; private string lastname; private int age; private string address; public string getfirstname() { return firstname; } public void setfirstname(string firstname) { this.firstname = firstname; } public string getmiddlename() { return middlename; } public void setmiddlename(string middlename) { this.middlename = middlename; } public string getlastname() { return lastname; } public void setlastname(string lastname) { this.lastname = lastname; } public int getage() { return age; } public void setage(int age) { this.age = age; } public string getaddress() { return address; } public void setaddress(string address) { thi

excel - Go up one folder level -

i have macro gets sub folder data. want main folder. i looked @ how current working directory using vba? need change activeworkbook path: application.activeworkbook.path might "c:\parent\subfolder" i want "c:\parent\" using excel 365 vba as path may not current working directory need extract path string. find last \ , read characters left: parentpath = left$(path, instrrev(path, "\")) if working around current directory chdir ".." jump 1 level, new path can returned currdir .

hadoop - Accessing HDFS Remotedly -

i have hadoop server runs on server, let's on ip 192.168.11.7 , have core-site.xml follows : <configuration> <property> <name>fs.defaultfs</name> <value>hdfs://localhost:9000</value> </property> i run hdfs, i.e. command : sbin/start-dfs.sh now, want access hdfs local computer browser. possible? i tried http://192.168.11.7:9000 or http://192.168.11.7:50075 , no avail. i.e. site can’t reached thank much edited : this content of hdfs-site.xml : <configuration> <property> <name>dfs.replication</name> <value>1</value> </property> <property> <name>dfs.webhdfs.enabled</name> <value>true</value> </property> <property> <name>dfs.namenode.http-address</name> <value>0.0.0.0:50070</value> </property> and core-site.xml : <configuration> <property>

angular - How to extract type out of observable<type> in typescript -

i trying create utility class have common functions used among components. below code import { component, oninit } 'angular2/core'; import { commonservice } './services/common.service'; import { observable } 'rxjs/observable'; @component({ providers: [commonservice] }) export class utils { constructor(private _commonservice: commonservice) { } getcolumnnames(database: string, tablename: string): string[] { return this._commonservice.getcolumnnames(database, tablename).subscribe(data => this.promise(data)); } private promise(data: string[]) { return data; } } the common service return observable<string[]> , want extract string[] out of observable<string[]> . know can create private promise retrieve how send calling function in components.

python - Jinja range raises TemplateSyntaxError in Django view -

in django jinja2 tempate code {% in range(10) %} foo {{ }}<br> {% endfor %} a templatesyntaxerror raised error message could not parse remainder: '(10)' 'range(10)' what need in order loop on range in jinja2 template. i found link in django documentation explaining because django intentionally limits amount of logic processing available in template language, not possible pass arguments method calls accessed within templates. data should calculated in views, passed templates display. but don't think applies range function. django not using jinja2, django template language. there no range function in django template language.

sql - Transpose Columns to Rows - Teradata -

i have 2 tables following data tablea types columna columnb columnc dart 8.00 9.00 10.00 tableb types descp acnt dart columna 14000 dart columnb 15000 dart columnc 16000 my expected output types amt acnt dart 8.00 14000 dart 9.00 15000 dart 10.00 16000 i have written following code output select x.types, case when descp='columna' columna when descp='columnb' columnb when descp='columnc' columnc else null end amt, b.acnt tablea x join tableb y on x.types=y.types these sample data , there around 10 types , more 10 columns. there other option apart writing case statements including columns achieve this? thanks use teradata td_unpivot it's purpose need.

jquery - How to use response data from ajax success function out of Ajax call -

i have question, when make ajax call, , in success function json data, can't use out of success function $.ajax({ type: 'get', url: url, datatype: 'json', success: function (response) { getdata[name] = response; } }); alert(getdata[name]); my question how work getdata out of ajax call the problem default ajax request async means ajax start request execute: alert(getdata[name]); finish request in background , call success function. so alert execute before success function. , want have tell ajax not execute thing before done, in other ward set async: false second thing have declare variable outside ajax scope can access outside ajax the final code : var getdata; $.ajax({ type: 'get', url: url, datatype: 'json', async: false, success: function (response) { getdata[name] = response; } }); alert(getdata[na

jsf - What is the difference between @Scope("session") and @SessionScoped -

this question has answer here: spring jsf integration: how inject spring component/service in jsf managed bean? 2 answers i following this tutorial . it uses @scope("session") , @sessionscoped in different implementations. what differences? it explained in tutorial: mixed use of both jsf , spring annotations working fine, weird , duplicated – @component , @managedbean together. actually, can uses single @component, see following new version, it’s pure spring, , works! so @sessionscoped jsf solution. , @scope("session") pure spring solution. using @sessionscoped make application more portable, when example want switch java ee. using spring-di gives more consistent implementation.

r - grouped data frame to list -

i've got data frame contains names grouped, so: df <- data.frame(group = rep(letters[1:2], each=2), name = letters[1:4]) > df group name 1 2 b 3 b c 4 b d i convert list keyed on group names , contains names. example output: df_out <- list(a=c('a', 'b'), b=c('c', 'd')) > df_out $a [1] "a" "b" $b [1] "c" "d" this not new question wholly within tidyverse. there no such function yet in tidyverse far know. thus, have write own: split_tibble <- function(tibble, col = 'col') tibble %>% split(., .[,col]) then: dflist <- split_tibble(df, 'group') results in alist of dataframes: > dflist $a group name 1 2 b $b group name 3 b c 4 b d > sapply(dflist, class) b "data.frame" "data.frame" to desired output, yo

google app engine - AppEngine/Go: Using a new version of Go with the SDK -

the go sdk ships go version 1.6.2 recent 1.7.1 . need enhancements/bugfixes released since 1.6.2 . however, when replace goroot directory in sdk directory contains go 1.6.2 symlink points 1.7.1, error has not being able find bin/goapp , looks appengine-specific , not provided in standard go build. does know way upgrade go available in appengine sdk? mean go in production 1.6.2? unfortunately you're stuck go version comes bundled in latest app engine go sdk. even if "switch" locally go 1.7.1 , somehow manage compile , run app go 1.7.1 (by adding missing files sdk's go root), production environment uses go 1.6.2, app , go code run errors in live environment when code missing 1.6.2 referenced. deployment fail. also note when deploy app app engine, source files uploaded, , app compiled in cloud. can't "trick" compiling locally , somehow "exclude" source files , upload binaries (binaries not uploaded). you can't else wait g

c# - How to hold image onClick WPF Grid and drag to another position in GRID -

<usercontrol x:class="chess_interface.usercontrols.positioncontrol" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:chess_interface.usercontrols" xmlns:m="clr-namespace:chess_interface" mc:ignorable="d" d:designheight="450" d:designwidth="450"> <grid> <uniformgrid rows="8" columns="1" height="400" horizontalalignment="left"> <label content="8" horizontalcontentalignment="center" verticalcontentalignment="center" padding="0" /> <label content="7"

angularjs - ngif is not working properly -

i want use ngif check int comes function, , if bigger 0 want present it, did: <div> <b>name:</b>{{person.getname()}}<b>balance left:</b> <div *ngif="person.getbalance()>0">{{bulk.getbalance()}}</div> </div> but blanc page, if remove ngif fine, need it, doing wrong? this data comes array called "person" tnx you misspelled it. try removing * , put - between ng , if. <div ng-if="person.getbalance()>0">{{bulk.getbalance()}}</div> i think that doesn't work either because you're evaluating method. instead store balance in variable this: <div ng-if="person.balance>0">{{bulk.balance}}</div> execute getbalance method in controller.

Not able to connect through Rasdial in azure ARM VPN connection -

i not able connect vpn using powershell cmdlet. use 'rasdial' build agent connect vpn, can trigger automated tests. whole process automated. earlier same rasdial command - rasdial "vpnname" working fine classic model (asm) of vpn. but, after migrated arm, facing issue. through ui i.e. clicking on buttons connect vpn working fine our need connect through script. i getting message- this function not supported on system. nb: following post- https://dzone.com/articles/deconstructing-azure-point the same workaround worked in asm not woking in arm. can workaround or fix ? i using below script create , download vpn package. not sure missing in script causing issue- $vnetname = "myvpn" $subname = "subnet-1" $gwsubname = "gatewaysubnet" $vnetprefix1 = "15.3.0.0/16" $subprefix = "15.3.1.0/24" $gwsubprefix = "15.3.200.0/26" $vpnclientaddresspool = "158.17.201.0/24" $rg = "vmsrg&quo

ios - Comparing the datatype of an inner class attributes to its corresponding datatype -

i want know attributes datatype of class has inner class objects while iterating. find code mentioned below. class myclass1: nsobject { var name:string? var id:int32? } class myclass2:nsobject { var sessionid:string? var classobj:[myclass1]? var item:int? } let mirroredobject = mirror(reflecting: myclass2()) var dictionary = [string:any]() for(index,attr) in mirroredobject.children.enumerated() { if let property_name = attr.label { let submirroredobj = mirror(reflecting: property_name) dictionary["\(property_name)"] = type(of: (attr.value)) any? } } (index,item) in dictionary.enumerated() { print(item.value) } in above code display list of attributes of classobject. here don't know how compare listed attributes of class. use type of property: attr.value.dynamictype

javascript - Using jquery to find the number of characters in img src -

i have image slider: <ul class="slider"> <li><img src=""></li> <li><img src=""></li> <li><img src=""></li> </ul> if length of characters <=41 , want remove li tag. tried following code not working var li = $(".slider ul > li"); var $img = $(".slider > ul > li img").attr("src"); if ($img == length(41)) { li.parentnode.removechild(li); } this snippet it: $(".slider > ul > li img").filter(function(){ return $(this).attr('src').length <= 41; }).closest('li').remove();

Create only 1 list from a map where map value is list using JAVA 8 Streams -

i have map, "value" list of projects: map<user, list<project>> projectsmap = ... i want extract map projects in , 1 list of projects: i've seen answers don't apply case. don't want result: list<list<project>> thevalueofthemap; the result want is: list<project> projects = ... // project in value's map how can achieve using java 8 streams? thanks. leonardo. thanks @holger answer. list<project> projects = projectsmap.values().stream().flatmap(list::stream) .collect(‌​collectors.tolist())‌​; code avoid nullpointerexception in case collection in value map null: projectsmap.values().stream().filter(objects::nonnull) .flatmap(list::stream).collect(collectors.tolist());

'None' is not displayed as I expected in Python interactive mode -

i thought display in python interactive mode equivalent print(repr()) , not none . language feature or missing something? thank you >>> none >>> print(repr(none)) none >>> yes, behaviour intentional. from python docs 7.1. expression statements expression statements used (mostly interactively) compute , write value, or (usually) call procedure (a function returns no meaningful result; in python, procedures return value none ). other uses of expression statements allowed , useful. syntax expression statement is: expression_stmt ::= starred_expression an expression statement evaluates expression list (which may single expression). in interactive mode, if value not none , converted string using built-in repr() function , resulting string written standard output on line (except if result none , procedure calls not cause output.)

sas temp library doesn't need libref while others do ? -

i working on sas enterprise guide 7.12 sas base 9.4 running code : data work.new; input fname $ ; datelines; john ; run; data temp.x ; set work.new; run; code running without errors there no errors although didn't submit libref temp library if change temp library name name error rise libref new lib , going on ? sas provide number of libraries automatically @ start of session, locations of can seen running code below: data _null_; work=pathname('work'); temp=pathname('temp'); sasuser=pathname('sasuser'); put (_all_)(/=); run; the work library emptied when session ends, temp , sasuser libraries can retain data after session ended (albeit files in temp may periodically cleared, depending on local configuration). can store personal items there, warned - may angry administrator after if store :-) also won't accessible else you. further info on system libraries here , seem documentation on temp libra

html file is showing all NUL characters when open in notepad++ -

Image
i had html file editing in dreamviewer , inbetween electricity went off,now when open file shows "nul" characters , not able see anything. show size 27kb. please help.

excel - Add row totals if cell is coloured? -

i novice @ excel, please bear me. i'm trying fortnightly budget. have row of bills paid, row total @ end. when bill paid change colour of cell. what have field @ end of row show total of has been paid far based on colour of cell. possible? if not can recommend method same type of thing? thank much tracy i'm afraid it's not possible use colour information sum cells, please see here more information. excel formula cell color

Zend Framework 3 tutorial error -

i started yesterday zend framework 3 tutorial but, at step : when had module 'album' in modules.config.php had following error : zend\servicemanager\exception\servicenotfoundexception /var/www/api/vendor/zendframework/zend-servicemanager/src/abstractpluginmanager.php:133 plugin name "getservicelocator" not found in plugin manager zend\mvc\controller\pluginmanager #0 /var/www/api/vendor/zendframework/zend-mvc/src/controller/pluginmanager.php(98): zend\servicemanager\abstractpluginmanager->get('getservicelocat...', null) #1 /var/www/api/vendor/zendframework/zend-mvc/src/controller/abstractcontroller.php(258): zend\mvc\controller\pluginmanager->get('getservicelocat...', null) #2 /var/www/api/vendor/zendframework/zend-mvc/src/controller/abstractcontroller.php(273): zend\mvc\controller\abstractcontroller->plugin('getservicelocat...') #3 /var/www/api/module/album/src/album/controller/albumcontroller.php(104): zend\mvc\controller

python - create dynamic fields in WTform in Flask -

i want create different forms in flask using wtforms , jinja2. make call mysql, has type of field. so i.e. table be: form_id | type | key | options | default_value 1 | textfield | title | | test1 1 | selectfield | gender |{'male','female'}| 2 | textareafield| text | | hello, world! then query on form_id. want create form wtforms having fields of rows returned. for normal form do: class myform(form): title = textfield('test1', [validators.length(min=4, max=25)]) gender = selectfield('', choices=['male','female']) def update_form(request): form = myform(request.form) if request.method == 'post' , form.validate(): title = form.title.data gender = form.gender.data #do updates data return ..... else: return render_template('templ

c# - How to read a header from a specific line with CsvHelper? -

i'm trying read csv file header @ row 3: some crap line empty line col1,col2,col3,... val1,val2,val3 val1,val2,val3 how tell csvhelper header not @ first row? i tried skip 2 lines read() succeeding call readheader() throws exception header has been read. using (var csv = new csvreader(new streamreader(stream), csvconfiguration)) { csv.read(); csv.read(); csv.readheader(); ..... if set csvconfiguration.hasheaderrecord false readheader() fails again. try this: using (var reader = new streamreader(stream)) { reader.readline(); reader.readline(); using (var csv = new csvreader(reader)) { csv.readheader(); } }

java - what does it mean to build LDAP V3 compliant application? -

i have requirement build build few rest api interface ldap v3 compliant server such open ldap/ ad. primary question if server ldap v3 compliant, have attributes defined per standard l[as opposed samaccount in ad]? way possible build single integration code integrates ldap v3 severs. if have create/query user on ldap v3 server, use same code using standard ldap attributes , not use vendor specific attributes such "samaaccount ", or "memberof". possible @ [just if write jpa compliant code use both hibernate, eclipselink orm providers]? or have misinterpreted ldap v3 compliance? ldapv3 capabilities, not attributes. depending on schemata used attributes ldap-server can hold differ. therefore can not expect ldapv3-compatible server identify users fix attribute-type. can expect ldapv3-compatible server capable of understanding sasl, referrals or controls. need make attributes need use configurable depending on used ldap-backend.

c# - How do I post an object array to Controller like json data via ajax -

i have model like [datacontract] public class module_shortcut_order { [datamember] public int module_id { get; set; } [datamember] public int line_order { get; set; } [datamember] public string user_id { get; set; } } and have controller use model list like public jsonresult sortupdate(list<module_shortcut_order> process) { ...processing... } and have ajax script post model list parms = { "process": [{ "module_id": "10", "line_order": "0", "user_id": "12354" }, { "module_id": "5", "line_order": "1", "user_id": "32154" }] }; $.ajax({ type: "post", url: "../home/sortupdate", datatype: "json", data: parms, success: function (data) { ... ... } }); javascript works object array doesnt fill controler list modal when run model fill objec

ruby on rails - Multiple Solr Instances - Second Solr Locked on Startup -

i've been trying figure out workflow minitest suite launch second solr instance feature tests if development instance running. however, i'm running issues getting servers start (i.e. when start them outside of testing). to start servers i'm using: rails_env=development bin/rake sunspot:solr:start rails_env=test bin/rake sunspot:solr:start however, whichever server starts second becomes locked. attempt access server in tests or in development yields error: rsolr::error::http - 500 internal server error error: {msg=solrcore 'test& 'is not available due init failure: index locked write core 'test'. solr longer supports forceful unlocking via 'unlockonstartup'. please verify locks manually!,trace=org.apache.solr.common.solrexception: solrcore 'test' not available due init failure: index locked write core 'test'. solr longer supports forceful unlocking via 'unlockonstartup'. please verify locks manually! @

Search in TextEdit Control Devexpress vb.net -

there 2 controls in form gridcontrol , textedit control. have bulk data of product names. need write 15 20 product names in single textedit control separating them spaces. when type in textedit first product name can find correctly first product name​ in gridcontrol gridview1.applyfindfilter("someproductname") . when type second product name includes previous product name in query need previous product name automatically remove query pressing space key not textedit. you use search on last term: public sub applyfindfiltertolastterm(terms string) dim lastterm = terms.split(" "c).last applyfindfilter(lastterm) end sub and call each time user enters space handling keydown event

c# - I make fileUpload to save images in folder now i want to display it -

that code url of image folder <asp:repeater id="rptimages" runat="server"> <itemtemplate> <li> <img alt="" style='height: 75px; width: 75px' src='<%# eval("images") %>' /> </li> </itemtemplate> </asp:repeater> this display images string[] filesindirectory = directory.getfiles(server.mappath("~/images")); list<string> images = new list<string>(filesindirectory.count()); foreach (string item in filesindirectory) { images.add(string.format("~/images/{0}", system.io.path.getfilename(item))); } rptimages.datasource = images; rptimages.databind(); when run it says:" error occurred during compilation of resource required service request. please review following specific error details , modify source code appropriately. " and show :( list<string> images = new list<string>(filesindi

wai aria - Advice on supporting screenreaders (fully) on a sliding widget (think iOS settings panels) -

Image
i building container nested sliding sub-containers - have own set of nested containers. basically behave similar how ios handles settings (see attached image). i need advice on how go this. aria properties use? , how structure keyboard navigation? .. there existing w3c recommended pattern can lean against? or need re-invent wheel on one? the wai-aria authoring practices guide intended provide understanding of how use wai-aria create accessible rich internet application. describes recommended wai-aria usage patterns , provides introduction concepts behind them. source: - https://www.w3.org/tr/wai-aria-practices-1.1/#intro from spec looks relevant: menu or menu bar a menu widget offers list of choices user, such set of actions or functions. menu opened, or made visible, activating menu button, choosing item in menu opens sub menu, or invoking command, such shift + f10 in windows, opens context specific menu. when user activates choice in menu, me

scripting - Can't setMyStatus with google script -

i have trouble google script. try run script below in form can't set status. function onformsubmit() { var form = formapp.getactiveform(); var email_address = form.getresponses()[0].getrespondentemail(); var date = new date("insert-date-here"); var event = calendarapp.getcalendarbyid("calender-id-here").geteventsforday(date); event[0].addguest(email_address); var guests = event[0].getguestlist()[0].getemail(); var status = event[0].setmystatus(calendarapp.gueststatus.yes); } the person added calender no problem when row setmystatus comes crashes error, "not user of event". can tell why happening? i've tried add long sleep , tried fetch event again. if debug can see email of user i'm trying add.

java - android anonymous asyncTask - will it cause memory leak -

in android trying prevent memory leak. inherited legacy code , in developer creating asynctask anonymous inner class this: void startasynctask() { new asynctask<void, void, void>() { @override protected void doinbackground(void... params) { while(true);//loop keep thread alive forever. } }.execute(); } so using loop in example keep child thread alive forever can demo point. activity if call startasynctask() there memory leak ? class not have activity reference realize anonymous class non-static inner class , holds reference outer class. true memory leak ? it hold reference outer class (the activity) until task finishes. cause activity held longer absolutely necessary. if task finishes in reasonable amount of time, ought ok- after finished task on , become garbage collectable, make activity garbage collectable. bigger concern long term threads can last past end of activity, or not terminate @ if poorly written.

optimization - How to make my Fortran loop faster with BLAS - Matrix vector multiplication -

i optimize speed following fortran code do ii = 1, n (:,:) = (:,:) + c (ii) * b (:,:, ii ) enddo with a(m,m) dimension , b(m,m) dimension. i thinking of use blas do jj=1,m call zgemm('n', 'n', 1, m, n, cone, c(:), cone, b (jj,:, : ),& n, czero, a(:,:), cone ) enddo but not efficient still have loop. possible use increment , how? in case n > m

python - time.strftime() not updaing -

i trying time when button pushed, going have few pushes without starting , calling time module. in ipython, tested out code, , time not updating import time t = time.strftime("%b-%d-%y @ %i:%m%p") print(t) #do else little t = time.strftime("%b-%d-%y @ %i:%m%p") print(t) it gives me same time even if put in time tuple such as: lt = time.localtime(time.time()) t = time.strftime("%b-%d-%y @ %i:%m%p", lt) print(t) i same time even if wait, , execute code again (in ipython), gives me same time. time.time() give me new time every time though i don't know if doing in ipython (i'm testing code before put in python file) matters what doing wrong?? you using %m @ %i:%m%p format "minutes", means month in decimals. try capital %m instead minutes. so, time.strftime("%b-%d-%y @ %i:%m%p") see strftime documentation format directives.

java - Gson + AutoValue error while trying to implement own deserializer -

i have retrofit interface combine rxjava. retrofit calls return observable. "somepojo" classes, generate them online using schema2pojo sites. i have problem when making following api call: https://developers.themoviedb.org/3/search/2y9y2lrefzdhfhbfa as can see, array 2 different types of objects, called "media" , "credit". these 2 classes generated using google's autovalue follows: @autovalue public abstract class media implements parcelable { @serializedname(value = "title", alternate = {"name"}) public abstract string title(); @nullable @serializedname("vote_average") public abstract string voteaverage(); @nullable @serializedname("backdrop_path") public abstract string backdroppath(); @nullable public abstract string adult(); public abstract string id(); @nullable public abstract string overview(); @nullable @serializedname("original_language") public abstract string originallanguag

ios - Search NSArray of NSDictionary. How to find using NSPredicate? -

i have nsarray . has 1 or more nsdictionary in each index. based on search input, want check whether contain value in contact_label inside contact_detail dictionary. this: ( { "contact_detail" = { "contact_is_in_phone" = 1; "contact_label" = "tyler globussoft"; "contact_displayname" = "suzan arohh"; }, "last_msg_details" = { ..... }; }, { } ); i have tired this. not getting result. nsarray *contacts = self.dataarray; //your array of nsdictionary objects nspredicate *filter = [nspredicate predicatewithformat:@"contact_label = %@",stringvalue]; nsarray *filteredcontacts = [contacts filteredarrayusingpredicate:filter]; you can use nsarray *contacts = self.dataarray; //your array of nsdictionary objects nspredicate *filter = [nspredicate predicatewithformat:@"contact_detail.contact_label = %@",stringva

javascript - Make radio button not checked on load of form? -

i have slight problem here each time run application first radio button checked, want make nun of radio buttons checked. how do this? <div class="col-md-12"> <!--<i class="fa fa-child" aria-hidden="true"></i>--> @html.labelfor(model => model.ccommmunication, "choose preferred way of communication", new { @style = "", @class = "", id = "" }) <span style="color: red;">*</span> @*@html.dropdownlistfor(model => model.profession, new selectlist(model.professions, "id", "name"), new { placeholder = "", @style = "", @class = "form-control", id = "profession" })*@ @html.enumradiobuttonfor(model => model.ccommmunication, false,false,"communicationcb") <!--first 2 paramerters false false communicationcb class--> @html.validationmessagefor(model => model.c

ubuntu - Maven error: Could not find or load main class .usr.share.maven.boot.plexus-classworlds-2.x.jar -

i have upgraded ubuntu 14.04 16.04 , started getting following error when running mvn commands (version 3.3.9): error: not find or load main class .usr.share.maven.boot.plexus-classworlds-2.x.jar . environment variables declared follows: $java_home: /usr/lib/jvm/java-8-oracle $path: /usr/local/texlive/2015/bin/x86_64-linux:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin $m2_home: /usr/share/maven $m2: /usr/share/maven/bin when trying find solution, i've tried removing m2 , m2_home variables suggested on various threads, resulted in getting different error: error: not find or load main class org.codehaus.plexus.classworlds.launcher.launcher . have tried running apt-get remove --purge maven , installing again downloading .tar.gz archive, in both cases, nothing has changed. when looking /usr/share/maven/boot folder, there chain of symlinks pointing plexus-classworlds-2.x.jar -> /usr/share/java/plexus-classworlds2-2.5.2

Multiple character replacement in R -

below part of code , can see, trying remove string of characters , meta characters. there way replacements in 1 line? tried writing symbols open , close parethesis after word function not work. { p1 <- gsub("function", "", deparse(s)[1]); #removing word "function" p2 <- gsub("\\(", "", p1); #removing open parenthesis p3 <- gsub("\\)", "", p2); #removing close parenthesis p4 <- gsub("\\s", "", p3); #removing spaces variables <- strsplit(p4,","); #separating variables } maybe not 1 line solution can simplify code this: listtoreplace <- c("function", "\\(", "\\s") string <- "function.... ...bbb((bbbb" gsub(paste(listtoreplace,collapse="|"), "", string)

windows - .bat file executing itself over and over -

i wrote ping google.fr -n 2500 in .txt file, saved "ping.bat". when execute script, can see command execut itselfs on , over, if loop. ofc didn't wrote loop in txt file. got solution? (check picture more details) normal expected behave of command : http://prntscr.com/cl2z44 actual behave : image of problem preferably, save script using name. otherwise, ping google.fr -n 2500 execute ( ping.bat ) in current directory rather searching ping.exe in path variable. proof, try where ping . another approach (nonpreferable): keep ping.bat name specify ping.exe google.fr -n 2500 inside bat script.

ios - Swift-3 error: '-[_SwiftValue unsignedIntegerValue]: unrecognized selector -

following code worked old swift. extension of string func stringbyconvertinghtml() -> string { let newstring = replacingoccurrences(of: "\n", with: "<br>") if let encodeddata = newstring.data(using: string.encoding.utf8) { let attributedoptions : [string: anyobject] = [ nsdocumenttypedocumentattribute: nshtmltextdocumenttype anyobject, nscharacterencodingdocumentattribute: string.encoding.utf8 anyobject ] { let attributedstring = try nsattributedstring(data: encodeddata, options: attributedoptions, documentattributes: nil) //crash here return attributedstring.string } catch { return self } } return self } but in swift 3 crashes saying *** terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[_swiftvalue unsignedintegervalue]: unrecognized selector sent instance 0x6080002565f0' any

vsts - OH-TFS-Connector-0051: InvalidNotEmpty for field [Remaining Work] value [0] -

i migrating team projects "on premises" tfs server 2013 visual studio team services online using opshub visual studio migration utility v.2.2.8.000. in team project, in particular, getting error: oh-tfs-connector-0051: operation failed createorupdateentity. server error : failed create/update entity because : invalidnotempty field [remaining work] value [0] anybody know how resolve this? i transcribe below log work item changes. changes of 2 days ago attempts workaround problem. note there several changes in value 'remaining work' field, 'original estimate' , 'completed work'. don't understand why error during migration. eric nazário cordeiro made field changes (a day ago) fields field new value old value rev 13 12 remaining work