text:
Python Tips, Tricks, and Hacks 15
Want to write shorter, cleaner code? Have an unfortunate situation where you need to fit as much as you can in one expression? Prefer a quick dose of hacks to spending the rest of your life reading the docs? You've come to the right place. We start out with some quick tricks that you might have figured out if you've spent some time with Python, but I promise there's more crazy stuff towards the bottom.
I've tried to make all of the code snippets executable on their own. If you want, paste them into your Python shell and try them out. You'll notice that many examples contain a 'true example' and a 'false example', with one commented out. Feel free to switch the comment and see what happens.
You'll also see a few blank comments floating around in the code. These are to improve readability by adding line breaks while still allowing the Python interpreter to parse the code. These would not be necessary in a 'real' (non-pasted) program.
A quick distinction about true vs. True in this article: when I say an object is 'true', I mean that the object, if converted to a boolean in an if statement or elsewhere, would be converted to True and not False. I don't mean that the object necessarily is identical to or equal to True. In the same way, if I say an object is 'false', I mean that the object would be converted to False, not that it necessarily is equal to or identical to False.
If you prefer, there are Portuguese and Russian translations of the first parts of this article.
1 Quick Tricks
1.1 Four Kinds of Quotes
Let's start with something quick that you probably know. If you're coming from a different language, you're probably used to using single quotes for one thing and double quotes for another. Python lets you use both, although not interchangeably (if you start with one, you have to end with the same one). Python also has a two more types of quotes. A triple quote, ''', is created by typing three single quotes. A triple-double quote, """, is created by typing three double quotes. So, you can have several layers of quoting before you need to worry about escaping your quotes. For example, this is valid Python:
1print """I wish that I'd never heard him say, '''She said, "He said, 'Give me five dollars'"'''"""
1.2 Truthfulness of Various Objects
Unlike some programming languages (cough Javascript cough) Python types are false if empty, and true if not. That means you don't have to check, for example, that the length of a string, tuple, list, or dict is 0 or is equal to an empty one. It is enough to just check the truthfulness of the object.
As you would expect, the number zero is also false, while all other numbers are true.
For example, the following expressions are equivalent. Here, 'my_object' is a string, but it could easily be another Python type (with appropriate modifications to the equality test)
1my_object = 'Test' # True example
2# my_object = '' # False example
4if len(my_object) > 0:
5 print 'my_object is not empty'
7if len(my_object): # 0 will evaluate to False
8 print 'my_object is not empty'
10if my_object != '':
11 print 'my_object is not empty'
13if my_object: # an empty string will evaluate to False
14 print 'my_object is not empty'
In conclusion, there's really no need to check lengths or equality if you're only interested in if the object is empty or not.
1.3 Checking if a String Contains a Substring
Here's a quick hint that might be obvious, but it took me about a year of Python programming to figure it out.
You probably know that you can test if a list, tuple, or dict contains an item by testing the expression 'item in list' or 'item not in list'. I never realized that this would work for strings as well. I was always writing code like:
1string = 'Hi there' # True example
2# string = 'Good bye' # False example
3if string.find('Hi') != -1:
4 print 'Success!'
That's some ugly code. It is completely equivalent to do 'if substring in string':
1string = 'Hi there' # True example
2# string = 'Good bye' # False example
3if 'Hi' in string:
4 print 'Success!'
Much cleaner and simpler. Might be obvious to 99% of the population, but I wish I'd known about it sooner.
1.4 Pretty-Printing a List
Lists don't print nicely. It's of course obvious what the list is, but an average user doesn't want to see brackets around everything. There's a trivial solution to this, using a string's 'join' method:
1recent_presidents = ['George Bush', 'Bill Clinton', 'George W. Bush']
2print 'The three most recent presidents were: %s.' % ', '.join(recent_presidents)
3# prints 'The three most recent presidents were: George Bush, Bill Clinton, George W. Bush.
The join method turns the list into a string by casting each item into a string and connecting them with the string that join was called on. It's even smart enough to not put one after the last element.
As an added advantage, this is pretty fast, running in linear time. Don't ever create a string by '+'ing list items together in a for loop: not only is it ugly, but it takes much longer.
1.5 Integer vs. Float Division
By default, if you divide one integer by another, the result will be truncated into an integer. For example, executing 5/2 returns 2.
There are two was to fix this. The first and simplest way is to just turn one of the integers into a float. If the values are static, you can just append a .0 to one to make it a float: 5.0/2 returns 2.5. Alternatively, you can just cast one of the values: float(5) / 2 returns 2.5.
The other way will result in cleaner code, but you must make sure none of your code is relying on this truncation. You can do a from __future__ import division to change Python to always return a float as the result of a division. After such an import, 5/2 will return 2.5. If you still need to use the truncating integer division somewhere, you can then use the // operator: 5//2 will always return 2.
15/2 # Returns 2
25.0/2 # Returns 2.5
3float(5)/2 # Returns 2.5
45//2 # Returns 2
6from __future__ import division
75/2 # Returns 2.5
85.0/2 # Returns 2.5
9float(5)/2 # Returns 2.5
105//2 # Returns 2
At some point float division will be the default. If you want your code to be future-proof, use the // operator if you want truncating division, no matter if you are doing a from __future__ import division or not.
1.6 Lambda Functions
Sometimes you need to pass a function as an argument, or you want to do a short but complex operation multiple times. You could define your function the normal way, or you could make a lambda function, a mini-function that returns the result of a single expression. The two definitions are completely identical:
1def add(a,b): return a+b
3add2 = lambda a,b: a+b
The advantage of the lambda function is that it is in itself an expression, and can be used inside another statement. Here's an example using the map function, which calls a function on every element in a list, and returns a list of the results. (I make a good case below in List Comprehensions that map is pretty useless. It does, however, presents a good one line example.)
1squares = map(lambda a: a*a, [1,2,3,4,5])
2# squares is now [1,4,9,16,25]
Without a lambda, you'd have to define the function separately. You've just saved a line of code and a variable name (for the function).
Syntax: Lambda Functions
A lambda function has the syntax: lambda variable(s) : expression
|a comma-separated list variable or variables that the function can receive. You can't use keywords, and you don't want these to be in parentheses (a mistake I started making for a couple of months and wondered why my lambdas never worked).
|an inline python expression. Scope includes local scope and variable(s). This is what the function returns.
2 Lists
2.1 List Comprehensions
If you've used Python for very long, you've at least heard of list comprehensions. They're a way to fit a for loop, an if statement, and an assignment all in one line. In other words, you can map and filter a list in one expression.
2.1.1 Mapping the List
We'll start with something really simple. Say you're trying to square every element in a list. A freshly-initiated Python programmer might write code like this:
1numbers = [1,2,3,4,5]
2squares = []
3for number in numbers:
4 squares.append(number*number)
5# Now, squares should have [1,4,9,16,25]
You've effectively 'mapped' one list to another list. You could also use the map function, and do something like this:
1numbers = [1,2,3,4,5]
2squares = map(lambda x: x*x, numbers)
3# Now, squares should have [1,4,9,16,25]
This code is definitely shorter (1 line instead of 3) but it's pretty ugly. It's hard to tell at a glance what the map function does (it accepts a function and a list, and applies the function to every element of that list). Plus, you have to give it a function of some sort which looks kind of messy. If only there were a cleaner way... perhaps a list comprehension:
1numbers = [1,2,3,4,5]
2squares = [number*number for number in numbers]
3# Now, squares should have [1,4,9,16,25]
This does the exact same thing as the previous two examples, but it's short (unlike the first example) and clean (unlike the second example). No one is going to have any problem determining what it does, even if they don't know Python.
2.1.2 Filtering the List
What if you're more interested in filtering the list? Say you want to remove every element with a value equal to or greater than 4? (Okay, so the examples aren't very realistic. Whatever...) A Python neophyte might write:
1numbers = [1,2,3,4,5]
2numbers_under_4 = []
3for number in numbers:
4 if number < 4:
5 numbers_under_4.append(number)
6# Now, numbers_under_4 contains [1,4,9]
Pretty simple, right? But it took 4 lines, two degrees of nesting, and an append to do something completely trivial. You could reduce the size of the code with the filter function:
1numbers = [1,2,3,4,5]
2numbers_under_4 = filter(lambda x: x < 4, numbers)
3# Now, numbers_under_4 contains [1,2,3]
Similar to the map function we talked about above, this reduces code size but is really ugly. What the hell is going on? Like map, filter accepts a function and a list. It evaluates for every list element and if the function evaluates to true, that list element is included in the final list. Of course, we can do this with a list comprehension as well:
1numbers = [1,2,3,4,5]
2numbers_under_4 = [number for number in numbers if number < 4]
3# Now, numbers_under_4 contains [1,2,3]
Again, using a list comprehension gives us shorter, cleaner, and easier to understand code.
2.1.3 Map and Filter at Once
Now we get to the true power of list comprehensions. If I haven't yet convinced you that map and filter are generally a waste of your time, hopefully this will.
Say I want to map and filter a list at the same time. In other words, I'd like to see the square of each element in the list where said element is under 4. Once more, the Python neophyte way:
1numbers = [1,2,3,4,5]
2squares = []
3for number in numbers:
4 if number < 4:
5 squares.append(number*number)
6# squares is now [1,4,9]
The code is starting to expand in the horizontal direction now! Alas, what could we possibly do to simplify the code? We could try using map and filter, but I don't have a good feeling about this...
1numbers = [1,2,3,4,5]
2squares = map(lambda x: x*x, filter(lambda x: x < 4, numbers))
3# squares is now [1,4,9]
While map and filter were ugly before, now they're just unreadable. Obviously this isn't a good idea. Once more, list comprehensions save the day:
1numbers = [1,2,3,4,5]
2squares = [number*number for number in numbers if number < 4]
3# square is now [1,4,9]
This is a bit longer than the earlier list comprehension examples, but in my opinion still very readable. It's definitely better than a for loop or using map and filter.
As you can see, a list comprehension filters then maps. If you absoulutely need to map then filter, things can get more complicated. You might even have to use nested list comprehensions, the map and filter commands, or a regular old for loop, depending on what is cleanest. That discussion, though, is outside the scope of this article.
2.1.4 Generator Expressions
There is a downside to list comprehensions: the entire list has to be stored in memory at once. This isn't a problem for small lists like the ones in the above examples, or even of lists several orders of magnitude larger. But eventually this becomes pretty inefficient.
Generator expressions are newish in Python 2.4, and possibly the least publicized Cool Thing About Python ever. As in, I just found out about them. Generator expressions do not load the whole list into memory at once, but instead create a 'generator object' so only one list element has to be loaded at any time.
Of course, if you actually need to use the entire list for something, this doesn't really help much. But if you're just passing it off to something that takes any iterable object -- like a for loop -- you might as well use a generator function.
Generator expressions have the same syntax as list comprehensions, but with parentheses around the outside instead of brackets:
1numbers = (1,2,3,4,5) # Since we're going for efficiency, I'm using a tuple instead of a list ;)
2squares_under_10 = (number*number for number in numbers if number*number < 10)
3# squares_under_10 is now a generator object, from which each successive value can be gotten by calling .next()
5for square in squares_under_10:
6 print square,
7# prints '1 4 9'
This is ever so slightly more efficient than using a list comprehension.
So, you want to use generator expressions for large numbers of items. You want to always use list comprehensions if you need the entire list at once for some reason. If neither of these is true, just do whatever you want. It's probably good practice to use generator expressions unless there's some reason not to, but you're not going to see any real difference in efficiency unless the list is very large.
As a final note, generator expressions only need to be surrounded by one set of parentheses. So, if you're calling a function with only a generator expression, you only need one set of parentheses. This is valid Python: some_function(item for item in list).
2.1.5 Nested 'for' Statements
List comprehensions and generator expressions can be used for more than just mapping and filtering; you can create rather complex lists of lists with them [1]. Not only can you map and filter, you can nest the for expressions. A python neophyte might write something like:
1for x in (0,1,2,3):
2 for y in (0,1,2,3):
3 if x < y:
4 print (x, y, x*y),
6# prints (0, 1, 0) (0, 2, 0) (0, 3, 0) (1, 2, 2) (1, 3, 3) (2, 3, 6)
You can see that this code is pretty crazy. With a list comprehension, though, you can do this more quickly:
1print [(x, y, x * y) for x in (0,1,2,3) for y in (0,1,2,3) if x < y]
2# prints [(0, 1, 0), (0, 2, 0), (0, 3, 0), (1, 2, 2), (1, 3, 3), (2, 3, 6)]
As you can see, this code iterates over four values of y, and for each of those values, iterates over four values of x and then filters and maps. Each list item then, is itself a list of x, y, x * y.
Note that xrange(4) is a bit cleaner than (0,1,2,3), especially for longer lists, but we haven't gotten there yet.
2.1.6 Conclusion
I hate to say it, but we've only scratched the surface of what list comprehensions and generator expressions can do. You really do have the full power of a for loop and an if statement. You can do anything (I think) that you could do in either of those. You can operate on anything that you want to start as a list (or any other iterable) and end as a list (or a generator), including lists of lists.
Syntax: List Comprehensions and Generator Expressions
A list comprehension has the syntax: [ element for variable(s) in list if condition ]
A generator expression has the syntax: ( element for variable(s) in list if condition )
|anything that can be treated as a list or iterator
|variable or variables to assign the current list element to, just like in a regular for loop
|an inline python expression. Scope again includes local scope and variable(s). If this evaluates to true, item will be included in result.
|an inline python expression. Scope includes the local scope and variable(s). This is the actual element that will be included in the result.
The for variable(s) in list bit can be repeated indefinitely.
2.2 Reducing a List
Unfortunately, you can't yet write your entire program with list comprehensions. (I'm joking... of course you can.) Although they can map and filter, there isn't a simple way to use a list comprehension to reduce a list. By this I mean applying a function to the first two list elements, then to that result and the next list element, and so on until a single value is reached. For example, maybe you want find the product of all of the values in a list. You could make a for loop:
1numbers = [1,2,3,4,5]
2result = 1
3for number in numbers:
4 result *= number
5# result is now 120
Or you could use the built-in function reduce, which accepts a function that takes two arguments, and a list:
1numbers = [1,2,3,4,5]
2result = reduce(lambda a,b: a*b, numbers)
3# result is now 120
Now it's not as pretty as a list comprehension, but it is shorter than a for loop. Definitely worth keeping in mind.
2.3 Iterating over a List: range, xrange and enumerate
Remember (or maybe not) when you programmed in C, and for loops counted through index numbers instead of elements? You probably already know how to replicate this behavior in Python, using range or xrange. Passing a value to range gives you a list of counting integers from 0 to the value - 1, inclusive. In other words, it gives you the index values of a list with that length. xrange does the same thing, except a bit more efficiently: it doesn't load the whole list into memory at once.
Here's an example:
1strings = ['a', 'b', 'c', 'd', 'e']
2for index in xrange(len(strings)):
3 print index,
4# prints '0 1 2 3 4'
The problem here is that usually you end up needing the list elements anyways. What's the use of just having the index values? Python has a really awesome built-in function called enumerate that will give you both. enumerate-ing a list will return an iterator of index, value pairs:
1strings = ['a', 'b', 'c', 'd', 'e']
2for index, string in enumerate(strings):
3 print index, string,
4# prints '0 a 1 b 2 c 3 d 4 e'
As an added advantage, enumerate is quite a bit cleaner and more readable than xrange(len()). Because of this, range and xrange are probably only useful if you need to create a list of values from scratch for some reason, instead of from an existing list.
2.4 Checking a Condition on Any or Every List Element
Say you want to check to see if any element in a list satisfies a condition (say, it's below 10). Before Python 2.5, you could do something like this:
1numbers = [1,10,100,1000,10000]
2if [number for number in numbers if number < 10]:
3 print 'At least one element is over 10'
4# Output: 'At least one element is over 10'
If none of the elements satisfy the condition, the list comprehension will create an empty list which evaluates as false. Otherwise, a non-empty list will be created, which evaluates as true. Strictly, you don't need to evaluate every item in the list; you could bail after the first item that satisfies the condition. The method above, then, is less efficient, but might be your only choice if you can't commit to only Python 2.5 and need to squeeze all of this logic in one expression.
With the new built-in any function introduced in Python 2.5, you can do the same thing cleanly and efficiently. any is actually smart enough to bail and return True after the first item that satisfies the condition. Here, I use a generator expression that returns a True or False value for each element, and pass it to any. The generator expression only computes these values as they are needed, and any only requests the values it needs [2]:
1numbers = [1,10,100,1000,10000]
2if any(number < 10 for number in numbers):
3 print 'Success'
4# Output: 'Success!'
Similarly, you can check if every element satisfies a condition. Without Python 2.5, you'll have to do something like this:
1numbers = [1,2,3,4,5,6,7,8,9]
2if len(numbers) == len([number for number in numbers if number < 10]):
3 print 'Success!'
4# Output: 'Success!'
Here we filter with a list comprehension and check to see if we still have as many elements. If we do, then all of the elements satisfied the condition. Again, this is less efficient than it could be, because there is no need to keep checking after the first element that doesn't satisfy the condition. Also again, without Python 2.5 it might be your only choice for fitting all the logic in one expression.
With Python 2.5, there's of course an easier way: the built-in all function. As you might expect, it's smart enough to bail after the first element that doesn't match, returning False. This method works just like the any method described above.
1numbers = [1,2,3,4,5,6,7,8,9]
2if all(number < 10 for number in numbers):
3 print 'Success!'
4# Output: 'Success!'
2.5 Combining Multiple Lists, Item by Item
The built-in zip function can be used, well, to zip lists together. It returns a list of tuples, where the nth tuple contains the nth item from each of the passed in lists. This might be a case where an example is the best explanation:
1letters = ['a', 'b', 'c']
2numbers = [1, 2, 3]
3squares = [1, 4, 9]
5zipped_list = zip(letters, numbers, squares)
6# zipped_list contains [('a', 1, 1), ('b', 2, 4), ('c', 3, 9)]
Often you'll use this sort of thing as the iterator a for loop, pulling out all three values at once ('for letter, number, squares in zipped_list').
2.6 A Few More List Operators
The following are all built-in functions that can be called on any list or iterable.
- max
- Returns the largest element in the list
- min
- Returns the smallest element in the list
- sum
- Returns the sum of all elements in the list. Accepts an optional second argument, the value to start with when summing (defaults to 0).
2.7 Advanced Logic With Sets
Now, I realize a section on sets doesn't really belong in a section on lists. But while I never find myself using sets for much, I occasionally need to do some set logic on a list I have lying around. Sets differ from lists in that they enforce uniqueness (they can't contain more than one of the same item) and are unordered. Sets also support a myriad of different logical operations.
The most common thing I want to do is to make sure my list is unique. This is easy; I just have to convert it to a set and check if the length is the same:
1numbers = [1,2,3,3,4,1]
3# returns set([1,2,3,4])
5if len(numbers) == len(set(numbers)):
6 print 'List is unique!'
7# In this case, doesn't print anything
Of course, you can convert the set back into a list, but remember that ordering is not preserved. For more information about the many operations sets support, check out the Python Docs. You'll want to use one or another of these operations on your lists or sets in the future.
3 Dictionaries
3.1 Constructing Dictionaries with Keyword Arguments
When initially learning Python, I completely missed this alternate way to create dictionaries. Any keyword arguments you pass to the dict constructor are added to the newly created dictionary before returning. Of course, you are limited to the keys that can be made into keyword arguments: valid Python variable names. Here's an example:
1dict(a=1, b=2, c=3)
2# returns {'a': 1, 'b': 2, 'c': 3}
This might be a bit cleaner than a 'regular' dictionary creation depending on your code; there are less quotes floating around. I use it often.
3.2 Dicts to Lists
Turning a dictionary into a list or an iterator is easy. To get a list of keys, you can just cast the dict into a list. It's cleaner, though to call .keys() on the dictionary to get a list of the keys, or .iterkeys() to get an iterator. Similarly, you can call .values() or .itervalues() to get a list or iterator of dictionary values. Remember though, that dicts are inherently unordered and so these values won't be in any meaningful order.
To preserve both keys and values, you can turn a dict into a list or iterator of 2-item tuples by using .items() or .iteritems(). This is something that you'll probably do a lot, and isn't very exciting:
1dictionary = {'a': 1, 'b': 2, 'c': 3}
2dict_as_list = dictionary.items()
3#dict_as_list now contains [('a', 1), ('b', 2), ('c', 3)]
3.3 Lists to Dicts
You can reverse the process, turning a list of 2-element lists or tuples into a dict:
1dict_as_list = [['a', 1], ['b', 2], ['c', 3]]
2dictionary = dict(dict_as_list)
3# dictionary now contains {'a': 1, 'b': 2, 'c': 3}
You can also combine this with the 'keyword arguments' method of creating a dictionary discussed above:
1dict_as_list = [['a', 1], ['b', 2], ['c', 3]]
2dictionary = dict(dict_as_list, d=4, e=5)
3# dictionary now contains {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5}
Being able to convert a dict to a list is kind of handy, I guess. But what really makes it awesome is the next trick.
3.4 'Dictionary Comprehensions'
Although Python doesn't have built-in dictionary comprehensions, you can do something pretty close with little mess or code. Just use .iteritems() to turn your dict into a list, throw it in a generator expression (or list comprehension), and then cast that list back into a dict.
For example, say I have a dictionary of name:email pairs, and I want to create a dictionary of name:is_email_at_a_dot_com pairs:
1emails = {'Dick': 'firstname.lastname@example.com', 'Jane': 'email@example.com', 'Stou': 'email@example.com'}
3email_at_dotcom = dict( [name, '.com' in email] for name, email in emails.iteritems() )
5# email_at_dotcom now is {'Dick': True, 'Jane': True, 'Stou': False}
Damn straight. Of course, you don't have to start and end with a dict, you can throw some lists in there too.
While this is a little less readable than a straight list comprehension, I'd argue it's still better than a massive for loop.
4 Selecting Values
4.1 The Right Way
While writing this article, I stumbled upon the right way to select values inline, new in Python 2.5 (you'd think there would have been more fanfare!). Python now supports the syntax 'value_if_true if test else value_if_false'. So, you can do simple selection of values in one line, with no weird syntax or major caveats:
1test = True
2# test = False
3result = 'Test is True' if test else 'Test is False'
4# result is now 'Test is True'
Okay, it's a bit ugly still. Alas. You can also chain multiple tests in one line:
1test1 = False
2test2 = True
3result = 'Test1 is True' if test1 else 'Test1 is False, test2 is True' if test2 else 'Test1 and Test2 are both False'
The first if/else is evaluated first, and if test1 is false the second if/else is evaluated. You can do more complicated things too, especially if you throw in some parentheses.
Personal Note
This is pretty new on the field, and my reaction is mixed. It really is the Right Way, it's cleaner, and I like it... but it's still ugly especially if you have multiple nested if/else's.
Of course, the syntax for all of the value selection tricks is ugly.
I have soft spot for the and/or trick below, I actually find it very intuitive, now that I understand how it works. Also, it's not any less efficient than doing things the Right Way.
What do you think? Feel free to comment below.
Although the inline if/else is the new, more correct way, you'd better still check out the tricks below. Even if you only plan on programming in Python 2.5, you're still going to run into these in older code. Of course, if you need backwards compatibility or don't have Python 2.5, you'd really better check out the tricks below.
4.2 The and/or Trick
In Python, 'and' and 'or' are complex creatures. and-ing two expressions together doesn't just return True if both are true and False if both are false. Instead, 'and' returns the first false value, or the last value if all are true. In other words, if the first value is false it is returned, otherwise the last value is returned. The result of this is something you would expect: if both are true, the last value is returned, which is true and will evaluate to True in a boolean test (eg, an 'if' statement). If one is false, that one is returned and will evaluate to False in a boolean test.
or-ing two expressions together is similar. 'or' returns the first true value, or the last value if all are false. In other words, if the first value is true it is returned, otherwise the last value is returned. So, if both are false, the last value is returned, which is false and will evaluate to False in a boolean test. If one is true, that one is returned and will evaluate to True in a boolean test.
This doesn't help you much when we're just testing for truthfulness. But you can use 'and' and 'or' for other purposes in Python; my favorite is to select between values in a manner akin to C's ternary conditional assignment operator 'test ? value_if_true : value_if_false':
1test = True
2# test = False
3result = test and 'Test is True' or 'Test is False'
4# result is now 'Test is True'
How does this work? If test is true, the and statement skips over it and returns its right half, here 'Test is True' or 'Test is False'. As processing continues left to right, the or statement returns the first true value, 'Test is True'.
If test is false, the and statement returns test. As processing continues left to right, the remaining statement is test or 'Test is False'. Since test is false, the or statement skips over it and returns its right half, 'Test is False'.
Be careful that the middle (if_true) value is never false. If it is, the 'or' statement will always skip over it and always return the rightmost (if_false) value, no matter what the test value is.
Having gotten used to this method, 'The Right Way' (above) actually seems less intuitive to me. If you're not worried about backwards compatibility, I suggest you try both and see which one you like better. It's pretty easy to nest and/or tricks or to throw on extra and's or or's once you understand the logic behind it. If you can't decide or don't feel like learning both, then don't use and/or. Do things the Right Way, and be done with it.
Of course, if you need to support Python versions under 2.5, 'The Right Way' won't work. (I was tempted to say that it 'is The Wrong Way'). In that case the and/or trick is definitely your best bet for most situations.
Hopefully this all makes sense; it's hard to explain. It might seem complicated now, but if you use it a few times and play with 'and' and 'or' it will shortly make sense and you'll be able to come up with more complicated 'and' and 'or' tricks on your own.
4.3 Using True and False as Indexes
Another way to select values is to use True and False as list indexes, taking advantage of the fact that False == 0 and True == 1:
1test = True
2# test = False
3result = ['Test is False','Test is True'][test]
4# result is now 'Test is True'
This is more straightforward than the and/or trick, and free of the problem where the value_if_true must itself be true.
However, it also suffers from a significant flaw: both list items are evaluated before truthfulness is checked. For strings or other simple items, this is not a big deal. But if each item involves significant computation or I/O, you really don't want to do twice the work that you have to. For this reason I usually prefer the 'Right Way' or the and/or trick.
Also note that the index method only works when you know that test is False or True (or 0 or 1, but not any other integer or an arbitrary object). Otherwise you should write bool(test) instead of test to get the same behavior as the and/or trick expression above.
5 Functions
5.1 Default Argument Values are Only Evaluated Once
Let's start this section with a warning. Here's a problem that has confused many new Python writers, including myself, repeatedly, even after I figured out the problem... It's easy to be stupid about this (note that this isn't the world's best example, but it illustrates the point):
1def function(item, stuff = []):
2 stuff.append(item)
3 print stuff
6# prints '[1]'
9# prints '[1,2]' !!!
The default value for a function argument is only evaluated once, when the function is defined. Python simply assigns this value to the correct variable name when the function is called.
Python doesn't check if that value (that location in memory) was changed. It just continues to assign that value to any caller that needs it. So, if the value is changed, the change will persist across function calls. Above, when we appended a value to the list represented by stuff, we actually changed the default value for all eternity. When we called function again looking for a default value, the modified default was given to us.
The solution: don't use mutable objects as function defaults. You might be able to get away with it if you don't modify them, but it's still not a good idea.
A better way to write the above code would be:
1def function(item, stuff = None):
2 if stuff is None:
3 stuff = []
4 stuff.append(item)
5 print stuff
8# prints '[1]'
11# prints '[2]', as expected
None is immutable (and we're not trying to change it anyways), so we're safe from accidently changing value of the default.
On the plus side, a clever programmer could probably turn this into a trick, in effect creating C-style 'static variables'.
5.1.1 Force Default Arguments to be Evaluated Each Time
If you prefer less cluttered functions at the cost of some clarity, you can forcefully re-evaluate the default arguments before each function call. The following decorator stores the original values of the default arguments. It can be used to wrap a function and reset the default arguments before each call. [3]
1from copy import deepcopy
3def resetDefaults(f):
4 defaults = f.func_defaults
5 def resetter(*args, **kwds):
6 f.func_defaults = deepcopy(defaults)
7 return f(*args, **kwds)
8 resetter.__name__ = f.__name__
9 return resetter
Simply apply this decorator to your function to get the expected results.
1@resetDefaults # This is how you apply a decorator
2def function(item, stuff = []):
3 stuff.append(item)
4 print stuff
7# prints '[1]'
10# prints '[2]', as expected
5.2 Arbitrary Numbers of Arguments
Python lets you have arbitrary numbers of arguments in your functions. First define any required arguments (if any), then use a variable with a '*' prepended to it. Python will take the rest of the non-keyword arguments, put them in a list or tuple, and assign them to this variable:
1def do_something(a, b, c, *args):
2 print a, b, c, args
5# prints '1, 2, 3, (4, 5, 6, 7, 8, 9)'
Why would you want to do this? A common reason is that your function accepts a number of items and does the same thing with all of them (say, sums them up). You could force the user to pass a list: sum_all([1,2,3]) or you could allow them to use an arbitrary number of arguments, which makes for cleaner code: sum_all(1,2,3).
You can also have arbitrary numbers of keyword arguments. After you've defined all other arguments, use a variable with '**' prepended to it. Python will take the rest of the keyword arguments, put them in a dictionary, and assign them to this variable:
1def do_something_else(a, b, c, *args, **kwargs):
2 print a, b, c, args, kwargs
4do_something_else(1,2,3,4,5,6,7,8,9, timeout=1.5)
5# prints '1, 2, 3, (4, 5, 6, 7, 8, 9), {"timeout": 1.5}'
Why would you want to do this? I think the most common reason is if your function is a wrapper for some other function or functions, any keyword arguments that you use can be popped off the dictionary and the remainder of the keyword arguments can be passed to the other function(s) (see Passing a List or Dictionary as Arguments, below)
5.2.1 Caveat
Passing both arbitrary non-keyword arguments and named (non-arbitrary) keyword arguments in one function is seemingly impossible. This is because named keyword arguments must be defined before the '*' parameter in the function definition, and are filled before that parameter is filled. For example, imagine a function:
1def do_something(a, b, c, actually_print = True, *args):
2 if actually_print:
3 print a, b, c, args
We now have a problem: there is no way to specify 'actually_print' as a named keyword argument while simultaneously providing arbitrary non-keyword arguments. Both of the following will error:
1do_something(1, 2, 3, 4, 5, actually_print = True)
2# actually_print is initially set to 4 (see why?) and then re-set,
3# causing a TypeError ('got multiple values for keyword argument')
5do_something(1, 2, 3, actually_print = True, 4, 5, 6)
6# This is not allowed as keyword arguments may not precede non-keyword arguments. A SyntaxError is raised.
The only way to pass 'actually_print' in this situation is to pass it as a non-keyword argument:
1do_something(1, 2, 3, True, 4, 5, 6)
2# Result is '1, 2, 3, (4, 5, 6)'
5.3 Passing a List or Dictionary as Arguments
Since you can receive arguments as a list or dictionary, it's not terribly surprising, I suppose, that you can send arguments to a function from a list or dictionary. The syntax is exactly the same as above.
To send a list as non-keyword arguments, just prepend it with a '*':
1args = [5,2]
3# returns pow(5,2), meaning 5^2 which is 25
And, of course, to send a dictionary as keyword arguments (this is probably more common), prepend it with '**':
1def do_something(actually_do_something=True, print_a_bunch_of_numbers=False):
2 if actually_do_something:
3 print 'Something has been done'
4 #
5 if print_a_bunch_of_numbers:
6 print range(10)
8kwargs = {'actually_do_something': True, 'print_a_bunch_of_numbers': True}
11# prints 'Something has been done', then '[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]'
Historical footnote: In older versions of Python (pre-2.3) you called functions with arbitrary arguments using the built-in apply (function, arg_list, keyword_arg_dict)'.
5.4 Decorators
Function decorators are fairly simple, but if you've never seen them before you'll have no idea what's going on, as unlike most of Python the syntax isn't very clear. A decorator is a function that wraps another function: the main function is called and its return value is passed to the decorator. The decorator then returns a function that replaces the wrapped function as far as the rest of the program is concerned.
Without further delay, here is the syntax:
1def decorator1(func):
2 return lambda: func() + 1
4def decorator2(func):
5 def print_func():
6 print func()
7 return print_func
11def function():
12 return 41
15# prints '42'
In this example, 'function' is passed to 'decorator1'. 'decorator1' returns a function that calls 'function' and adds 1. This function is then passed to 'decorator2', which returns a function that calls the function returned by 'decorator1' and prints the result. This last function is the function you are actually calling when you call 'function'. Whew.
This example does the exact same thing, but more verbosely and without decorators:
1def decorator1(func):
2 return lambda: func() + 1
4def decorator2(func):
5 def print_func():
6 print func()
7 return print_func
9def function():
10 return 41
12function = decorator2(decorator1(function))
15# prints '42'
Typically decorators are used to add abilities to your functions (see Creating Class Methods, below). But even more typically, they're not used at all. But it's good to know what you're looking at.
For more information, check out my article Python Decorators Don't Have to be (that) Scary, Python Decorators on Dr. Dobbs or "Function Definitions" in the Python Docs
5.5 'Switch Statements' using Dictionaries of Functions
Ever miss the switch statement? As you probably know, Python doesn't really have a syntactical equivalent, unless you count repeated elif's. What you might not know, though, is that you can replicate the behavior (if not the cleanliness) of the switch statement by creating a dictionary of functions keyed by the value you want to switch on.
For example, say you're handling keystrokes and you need to call a different function for each keystroke. Also say you've already defined these three functions:
1def key_1_pressed():
2 print 'Key 1 Pressed'
4def key_2_pressed():
5 print 'Key 2 Pressed'
7def key_3_pressed():
8 print 'Key 3 Pressed'
10def unknown_key_pressed():
11 print 'Unknown Key Pressed'
In Python, you would typically use elif's to choose a function:
1keycode = 2
2if keycode == 1:
3 key_1_pressed()
4elif keycode == 2:
5 key_2_pressed()
6elif number == 3:
7 key_3_pressed()
9 unknown_key_pressed()
10# prints 'Key 2 Pressed'
But you could also throw all the functions in a dictionary, and key them to the value you're switching on. You could even check see if the key exists and run some code if it doesn't:
1keycode = 2
2functions = {1: key_1_pressed, 2: key_2_pressed, 3: key_3_pressed}
3functions.get(keycode, unknown_key_pressed)()
You can see that this could be a lot cleaner than the elif example for large numbers of functions.
6 Classes
6.1 Passing 'self' Manually
Methods are just regular functions that when called from an instance are passed that instance as the first argument (usually called 'self'). If for some reason you're not calling the function from an instance, you can always pass the instance manually as the first argument. For example:
1class Class:
2 def a_method(self):
3 print 'Hey a method'
5instance = Class()
8# prints 'Hey a method', somewhat unsuprisingly. You can also do:
11# prints 'Hey a method'
Internally, these statements are exactly the same.
6.2 Checking for Property and Method Existence
Need to know if a particular class or instance has a particular property or method? You can use the built-in 'hasattr' function to check; it accepts the object and the attribute (as a string) to check for. You use similarly to the dict 'has_key' method (although it works completely differently):
1class Class:
2 answer = 42
4hasattr(Class, 'answer')
5# returns True
6hasattr(Class, 'question')
7# returns False
You can also check for existence of and access the property in one step using the built-in function 'getattr'. getattr also accepts the object and the attribute, as a string, to check for. It has an optional third argument, giving the default if the attribute is not found. Unlike the dict's 'get' method that you might be more familiar with, if the default is not given and the attribute is not found, an AttributeError is raised:
1class Class:
2 answer = 42
4getattr(Class, 'answer')
5# returns 42
6getattr(Class, 'question', 'What is six times nine?')
7# returns 'What is six times nine?'
8getattr(Class, 'question')
9# raises AttributeError
Don't overuse hasattr and getattr. If you've written your class in manner where you need to keep checking to see if a property exists, you've written it wrong. Just always have the value exist and set it to None (or whatever) if it's not being used. These functions are best used for handling polymorphism, that is, allowing your function/class/whatever to support different kinds of objects.
6.3 Modifying Classes After Creation
You can add, modify, or delete a class property or method long after the class has been created, and even after it has been instantiated. Just access the property or method as Class.attribute. No matter when they were created, instances of the class will respect these changes:
1class Class:
2 def method(self):
3 print 'Hey a method'
5instance = Class()
7# prints 'Hey a method'
9def new_method(self):
10 print 'New method wins!'
12Class.method = new_method
14# prints 'New method wins!'
Pretty awesome. But don't get carried away with modifying preexisting methods, it's bad form and can confuse the crap out of any objects using that class. On the other hand, adding methods is a lot less (but still somewhat) dangerous.
6.4 Creating Class Methods
Occasionally when writing a class you want to include a function that is called from the class, not the instance. Perhaps this method creates new instances, or perhaps it is independent of any properties of any individual instance. Python actually gives you two ways to do this, depending if your method needs to (or should) know about which class called it. Both involve applying decorators to your methods.
A 'class method' receives the class as the first argument, just as a regular instance method receives the instance as the first argument. So, the method is aware if it is being called from its own class or from a subclass.
A 'static method' receives no information about where it is called; it is essentially a regular function, just in a different scope.
Class and static methods can be called straight from the class, as Class.method(), or from an instance as Class().method(). The instance is ignored except for its class. Here's an example of each, along with a regular instance method:
1class Class:
2 @classmethod
3 def a_class_method(cls):
4 print 'I was called from class %s' % cls
5 #
6 @staticmethod
7 def a_static_method():
8 print 'I have no idea where I was called from'
9 #
10 def an_instance_method(self):
11 print 'I was called from the instance %s' % self
13instance = Class()
17# both print 'I was called from class __main__.Class'
21# both print 'I have no idea where I was called from'
25# raises TypeError
27# prints something like 'I was called from the instance <__main__.Class instance at 0x2e80d0>'
7 Conclusion
Need more inspiration? One good place to look is the Python Built-in Functions page. There's a lot of cool functions that you've probably never heard of.
If you come up with any good tricks or need-to-knows, feel free to add them to this article. (You can get a Siafoo account at http://www.siafoo.net/new/user)
Happy coding.
8 Other Python Articles I've Written
Python Decorators Don't Have to be (that) Scary
9 References & Further Reading
- Python General Programming FAQ
- More cool tricks in Python
- Core Python Programming by Wesley J. Chun
- I've only checked this out on Google Books, but it seems to a be a well-written, easy to understand Python primer with some good coverage of advanced topics.
- Python Idioms and Efficiency by Rob Knight
- A bit outdated (assumes you're used to Python 2.2 or so), but full of more Python tricks and tips.
- Dr. Dobb's: Python Decorators
- Need ideas or examples on using decorator functions? This is a good article.
- Python Cookbook
- Source of the resetDefaults decorator and many other useful Python tips.
- Python Docs: Function Definitions
- A good briefing on function syntax and the workings of function decorators.
- Wikipedia: "?:"
- Different ternary operators for different languages. Where I found out about Python's new ternary operator.
- DaniWeb Forums: Default arguments - what is Python doing?
- A discussion of the workings of default function parameters. Default arguments example from here.
- Python.org Tutor Mailing List: Class vs. Static Methods
- This thread has a decent discussion on when you should use class methods versus static methods. Class and static method examples from here.
|Thanks to Honeyman for letting me know this was possible.
|Thanks to nostrademons for this simple yet elegant solution.
|Thanks to midorikid for this solution, and for adding it directly to the article.
Minor corrections provided by:
David Underhill
One minor glitch with section 6.2 and your math. With the question 'What is six times nine?' and your answer of 42. Obviously, either the question should be 'What is six times seven?' or the answer should be 54. :-)
(<cond> and (<expr_true>,) or (<expr_false>,))[0]


text:
Little back story - A while ago, I had a contractor out and in passing complained about how cold my house is in the winter (brick, no real insulation) -- brilliantly, he says "well, yea, your furnace is in the front of the house, and it's what? 60 feet at least to that addition? No wonder you're not getting any heat back there" ... I'll be damned what a great idea.
Earlier this week, I finally had my furnace moved to a far more central location in the house ... actually it's as centered as humanly possible without being in the middle of a walk way. The vents in the middle of the house, of course blasts air, the rear of the house a little more but the front ... not NEARLY as much, you can barely feel it -- this concerned me quite a bit (I was wondering if I had made a mistake). Anyway, last night I turned it on for the first time "let's see how this baby works" -- it went from 64' to 70 in under 45 minutes (!!!!! <-- me excited). What really confused me is the front of the house was just as warm as the rest. This defies logic.
Maybe there's no real answer, but I'm really curious how this works and if I should worry about improving the ducting to the front so the flow is more balanced or just leave it alone?

subset: commoncrawl


text:
Give Now
Find aDoctor
Search All Doctors and Providers Affiliated with WakeMed.
WakeMedPhysician Practices
Search For Providers Who Are Members of WakeMed Physician Practices.
Our Practices
Centers of Excellence
WakeMed PhysicianPractices Specialties
Specialty Hospitals
WakeMed PhysicianPractices Locations
Outpatient Facilities
Find a Service Location
3000 New Bern Avenue, Raleigh, NC 27610 | Map & Directions
Rehab Patient/Family Education Notebook: Here you'll find important Rehab Hospital phone numbers, detailed hospital information, information on family education, discharge planning, an explanation of rehab words & terms, and much more pertaining to our rehabilitation services at WakeMed.
Visiting Hours
Visiting hours at WakeMed have been designed to compliment your rehabilitation program. It is through visits from family and friends that you get encouragement and reinforcement for continued recovery. There may be times that you are not available for visitors because of your therapy schedule.
Because the therapy program cannot be interrupted, please have your visitors check with your nurse to determine the most convenient times for a visit. Generally, you will be available to visit Monday through Friday after 4:00 p.m., and on weekends after noon.
We look forward to your family and friends involvement in your recovery, and welcome any suggestions that they may have regarding your rehabilitation stay.
Your Room
Your room is equipped with a telephone and color television. Most rooms are shared, so you will likely have the company of a roommate. A limited number of private rooms are available for patients with special needs or whose medical condition may require privacy.
Mail and Flowers
Your mail and flowers will be delivered to your room each day. Your mail should be addressed:
Your Name
WakeMed Rehab - (your room number)
P.O. Box 14465
Raleigh, NC 27620-4465
You will have your own phone in your room. To make calls within the hospital, you do not need to dial the 350-prefix, simply the five digit extension number. If you need assistance, dial "08000" to reach the hospital operator. To make outside local calls, dial 9 + the local number. There is no charge for local calls. To make long distance calls, dial 9 and then you will need to use your calling card.
WakeMed Health & Hospitals is a tobacco-free facility. This initiative, which supports WakeMed's commitment to the promotion of health, prohibits the use of any tobacco products on all WakeMed campuses, facilities, and office space (including parking lots, sidewalks and other outside areas). The tobacco-free policy applies to anyone at these facilities, including employees, volunteers, medical staff, vendors, patients and visitors.
Cafe 3000 is open from 6:30 a.m. to 8:00 p.m.
3000 New Bern Ave.
Raleigh, NC 27610


text:
I have a new tune stuck in my head now. It got stuck there this afternoon shortly after my computer was forced into a reboot. I was in the middle of writing a blog post, working on some stored procs and some general queries. All of the sudden my system is shutting down and I can do nothing to prevent it.
After SSMS closes, my browser closes, the command prompt that is running a chckdsk is forced closed, then the logoff window appears and I see that windows updates are being applied. SOME OF IT ITCHES!!!!! Why can't Microsoft allow us some latitude when running these updates? I could understand it if the patches were scheduled to be installed and prompted a reboot – I got none of that. Do I need to have critical updates forcibly applied to my systems so frequently? And believe me this is occurring much more frequently than the mythological 2nd Tuesday of the month.
In the end I am happy that these updates did not toast my windows install like an update did a few weeks ago. But I seriously have seen enough of these updates over the past few months and something has got to change.


text:
|Tweet me: Laura Devaney
One gaming strategy involves Minecraft, a sandbox game touted for its open-ended nature and ability to engage students through creative thinking and problem solving.
The gaming evolution has prompted one educator to create Mathcraft, a Common Core-focused math curriculum focused around Minecraft.
|Photo: eSchool News
Jim Pike, a third grade teacher at Ascension Catholic School and director of education for learnbygaming.net, aligned mathematical equations to Minecraft structures to engage his students in mathematical processes as they created buildings and other structures in the game. Pike demonstrated his use of Minecraft during an edWeb webinar, and gave the audience step-by-step visual instructions.
Pike offered a handful of recommendations when it comes to using Minecraft with students:
- Start with a whole-class exploration using a projector and a single-player flat world so that students can watch the instructor build a structure
- Give students the equations to solve and ask them to complete their math work before they begin playing Minecraft. Once they complete the equations to discover how many building materials they'll need, they will be able to "request" that amount in the game when they begin playing
- Next, take students into a computer lab or use school-issued devices in class, and let students create their structures
- Have students create a "sign" in front of their structure with the completed equation(s) and their names on each sign
- Give students time to play in Minecraft, but make sure they've completed their equations, built their structures, and "signed" their work
Read more...
Source: eSchool News


text:
HOLA MY LITTLE BLOG!! who knew it would be MONTHS since i posted something. life has come speeding by and it has been a whirlwind of a year!!! really, it feels like i have been in a FOG this year...could be my FIBRO and what they call FIBRO FOG, i guess any excuse i will take it! right?
Well, this year my boys turned ALEX 12, MATTHEW 10 and JOSHUA 7....these boys keep growing and growing and THANK YOU GOD they do! who knew that i would have such amazing boys and that they are just so wonderful and loving....they have grown into such beautiful and loving boys...they show us each day how much they know that they are LOVED by us their parents and how much we want them to know GOD'S LOVE....that HE is the most important person in the world and that they should love and honor him every moment of their lives...
This year we have had so many things happen to us. we bought a new BOAT for our family...this boat we call MATTHEW's boat because it is a PONTOON and that gives him the ROOM to roam around the boat so that he can go on the water. he had not been able to be on the water in our other smaller boat because he had no where to go. but now with this bigger boat, he is more comfy and he LOVES being back on the water!! we also love being able to take more family out on the boat with us.
MATT got his new KAYE WALKER and he has started to do his walking and getting stronger and doing SOOO GOOD! we are so proud of all his new accomplishments! He has been walking to and from the bathroom and also up and down the stairs....soooo proud of him and how much better he is getting on walking!! <3
EASTER 2014 was really a nice family time with so many people there joining us at our home. The kids enjoyed being there and having all their cousins there to crack cascarones on each other! The food was amazing and all the goodies you just can't beat!!
Matthew started in a BASEBALL LEAGUE called the MIRACLE LEAGUE OF SAN ANTONIO....he was on the DODGERS team and boy, he LOVES it soooooo much! he has such a good time hitting home runs and being on his team....he played 2 seasons...the spring and the fall and he always gets so happy and excited when we pull into the parking lot....such a HAPPY BOY!! GO DODGERS!!
ALEX AND JOSH have also started their 3rd year of CYO BASEBALL THRU PRINCE OF PEACE! This will be Alex's last year playing baseball...this year he was with the ROYAL TITAN'S....and Josh was with the PADRES...and it was the first time he was with an all male team!! no more T-BALL for him!!! He's in coaches pitch and he did so well this year! Both boys did amazing! so proud of both of them!!
This year, we ended up going to GREAT WOLF LODGE for our summer vacation. we had soon much fun and soon enjoyed being with our little family, splashing around and just getting wet. what memories our boys will have of this time with each other.....they are just young for a little while and then they grow up and don't want to be with us anymore, so we have to enjoy. Life is amazing and we have been so happy that GOD has granted us each other...
Towards the end of this year, we have continued to be BLESSED with good health....ALL OF US, THANK YOU JESUS!! Matt has done amazing and we thank Him everyday for every moment...just watching all of us growing and getting healthy and happy is amazing....
So, as we closed 2014 and are now in 2015, we can only PRAY that we continue to grow and give THANKS to GOD for all the blessings in our life and Pray we have continued GOOD HEALTH and happiness...in HIM!!! BLESSING TO ALL!
Thursday, January 01, 2015
2014 has come to an end....LET'S RING IN 2015!!
HOLA MY LITTLE BLOG!! who knew it would be MONTHS since i posted something. life has come speeding by and it has been a whirlwind of a year!!! really, it feels like i have been in a FOG this year...could be my FIBRO and what they call FIBRO FOG, i guess any excuse i will take it! right?
14 comments:
- abo-bder said...
شركة مكافحة حشرات بالجبيل
شركة تنظيف بالجبيل
شركة تنظيف بالخبر
شركة تنظيف بالاحساء
شركة تنظيف بالقطيف
شركة تنظيف بخميس مشيط
شركة تنظيف بابها
شركة تنظيف بالهفوف
شركة تنظيف بحفر الباطن
شركة تنظيف بالظهران
شركة تنظيف براس تنورة
- hitaakademi said...
Ankara merkezli sanal gerçeklik oyun merkezi kurulum hizmetleri
VR CAFE Türkiye'de hizmet ve faaliyetlerini sürdürmektedir.
- Unknown said...
Nhung Mẫu thiết kế nhà đẹp hcm
Cong ty Thiết kế nhà hcm
Mẫu nhà đẹp hcm
Mẫu thiết kế nhà
Thiết kế nhà đẹp hcm
- Unknown said...
Nice blog !!!
thanks for sharing
thiet ke nha hcm
mau thiet ke nha dep hcm
mau nha dep tai hcm
thiet ke nha dep hcm
kien truc nha dep hcm
mau thiet ke nha hcm
nha pho dep hcm
mau nha pho dep hcm
nha pho hien dai hcm
nha pho co dien hcm
mau thiet ke nha pho hcm
biet thu dep tai hcm
biet thu vuon
biet thu hien dai hcm
biet thu co dien hcm
biet thu pho hcm
mau thiet ke biet thu hcm
thiet ke noi that tai tphcm
noi that dep tai tphcm
trang tri noi that tai hcm
trang tri noi that tai tphcm
cong ty thiet ke noi that tai hcm
mau noi that dep tai tphcm
tu van thiet ke noi that
thi cong noi that chung cu
thiet ke noi that chung cu
mau thiet ke noi that
- Unknown said...
Nice blog !!!
thanks for sharing
biệt thự hiện đại hcm
mẫu biệt thự hiện đại hcm
biệt thự cổ điển hcm
biệt thự đẹp tại hcm
biệt thự phố tại hcm
mẫu thiết kế biệt thự hcm
- hitaakademi said...
Ankara merkezli sıramatik sistemleri kurulum ve teknik destek hizmetleri
siramatik Türkiye'de hizmet ve faaliyetlerini sürdürmektedir.
- Unknown said...
Earth Taken 2 is a zombie game in which you can fight weapons and zombies that are formed after dawn. The music playing in the background of the game will invite you to the world. Are you strong enough to deal with all the zombies? Good luck...
- hitaakademi said...
Ankara merkezli etkili sunum teknikleri
sunan Haluk GÖKŞEN arı kovanı
eğitimi ile sistematik bir yapı sunuyor.
- مؤسسة سما المثالية said...
- Unknown said...
- NO NAME said...
- Kevin said...
Amazing article written.
After so many days i am reading such a great post.
Good writing skills and research skills.
Use best antivirus in India and also download malware crusher.
- Unknown said...
Do you know that this article is damn amzing.
Trust me i have never seen such a good style of writing.
The Author has covered all the important points related to this topic.
There are many types of virus and you can easily remove shortcut virus in just one click.
If you are searching for some kind of recipe then be careful with a virus and if infected then remove recipehub virus.
Please look on how to remove dogpile web search.
- ghitas said...
شركة تنظيف بالخبر
شركة تنظيف منازل بالخبر
شركة تنظيف فلل بالخبر
شركة تنظيف مجالس بالخبر
شركة تنظيف خزانات بالخبر
شركة مكافحة حشرات بالخبر
شركة مكافحة نمل ابيض بالخبر


text:
When you are starved of space, money and time or if you want to do in a different manner, try a micro layout on a n Iphone case.
In paralell to my layout sidi fontana, I want to explore another scale and another way to do. The layout is at n scale.
In the past I have done also a pizza layout but at gn15 scale.
The Iphone case is from M. Kobayashi, the locomotive is a japaneese one (7 tons) from TGW.
I will add a building as the backdrop, I will do snow and the layout will be located in Japan.


text:
Murki D and DJ Fett – Face It
Lyrics with Video
The new UK Hip Hop single by Murki D and DJ Fett, available at good download stores now. Rap along with the lyrics in this Youtube video.
Lyrics written and performed by Murki D. Track produced by DJ Fett.


text:
A newly married bride and groom spent their wedding night in jail after getting into a scuffle in their hotel lobby. Nick and Kirsty Bigland, from Salford, England were arrested at the Hilton Hotel in Manchester - the same venue that hosted the wedding reception - after they allegedly got into a late-night scuffle with hotel security staff. The Manchester Evening News reports that the couple became combative with hotel staff as they were trying to check into their wedding suite, so security guards were called. Nick Bigland is accused of causing bodily harm to one of the guards and Kirsty allegedly made racist comments to another guard.
They couple spent the night in jail in their wedding attire, but have since been released.


text:
Who was/is Charles Brown ? - CDs, Vinyl LPs, DVD and more
Charles Brown and His Band
After tearing up the postwar R&B charts with their mellow, cosmopolitan brand of West Coast club blues, pianist and front man Charles Brown came to a parting of the ways with Johnny Moore's Three Blazers (Moore's brother, the equally dazzling guitarist Oscar Moore, joined the act in 1947). The Blazers' personal hit parade for the Exclusive label included Sunny Road, New Orleans Blues, and the immortal Yuletide perennial Merry Christmas Baby, but they broke up nonetheless.
"Johnny Moore got so greedy. They took a lot of money that was supposed to divide and brought home, but he left us out of the picture, Eddie Williams and I, who was the bass player. So it became a problem, not getting along, and I decided to quit," said Brown. "I left them in '48 and organized my own group, called Charles Brown & The Smarties. I went back to Aladdin Records."
The hits came immediately for Brown at Aladdin: Get Yourself Another Fool and the R&B chart-topping Trouble Blues in 1949 and the mournful Black Night, cut December 21, 1950 at Radio Recorders in L.A. with Jesse Ervin's guitar work solidly in the Moore tradition, were among the biggest. Penned by L.A. female songsmith Jessie Mae Robinson, Black Night paced the R&B hit parade for 14 weeks in 1951. "Everything I was doing was a big hit with them," said Charles of his Aladdin hookup. But the good times didn't last. Brown took his final bow on the R&B charts for almost a decade the next year (a holiday offering, Please Come Home For Christmas, brought him back briefly in 1960), and a 1958 dispute with his booking agency laid him low for years as a live act.
"I became a scab musician," he explained. "I couldn't work in no place unless I paid the union. Well, I couldn't work because I didn't have nobody booking me. So I went into seclusion. That's how I came off the scene." The drought ended during the '80s, when Europe began to beckon. Then in 1990, Bonnie Raitt booked Charles as her opening act. "That really started the ball rolling for me," he said.
Brown died January 21, 1999 after a full decade back in the spotlight. "I did do something that I thought was part of me, and that the people recognize," Brown said. "I can go to my grave thinking that I did do something that got recognition."
Bill Dahl
Chicago, Illinois
Electric Blues 1939-2005. - The Definitive Collection!


text:
Good Luck to The Oxford American
In the NYT Dwight Garner has a nice tribute to the Oxford American, in both its previous and its new incarnation.
I used to write for the Oxford American, years and years ago, and really enjoyed it. I found Marc Smirnoff an enjoyably low-key person to write for, though I had friends and acquaintances whose experience was not nearly so pleasant. Smirnoff was so gentle and soft-spoken with me that I found it hard to believe that he has a bad side, but I was assured, by people I trust, that he most certainly does.
I didn't stop writing for them for any particular reason, except that I had a sense that the magazine — having so strenuously avoided so many familiar Southern poses — was developing its own. Larry Brown — Mister Southern Grit Lit himself, may he rest in peace — was perhaps too much the presiding spirit of the magazine. I wasn't sure I had much to say that was low-down-and-dirty enough to fit in. And even low-doen-and-dirty finds, on the other side of cliché, an unbearable cuteness. That's where Roy Blount Jr. goes sometimes, and Tony Earley pretty much all the time. I've had enough of what Tom Franklin — Garner quotes this — calls "the sensitive guy at the dogfight" stories.
But you know, the South remains its own place, with its own distinctive take on the Human Comedy, and on the various human tragedies as well, and I hope it will continue to punch above its weight, literarily speaking. I think is this is going to happen the Grit Lit thing will need to be overcome, or at least to become just one of the punches it might throw at any given time. The ordinary middle-class Southern existence hasn't had a true recording angel since Walker Percy; I'd sure like to see another one. (Garden and Gun is fine as far as it goes, but Southerners have more, and more varied, stories to tell.)
I'd love to see the new Oxford American stretch the intellectual boundaries of Southern culture, and push into new territories of writing. I wish Roger Hodge well as the magazine's new editor. And for heaven's sake, man, keep those Music Issues coming.


text:
A common explanation for the lack of progress on a problem is that there's no "quick fix." Actually, there's ample evidence that our problem-solvers resort to quick fixes much too often.
A common explanation for the lack of progress on a problem is that there's no "quick fix." Actually, there's ample evidence that our problem-solvers resort to quick fixes much too often.
As Webster's Dictionary defines it, a "quick fix" is "an easy and expedient solution or remedy, especially one producing results that are temporary, illusory or counterproductive." That last part rings a bell or two, doesn't it?
We get a lot of mileage out of the word "fix," whose root is the Latin "fixus," past participle of the verb "figere," meaning "to fasten, attach."
The first handful of definitions in Webster's reflects those original notions:
"To make firm, stable or secure" –– to fix a mirror to a wall, or to fix any "fixture," for that matter.
"To set firmly in the mind," –– a fixed idea, which, when taken to the extreme, becomes an obsession (as with the French term "idee fixe").
"To direct steadily" — to fix one's gaze.
"To make rigid or stiff" — let's go with Webster's example of a fixed jaw.
"To make permanent or lasting" — as when using dye.
"To arrange or establish definitely" — Prince William and Kate Middleton just a few days ago fixed
the date for their wedding.
"To arrange properly or in a certain way" — as when someone fixes your tie.
That's a fairly full plate, but there's much more, including fixing food to put on other plates.
When things have been damaged or just aren't working properly, it's time to fix them — or get new ones. Special terms related to this one are "fix-it," informal for "of or having to do with fixing or repairing things," and "fixer-upper," informal for "a house in poor repair but suitable for restoration, that is for sale at a bargain price."
Then there are the informal uses:
"To influence the result or action of (a horse race, jury, election, etc.) to one's advantage by bribery,
trickery, etc." This kind of fixing is illegal — or should be if it isn't.
"To revenge oneself on; get even with; punish or chastise." It is often expressed in a threat such as "I'll fix you!" In the 1940s, according to "American Slang," this was expanded to the phrase "fix someone's wagon" — not as nice as it might sound.
When dealing with animals, "to spay or castrate." That's fixing to prevent something from working.
And as a noun, "a difficult or awkward situation" — to be "in a fix."
A couple of slang uses also are worth noting:
"A clear understanding or evaluation," as in "to get a fix on," which "American Slang" dates to 1902.
And, beginning in the 1930s, "fix" as "an injection of a narcotic, as heroin, by an addict."
Among its idiomatic phrases are "fix on" (or "upon"), meaning "to choose; settle on"; "fix up," for "to repair," "set in order" or "make arrangements for"; and the informal "fix (someone) up," meaning "to arrange a meeting or date for."
The verb "fixate" and related noun "fixation" are members of this family as well. The latter has become another popular term for "an exaggerated preoccupation; obsession."
All in all, that's quite a feast for word fans. Which reminds me, I hope you enjoyed your holiday meal with all the fixings.
Contact Barry Wood at firstname.lastname@example.com or read his blog at blogs.e-rockford.com/woodonwords/.


text:
That said...how about some pictures of the four of us!? We recently got all of our pictures back from our wonderful photographer friend, Trinity, and I have been itching to show some of them off!
Did you ever have a photo session go a bit off course? It seems ours typically do, but I feel like that is the way we get the most 'us' pictures out of them!
Also - what do you think of the new look? If there is anything all messed up through your screen, let me know! Thanks!


text:
Xeriscaping in the city and the country
When people say xeriscaping, the first thing that comes to mind is water conservation. While that's true, another benefit to this type of landscaping is the time and money savings. Here's how it works.
Xeriscaping balances a right-size lawn with native or minimal-maintenance plants and shrubs. This could include a wildflower meadow, sunflower patch, or just a line of tall grasses.
To start xeriscaping on your property, decide how much of your lawn you can eliminate. Trimming back your lawn will make room for your new shrubs, plants, and flowers.
Be sure to choose plants that easily grow in your part of the Northwest. The vegetation you choose should be able to survive on rainfall or just a little added water. Put plants that require more water closer to your lawn. Outside of your lawn area, use drip irrigation or soaker hoses wherever possible to minimize water use and evaporation. Lastly, cover any exposed soil with mulch or rock to keep it from washing away.
Coastal has what you need to xeriscape your property. Your store carries the plants, shrubs, and seeds that grow in your area. Plus, you'll find soaker hoses and drip irrigation systems. Swing by and let us show you how this new idea in landscaping can work for you.
To read the full version of this story...Click HERE to continue to the


text:
Please note that for the use of MASTER SOLUTION you need to read the following processors "Clap", "Execute it", "Merge", "Hoppo" here
"Looks like a nice peace-full universe be in created over there..."
You are a genius.
"Gives a good deal of clarity, I am working on the dualities now and already considering where they appear. Many thanks for this valuable item to add to the regime."


text:
Overview Specification Prices SUV Capability Technology Safety Exterior Interior Accessories
Finance & offers ▼
The Shogun Sport is packed with the most advanced on and off road technological features. It has been designed from the ground up to take you anywhere and everywhere you want to go.
The Shogun Sports 2.4L turbo diesel engine has been paired with a all new 8 speed automatic gearbox, providing the Shogun Sport with the optimum balance between power, fuel economy and interior quietness. This all new transmission also delivers great fuel efficiency, smooth acceleration and low RPM whilst travelling at high speeds.
The Off Road Mode optimises off-road performance by controlling the engine, automatic transmission and brakes depending on road conditions. When travelling in a 4WD mode with the centre differential locked (4HLC or 4LLC), press the Off Road Mode selector until the appropriate mode appears in the multi-information display.
Achieves just the right amount of wheel slippage to balance acceleration and vehicle stability over unpaved surfaces covered with small stones and dirt.
Control tyre slippage to provide optimum vehicle stability and prevent the vehicle from becoming stuck. After the vehicle starts moving, some slippage is allowed to eliminate the feeling of losing speed. When the vehicle is about to become stuck the engine adjusts to prevent it.
Controls wheel slippage when accelerating from a standstill to prevent the vehicle from becoming stuck. After the vehicle starts moving it permits some slippage and eliminates the feeling of losing speed. The automatic transmission uses lower gears to maintain driving force.
reduces loss of traction by preventing wheel slippage. The automatic transmission uses lower gears to maintain driving force.
Everything you need to manage your journey is right where you want it with the Shogun Sport.
Located neatly between the speedometer and rev counter, the multi info display gives you full journey information at a glance.
Fuel economy, estimated miles remaining, outside temperature and more.
Steering wheel mounted cruise controls to make motorway driving a breeze. You simply switch it on and set your speed and the Shogun Sport will maintain that speed until you press the brake.
Adjust volume, change tracks and switch between radio, USB and Bluetooth audio sources are the touch of a button.
Connect your smartphone via Bluetooth and make phone calls on the go safely.
Music and podcasts from your phone can also be played.
When the vehicle is travelling off-road down a steep gradient of more than 5% and 1 to 12 MPH, this system maintains constant vehicle speed by controlling the brakes. The driver can concentrate on steering and not worry about the brake pedal control.
Your keys can stay safely in your pocket or your bag. Unlock and start the Shogun Sport just by having the keys on you.
The Shogun Sport range features automatic dual zone climate control for the driver and front passenger, and rear air vents with cooler, adding to your driving comfort.
The Shogun Sports in-car entertainment system uses Apple CarPlay and Android Auto to allow your smartphone to integrate seemlessly with your car. Learn how this is done by clicking the links below.Explore Apple CarplayExplore Android Auto
Apple CarPlay and iPod are trademarks of Apple Inc., registered in the U.S. and other countries. Overall device compatibility as well as individual feature operation and functionality is contingent upon the device software version. Android Auto is a trademark of Google Inc.
The 360º Camera helps make tricky manoeuvres and tight parking spaces so much easier. Activated automatically when the car enters reverse, it provides a birds-eye view of the area surrounding the vehicle.
Adaptive cruise control monitors the road and adjusts the car's speed accordingly, maintaining the driver's chosen distance from the vehicle in front.
By detecting vehicles in your blind spot and alerting you in your mirrors this system helps to enhance safety and reduce accidents.
Decades mastering off-road adventure with the Shogun, and high-speed rally prowess with the Lancer Evolution, have taught us a thing or two about safety.
All that learning goes into our Shogun Sport.Safety
Next steps
Tackle any terrain in any condition with the Shogun Sport. Discover just how capable the Shogun Sport really is.SUV Capability
With a expressive new look,the Shogun Sport utilises Mitsubishi's new design ethos "form follows function".Exterior
Cope with slippery road, emergency stops, tricky hill starts and more. With 7 airbags you're in good hands with Shogun Sport.Safety
Get behind the wheel and experience the power and space of the Shogun Sport.Test Drive


text:
Iowa Central Hosts High School Diva Tech Camp
by Phyllis Minnihan
Posted on 6/15/2012
Fort Dodge - Iowa Central hosted Diva Tech Camp for high school girls June 11, 12, and 13. We have hosted a middle school camp every summer since 2005, but this was the first time it has been offered for the high school age group. There were 13 girls in attendance, most of whom attended Diva Tech Camp when they were in middle school. It was great to see the girls again and meet some new "divas." The girls talked about the different careers they are considering, and it was great to hear that some are planning on non-traditional careers they have explored at Diva Tech Camp.
Neale Adams, Dean of the Departments of Business and Industrial Technology, applied for a non-traditional Perkins grant to help fund the camp. When the girls finish their last year of middle school camp, they always ask if they can come back for a high school camp, so we decided to expand on what we've offered in the past and host a HS camp this year. Projects and experiences in the various shops and labs were different than what we do at the middle school camp, and the girls all gave a big thumbs up, and are looking forward to coming again next year.
Thanks to all the instructors who organized a session, and a big thanks to the girls who attended! Coming soon will be camp pictures on the Iowa Central Facebook page. Check it out!


text:
Christmas Star Rolls
On a special day, preparing mouthwatering cinnamon rolls with a rich caramel sauce is a tempting way to treat family and friends. Using convenient hot roll mix makes it easy to do, and the pecans and candied cherries give the rolls a lovely look.—Ann Harrill, Reidsville, North Carolina
Total TimePrep: 30 min. + rising Bake: 20 min.
Makes16 rolls
- 1 package (16 ounces) hot roll mix
- 2 tablespoons butter, melted
- 1/2 cup sugar
- 2 teaspoons ground cinnamon
- 3/4 cup pecan halves
- 2 cups packed brown sugar
- 1/4 cup light corn syrup
- 2 tablespoons butter
- Prepare hot roll mix according to package directions. Turn onto a floured surface; knead until smooth and elastic, about 5 minutes. Cover and let rest for 5 minutes. Divide dough in half. Roll each half into a 1/4-in. thick rectangle. Brush with butter. Combine sugar and cinnamon; sprinkle over dough. Roll up jelly-roll style, starting at a long end; pinch edges to seal seam. Cut each roll into eight equal pieces and set aside. Arrange pecans and cherries in two greased 8-in. round pans or 6-cup ring molds. Combine glaze ingredients in a medium saucepan; cook and stir over low heat until the butter is melted and the mixture is well blended. Pour glaze over pecans and cherries; top with rolls. Cover and let rise in a warm place until doubled, about 30-45 minutes. Bake at 350° for 20-25 minutes or until golden brown. Immediately invert pans onto platters and let glaze drizzle over rolls.


text:
Today marks the 49th anniversary of the opening of Vatican II, which means the church as a full year to prepare for the 50th anniversary celebrations. How will you get ready?
By guest blogger Ken Trainor
October 11 is the 49th anniversary of the beginning of the Second Vatican Council. It is also the feast of Blessed John XXIII. No coincidence, of course, since John is most closely identified with the council (though, to be fair, Paul VI did a lot of the heavy lifting).
We're one year away from the 50th anniversary. Worth noting, certainly worth celebrating, but don't look for the Vatican to go all out. That leaves it up to us, and why not? This, after all, was the council that called for a more active, participating, empowered laity, and one way to serve notice that the laity has awakened is to celebrate the 50th anniversary of Vatican II in your own parish.
The best way to celebrate is to tell the story of the Second Vatican Council because it's a tale worth telling–about the Holy Spirit working through a flawed, human institution that learned it could change, renew, even resurrect. But to tell the story we have to learn the story, which many have forgotten–or never knew in the first place. This is not some lifeless historical event, dispassionately marked. It is an amazing story that needs to be told by people who believe in it.
Parishes will have to prepare, and they have a year to do so–through book clubs, panel discussions, reminiscences from those who were in Rome at the time, reading the council documents, and publishing passages from those documents in the parish bulletin.
If you want to get a sense of what happened 49 years ago, search YouTube for "Discorso della Luna," the discourse on the moon, which took place in St. Peter's Square the evening of Oct. 11, 1962, following the formal ceremonies opening the council. Several videos exist on YouTube. Watch them all. I think you'll be inspired. It might even put you in a celebratory mood.
A spontaneous candlelight vigil took place, and Pope John came to his window to speak to those who jammed the square. His remarks were impromptu, simple, and human, like the pope himself–like no other pope before or since.
"Even the moon has rushed to join us tonight," he said gesturing toward the sky. His voice sounded young, strong, vibrant. It was an unforgettable moment, witnesses say, and has become something of a legend in Rome.
"For the church universal to receive the council is to enter into the dynamics of the council," writes Rev. Ladislas Orsy, a Georgetown University Jesuit and canon law expert. "For communities and individuals to enter into the dynamics of the council is to expose themselves to the ever-surprising action of the Spirit. Whenever the Fathers gathered at St. Peter's Basilica, their prayer was the traditional exclamation, Adsumus–'we are present and listening.' Over four years, the Spirit heard their cry and responded. … Over four years again, let the cry Adsumus resound–not within the walls of St. Peter's Basilica but throughout the face of the earth. The Spirit of God will not fail to respond."
By Ken Trainor, a practicing, progressive Catholic, who was 10 years old when Vatican II began. For the past 20 years, he has been a reporter, editor and weekly columnist for Wednesday Journal, a newspaper in Oak Park. You can find his column at OakPark.com/Opinion/KenTrainor. He is currently writing a book on Vatican II.
Guest blog posts express the views of the author. They do not necessarily reflect the views of U.S. Catholic, its editors, or the Claretians.


text:
Welcome NastyBoy! Enjoy the stay!
So.... I was browsing about hell hounds, im sure you can call them a billion other names but i chose hell hound due to the fact that its all ive ever heard, in short we ...my friend and i, stumbled onto a coven being freakin stupid, ...all we could smell is witch hazel and the moon was being covered by a dark cloud, i wont discuss who they were summoning, but in short i have this freakin hell hound being dumb and TRYING to mess with me, it circles and calls to other dogs, ....oh....i kinda ran over it to...BUT ITWAS IN THE FREAKIN STREET right over a hill, i hit him and looked back and he wasnt even there, i didnt even feel a bump...but there were tons of dogs out there with him apparently just hanging out. Question? Ya how the heck do you dispose of a hell hound, or do i gotta go out and do this on my own? Im not affraid of um, ive actually come very close to them, i went out to meet one to destroy it however i was gonna do it and it never showed up, i tried to antaganize it, try to make it mad, never showed up. AND recently we banished a dark shadow....it was just spieing on us..but we both felt outta place, and ever since we saw the coven doing there dumb weather stuff, ive had this stupid freakin cough, cant get rid of it but its not getting worse, not getting better, had it for 2 weeks now...just outta the blue. Im not weak, not tired, i have no sick symptoms, just keep caughin up crap. flem? ya its alot of info sorry. so does anyone know what is actually going on? or can anyone give me advise, remmember im stubborn and i really dont care about what they can and cant do to me, im a beginner so ya im dumb , but my bestest friend in the world has been doing wicca for 12 years, keeps telling me im some key and apparently ive caused an earthquake? it wasnt big....as a matter of fact it didnt even make the news, but apparently its all been done subconsciously...i have no controle over what is happening i am only embracing my path. so im a little lost on what is going on, could someone fill me in? if you have to send me an email its cool, i just need some guidance. thanks


text:
"I Should Have Never Gone Ziplining"
This episode is currently not available at South Park Studios
Featured Episodes
I Should Have Never Gone Ziplining
s16e06 April 18, 2012
The boys' ziplining adventure becomes a terrifying test of survival.
The boys' ziplining adventure becomes a terrifying test of survival.
By clicking outside of this box or X, you agree to the Site's updated Terms of Use and consent to the collection, use, disclosure and transfer of information as described in this Site's updated Privacy Policy and to third parties receiving information about the videos you watch as described in this Site's Video Privacy Terms. Before you do, please read them and check out some of these changes (such as arbitration for disputes - see our FAQs). Please also note that you are accessing a site which is designed for and targeted to U.S. audiences and is governed by and operated in accordance with U.S. laws.


text:
This meditative emblem first published in 1659 as an illustration for the book Azoth of the Philosophers by the legendary German alchemist Basil Valentine. The word "Azoth" in the title is one of the more arcane names for the One Thing. The "A" and "Z" in the word relate to the Greek alpha and omega, the beginning and end of all things. The word is meant to embrace the full meaning of the One Thing, which is both the chaotic First Matter at the beginning of the Work and the perfected Stone at its conclusion.
At the center of this striking drawing is the face of a bearded alchemist at the beginning of the Work. Like looking into a mirror, this is where the adept fixes his or her attention to meditate on the mandala. Within the downward-pointing triangle superimposed over the face of the alchemist is the goal of the Work, the divine man in which the forces from Above and Below have come together. Each of the sequentially numbered points on the star emanating from the alchemist stands for an operation in the Emerald Formula (Calcination, Dissolution, Separation, Conjunction, Fermentation, Distillation, and Coagulation) and contains the cipher for the corresponding metal. To see an explanation of these operations, click on the appropriate point on the star.
Table of Operations = Metals
The alchemist's schematized body is the offspring of the marriage between Sol, the archetypal Sun King seated on a lion on a hill to his right, and Luna, the archetypal Moon Queen seated on a great fish to his left. "Its father is the Sun," says the tablet, "its mother the Moon." The laughing, extroverted Sun King holds a scepter and a shield indicating his authority and strength over the rational, visible world, but the fiery dragon of his rejected unconscious waits in a cave beneath him ready to attack should he grow too arrogant. The melancholy, introverted Moon Queen holds the reins to a great fish, symbolizing her control of those same hidden forces that threaten the King, and behind her is a chaff of wheat, which stands for her connection to fertility and growth. The bow and arrow she cradles in her left arm symbolize the wounds of the heart and body she accepts as part of her existence.
In simplest terms, the King and Queen represent the raw materials of our experience -- our thoughts and feelings -- with which the alchemist works.
The King symbolizes the power of thought, ultimately the One Mind of the highest spirit.
The Queen stands for the influence of feelings and emotions, which are ultimately the chaotic One Thing of the greater soul.
The much anticipated Marriage of the King and Queen produces a state of Consciousness best described as a feeling intellect, which can be raised and purified to produce a state of perfect intuition, a direct gnosis of reality. "All Obscurity will be clear to you," says the tablet of this state of mind; it is "the Glory of the Whole Universe." The goal of alchemy is to make this golden moment permanent in a state of consciousness called the Philosopher's Stone, and it all starts with the marriage of opposites within us.
In our drawing, the body of the alchemist is composed of the Four Elements. His feet protrude from behind the central emblem; one is on Earth and the other in Water. In his right hand is a torch of Fire and in his left a feather, symbolizing Air. Between his legs dangles the Cubic Stone labeled with the word Corpus, meaning body. The five stars surrounding it indicate that it also contains the hidden Fifth Element, the invisible Quintessence whose "inherent strength is perfected if it is turned into Earth." Where the head of the alchemist should be, there is a strange winged caricature that is variously interpreted as a heart, a helmet, or even the pineal gland at the center of the brain. The symbol evolved from the Winged Disk of Akhenaten and became the top of the Caduceus, the magical wand of Hermes where opposing energies merge to produce miracles. This knob represents the Ascended Essence, the essence of our souls raised to the highest level in the body, to the brain, where it becomes a mobile center of consciousness able to leave the body and travel to other dimensions.
Touching the wings of the caduceus are a salamander engulfed in flames on the left side of the drawing and a standing bird on the right. Below the salamander is the inscription Anima (Soul); below the bird is the inscription Spiritus (Spirit). The salamander, as a symbol of soul, is attracted to and exposed in the blazing fire of the Sun. Likewise, the bird of spirit is attracted to the coolness of the Moon and is reflected in it. This is a subtle statement of the fundamental bipolar energies that drive the alchemy of transformation. Spiritus, Anima, and Corpus form a large inverted triangle that stands behind the central emblem. Together they symbolize the three archetypal celestial forces that the alchemists termed Sulfur, Mercury, and Salt. Again, these chemicals are not chemicals at all, but our feelings, thoughts, and body.
Free eBooks (Can Be Downloaded):Paul Foster Case - An Introduction To The Study Of The Tarot
Paracelsus - The Book Concerning The Tincture Of The Philosophers
Anonymous - A True Relation Of The Araignment Of Thirty Witches
John Opsopaus - Interpretationes Of Ancient Herbs


text:
Lux - The Original Android Auto-Brightness App
So I thought I should make an XDA thread for Lux, over a year after releasing it to the Play Store!
FULL or FREE
If you have any issues or suggestions, please add them to the public issue tracker found here. Be sure to search first, duplicated issues will not work in your favour.
- Update to 1.51 released to Play Store!
- Profiles. Have different behaviour for day and night!
- Root plug-ins. Custom kernel with RGB control? Make a plug-in to utilise it!
- Improved notification
- Low pass filter
- Cubic interpolation
- Polish/French/Russian/German/Italian translation
- Manual sunrise location input
- Control Dashboard slider with vol. keys
- Fade duration/step
- Reduced battery usage
- Fixes
- Update to 1.06 released to Play Store!
- Automatic night mode (uses location for sunset/sunrise).
- Notification priority
- Enhanced dashboard and notification UI
- Enable/disable and refresh Lux via Tasker
- Bug fixes
- Update to 0.76 released to Play Store!
- Fixed brightness issues after call
- Update to 0.74 released to Play Store!
- Fixed max/phone brightness preferences swapped
- Added ignore 0 lux option
- Made static phone brightness optional
- Update to 0.70 released to Play Store!
- New 'ascending' automatic mode for zero jitter!
- Expandable notification for added control (Android 4.1+)
- Improved efficiency
- Install to OS functionality
- Set min/max brightness bounds
- Adjustable night mode
- Improved persistence (Android won't kill it!)
- Fixed Nexus 7 255 luma bug
- Fixed Tasker 'on wake' revert bug
- Compat. mode is now known as 'sleep mode'
- Night Mode now default Dashboard action (hold for Astro. mode)
- Misc. tweaks and fixes.
App Description
Lux isn't your ordinary brightness app. It intelligently adjusts the brightness of your display based on the environment you're in. If, for example, you step into a dimly lit room, Lux will automatically lower the brightness of your display to make it not only comfortable to read, but to also preserve battery power.
Lux provides the option to automatically adjust the backlight at fixed intervals (periodic mode), when a change in environment is detected (dynamic mode), or when the phone wakes from sleep. It's also possible to adjust the backlight manually. Simply disable automatic mode and you can use it like a traditional brightness tool!
Perhaps the best thing about Lux is that you can teach it how to behave. If the backlight is too bright or dim for your liking, simply open the provided Dashboard, adjust the brightness slider to the level you desire, then hold the link button. Lux will use this new 'link' as a reference in future.
Give it a go! I want you to test Lux for more than the 15 minute refund period offered by Google. I understand that some devices may not have the best quality light sensor, and that you may need more time to play around with settings. If you find that Lux doesn't suit you after the 15 minutes is up, you can request a refund at any time via e-mail - no questions asked.
■ Custom auto brightness.
■ Sub-zero brightness to make reading in the dark significantly less irritating.
■ Battery efficient
■ Handy brightness widget
■ Option to use the camera to read in ambient light.
■ Power-user settings such as choice of interpolation, sensor debugging, and linked sample editing.
■ Backup to SD.
■ 'Ascending' auto mode for phones with inaccurate light sensors.
■ Gradual fade for backlight adjustments.
■ Astronomer mode adds a red filter to the screen to preserve the eyesight of stargazers.
■ Jitter control to prevent constant small changes to the backlight.
■ Automatic night mode, to change the colour temperature of the display for comfortable night time viewing.
■ Add app specific exceptions via sleep mode
■ No ads, or other nuisances.
■ Tasker and Locale support!
Note: Please disable other brightness apps before using Lux. The author is not liable for any issues caused when using this app.
TAKE PICTURES AND VIDEOS: Used to read in luma values, if camera input is selected.
DRAW OVER OTHER APPS: Required for night/astro mode.
READ PHONE STATE: Required to prevent Lux from interfering with phone controls in Android 4.1.
MODIFY SYSTEM SETTINGS: Brightness is a system setting, as is toggling the default auto brightness.
RETRIEVE RUNNING APPS: Required to make the 'sleep list' functionality work, so Lux can disable itself when certain apps are in the foreground.
COARSE LOCATION: Required to automatically calculate sunrise/sunset times.
IN APP BILLING: Required for purchasing future device specific root only plug-ins, to enhance functionality.