w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Most lightweight cross-platform http python host
The most lightweight would be wsgiref.simple_server from the standard library which Django's runserver command uses internally. Alternatively you can use WSGI server from the Paste This is a minimalistic WSGI server using Python’s built-in BaseHTTPServer; if pyOpenSSL is installed, it also provides SSL capabilities. Waitress from the Pylons project Waitress is meant to be a production-quality pure-Python WSGI server with very acceptable performance. It has no dependencies except ones which live in the Python standard library. It runs on CPython on Unix and Windows under Python 2.6+ and Python 3.2+. It is also known to run on PyPy 1.6.0 on UNIX. It supports HTTP/1.0 and HTTP/1.1. WSGI server from CherryPy A high-speed, production ready, thread pooled, g

Categories : Python

Could not find installable ISAM. Server Error in '/' Application
I've encountered this error, and I've read this article back and forth but no vain. Finally, I've understood that the trouble is something with the security. So, my solution was to use the local (default) mdw file (Microsoft Access Workgroup Information) like this: string strConnectionString = "Provider='Microsoft.Jet.OLEDB.4.0';Data Source=" + p_strFileName + ";Jet OLEDB:Database Password=" + p_strDBPassword + ";Mode=Share Exclusive;Persist Security Info=True;"; // Important part - using mdw file strConnectionString += "Jet OLEDB:System Database=" + Environment.GetEnvironmentVariable("APPDATA") + @"MicrosoftAccesssystem.mdw"; and use the connection on code: var conn = new OleDbConnection(strConnectionString);

Categories : Asp Net

Client-Server Program: Client can connect to server easily but server can't respond cause target machine actively refuses connections
You need to design your client and server so that the client-to-server connection remains open to recieve the responce and then do something like this: public static bool sendTo(IPEndPoint ip, String data) { TcpClient client = null; NetworkStream stream = null; StreamWriter writer = null; StreamReader reader = null; try { client = new TcpClient(); client.Connect(ip); stream = c.GetStream(); writer = new StreamWriter(stream); writer.WriteLine(data); writer.Flush(); reader = new StreamReader(stream); string response = reader.ReadLine(); if (response == "roger-alpha-tango") { return true; } } catch { return false; } finally { i

Categories : C#

How to send an image from HTTP client to http server listening on this URL(http://localhost:8000/test)
Are you using web container like apache/nginx or one you write it yourself? If you are wondering how to decode the tcp packet in your own server, just upload a file to a server and grasp the http packet to see the detail of the protocol

Categories : Misc

Writing a custom http server, does supporting AJAX require extra code over HTTP GET?
AJAX is fine, it's just GET (or occasionally POST) requests which are formatted exactly the same on the server side. The difference on the server is, they'll typically go to a different "servlet" (or method in your C code) to be answered. Typically, the answer may be XML, JSON (serialized data for Javascript) or perhaps an HTML fragment (without or tags, just the content of a or something.). Or it could just be a 200 OO response indicating "success". On the browser side, AJAX is requested & used from Javascript within a page; with the results then either pasted into the DOM via innerHtml (for HTML fragments), or built into the DOM via Javascript (for JSON). The second option is less performant. Your first typical use-case might well be an autocomplete for a search-box, or somet

Categories : C

C HTTP Server & OpenSSL - Works fine for HTTP - Multiple/rapid/concurrent connections being dropped using HTTPS
You should call SSL_accept() in your request handling thread. This will allow your listening thread to process the TCP accept/listen queue more quickly, and reduce the chance of new connections getting a RESET from the TCP stack because of a full accept/listen queue. SSL handshake is compute intensive. I would guess that your spammer is probably not using SSL session cache, so this causes your server to use the maximum amount of CPU. This will cause it to be CPU starved in regards to servicing the other connections, or new incoming connections.

Categories : C

How to parse http Get request body in a Go http server?
Most of the magic happens in transfer.go. Here's what I found that looks relevant in the fixLength func: if !isResponse && requestMethod == "GET" { // RFC 2616 doesn't explicitly permit nor forbid an // entity-body on a GET request so we permit one if // declared, but we default to 0 here (not -1 below) // if there's no mention of a body. return 0, nil } Looks like, as long as your client is ending a Content-Length header, you're all good. If not, the library will assume there's no body on a GET request. You're kind of off the edge of the map as your client is doing some pretty unusual/broken stuff. If you can fix the client, that's your best bet. That said, if you have a client you need to support that's doing this wrong, you're going to have to roll so

Categories : Http

Myrrix recommend vs recommendToAnonymous
They are nearly identical in speed. The 'anonymous' method has to form a temporary user vector, which takes time proportional to the # of items passed, but this is quite fast. Neither uses any significant memory. The problem with always using the anonymous method is that you would have no data actually in your model then!

Categories : Misc

Why do people recommend against using Amazon RDS?
The only thing that you would give up by using RDS, are the logs, unfortunately RDS doesn't provide a full set of logs which sometimes are vital for debugging. If you can live without them and you have a strong testing before going to production then RDS is the way to go.

Categories : Mysql

VB.Net could not find installable isam oledb excel
Could not find installable ISAM. Imports System.Data.OleDb Public Class Form1 Dim con As New OleDb.OleDbConnection Dim da As New OleDb.OleDbDataAdapter Private Sub btnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClose.Click Me.Close() End Sub Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click Me.txtstdID.Text = "" Me.txtstdName.Text = "" Me.txtstdPhnno.Text = "" Me.cmbGender.Text = "" Me.txtAddress.Text = "" Me.txtstdID.Focus() End Sub Private Sub RefreshData() If Not con.State = ConnectionState.Open Then con.Open() End If Dim dt As New DataTable ' Dim da As OleDb.OleDbDataAdapter ("select * from student")' da.fill(dt)

Categories : Vb.Net

php5-mysql : Depends: libmysqlclient16 (>= 5.1.21-1) but it is not installable
If you are facing problems regarding Broken packages then first of all remove that package by first checking dependencies and then forcefully remove that package, and don't ever forget to reboot when you do make enormous changes in your system. To remove that package use these shell commands First be a super user : login through root $ sudo su Then Enter your password # apt-cache rdepends package-name # apt-get --purge remove --force package-name Then reboot your system and put these shell commands # apt-get clean # apt-get autoclean # apt-get update # apt-get upgrade # apt-get dist-upgrade # reboot and When you are done try re installing your desired package with # apt-get install package-name This worked in my Ubuntu, Try this, I believe this will fix all your problems, Good

Categories : PHP

Could not find installable ISAM in excel 2007 vba
I don't know what is inside your XLSM file you retrieve data from but you connection string should be as simple as possible. This is working for me (but I didn't check for read-only parameter): "Provider=Microsoft.ACE.OLEDB.12.0;" & _ "Data Source=C:UsersDaneBazaDanych.xlsm;" & _ "Extended Properties=Excel 12.0 Macro"

Categories : Vba

Easeljs, is it a recommend way to fix the size of container?
Consider a container as a group of objects, not a physical container. Containers give you the ability to transform, translate, cache, and otherwise control multiple items as a single item. They do not really have a physical size, except that of their collective children. There is no width or height mainly due to the cost of calculating the size, especially considering transformations, sub-containers, etc. There may be support added in the future for width/height, but for now its not available.

Categories : HTML

nginx as load balancer server out 404 page based on HTTP response from app server
Simply set the proxy_intercept_errors option to on and create an nginx error page for it. error_page 404 /404.html; proxy_intercept_errors on; To ensure that nginx will serve the static file from it’s document root you also have to specify the following: location /404.html { internal; } I'm assuming here that nginx is configured to talk with your app servers as proxy, because that is the usual way and your question does not mention any of this.

Categories : Nginx

Server-side Websocket implementations in non-event driven HTTP Server Environments
Underlying network logic to deal with sockets depends on platform, OS and particular software implementations. Most common three methods are: pulling - there is blocking constant "asking" if socket has some data. This method is well bad, as it will block execution of main thread for as long as it waits for some data. thread per socket - each new connection involves creating new thread and asking each socket in blocking manner happens within that thread. So it wont block main thread with logic. This method is bad as creating thread for each connection is too expensive for memory, and can be around 1Mb or RAM based on OS and other criteria. async - uses system features to "notify" your process when there is something. So you can react once your app is ready (in case of single threaded app)

Categories : Perl

Server Code HTTp POST to remote server; Javascript API call
use the $ajax() function from jquery use urllib and urllib2 to access external resources from python. Call these libraries from within your view function Here's an example for the $ajax function: $.ajax({ type: "GET", url: '/htmlApi/sendSms/', data: { 'phone':'+12412354135', }, success: function(data){ $("#ajaxDestination").html(data); } }); here's an example of a view function that posts data to the remote server: def verify1(request): u = request.session['user'] u.phone_number = request.GET['phone'] u.save() apiUrl = "http://www.XXXXXXXXX.net/api/send.aspx?username=XXXXXXX&password=XXXXXX&language=1&sender=XXXXXX&mobile=" + request.GET['phone'] + "&message=" + 'ghis' + " is your verificatio

Categories : Javascript

apache http client org.apache.http.NoHttpResponseException: The target server failed to respond
Check if your "URL" has correct value. Error message says "The target server failed to respond". That's either your provided URL has wrong or server has shut down. If you provided wrong parameter name/value or something, error message would be different.

Categories : Java

Could not find installable ISAM - Reading Excel Sheets through SAP B1
Actuality in connection string, it needs two ; (semicolons) at the end. So *connString * must be like follow: var connString = string.Format("Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties='Excel 12.0 Xml;HDR=YES;';", saved_FileName); It worked for me.

Categories : C#

PHP on apache server http calling javascript api on tomcat server
You can use PHP-cURL to do a request to the Tomcat server from you php script: http://php.net/manual/en/book.curl.php Or, if you need something a bit simpler, just do file_get_contents to the http location: http://php.net/manual/en/function.file-get-contents.php

Categories : PHP

server code HTTP POST to the remote server - Django
Ajax CAN do cross-domain calls, but the other domain must allow you to do so by using CORS. However, if you really just need to reflect an external API from your own domain, you can set your web server to reverse proxy the relevant endpoints of the external API. This will be much more performant than proxying through Django. You can even use your web server to add authentication details into the proxied request. Apache Docs Nginx Docs

Categories : Javascript

Recommend ways for passing configuration to modules
One solution could be using something like nconf and rely on it to load the right files at the right time. Particularly in your case, I'd go by creating a conf folder in the root of your project with a default.json configuration file. You can then create a global configuration.js that leverages nconf and the newly created file: var nconf = require("nconf") , path = require("path") , environment; nconf.argv().env("_"); environment = nconf.get("NODE:ENV") || "development"; nconf.file("default", path.resolve("config/default.json")); module.exports = nconf.get From the other modules that require the some configuration, you can simply use: var conf = require('configuration.js') conf('NODE_ENV') // print NODE_ENV But it sounds like it's very similar to what you DON't want. The othe

Categories : Node Js

Why does sinatra nginx recipe recommend only 1 worker?
It probably doesn't have anything to do with the relationship between the two, just the fact that whoever wrote the tutorial was using a single processor machine (usually you assign one worker process per core with Nginx).

Categories : Nginx

Recommend an approach for 'modeling' localized strings for the view?
Using auto-generated resource accessor class (Running PublicResXFileCodeGenerator at compile time) and simply rendering strings in a view using whatever rending engine you prefer is simple and straightforward version. Razor sample below: @* assuming CurrentUICulture is set correctly for whole request *@ <span>@Resource.DirectionsTitle</span> If you need to pass localized strings to JavaScript - rendering in a view in script tag is possible option (don't forget proper encoding).

Categories : C#

would you recommend using assembly to access arguments in this exceptional case?
No, I would not. Calling conventions may vary (between x86 and x86_64); Parameters could be pushed to the stack or put into register, and I'm not sure you can know for sure where they'll be. Writing this in assembly, unless you really know what you're doing is likely to lead to undefined behavior code.

Categories : C++

using PHP to recommend products based on the current view item
Assuming you have your data set up as such. items: +----+-------------+------+ | id | category_id | name | +----+-------------+------+ categories: +----+------+ | id | name | +----+------+ You could use select * from items left join categories on categories.id = items.id where item.category_id = $category_id limit 4 this will pull 4 items from the same category as whatever $category_id is set to. thats as good an answer as i can give with the data you've given.

Categories : PHP

how to recommend other contents that created by a node author to a visitor in drupal 7?
Contextual filters in View is the easiest / most correct way to accomplish this task. You can create a view that defines a block and shows content of the type you are after. Then by adding a Contextual filter of "Author uid" and selecting the 'provide default value' bullet and choosing User ID from URL, then that block will display content created by that same user. I can offer you some screenshots if that would help. Views is most excellent at performing this task IMO

Categories : Drupal

Solr : Server at http://localhost:8080//solr returned non ok status:500, message:Internal Server Error
Hey great news I was able to solve the issue. Two changes required. First I edited solrconfig.xml to remove extra tab like to for every path and second change was to copy jars from /solr/contrib/extraction/lib to /tomcat/web-inf/lib folder. –

Categories : Solr

IIS 7.5, ASP.NET MVC. HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfil
I assume you're using Chrome as your web browser? This is the default error page Chrome displays when it receives a 500 HTTP response from the server with no content. You need to find the cause of this error. Open the Event Viewer (Win+R, type "eventvwr.msc", click OK). Expand "Windows Logs" and click "Application". Look for an error or warning that relates to IIS, W3SVC or similar. It's likely an error that's occurring before the request reaches the .NET pipeline.

Categories : Asp Net

Lightweight messaging on GAE
You have some stuff (task queues) built into GAE for messaging. Start with that. The problem with running stand alone integration soltuions (Camel, Spring Integration, ActiveMQ..) on GAE is that they need to open tcp listeners and start threads, which is not really an option in GAE. At least not the standard java way. You can run Camel to some point if you want to leverage the Camel DSL and such things. But all of Camel will not work. Camel does not include a messaging solution either. The other option is likely to use some external messaging source, such as a RabbitMQ or ActiveMQ hosted somewhere else. Like EC2 or some cloud service.

Categories : Google App Engine

WireShark lightweight capture, can it be done?
I don't really need to capture the contents of a frame ... I'm essentially just making sure that some traffic is flowing, and maybe checking a few flags (FIN ACK etc) So you need only the TCP header (and all the packet data that goes before the TCP header). A typical IPv4 header is 20 bytes long, as is a typical TCP header, so, on an Ethernet, you would typically only need to capture the first 54 bytes of the packet. For IPv6, the typical header is 40 bytes long, so that, on an Ethernet, you would typically only need the first 74 bytes. However, the IPv4 and TCP headers might have options, and the IPv6 header might have extension headers, so capturing 68 bytes for IPv4 or 96 bytes for IPv4-or-IPv6 might be better For other networks, you'd have to adjust that value based on the lin

Categories : Networking

Lightweight GNU readline alternative
This is an admirable goal I think :-) Perhaps Linenoise, libedit/editline or tecla would fit the bill? Of those probably libedit is the most widely used - e.g. postgreqsql client shell and various BSD utilities for Kerberos and ntp (although for the upstream sources it may not be the default line editing library for compilation due the to widespread use of libreadline on Linux). There are a couple of slightly different versions of libedit/editline as you'll see if you read some of those references and do some further research. Cheers, and good luck with your project.

Categories : C

How do I test persistence layer (lightweight)
You could consider creating a in-memory HSQL, H2 or Derby database and test your persistence layer against that database. To make sure the test database has an up-to-date schema, you could either use Liquibase (you can use that to update your real database as well) or DBUnit. If you place your persistence.xml for testing in src/test/resources, it should override the version that resides in src/main/resources. This way you can easily make configuration changes (for example, skip connection pooling and just use the in-memory database instead of whatever database you normally use). After your tests have ran and the JVM has shutdown, your database is thrown away automatically.

Categories : Java

Is a Task lightweight compared to a Thread?
You are right - everything runs on a thread under the covers. The reason people say that a Task is more lightweight than a Thread is that Microsoft put a lot of thought into having Tasks make efficient use of Threads, and the implementation is probably much lighter weight than what the average developer would come up with on their own using the Thread class. EDIT A more clear explanation is that a Task object is lighter weight than a Thread object, and while each Task is eventually run on a Thread, creating N Task objects concurrently leads to less than N concurrent Thread objects being used, for large N.

Categories : Multithreading

Lightweight release of a very simple Qt program
You won't get too far when you don't compile your Qt yourself. For a simple Qt GUI app you need at least the Qt5Core and the Qt5Gui dll. They are not so big, However, the available binaries have a dependency to ICU. This lib is a bit large. If you don't need QWebKit you can disable ICU. There is probably some other stuff you can disable when you don't need it, but ICD is by far the biggest dependency. And don't worry about the LGPL. You don't modify your libs. You just don't deliver the whole package. This is not what the LGPL demands. So it is perfectly fine just to deliver Qt5Core and Qt5Gui. Even when you configured and compiled your Qt5 yourself. You did not change the code of a lib.

Categories : Qt

A lightweight Java library with Preconditions?
I would use the whole library as suggested in the comments, but if you really want the small size, there is a recommended way specified in guava's docs - Shrinking JARs with ProGuard

Categories : Java

6502 lightweight compression algorithms
If it's the Forth source code you're most worried about, you could restrict the character set to the 48 Chuck Moore chose for colorForth and use his Shannon coding scheme which results in 5.2 bits per character on average. He also claims that colorForth source is only about twice the size of the object code. By the way, it seems that the character set is ever so slightly different in arrayForth (see pg. 47 of the User's Manual - different order for digits, apostrophe instead of colon, etc.). Using the Shannon coding has nothing necessarily to do with colored words of course. If you wanted to go all the way and store pre-parsed words as in colorForth you could use his scheme here. He doesn't give many details, but for etherForth he abandoned the Shannon coding and went with a simple 6-bit

Categories : Assembly

Lightweight tilt onClick / JS or CSS3
You have to use an Interval function, rather using a for-loop with the limit of 3. There are several ways to do the Interval function in JS, you can use setInterval(?,?), and pass the function name and interval in milliseconds should do the Trick setInterval(localFunction, 100); // 1 second setInterval(globalFunction(), 200); // 2 seconds try jQuery: setInterval

Categories : Javascript

Lightweight fork replacement for threads
That looks like it should work just fine, although there should be an error check on fork (it returns undef on failure), and it needs elaboration if you want any means of communicating between the children and the parent, or between different children.

Categories : Perl

Lightweight, multi-language and bidirectional RPC
If java and python language support is sufficient, one alternative you might consider is Versile (full disclosure: I am one of the developers). Supports bi-directional object interaction. That is also how you would implement "registering to events", by providing an object to a peer for event callbacks. Best source of more info is Versile Python documentation overview and examples.

Categories : Java

draw charts lightweight libraries
There is another light weight graph library with much improved and simple options. The name of this library is GraphView library. It provides the features of drawing graphs both statically and dynamically. Also the are many other features like pinch to zoom and others. Using GraphView library: Google for the GraphView.jar and place it inside your /libs folder under your applications directory. Below is a sample code to draw a random curve (sine wave): GraphViewSeries rndSeries=new GraphViewSeries("random curve",null,data); Log.d(TAG, "Series created"); GraphView graphView=new LineGraphView(getApplicationContext(), "Amplitude-Time Graph X-axis:Time(ms) Y-axis: Amplitude"); Log.d(TAG, "Line Grap

Categories : Android

© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.