w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Setting up local ip over wireless network to create a local server on Ubuntu
Just add this to your normal runserver command: python manage.py runserver 0.0.0.0:8000 Then others on your local network can access it through: http://192.168.1.18:8000

Categories : Django

Create a local .php page on my server
You can take a look at $_SERVER['REMOTE_ADDR'], which is the address of the client connecting to a php script. if ($_SERVER['REMOTE_ADDR'] == '127.0.0.1') { // connection from localhost, proceed } else { // connection from the outside, deny header('403 Forbidden'); echo "You are not allowed to be here."; die(); } Take into account that if you have a reverse proxy in the same machine, then all connections to your script will come from the proxy, and you will have no way to know if they are really from localhost or from another host. Comment from @x4rf41 is also good, managing that from the webserver layer (although it has the same problem with reverse proxies). Another option would be a command line script instead of a web page, where you would pass the data as parameters to

Categories : PHP

Update masters SQLite database table in local with MS SQL in Server
Put following code in your async task in doInbackground() public boolean getData() { try { SoapObject soReturn ; String [] ParameterName = new String[2]; String [] ParameterValue = new String[2]; ParameterName[0] = "MANUFACTURERID"; ParameterValue[0] = manmasid; ParameterName[1] = "MANUFACTURERDESC"; ParameterValue[1] = manmas; try { objWSConfig.SetURL(URL, WebService); objWSConfig.SetSOAPAction(SoapAction, MethodName); objWSConfig.SetWebService(WebService); objWSConfig.SetMethod(MethodName); ws_Method = objWSConfig.getMethod();

Categories : Android

Create CSV and Save on local/server automatically
This code will do the trick $data_array = array ( array ('1','2'), array ('2','2'), array ('3','6'), array ('4','2'), array ('6','5') ); $csv = "col1,col2 ";//Column headers foreach ($data_array as $record){ $csv.= $record[0].','.$record[1]." "; //Append data to csv } $csv_handler = fopen ('csvfile.csv','w'); fwrite ($csv_handler,$csv); fclose ($csv_handler); echo 'Data saved to csvfile.csv'; put be sure about permession of csvfile so your script can create or write on it

Categories : PHP

Pyqtgraph with anaconda python on MAC gives nib error
The solution is to use python.app (or the equivalent pythonw) to run the program, instead of just python. If pyqtgraph installed any commands, you'll need to edit them so that their shebang line calls #!/path/to/anaconda/bin/python.app/Contents/MacOS/python.

Categories : Python

SQL Server 2008 Express - How to update my local database to server database
You can alsouse tools which generate diff scripts, like this one for schema or see here

Categories : SQL

When does Python create a name record in the local scope
The problem is that the Python compiler can't determine basedir's proper scope. Scoping in Python is determined statically. But basedir="empty" assignment statement makes basedir variable as a local variable for newf function. And as a result you cannot access a local variable before its first assignment. And as for your "fix" just you removed assignment of basedir="empty" and basedir isn't more local for newf but it uses from deco function.

Categories : Python

Importing scipy.misc.pilutil in python using Komodo and Anaconda?
The problem is that the scipy.misc.__init__ deletes the pilutil module - relevant code line - so you cannot import it directly. But all functions from the pilutil module are, before that, added to the misc module, and you can use them from there: In [1]: from scipy import misc In [2]: misc.fromimage Out[2]: <function scipy.misc.pilutil.fromimage> In [3]: misc.bytescale Out[3]: <function scipy.misc.pilutil.bytescale>

Categories : Python

How can I create/install a SSL Cert for a standalone Datasnap Rest Server on local network
First purchase an SSL certificate from a provider such as GoDaddy or RapidSSL. When purchasing you specify the domain name that the certificate will represent. Obviously you can point the domain name to any IP address you wish by configuring the DNS entries for your domain. I've never configured a certificate to point to an actual IP address but I guess it's possible. Given you want to have your server accept requests from the internet, I would use a domain name so that you can change the IP address if required. When purchasing your SSL certificate, you will need to provide a Certificate Signing Request (CSR) which you generate on your server computer, specifying the domain name you want to use the SSL certificate for. You can use a utility such as the DigiCert util (www.digicert.com

Categories : Delphi

why I get python exception "OperationFailure: local.oplog.rs missing. did you drop it? if so restart server" every morning on CI?
we found that we were cleaning mongo databases every night with : db.adminCommand("listDatabases").databases.forEach( function (d) { if (d.name != "admin" && d.name != "config") db.getSiblingDB(d.name).dropDatabase(); }) But we were dropping db.local which is not a good idea : it holds replicaset config !

Categories : Python

python: create and update a datetime field in a sqlite db
Okay, I figured it out. You have to import time import datetime and then, rather than TempDateC = time.strptime(TempDateC, "%Y-%m-%dT%H:%M:%SZ") you need to parse the date with a few functions: TempDateC = datetime.datetime.fromtimestamp(time.mktime(time.strptime(TempdateC, "%Y-%m-%dT%H:%M:%SZ")))

Categories : Python

Error in AJAX post when running from local web server but not local file system
Note to anyone who runs into this. It took me about a day to figure it out. First off Blender was right about the POST requests, I changed them to GET requests. Secondly the issue, as I found out lied not within my code, but with IIS 7.5. It does not come with json as a predefined MIME type. Here are the steps in order to solve this. 1)Make sure you are running IIS 7.5. 2)Open the IIS Services Manager. 3)Open up MIME Types 4)Add a new MIME type 5) There are two fields to fill out. File Name Extension: JSON MIME Type: application/json After that it should work.

Categories : Jquery

Using Python FTP Server (pyftplib) - create HTML file on log in
What worked for me was not editing the handler.py file, but rather creating my own subclass (myFTPHandler) and then redefining the onconnect method to write my html file then. Thanks for the help though!

Categories : Python

How would I create a Python web server that downloads a file on any GET request?
Try following: import BaseHTTPServer import os import shutil import sys FILEPATH = sys.argv[1] if sys.argv[1:] else __file__ class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): def do_GET(self): with open(FILEPATH, 'rb') as f: self.send_response(200) self.send_header("Content-Type", 'application/octet-stream') self.send_header("Content-Disposition", 'attachment; filename="{}"'.format(os.path.basename(FILEPATH))) fs = os.fstat(f.fileno()) self.send_header("Content-Length", str(fs.st_size)) self.end_headers() shutil.copyfileobj(f, self.wfile) def test(HandlerClass=SimpleHTTPRequestHandler, ServerClass=BaseHTTPServer.HTTPServer, protocol="HTTP/1.0"): if

Categories : Python

How to create multi-server sockets on one client in Python?
You can use select. http://pymotw.com/2/select/ plus the select documentation. Or some third party module such as twisted.

Categories : Python

Can't get a XMLHttpRequest's response neither from local file:/// nor from local web server
Feedburner does not support CORS (yet). These are the headers I receive from feedburner when executing your code from jsfiddle: HTTP/1.1 200 OK Content-Type: text/xml; charset=UTF-8 ETag: ckkcnAejDTcF+4d0Kj6kftZuq+0 Last-Modified: Tue, 30 Jul 2013 19:56:16 GMT Content-Encoding: gzip Transfer-Encoding: chunked Date: Tue, 30 Jul 2013 19:58:11 GMT Expires: Tue, 30 Jul 2013 19:58:11 GMT Cache-Control: private, max-age=0 X-Content-Type-Options: nosniff X-XSS-Protection: 1; mode=block Server: GSE If it supported CORS you should see an Access-Control-Allow-Origin header in there

Categories : Javascript

Be aware that the Local Service account is not supported for the SQL Server or SQL Server Agent services
That generally means (used to work for MSFT many moons ago) that any problem or issue that you may call Microsoft about when the service runs under the Local Service account will not be answered or handled by their support staff. Long story short, you're on your own when it comes to errors or other challenges. You're best off running the services under a domain account.

Categories : SQL

Stop local development server in Eclipse(Pydev) like ASP .Net Developement Server
The usual issue is that you have a main script which executes a secondary process to do the work (for auto-reload). I haven't checked this, but the usual 'easy-fix' is passing in the command line an option which says that you don't want the reload to happen (in which case it wouldn't create a second process).

Categories : Django

after working in local server, how to move OpenERP on a remote server?
This is not a generally accepted way of doing customization in openerp. Ususally, you should make a custom module that implements your customization when installed on the OpenERP server installation. Are you using Windows or Linux? The concept here is to move all of the server addons files to the upsite server, including a dump of the database which can be restored on the upsite server. Here's how. First click the Manage databases at the login screen, Do a backup database and save the generated dump file. Install openerp o nthe upsite server (*major versions must match). Copy the server addons folder, and upload to the upsite server's addon directory. Restart openerp service. Then restore the dump file from your backup location. This is basically how you can mirror a "customized" open

Categories : Python

Galleria slideshow works on local server, not on live server
When you deploy your file to production it compile and collect all your assets in one folder called assets, so specified paths doesn't work, because there is no galleria/themes/classic/ path on Heroku server or other server, which you're using. So, you need to specify path in HTML file like this href="assets/galleria.classic.css" if it is necessary. But in fact your *= require galleria/themes/classic/galleria.classic and //= require galleria/galleria-1.2.9.min //= require galleria/themes/classic/galleria.classic has already done it, and all the necessary code must be in your compiled .css and .js files. So, you can just remove <link rel...> part from your code. P.S. I'm trying to avoid subfolders in css, javascripts and images folders, because it can often cause such proble

Categories : Ruby On Rails

"Undefined" Error on another web server while everything is fine on local server
You have display_errors turned off on one server and on on the other. The issues still occur on both servers, you just don't get told about them on one. The issue is that you are accessing variables or parts of arrays that are not defined before you try to use them.

Categories : PHP

Inserting from remote sql server to local mysql server
As your code stands now, only one row will get inserted into mysql. The second while loop is looping on the select statement's result set. So when it gets there it is just going to exhaust the result set outputting the second, third and so on results. If that while block is not being executed then you might only have one row that matches the select statement.

Categories : Java

Error on live server and not on local server
Error states that BrakeShoe is not accessible, make BrakeShoe public rebuild and deploy may help. You can revere engineer your existing dll to find if BrakeShoe has proper access specifier.

Categories : C#

Knockout mapping plugin [create, update]: objects created, cannot update
John, When updating your data using ko.mapping be sure you don't create a new item. Your UI is already bound to the existing items, so you just want to update the values of the existing item properties; not create new ones. For the example you posted, you'll want to adjust your "update" method of your map to insert the new values into the correct ko.observable property, rather than creating a new object in it's place. The ko.mapping "update" method has a few different parameter lists depending on usage, with the third parameter being the target object of the map. You would want to update that object's properties. obj.target[label].items[0].text(obj.data[label][0].text); But, that's a bit of a mess. You'll probably want to create a second level of mappings (create / update) to hand

Categories : Javascript

Confused about SQL Server trigger that does an UPDATE (strange UPDATE statement format)
I'm not sure if you are aware of the fact that Inserted or Deleted in the above mentioned queries are not alias but special tables used by the SQL server to track insertion, update or deletion of data within triggers. Here is more information: http://msdn.microsoft.com/en-us/library/ms191300.aspx

Categories : Sql Server

How to ignore local python when building python from source
This looks to be a misfeature of the setup.py script always including /usr/local in the search path when make builds the target sharedmods. You'll have to manually frob the setup.py, so do the... ./configure --enable-shared --prefix=/app/vendor/python-dev ...first, then edit setup.py, find lines 442, 443, and 444 which should look like this... if not cross_compiling: add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') ...and comment them out so they look like this... # if not cross_compiling # add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') # add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') ...then the make should work.

Categories : Python

How to update npm package from a local folder
Instead of npm install from a local directory, try npm link, which creates a globally-installed symlink to the directory. As stated in the docs, this is a two-step process: In package directory: $ npm link This creates a symlink to the current folder in npm's global installation directory. Somewhere else, where you want to use the module: $ npm link <pkgname> This will create a symlink in your project's node_modules/ folder to the global installation.

Categories : Node Js

A local repository to update games?
Version Control Systems work with revisions, yes, that counts for either SVN and git. In case of new program versions it naturally makes sense to put them into revisions, as they are usually only a snapshot of XYZ in a certain point in time. XYZ being whatever want it to be, binary programs, images, files, etc. But to make it really part of a revision you would also need to commit the newly fetched changes. That in the end makes a new revision of your (let's say) games tree. Those revisions then can be fetched from the client computers. That can happen either by scripts that automatically check the server every couple of minutes (cronjobs?) for changes or manually. The benefit of that workflow is quite obvious, in case your new versions are not what you want (e.g. later you notice they

Categories : GIT

Copy data from local production SQL Server database to remote read only SQL Server database
I think the logshipping solution fits your needs. After a one-time setup proces, the logs would be continually shipped from the local db to the remote db. Keeping the remote perfectly in sync with the local one, providing you with the readonly copy. Logshipping is available in all editions, besides Express. There would be no need for a continuous restore process. You can find more information here.

Categories : Sql Server

module works for /usr/bin/python but not /opt/local/bin/python
Was having this issue myself this week. The solution with thanks to [1] is to build it yourself from the git sources [2]. git clone https://github.com/Kitware/VTK.git VTK mkdir VTK-build && cd VTK-build ccmake ../VTK Press 't' for advanced mode. Ensure you've set "VTK_WRAP_PYTHON: ON". Press 'c' to run the first configure. Set PYTHON_EXECUTABLE: /to/your/python (for Macports: /opt/local/bin/python) Set PYTHON_INCLUDE_DIR: /to/your/Python.framework/Headers (for Macports: /opt/local/Library/Frameworks/Python.framework/Headers) Set PYTHON_LIBRARY: /to/your/Python.framework/libpythonx.x.dylib (for Macports: /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib) Press 'c' to run final configure Press 'g' to generate make files make [sudo] make install

Categories : Python

Update in SQL Server , how does it work with selected update?
You unnecessarily making a Complex Query UPDATE X SET X.column1 = Y.column1 FROM tableX X INNER JOIN tableY Y ON X.primary_key_col = Y.primary_key_col WHERE X.column1 != Y.column1

Categories : Sql Server

How to update my local repo using git pull without pushing
git status On branch anotherbranch Your branch is ahead of 'origin/anotherbranch' by 2 commits. (use "git push" to publish your local commits) It means that you have 2 commits that are not pushed. As a best practice is good to run git fetch once in a while to get all the server metadata (updated deleted branches, new commits etc) what is the results of this command: git log --oneline it will show you all the log with the commits so yu can see what is the problem

Categories : GIT

Is it possible to update a SQL ResultSet in Java for local use without modifying the DB?
The best way to answer this question is to do an experiment. Perhaps you should have asked the question, then conducted your own experiment and answered it yourself. I suspect it is possible to do it as you describe, without calling a rollback as one of the comments suggested, but I would recommend against it. Often times we are tempted to take the most expedite way of doing something, but often time that leads to hard to find faults. Take the time and do it right, construct the array list as you suggest.

Categories : Java

Anaconda default directory
Double your backslashes. pd.read_csv('C:\Users\aaa\Desktop\contrylist.csv') Or use raw strings: pd.read_csv(r'C:UsersaaaDesktopcontrylist.csv') Backslash is a special character in string literals and it's used for escaping. You should read the docs: strings and string literals.

Categories : Python

Installing anaconda to use with windows
well you might have two installations of python, one inside the anaconda package, and other which you might have installed earlier. try doing : which python from CygWin console. If it returns: /usr/bin then it is definitely a add-to-path problem. to fix it for CygWin, you have to add the python installation from anaconda to the path. try this fromn CygWin: PATH=path-where-anaconda-is-installed/anaconda/bin:$PATH and then doing: which python should give you: /path-to-anaconda/anaconda/bin and then it will work. Cheers

Categories : Python

what does openerp-server do after I restart server with the para--update?
you tend to use this in development along with a database parameter -d. This means that openerp will connect to the database and then update this module. Note that it is update only, it won't install. If other modules depend on the module being upgraded they will also be upgraded. You can also pass in a comma separated list of modules.

Categories : Postgresql

How to load app with local data and subsequently update it when online.
EDIT: I think I did not understand the question completely. Thanks Xman, for pointing it out. What I would have done in this case is - save the last loaded JSON file to my bundle and use it for displaying information while querying the server and loading updates in the background. The flow should be like this: Parse and display data using local JSON file. (Assuming there is local copy of JSON file) Query the server for latest data. Upon receiving response, update the bundle with the latest JSON file. Then, do step 1. In case there is no JSON file, just start from step 2. If there is a Network error display the appropriate information. This SO question answers how to handle Network connections in iOS: How to check for an active Internet Connection on iPhone SDK? Saving file locally:

Categories : IOS

mysql insert update LOAD DATA LOCAL INFILE
I'm not sure what the other columns in the product table are, but here's a basic approach that should work for you based on the 3 columns in your example, assuming the products_model column is unique in the products table: insert into products (products_price,products_quantity,products_model) select price, stock, model from mid on duplicate key update products_price = values(products_price), products_quantity = values(products_quantity)

Categories : Mysql

How to update the tag in maven-metadata-local when installing an artifact?
If you are working with SNAPSHOT's you don't need version ranges apart from that never use version ranges (only in extrem rare situtions). With version ranges your build is not reproducible which should be avoided in my opinion under any circumstance. But you can use things like this: <version>[1.2.3,)</version but as you already realized that caused some problems, but I would suggest to use the versions-maven-plugin as an alternative to update the projects pom files accordingly. mvn clean versions:use-latest-versions scm:checkin deploy -Dmessage="update versions" -DperformRelease=true This can be handled by CI solution like Jenkins. But I got the impression that you are doing some basic things wrong. In particular if you need to use version ranges.

Categories : Maven

best way to process local file and update Titan graph database
If the graph schema is not too complex and the data in a single file, the easiest way is to simply use a Gremlin script. Check out this simple recipe to load an edge list: http://gremlindocs.com/#recipes/reading-from-a-file If you have a large amount of data, consider using the BatchGraph wrapper for easier programming, auto-commit and better performance: https://github.com/tinkerpop/blueprints/wiki/Batch-Implementation Once you have your script, you could run it in the Gremlin REPL or execute it from shell script with gremlin.sh: https://github.com/tinkerpop/gremlin/wiki/Using-Gremlin-through-Groovy#gremlin-and-groovy-shell Note that your question is about Titan, but I've responded generically with Blueprints in mind (so you will see TinkerGraph examples in many of these links), bu

Categories : Python



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