Posts

linux - How to solve too many TCP connections on FIN_WAIT_2? -

server , client connected using port 8000. clients aborted unexpectively connections still there. besides restarting server, suggestion release legacy connections? $ net stat -an | grep 8000 tcp4 0 0 127.0.0.1.8000 127.0.0.1.58761 close_wait tcp4 0 0 127.0.0.1.58761 127.0.0.1.8000 fin_wait_2 tcp4 0 0 127.0.0.1.8000 127.0.0.1.58755 close_wait tcp4 0 0 127.0.0.1.58755 127.0.0.1.8000 fin_wait_2 tcp46 0 0 *.8000 *.* listen

java - How complete list of object into another object uqing Rxjava -

on service, client has on or many relationships. using rxjava when client want retrieve client object list of relationships. something like: datamanager.getclient(clientid) .zipwith(???) .observeon(androidschedulers.mainthread()) .subscribeon(schedulers.io()) .subscribe(); use map function change scope of data within observable: datamanager.getclient(clientid) .map(client -> client.relationships) .observeon(androidschedulers.mainthread) .subscribeon(schedulers.io()) .subscribe(list -> { *do something* });

angularjs wait for response from $http -

i have problem function doesn't wait response of http request , go further. know can use promise wait don't understand concept. i have data service have http request : function getgroupidfrombakery(bakeryid, successcallback, errorcallback) { $http.get(service.baseurl + "bakeriesgroup/bakeries/" + bakeryid) .then(function (result) { successcallback(result.data); }, errorcallback); } from service, call data service : var haspermission = function (permission, params) { permissionroute = permission; setidentity(params); (var = 0; < permissions.length; i++) { if (permissionroute.name === permissions[i].name) { if (permissions[i].scope == "system") return true; else if (permissions[i].scope == permissionroute.scope && permissions[i].identity == permissionroute.identity) return tr...

java - javax.xml.bind.UnmarshalException iccurs when unmarshalling an XML -

i use below code unmarshal xml using jaxb. responsexml contains xml string returned web service call. stringreader reader = new stringreader(responsexml); jaxbcontext = jaxbcontext.newinstance(testresponse.class); unmarshaller unmarshaller = jaxbcontext.createunmarshaller(); object idresponse = unmarshaller.unmarshal(reader); below exception occurs when unmarshalling. javax.xml.bind.unmarshalexception - linked exception: [exception [eclipselink-25004] (eclipse persistence services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.xmlmarshalexception exception description: error occurred unmarshalling document internal exception: java.lang.illegalargumentexception: ] someone work on this. below testresponse class auto generated xsd @xmlaccessortype(xmlaccesstype.field) @xmltype(name = "", proporder = { "responsecode", "responsedescription", "responsemessage" }) @xmlrootelement(name = ...

mysql - myrocks (mariadb + rocksdb) php charset -

there plenty of posts choosing right charset mysql, it's again different (and frustrating) story rocksdb engine. firstly, decided use utf8-binary charset (latin1, utf8-bin , binary supported myrocks) because data may contain special chars , want on save side. furthermore, using php , pdo loading data mysql , connection looks this: $pdo = new pdo('mysql:host=localhost;dbname=dbname;charset=utf8', 'user', 'password'); so set charset utf8 (i tried use utf8_bin , not supported pdo). although, able insert rows, errors following one: incorrect string value: '\xf0\x9f\x87\xa8\xf0\x9f...' column 'column_name' but what's error now? hex sequence encodes unicode-smily (a regional indicator symbol letter c + regional indicator symbol letter n). seems me valid utf8 , mysql php configured use it. you gotta have utf8mb4 , not mysql's subset utf8 . 🇨 needs 4-byte utf-8 encoding, hex f09f87a8 . if rocksdb not support ...

javascript - JS Animation really buggy -

i'm trying build image slider automatically takes div ids , animates them. far works buggy. animation lagging lot , when minimized tab, slides animated @ same time. i made jsfiddle issue: https://jsfiddle.net/2cdwgvm7/ js: function slider() { var counter = 0; var sliderebene = document.getelementbyid(imageids[counter]); sliderebene.style.left = '0px'; var counter = 1; var flag = true; var functionisrunning = true; function clickslider() { forward.addeventlistener('click', function () { functionisrunning = true; if (counter >= imageids.length) { counter = 0; } else { var sliderebene = document.getelementbyid(imageids[counter]); var pos = browserwidth; var id = setinterval(frame, 0.6); function frame() { if (pos == 0) { sliderebene.style.zindex = ...

rust - Is there a way to add elements to a container while immutably borrowing earlier elements? -

i'm building gui , want store used textures in 1 place, have add new textures while older textures immutably borrowed. let (cat, mouse, dog) = (42, 360, 420); // example values let mut container = vec![cat, mouse]; // new container let foo = &container[0]; // container immutably borrowed container.push(dog); // error: mutable borrow is there kind of existing structure allows this, or can implement using raw pointers? the absolute easiest thing introduce shared ownership : use std::rc::rc; fn main() { let (cat, mouse, dog) = (42, 360, 420); let mut container = vec![rc::new(cat), rc::new(mouse)]; let foo = container[0].clone(); container.push(rc::new(dog)); } now container and foo jointly own cat . is there kind of existing structure allows this, yes, there tradeoffs. above, used rc share ownership, involves reference counter. another potential solution use arena: extern crate typed_arena; use typed_arena::arena; fn main(...