Skip to main content

Posts

Showing posts from 2014

PYTHON REGULAR EXPRESSIONS

Proved to be a very useful resource for me ! http://www.tutorialspoint.com/python/python_reg_expressions.htm PYTHON REGULAR EXPRESSIONS http://www.tutorialspoint.com/python/python_reg_expressions.htm Copyright © tutorialspoint.com A  regular expression  is a special sequence of characters that helps you match or find other strings or sets of strings, using a specialized syntax held in a pattern. Regular expressions are widely used in UNIX world. The module  re  provides full support for Perl-like regular expressions in Python. The re module raises the exception re.error if an error occurs while compiling or using a regular expression. We would cover two important functions, which would be used to handle regular expressions. But a small thing first: There are various characters, which would have special meaning when they are used in regular expression. To avoid any confusion while dealing with regular expressions, we would use Raw Strings as  r'expression' . T

Method argument Pass by Value & Pass by Reference behavior in Python

This is a very important concept in Python where the behavior of pass by value & pass by reference varies with lists compared to immutable data types like strings. Source  http://www.python-course.eu/passing_arguments.php Parameter Passing "call by value" and "call by name" The most common evaluation strategy when passing arguments to a function has been call by value and call by reference: Call by Value The most common strategy is the call-by-value evaluation, sometimes also called pass-by-value. This strategy is used in C and C++ for example. In call-by-value, the argument expression is evaluated, and the result of this evaluation is bound to the corresponding variable in the function. So, if the expression is a variable, a local copy of its value will be used, i.e. the variable in the caller's scope will be unchanged when the function returns. Call by Reference In call-by-reference evaluation, which is also known as pass-by-reference, a fun

Sony Playstation 3 unboxing video

https://www.youtube.com/watch?v=JMFb3tbId2A Part II coming soon...

OpenStack Keystone Issue with Update of User’s Password – Havana

OpenStack Keystone Update User’s Password – Havana Thanks to this source which helped me out with Openstack keystone documentation issue. Source:  http://blog.autodevbot.com/2014/04/15/openstack-keystone-update-users-password-havana/comment-page-1/#comment-59 It took me a while to figure out how to update a user’s password via the API in Keystone.  All of the documentation seems to be incorrect.  I finally had to take a packet trace of the keystone CLI performing a password update and looking at that before I got the correct API endpoint and what to send to the server.  It turns out to be a PUT request and not like most of their documentation saying it is is a POST request.  Which would make sense since PUT is for updating. Here is the cURL command: curl -X PUT \ -H “X-Auth-Token: ” \ -H “Content-type: application/json” \ -d ‘{“user”: {“password”: “new_password”, “id”: “ “}}’\ http://localhost:35357/v2.0/users/ /OS-KSADM/password