Posts

c# - FTPWebRequest: The underlying connection was closed: An unexpected error occurred on a receive -

i've got problem when uploading files ftp server. connection works fine on local connection - however, im trying connect public ip address of system ( ftp://xx.xxx.xxx.xx ). can connect fine on filezilla upload , download files - however, reason not seem work. this code im using create webrequest: ftpwebrequest request = (ftpwebrequest)webrequest.create("ftp://xx.xxx.xx.xxx" + uploadpath); request.usebinary = true; request.keepalive = false; request.method = webrequestmethods.ftp.uploadfile; that runs fine in debug mode, filepaths allowed, etc.. however, code throwing error in section here: byte[] b = file.readallbytes(tarpath); request.contentlength = b.length; using (stream s = request.getrequeststream()) { s.write(b, 0, b.length); } ftpwebresponse ftpresp = (ftpwebresponse)request.getresponse(); if (ftpresp != null) { debug.writeline(ftpresp.statusdescription); } any ideas? i've searched through various online posts error , of them in regard...

logstash - Remove unnecessary fields in ElasticSearch -

we populating elasticsearch via logstash. thing see unnecessary fields had remove example: @version file geoip host message offset tags is possible defining/extending dynamic template? if yes, how? if no, can via logstash configuration? your appreciated. you can remove fields using logstash filter - when filter succeeds, remove field. it makes sense me use mutate: filter { mutate { remove_field => [ "file" ] } } that said, of these fields incredibly useful , should not removed.

Atom editor locking git -

whenever open project in atom editor, git throws permission denied whenever merge branches. closing atom resolves issue. is possible avoid behavior in atom? edit: using sourcetree https://www.sourcetreeapp.com/ i not see such behavior git , atom. may issue 1 of packages have atom. can provide list of packages have installed in atom?

android - I am using Google Maps service (Places, directions). After using for a while I am receiving response : -

i using google maps service places , directions after using while receiving response server. { "error_message" : "you have exceeded daily request quota api.", "predictions" : [], "status" : "over_query_limit" } please solve problem thanks you'll need upgrade paid plan raise query limit. see https://developers.google.com/maps/pricing-and-plans/

java - How to get Enum when it's string representation and type are known at Runtime? -

suppose have enum as: com.mypackage.enums public enum days { monday, tuesday, wednesday } now somewhere know need enum monday runtime string provided "monday". know enum lies in com.mypackage.enums.days how can this? or without reflection? edit: both string "monday" , class com.mypackage.enum.days determined @ runtime. class provided object of class , not string. an alternative @jonskeet solution not involve raw types (only unchecked cast): static <t extends enum<t>> enum<t> getvalue(string classname, string name) throws classnotfoundexception { @suppresswarnings("unchecked") class<t> clazz = (class<t>) class.forname(classname); return enum.valueof(clazz, name); } public static void main(string[] args) throws exception { string classname = "day"; string name = "saturday"; // note use of raw type system.out.println("parsed:...

iphone - Reading large files from NSInputstream is not working in ios -

i trying read large image file more 300kb nsinputstream. i'm getting upto 300kb. other data missing. please me if know. i'm waiting valuable answer. mentioned code below : call readalldata method nsstreameventshasbytesavailable: - (void)readalldata { if (_readdata == nil) { _readdata = [[nsmutabledata data] retain]; } while ([[_session inputstream] hasbytesavailable]) { unsigned int bytesread = 0; bytesread = [[_session inputstream] read:buf maxlength:ead_input_buffer_size]; if (bytesread) { nsmutablestring *_string = [nsmutablestring stringwithstring:@""]; (int = 0; < _readdata.length; i++) { unsigned char _byte; [_readdata getbytes:&_byte range:nsmakerange(i, 1)]; if (_byte >= 32 && _byte < 127) { [_string appendformat:@"%c", _byte]; } else { [_string appendformat:@"[%d]", _byte]; ...

azure - What is the difference between Worker Role and Worker Role with Service Bus Queue -

what difference between these 2 implementations, can tell 1 use under scenario? also pros , cons if there any? in advance. there isn't difference between two. worker role service bus queue vs project template adds service bus dependencies , configures empty message handling function , adds code ready set own connection string etc. if planning on implementing worker role reads queue save little typing time. if prefer can create basic worker role project , add queue handling logic it, achieve same thing.