w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Update Magento to specific version (not latest)
Two different ways of handling this, 1) Manually... From my experience, what you end up doing is scrapping Magento Connect (which often is the source of all evil, when you've had it do partial upgrades two or three times in a row), downloading the whole package from the download archive (you have all the versions available from there on the Release Archives tab), unzipping them to a directory and then either on the server, copying them into your Magento root directory or from a remote workstation, ftp/scp uploading them to the server Magento root directory. If you're serious about running Magento, you will have a development server that you do this to several times to find out where all the upgrade breakages are so you can weed out busted templates, detect forgotten core modifications,

Categories : Magento

How can I update Android Studio to the latest version?
I noticed that I would get a completely different dialog on another machine. The machine where I noticed the problem was connected to the internet via cable and the WiFi was turned off. As soon as I turned on the WiFi, I would get the same update dialog.

Categories : Android

getElementByID returns null with latest KineticJS update
You must be getting error in your console and i think you need to use document.getElementById as it is a method of the document not of the global window scope. console.debug(document.getElementById('chatarea'));

Categories : Javascript

Display latest SVN update date and version on site
Use svnversion to get the latest revision. Not sure about the date. Maybe check one of the files in the .svn directory. Or just make a script that does your update and get it to touch a file if the update is successful. You could combine these: eg svn update && svnversion > last_update Now the version number is stored in the file last_update, and the file modification date is set correctly.

Categories : Svn

Get latest or new products on home page in magento with layout update
This is what I use on my homepage: {{block type="catalog/product_list" category_id="11" num_products="16" template="catalog/random.phtml"}} I use this on the homepage to show items from that category directly. This way I dont have duplicate content issues and the user links directly into the category. You can see an example on our website www.SaveTheMage.com

Categories : Magento

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

How to configure links with HasNavigationPropertiesLink after latest WebAPI beta (26-Jun-2013) Update
looks like the version of the OData bits you are using is very old. In our current version, you can use the ODataConventionsModelBuilder to create a model that defines navigation properties and links following conventions, so unless you need to generate custom links, it's a better way to go. However, if you want to generate a custom navigation link, the link generation code looks something similar to this: var jobs = builder.EntitySet<Job>("Jobs"); jobs.HasNavigationPropertiesLink(customers.EntityType.NavigationProperties, (context, navigationProperty) => { var result = "http://mydomain.com/prefix/odataPath"; //In order to generate this link you can use context.Url.ODataLink(new EntityPathSegment("Jobs"), ...

Categories : Asp Net

how to install curl in latest python?
The package is not compatible with Python 3; you'll have to request the author ports it. There is an existing patch you could try out. In the meantime, look into other libraries instead, the requests library does support Python 3 and has a far superior API to pycurl.

Categories : Python

Python (latest version) Syntax Error
print is a function in py3.x: print newReadData should be : print (newReadData) Demo: >>> print "foo" File "<ipython-input-1-45585431d0ef>", line 1 print "foo" ^ SyntaxError: invalid syntax >>> print ("foo") foo statements like this: elif userInput == "yes" or userInput == "ye" or userInput == "y" can be reduced to : elif userInput in "yes"

Categories : Python

Determining the latest version of a file (python)
Assuming that d is a version number in your question latestVersion = max(int(fname.rsplit('.',1)[0].rsplit("_",1)[1].strip('v')) for fname in myFiles) From your comments, I understand that you want to keep the latest versions of versioned files. For that, you'll need this: answer = set() for fname in myFiles: name, version = fname.rsplit('.', 1)[0].rsplit("_",1) if version.startswith('v'): # this is a versioned file answer.add( max((fname for fname in myFiles if fname.startswith(name) and not fname.rsplit('.', 1)[0].endswith('d')), key=lambda fname: int( fname.rsplit('.', 1)[0].rsplit("_",1)[1].strip('v')) )) else: answer.add(fname)

Categories : Python

Why have maps stopped working with the latest Google Maps update?
The problem here is, if you start navigation without enabling gps and then enable it while the app is running, it doesn't sense that gps is on. Its just because it asks if the gps is on when it first turns on. The solution would be that you need to enable gps before entering the app, or if you forget, just back out of the app and re-enter.Also can stop updates to fix the issue. Also have a look at it: Google Services Bug Causing Location Issues, Google Working On A Fix

Categories : Android

How can update the Grails ElasticSearch Plugin to the latest Version of ElasticSearch?
You need to update this line to use 0.90.3. I am unable give more details right now as I am using my phone.

Categories : Spring

Cannot get the latest DB data by "select" sql command, after updated that data by "update" command by another mysql connection
Things would work if you commit your conn1 before selecting again.. or just enable auto_commit to True. conn1.commit() This has been talked about here: http://sourceforge.net/p/mysql-python/discussion/70461/thread/efea588e BTW your code contains conn and cur variables which have not been defined..

Categories : Python

use F to update with where in Python
Please escape your SQL before doing anything else. You should do this: query = """ UPDATE Game_mygame SET game_played = %s WHERE home_teamID = %s AND away_teamID = %s """ cursor.execute(query, (game_played, home_team_id, away_team_id)) This will protect you if someone gets malicious values of game_played or the team ids into your system. The cursor will take care of escaping these values so they're safe to run in MySQL. To answer the rest of your question: no, F expressions are not sufficiently expressive for what you want to do. Fundamentally they AND the clauses you express in them, whereas what you want is to OR together a bunch of queries: (team_id_1 = a1 and team_id_2 = a2) OR (team_id_1 = b1 and team_id_2 = b2) OR ... You can use Q expressions to express this query: h

Categories : Jquery

Update python mac installation
It is better if you reinstall your system from recovery mode. A lot of OSX software can rely on system python, even if it is not python projects. Then recomended way is use homebrew. You can have different python (2.7, 3.3, pypy) versions the same time.

Categories : Python

how to update global variable in python
Use global statement. But there's no need of global for mutable objects, if you're modifying them in-place. You can use modules like pickle to store your list in a file. You can load the list when you want to use it and store it back after doing your modifications. lis = ["link1", "link2",...] def update(): global lis #do something return lis Pickle example: import pickle def update(): lis = pickle.load( open( "lis.pkl", "rb" ) ) # Load the list #do something with lis #modify it pickle.dump( lis, open( "lis.pkl", "wb" ) ) #save it again For better performance you can also use the cPickle module. More examples

Categories : Python

Where should my .bash_profile file be for Python to update?
Use python3 to run python3, and also restart your shell after modifying .bash_profile or do source .bash_profile to load the new settings without restarting the shell. $ which python3 /usr/bin/python3 Example: $ cat so.py #!/usr/bin/python3 print("hello, world!") $ chmod +x so.py $ ./so.py hello, world!

Categories : Python

Python Dictionary Update and Append
Use defaultdict >>> from collections import defaultdict >>> d = defaultdict(list) # create the dictionary, then populate it. >>> d.update({"TIM":[['xx', 'yy'], ['aa', 'bb']], "SAM":[['yy', 'cc']]}) >>> d # see its what you wanted. defaultdict(<type 'list'>, {'TIM': [['xx', 'yy'], ['aa', 'bb']], 'SAM': [['yy', 'cc']]}) >>> d["SAM"].append(['tt','uu']) # add more items to SAM >>> d["KIM"].append(['ii','pp']) # create and add to KIM >>> d # see its what you wanted. defaultdict(<type 'list'>, {'TIM': [['xx', 'yy'], ['aa', 'bb']], 'KIM': [['ii', 'pp']], 'SAM': [['yy', 'cc'], ['tt', 'uu']]}) If you want the dictionary values to be sets, that is no problem: >>> from collections import defaultdict >>>

Categories : Python

Update method in Python dictionary
The difference is that the second method does not work: >>> {}.update(1, 2) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: update expected at most 1 arguments, got 2 dict.update() expects to find a iterable of key-value pairs, keyword arguments, or another dictionary: Update the dictionary with the key/value pairs from other, overwriting existing keys. Return None. update() accepts either another dictionary object or an iterable of key/value pairs (as tuples or other iterables of length two). If keyword arguments are specified, the dictionary is then updated with those key/value pairs: d.update(red=1, blue=2). map() is a built-in method that produces a sequence by applying the elements of the second (and subsequent) ar

Categories : Python

auto update python library
What OS are you using? Linux has a utility called cron that lets you schedule routine tasks. You could tell cron on each computer to run cd repo && git pull every hour. You might also consider doing something with a git hook: http://git-scm.com/book/en/Customizing-Git-Git-Hooks

Categories : Python

How to update parameters using subprocess (python)
You cannot update the parameters that were used to start a program. However, you can use other forms of interprocess communication to do so. An easy way would be to have "sub.py" read its parameters from standard input. Each time it reads a new line, it will display new text.

Categories : Python

python setdefault(key,set())).update(... returns None
dict.setdefault returns a set in your case. And set.update is an in-place operation, which means it changes the original set and returns None. So if you assign the result to a variable you just assign it a None.

Categories : Python

use F for referencing 2 tables to update python
A dramatic performance boost could be given running your update function in a single transaction. Take a look at Django database transaction management for details. You could consider the use of django.db.transaction.commit_on_success that can be used as a context manager: from django.db import transaction with transaction.commit_on_success(): # your code here or as a function decorator: from django.db import transaction @transaction.commit_on_success def update_function(): # your code here

Categories : Python

Python update json file
You can either read, parse and modify the file every time you need to add new data to it and that would look like: import json def append(filename, obj): with open(filename, 'rb') as f: data = json.load(f, encoding='utf-8') data.append(obj) with open(filename, 'wb') as f: json.dump(data, f, encoding='utf-8') But that could be very slow, especially if you have a large file, since you'll have to read the whole file into memory every time, deserialize it, append, serialize it again, and write it down... If you need the extra speed, you could do a little hackery by just append the new data to the file: import io import json def append(filename, data): with open(filename, 'r+b') as f: f.seek(-2, 2) f.write(b', ') f.write(b' ' + js

Categories : Python

Python - Pymongo Insert and Update Documents
Use upsert option: from pymongo import MongoClient cl = MongoClient() coll = cl["local"]["test2"] data = [{"_id" : 1, "foo" : "HELLO"}, {"_id" : 2, "Blah" : "Bloh"}] for d in data: coll.update({'_id':d['_id']}, d, True)

Categories : Python

403 when trying to update Google Sites with python script
According to Google themselves, the ClientLogin method should be replaced with OAuth. Important: ClientLogin has been officially deprecated as of April 20, 2012. It will continue to work as per our deprecation policy, but we encourage you to migrate to OAuth 2.0 as soon as possible. And i'd suggest using a OAuth lib rather than doing it on your own at first. python-oauth2 is a nice one. Edit: Google has OAuth API built in to the app-engine module if you have that. from google.appengine.api import oauth Otherwise for manual OAuth implementation: oauth google using python (I won't post example code here cause that guy deserves the ups he can get.

Categories : Python

how to make a check for update option in python
There is a library called esky in which if you freeze with it, it can check for updates on a certain website, get a list of avaliable versions on a certain website, distribute patch files, and much more. check out here: esky p.s. I dont know if there is a version for 3.x though.

Categories : Python

Determine the firefox version available for update using Python
Have you considered using a regular expression to match the numbers you're trying to extract. That would be a lot easier. Something like this: matches = re.findall(r'd+(?:.d+)+', firefox_version_fresh) if matches: fvnf = matches[0] That's assuming the version is of the form x.y potentially followed by more sub versions (e.g. x.y.z). d+ is one or more digits (?: )+ is one or more of everything in the parentheses. The ?: tells the compiler that it's a non-capturing group - i.e. you're not interesting in extracting the data inside the parentheses as a separate group. .d+ matches a dot followed by one or more digits So the whole expression can be described as one or more digits followed by one or more occurences of a dot and one or more digits.

Categories : Linux

Which is the best way to update database in python django from the list
Since you said that your tables are small, you can do the following. I assume you can do better by using raw queries, but you can consider the following approach (Hope that code contains no errors). s3_keys = [list of s3 keys] Now you want to delete all entries that are not in s3 keys, I think this is simple: File.objects.exclude(id___in=s3_keys).delete() Node.objects.exclude(id___in=s3_keys).delete() Now you want to add s3 which are not in the list to the DB: #Bring all entries and make them to a set: db_keys = set(File.objects.all().values_list('key',flat=True)) # find the new keys new_db_keys = set(s3_keys) - db_keys Now do bulk create: new_nodes = [] new_files = [] for key in new db_keys: new_nodes.append(Node(key=key)) new_files.append(File(key=key)) Node.objects.bulk_

Categories : Python

How can I update data with google appengine-python-ndb?
If you mean manually and not automathic, just like this: #Assuming you already know the key of the entity you want to change. user = user_key.get() user.something = 'new something' user.put()

Categories : Python

Python: Update Sensor Data to Variable
That's because you only called the bmp.readTemperature() and bmp.readPressure() functions once - in tps.__init__. In your print statements at the end, you're just twice reading the values that those functions returned, rather than getting updated values. Here's an example of how to get updated values: class tps(): def __init__(self): #temperature/pressure sensor setup self.bmp = BMP085(0x77) self.temp = None self.pressure = None # If you want to initialize your tps object with sensor data, you can call your updater method here. self.updateTempAndPressure() # Here's a function that you can call whenever you want updated data from the sensor def updateTempAndPressure(self): self.temp = self.bmp.readTemperature()*1.8+32

Categories : Python

Python 3.3 tkinter's Entry widget update on key
It can be solved by changing EntryFilePath.bind("<Key>", updateAmountOfPeople) to EntryFilePath.bind("<KeyRelease>", updateAmountOfPeople)

Categories : Python

UPDATE statement error - MySQLdb/Python
I solved it. The code should look like: cur.execute("""UPDATE `term_results` SET `%s` = %s, `%s` = %s WHERE `results_id` = %s""" % (term, nResult, termInserted, bResultsInserted, mostRecentRecord))

Categories : Python

Update google spreadsheet using python client API on GAE app
You can use gdata.spreadsheets.client (Google Data API) on the OAuth2 (Google API platform) flow. https://github.com/HatsuneMiku/googleDriveAccess It uses 'oauth2client-gdata-bridge'.

Categories : Google App Engine

Having Ansible pip update python package during development
I am going to post this as the correct answer for everyone else to have a reference back to this. Currently I have an Ansible play that sets up an environment by installing local python packages and then creating a virtualenv and installing everything into that for development. First in setting up the virtualenv and install your local git repo into the environment i use these tasks in Ansible. - name: Source virtualenvwrapper. local_action: shell /usr/local/bin/virtualenvwrapper.sh executable=/bin/bash - name: Set Enviroment to working directory. local_action: shell export WORKON_HOME=${working_dir} - name: Set pip to use working virtual enviroment. local_action: shell export PIP_VIRTUALENV_BASE=$WORKON_HOME - name: Create new virtualenv in development. l

Categories : Python

update module on import to python interpreter
(Spyder dev here) I think at the moment you are not able to reload a module directly in the console (but we are considering to change this in the future). The idea about UMD is that it will reload your modules but only if you run a file from the editor that imports them. It doesn't work if you want to reload them directly in the console. Let's say you developed a module, then you are probably using it in a different script that (most likely) you'll be writing in our editor and send it to run to our console. UMD is a little bit of magic that reloads it for you when that happens.

Categories : Misc

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

How to store and update a configuration in Google App Engine (Python)
AFAIK there isn't any other way to achieve what you want, though I'd probably do it more like.. current = Configuration.query().get() or Configuration() current.displayName = self.request.get('newDisplayName') current.starting = self.request.get('newStartingDate') current.put() but I couldn't help myself and would have to allow for alternate configs.. id = self.request.get('id') or 'default' config = Configuration.get_by_id(id) or Configuration(id = id) config.displayName = self.request.get('newDisplayName') config.starting = self.request.get('newStartingDate') config.put()

Categories : Python

Creating Oracle Update Statements from Python Dictionary
from the docs it seems that you're calling: Cursor.execute(statement[, parameters], **keywordParameters) as in the other answer, you could match by position with cursor.execute(SQL, *list(schemes_dict.values())) or maybe, from the error message, a simple sequence is OK: cursor.execute(SQL, list(schemes_dict.values())) (i've just added list(...) for python 3 - see below) but that relies on the order of the two iterations being the same (which is likely true in this case with cpython, but not something you should be trusting in general). it seems to me that it would be better to use named bindings (using :name instead of %s): SQL = 'UPDATE scheme SET {}'.format(', '.join('{}=:{}'.format(k, k) for k in schemes_dict)) cursor.execute(SQL, **schemes_dict) where ** is like having na

Categories : Python

python dictionary update to a list gives wrong output
You're appending the dictionary to res in the loop every time, that's why you are seeing the repeat. They all have the same values because you are updating the same dict everytime res=[] my_inital_dict={'aa':1,'bb':1} updates = [my_initial_dict] for i in range(4): updates.append({'aa':i+4}) my_initial_dict.update({'aa':i+4}) res = my_initial_dict print updates

Categories : Python



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