host

How to read HTTP request headers in a WCF web service?

匿名 (未验证) 提交于 2019-12-03 01:52:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: In a WCF web service, how does one read an HTTP/HTTPS request header? In this case, i'm trying to determine the original URL host the client used. This might be in the X-Forwarded-Host header from a load balancer, or in the Host header if it's direct-box. I've tried OperationContext.Current.IncomingMessageHeaders.FindHeader but i think this is looking at SOAP headers rather than HTTP headers. So, how to read HTTP headers? Surely this is a simple question and i'm missing something obvious. EDIT - @sinfere's answer was almost exactly what i

Android USB Host - bulkTransfer() is losing data

匿名 (未验证) 提交于 2019-12-03 01:49:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to receive data from a custom device based on an FTDI 2232H chip. I am using a simple Async FIFO mode, and the incoming data rate is 3.2MB/sec. Everything works perfectly with test code on my PC, but I'm having problems receiving data on my Toshiba Thrive. TDI's Android driver fails, so I am coding using Java. I can receive 95%+ of the data perfectly, but every once in a while the data 'sputters' and I get portions of the same 4-5K of data two or three times, then back to good data. I am not going too fast for the Thrive or

TLS connection using SSLSocket is slow in Android OS

匿名 (未验证) 提交于 2019-12-03 01:48:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm developing an Android app which uses SSLSocket to connect to a server. This is the code I'm using: // Connect if (socket == null || socket.isClosed() || !socket.isConnected()) { if (socket != null && !socket.isClosed()) socket.close(); Log.i(getClass().toString(), "Connecting..."); if (sslContext == null) { sslContext = SSLContext.getInstance("TLS"); sslContext.init(null, trustAllCerts, new SecureRandom()); } SSLSocketFactory socketFactory = sslContext.getSocketFactory(); socket = (SSLSocket)socketFactory.createSocket(host, port); socket

Target host must not be null or set in parameters.scheme=null,host=null

匿名 (未验证) 提交于 2019-12-03 01:48:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: i am getinng the following exception: Target host must not be null or set in parameters.scheme=null, host=null,path=/webservices/tempconvert.asmx/FahrenheitToCelsius My source code: public class ParActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); TextView t=new TextView(this); String encodedUrl = null; // setContentView(R.layout.main); HttpClient client = new DefaultHttpClient(); //String query = "?Fahrenheit=26"; // String host = "www.w3schools.com/webservices

How to run “host” functions on GPU with CUDA?

匿名 (未验证) 提交于 2019-12-03 01:47:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm going to run on GPU for example a strcmp function, but I get: error : calling a host function ( "strcmp" ) from a __device__ / __global__ function ( "myKernel" ) is not allowed It's possible that printf won't work because gpu hasn't got stdout, but functions like strcmp are expected to work! So, I should insert in my code the implement of strcmp from the library with __device__ prefix or what? 回答1: CUDA has a standard library, documented in the CUDA programming guide. It includes printf() for devices that support it (Compute

logstash json post output

匿名 (未验证) 提交于 2019-12-03 01:46:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am current trying to do a JavaScript post to Logstash by using a tcp input. JavaScript Post xhr = new XMLHttpRequest(); var url = "http://localhost:5043"; xhr.open("POST", url, true); xhr.setRequestHeader("Content-type", "application/json"); var data = JSON.stringify({"test" : hello}); xhr.send(data); Logstash config file input { tcp { port => 5043 } } filter{ } output { stdout { codec => rubydebug } } Output in console { "message" => "OPTIONS / HTTP/1.1\r", "@version" => "1", "@timestamp" => "2016-12-15T09:58:54.611Z", "host" => "0:0:0:0

Unable to load balance using Docker, Consul and nginx

匿名 (未验证) 提交于 2019-12-03 01:45:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: What I want to achive is load balancing using this stack: Docker, Docker Compose, Registrator, Consul, Consul Template, NGINX and, finally, a tiny service that prints out "Hello world" in browser. So, at this moment I have a docker-compose.yml file. It looks like so: version : '2' services : accent : build : context : ./ accent image : accent container_name : accent restart : always ports : - 80 consul : image : gliderlabs / consul - server : latest container_name : consul hostname : $ { MYHOST } restart : always ports : - 8300 :

java.lang.IllegalStateException… at tabhost.add(tabspec);

匿名 (未验证) 提交于 2019-12-03 01:45:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Hi guyzz I have TabActivity as following simple code public class TabhostActivity extends Activity{ TabHost host; public class TabhostActivity extends Activity{ TabHost host; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.tablayout); host = (TabHost) findViewById(R.id.mytabhost); host.setup(); Intent intent = new Intent(getApplicationContext(), RatingBarActivity.class); TabHost.TabSpec spec = host.newTabSpec("positions")

How to use TLS 1.2 in Java 6

匿名 (未验证) 提交于 2019-12-03 01:45:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: It seems that Java 6 supports TLS up to v1.0, is there any way to use TLS 1.2 in Java 6? Maybe a patch or a particular update of Java 6 will have support for it? 回答1: Public Oracle Java 6 releases do not support TLSv1.2. Paid-for releases of Java 6 (post-EOL) might. ( UPDATE - TLSv1.1 is available for Java 1.6 from update 111 onwards; source ) Contact Oracle sales. Other alternatives are: Use an alternative JCE implementation such as Bouncy Castle. Use an IBM Java 6 ... if available for your platform. According to "IBM SDK, Java Technology

Virtual Hosts in CentOS 7 + Laravel

匿名 (未验证) 提交于 2019-12-03 01:45:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have problems with my VirtualHosts The Directory of the website is /var/www/html/laravel The httpd.conf file is When open the website show me this error: Somebody can help me? Thanks 回答1: I found a Solution! I have many sites in /var/www/html folder. www.example.com/site1 www.example.com/site2 ... The solution is create one alias for each site in httpd.conf . example: Alias / site1 / var / www / html / site1 < VirtualHost *: 80 > DocumentRoot "/var/www/html/site1" </ VirtualHost > Alias / laravel / var / www / html / laravel /