Posts

jsf - How to order SelectItems in custom renderer extending MyFaces HtmlMenuRenderer -

i´m trying migrate custom component render selectonemenu on myfaces 2.0, need use library because 8.5 moved mojarra 1.2 myfaces 2.0 implementation. in mojarra 1.2, extended com.sun.faces.renderkit.html_basic.menurenderer had method renderoptions receives parameters facescontext context, uicomponent component, list<selectitem> listselectitems , myfaces haven´t similar method. this method used order items before render (mojarra 1.2): @override protected void renderoptions(facescontext context, uicomponent component, list<selectitem> listselectitems) throws ioexception { cobisselectonemenuuicomponent uicomponent = (cobisselectonemenuuicomponent) component; string order = uicomponent.getorder(); if (order == null || order.isempty()) { order = default_order; } if (order.equals("asc")) { collections.sort(listselectitems, comparatorselectitemlabel); } else { if (order.equals("desc")) { ...

Android : Making Listview full screen -

<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context=".mainactivity"> <edittext android:layout_margintop="5dp" android:layout_width="match_parent" android:layout_height="50dp" android:background="@drawable/location_edittext" android:id="@+id/locationeditext" android:textsize="15sp" android:textcolor="#999" android:paddingleft="15dp" /> <com.example.ravi_gupta.slider.viewpagercustomduration android:layout_width="wrap_content" android:layout_height="0dp" android:id="@+id/viewpager" android:scrollbarstyle="outsideoverlay" android:layout_weight="0.5...

java - WebServiceException : Class do not have a property of the name debug -

i generated java proxy classes using 'xjc'. getting "do not have property of name debug" webservice exception when deploy application production environment. however, in staging environment works fine. referring same web-service both environments, endpoint url & wsdl same. any appreciated. built on java 6, deployed on jboss 6.x here client code using call webservices. ==========client code=========== processaccountsiteunitwsd service = new processaccountsiteunitwsd(); final processaccountsiteunitwsdporttype port = service.getgesfdcpwaccountsiteunitserviceswebservicesproviderprocessaccountsiteunitwsdport(); final bindingprovider hb = ((bindingprovider) port); hb.getrequestcontext().put(bindingprovider.endpoint_address_property, resources.getstring("endpoint_address")); hb.getrequestcontext().put(bindingprovider.username_property, ...

sql server - SQL, get max id of column -

i've got table in ms sql server management studio +------+-----------+-------- | id | client id | bla bla blaaaa +------+-----------+-------- | 1 | 1 | ....... | 2 | 2 | ....... | 3 | 3 | ....... | 4 | 8 | ....... | 5 | 9 | ....... | 6 | 15 | ....... | 7 | 1 | ....... | 8 | 16 | ....... | 9 | 2 | ....... | 10 | 9 | ....... | 12 | 12 | ....... +------+-----------+-------- i need unique [client id] max value of [id], this +------+-----------+-------- | id | client id | bla bla blaaaa +------+-----------+-------- | 3 | 3 | ....... | 4 | 8 | ....... | 6 | 15 | ....... | 7 | 1 | ....... | 8 | 16 | ....... | 9 | 2 | ....... | 10 | 9 | ....... | 12 | 12 | ....... +------+-----------+-------- i tried code, doesn't work .. can me? select * table 1 inner join table 2 o...

c# - How to share session between a MVC project and a WCF project? -

i have angular-webapi-mvc-wcf solution. i want share user session between mvc , wcf projects. possible? also, want share authentication mechanism, mean, want user authenticated once on mvc project using formauthentication, , let wcf know when user authenticated without envolving other technologie. i have solution mvc , wcf app reside on same project(dll), , on context can share authentication , session data. so, in order share session, should move svc files wcf mvc project? way? all projects share same db, solve without having store session data on db level. thanks info if wcf layer on same app pool, can check aspxauth cookie (forms auth cookie name configurable) , can use methods in formsauthentication class/namespace decode cookie user in wcf layer. if configure forms auth cookie domain cookie can host wcf layer in different app pool/iis site long it's on same domain main site. both sites receive cookie. that cookie drives forms authentication. if fo...

javascript - How to Hide Date Menu from Datepicker in yii2 -

basically in datetimepicker widget date choose first time, how can hide date option widget , filter according time. tried not working want hide remove button [ 'attribute'=>'time', 'label'=>'time', 'format'=>'raw', 'value'=>function($data){ return date('h:i:s',strtotime($data->time)); }, 'filter'=> datetimepicker::widget([ 'model' => $searchmodel, 'attribute' => 'time', 'clientoptions' => [ 'autoclose' => true, 'format' => 'hh:ii', 'showon' =...

ios - How to call the -(void)update:(CCTime)delta method in Objective-C -

is there way call -(void)update:(cctime)delta method in objective-c? know (using sprite builder) can create scene , have attached custom class when scene loaded through ccbreader, class's update method automatically called. i loading scene through code without custom class still update method "start" (for lack of better word.) there way this? call scheduleupdate from, example, onenter method. [self scheduleupdate]; however if using cocos2d-objc or cocos2d-spritebuilder version 3.0 or later, update: methods scheduled automatically. https://github.com/cocos2d/cocos2d-objc/blob/v3.0/cocos2d/ccnode.m#l1190 -(cctimer *) schedule:(sel)selector interval:(cctime)interval repeat: (nsuinteger) repeat delay:(cctime) delay { nsassert(selector != nil, @"selector must non-nil"); nsassert(selector != @selector(update:) && selector != @selector(fixedupdate:), @"the update: , fixedupdate: methods scheduled automatically."); ...

javascript - getting null value in list when passing by ajax call to mvc controller -

i passing list mvc controller getting null value in controller.but list has values when show in alert on client side. ajax call $("#addtiles").click(function() { usertiles = json.stringify({ 'usertiles': usertiles }); alert("entered function."); alert(usertiles[0].tileid); var url = '@url.action("addtiles")'; $.ajax({ type: "get", url: url, data: usertiles, success: function(d) { if (d.indexof('"issessionexpired":true') != -1) { location.reload(); } else { onaddtilessuccessful(d); } }, error: function() { errorinoperation(); }, contenttype: "application/html; charset=utf-8", datatype: 'html' }); }); function onaddtilessuccessful(e) { $("#tilessubmissionmsg").append(e); } function errorin...

android - Google Maps Api V2 draw circle around current position -

im working google maps api v2 on android project, need able draw circle around users current position , display markers points of interest within radious around users current position. im struggling small marker denotes users current position can draw circle around it. this code far. //set map , display users current position. mapfragment mapfragment = (mapfragment) getfragmentmanager() .findfragmentbyid(r.id.nearbymapsearch); mapfragment.getmapasync(this); final googlemap map = (((mapfragment) getfragmentmanager().findfragmentbyid(r.id.nearbymapsearch)).getmap()); map.setmylocationenabled(true); //zoom users location geolocationhandler geohandler = new geolocationhandler(getactivity().getapplicationcontext()); log.i("search fragment", "" + geohandler.getcurrentlatitude() + " , " + geohandler.getcurrentlongitude()); latlng loc = new latlng(geohandler.getcurrentlatitude(), geohandler.getcurrentlongitud...

javascript - Jquery ajax on IE11 -

i have problem here. use jquery ajax send request end server , return clue notice if request proceed or not. had try in ie8 , ie7, jquery ajax works well, when try on ie11, error few times, , work after that. question is, how make run on ie11 without have wait few times? this jquery ajax script var value = $("#record"+index).attr('value'); var hiddenamount = number ($("#hiddentotalamount").val()); var values=value.split('/'); var uncheckedamount = number(values[1]); var realamount = 0; var realrecord = number ($("#totalrecord").val()); var checkeddoc = $("#record"+index).val(); var datastring = "action=validatedocnum&holddocnum="+checkeddoc; if($("#record"+index).attr('checked')){ $.ajax({ type: "post", url: "executesp2d.do", data: datastring+"&act=check", cache: fa...

node.js - Passing/Comparing by reference for javascript objects -

i'm trying compare 2 objects. use socket.io send nodes object client. my server.js goes: var nodes = {'101':{id:'101',x:100,y:200}, '102':{id:'102',x:200,y:200}}; socket.emit('message', nodes); in client, i'd create copy of object nodes first time receives. save variable oldnodes , next time socket receives nodes object, comparison oldnodes , output property has been changed. e.g., if receives var nodes = {'101':{id:'101',x:100,y:200},'102':{id:'102',x:200,y:300}}; , should print(console.log) nodes[102].y changed . client.html : socket.on('message', function(nodes){ if (oldnodes == undefined){ var oldnodes = nodes; } else{ //compare oldnodes & nodes //print result } }); for copying, var oldnodes = nodes; not want since javascript passes objects reference. so, if oldnodes & nodes have same content, (oldnodes == nodes) ...

c - What is the best way to generate prime numbers? -

i doing exercises programming in c kochan; @ initial stage, chapter 5. here task: program 5.10 has several inefficiencies. 1 inefficiency results checking numbers. because obvious number greater 2 cannot prime, program skip numbers possible primes , possible divisors. inner loop inefficient because value of p divided values of d 2 through. inefficiency avoided adding test value of is_prime in conditions of loop. in manner, loop set continue long no divisor found , value of d less p. modify program 5.10 incorporate these 2 changes. here program 5.10 // generate table of prime numbers #include <stdio.h> int main (void) { int p, d; _bool is_prime; (p = 2; p <= 50; ++p) { is_prime = 1; (d = 2; d < p; ++d) if (p % d == 0) is_prime = 0; if (is_prime) // or if (is_prime != 0); same printf ("%i ...

vb.net - Auto-save attachments in Outlook 2010 -

my goal able save attachments specific email address folder locally. have created vb script reason doesn't work. public sub saveattachtodisk (itm outlook.mailitem) dim objatt outlook.attachment dim savefolder string dim dateformat dateformat = format(now, "dd-mm-yyyy h-mm") savefolder = "c:\temp\" each objatt in itm.attachments objatt.saveasfile savefolder & "\" & dateformate & objatt.displayname set objatt = nothing next end sub i've tried created new module , new rule run script when message arrives specific address. have tried put script in "thisoutlooksession" nothing works. did try run script manually under debugger? try choose drive. c: drive requires admin privileges writing. you may find getting started vba in outlook 2010 article helpful.

django - iOS Push Notifications is not received -

backend - django frontend - objective c (x-code) i've followed this apple document configure push notifications , completed steps. for backend, using django-push-notifications django==1.7 , results no error when message sent. for frontend, have added following lines receive notification, uiusernotificationtype usernotificationtypes = (uiusernotificationtypealert | uiusernotificationtypebadge | uiusernotificationtypesound); uiusernotificationsettings *settings = [uiusernotificationsettings settingsfortypes:usernotificationtypes categories:nil]; [application registerusernotificationsettings:settings]; [application registerforremotenotifications]; - (void)application:(uiapplication *)application didregisterforremotenotificationswithdevicetoken:(nsdata *)devicetoken {...

objective c - AFNetworking GET parameters with JSON (NSDictionary) string contained in URL key parameter -

this json string has sent: { "dashboard": "compact", "theme": "dark", "show_side_bar": "yes" } to rest api using get method in format (since server retrieves data php code $_get["setting"] ) afhttprequestoperationmanager , such equivalent url becomes: http://www.examplesite.com/api/change_setting?setting={ "dashboard" : "compact", "theme" : "dark", "show_side_bar" : "yes" } when create nsdictionary of parameters in afhttprequestoperationmanager 's get:parameters:success:failure: adds url key parameter parameter dictionary this: { "setting": { "dashboard": "compact", "theme": "dark", "show_side_bar": "yes" } } in short only json string must encapsulated in setting parameter not object of setting in json string. edit: here's code: afhttpreq...

java - How to upload files to server using JSP/Servlet? -

how can upload files server using jsp/servlet? tried this: <form action="upload" method="post"> <input type="text" name="description" /> <input type="file" name="file" /> <input type="submit" /> </form> however, file name, not file content. when add enctype="multipart/form-data" <form> , request.getparameter() returns null . during research stumbled upon apache common fileupload . tried this: fileitemfactory factory = new diskfileitemfactory(); servletfileupload upload = new servletfileupload(factory); list items = upload.parserequest(request); // line died. unfortunately, servlet threw exception without clear message , cause. here stacktrace: severe: servlet.service() servlet uploadservlet threw exception javax.servlet.servletexception: servlet execution threw exception @ org.apache.catalina.core.applicationfilterchain.internaldofilter(...

python - How to remove the Xframe Options header in django? -

i have made page has iframe . inside iframe want show multiple different links article facebook, or news, or youtube video or other possible url. but, due xframe header, unable so. referred following link: https://docs.djangoproject.com/en/1.8/ref/clickjacking/ , django xframeoptionsmiddleware (x-frame-options) - allow iframe client ip but didn't help. my settings.py file's middleware_classes is: middleware_classes = ( 'django.contrib.sessions.middleware.sessionmiddleware', 'django.middleware.common.commonmiddleware', 'django.middleware.csrf.csrfviewmiddleware', 'django.contrib.auth.middleware.authenticationmiddleware', 'django.contrib.auth.middleware.sessionauthenticationmiddleware', 'django.contrib.messages.middleware.messagemiddleware', 'django.middleware.clickjacking.xframeoptionsmiddleware', ) from http://django-secure.readthedocs.org/en/latest/middleware.html , found using ...

xml - List<JAXBElement> in adapter code impacting JSON format -

i format json output contain string objects having 1 element , not array. below pojo. @component("myvo") @scope("prototype") @xmlrootelement @xmlaccessortype(xmlaccesstype.none) @xmltype(proporder = {"a", "b", "c", "d", "e", "f", "sectionlist"}) public class myvo extends serviceresponseto { private static final long serialversionuid = -9190950749517871535l; @xmlelement(name="abc") private string a; @xmlelement(name="def") private string b; @xmlelement(name="ghi") private string c; @xmlelement(name="jkl") private string d; @xmlelement(name="mno") private string e; @xmlelement(name="pqr") private string f; @xmlelement(name="section") @xmljavatypeadapter(myadapter.class) private list<map<string, string>> sectionlist ; //corresponding getters , setters @override public string tostring() { return...

java - OnClickListener doesn't work implicitly. Why? -

i created custom button class implements listener interface: public class blinkbutton extends button implements view.onclicklistener { list<onclicklistener> onclicklistenerlist = new arraylist<onclicklistener>(); public blinkbutton(context context) { super(context); this.setlistener(new highlightbuttonlistener()); } //other constructors here public void setlistener(onclicklistener listener){ onclicklistenerlist.add(listener); } @override public void onclick(view v) { for(onclicklistener listener : onclicklistenerlist){ listener.onclick(this); } } and have view: <com.example.element.blinkbutton .../> i claim onclick method inside com.example.element.blinkbutton should call implicitly when user clicks blinkbutton, it's not. have write explicitly: android:onclick="fireevent" , public void fireevent(view view) { fireeventbutton.onclick(view); } why blinkbutton.onclick(); doesn...

Value of variable is not changing on first iteration when input in loop, batch file -

this question has answer here: why setting batch script variable delayed? 1 answer by input value of variable not changing, on next iteration , show previous input value. set /a firstnum=0 set /a secondnum=0 :while if %firstnum% neq -99 ( set /p firstnum="enter first number" echo first number %firstnum% ) if %secondnum% neq -99 ( :2input set /p secondnum="enter second numer" echo second number %secondnum% if %secondnum% == 0 ( goto :2input ) ) goto :while no idea want achieve peace of nonsense if want values chenge have add setlocal enabledelayedexpansion @ beginning of code , call variables !variable! instead of %variable% .