Next:
sizeof Get
Up:
Dense Vector Data Structure
Previous:
Vector Methods
Contents
get_nrows -- Get number of rows in a dense vector
nr = v%get_nrows()
Type:
Asynchronous.
On Entry
v
the dense vector
Scope:
local
On Return
Function value
The number of rows of dense vector
v
.


Design patterns in python¶
Many common design patterns are made much simpler or even trivial through the dynamic nature of python
in this lesson, we go through some common design patterns and how they can be implemented in python. we will use class Person
as an example wherever appropriate
class Person:
def __init__(self, name):
self.name = name
def __repr__(self):
return f"{type(self).__name__}({self.name!r})"
def walk(self):
print(self.name, 'walking')
def run(self):
print(self.name,'running')
def swim(self):
print(self.name,'swimming')
class OlympicRunner(Person):
def run(self):
print(self.name,self.name,"running incredibly fast!")
def show_medals(self):
print(self.name, 'showing my olympic medals')
def train(person):
person.walk()
person.swim()
person.run()
terry = Person('Terry Gilliam')
graham = Person('Graham Chapman')
usainbolt = OlympicRunner('Usain Bolt')
Prototype¶
The prototype pattern is a creational design pattern in software development. It is used when the type of objects to create is determined by a prototypical instance, which is cloned to produce new objects. Wikipedia
in python implementing this pattern is trivial, since we can easily clone any object regardless of its type
from copy import deepcopy as clone
def simulate_training(person):
simulated_person = clone(person)
simulated_person.name += ' after training'
return simulated_person
trained_usainbolt = simulate_training(usainbolt)
print(usainbolt)
print(trained_usainbolt)
trained_terry = simulate_training(terry)
print(terry)
print(trained_terry)
OlympicRunner('Usain Bolt')
OlympicRunner('Usain Bolt after training')
Person('Terry Gilliam')
Person('Terry Gilliam after training')
Singleton¶
the singleton pattern is a software design pattern that restricts the instantiation of a class to one “single” instance. This is useful when exactly one object is needed to coordinate actions across the system. Wikipedia
The singleton pattern is when we want to have just one object from a particular class.
Many of the complications with implementing singletons in different languages arise from intricacies of making sure that constructing the object or destroying the object can be done safely
this safety is taken care for us by python’s modules. creating an object in a module ensures that all its dependant modules are already loaded so it can be safely constructed. deconstruction is also trivial due to garbage collection.
lastly, to ensure that no further objects can be created from a class, we only need to redefine its __new__
method
here’s sample code to illustrate all this:
#
# module:
# singleton.py
#
def make_singleton(class_):
def __new__(cls, *args, **kwargs):
raise Exception('class', cls.__name__, 'is a singleton')
class_.__new__ = __new__
#
# module:
# earth.py
#
from singleton import make_singleton
class HomePlanet:
def __init__(self, name):
self.name = name
def __repr__(self):
return f'HomePlanet({self.name})'
earth = HomePlanet('earth')
make_singleton(HomePlanet)
from earth import earth, HomePlanet
print(earth)
# we can't make another instance of HomePlanet
try:
HomePlanet('mars')
except Exception as ex:
print("we only have one home planet, can't make more", ex)
HomePlanet('earth')
we only have one home planet, can't make more ('class', 'HomePlanet', 'is a singleton')
Proxy¶
See definition of the proxy pattern at wikipedia
What problems can the Proxy design pattern solve?¶
The access to an object should be controlled.
Additional functionality should be provided when accessing an object.
Possible usage scenarios¶
Remote proxy - In distributed object communication, a local object represents a remote object that resides in a different process or machine
Virtual/Lazy proxy - In place of a complex or heavy object, a proxy that loads the actual information on demand
Protection proxy - A protection proxy might be used to control access to a resource based on access rights.
Python example¶
We show a completely dynamic implementation of a proxy, that has no knowledge about the object it is proxiying
import inspect
class ProxyExample:
"""
show that we can discover and act upon any call to proxied object functions,
or any access to proxied object attributes
"""
def __init__(self, obj):
self.obj = obj
def __getattr__(self, name):
obj = self.obj
attr = getattr(obj, name)
print(f'accessing {obj}.{name}')
if inspect.isfunction(attr) or inspect.ismethod(attr):
def callable_proxy(*args, **kwargs):
print(f'calling {obj}.{name}() with args:{args} and kwargs:{kwargs}')
result = attr(*args, **kwargs)
return result
return callable_proxy
else:
return attr
# make a proxy to usain bolt
usain_proxy = ProxyExample(usainbolt)
# now every action taken is logged
usain_proxy.name
usain_proxy.run()
accessing OlympicRunner('Usain Bolt').name
accessing OlympicRunner('Usain Bolt').run
calling OlympicRunner('Usain Bolt').run() with args:() and kwargs:{}
Usain Bolt Usain Bolt running incredibly fast!
Composition¶
Sometimes we want to model ‘has-a’ relationship instead of an ‘is-a’ relations. for instance, we can say a person has (or composes) arms, legs, a face, a head and eyes.
the composition patterns allows the composing object to behave as if all the abilities of the composed object
lets see an example. the ‘magic’ of how this works is available in the composition.py
module in this repository
# import a local module named composition that holds all the magic
from composition import Composition
class Arms:
def up(self):
print("I raised my arms")
class Legs:
def up(self):
print("I raised my legs")
class Eyes:
def close(self):
print("I closed my eyes")
class Face:
def __init__(self):
Composition.compose(self, Eyes())
def smile(self):
print('I smiled')
def __getattr__(self, arg):
return Composition.get_composed_attr(self, arg, super())
class Head:
def __init__(self):
Composition.compose(self, Face())
def balance(self):
print("I shook my head")
def __getattr__(self, arg):
return Composition.get_composed_attr(self, arg, super())
class Person:
def __init__(self):
Composition.compose(self, Arms())
Composition.compose(self, Legs())
Composition.compose(self, Head())
def __getattr__(self, arg):
return Composition.get_composed_attr(self, arg, super())
person = Person()
person.up_arms() # # calls person.arms.up()
person.up_legs() # calls person.legs.up()
person.balance_head() # calls person.head.balance()
person.smile_face() # calls person.head.face.smile()
person.close_eyes() # calls person.head.face.eyes.close()
I raised my arms
I raised my legs
I shook my head
I smiled
I closed my eyes
Abstract Factory¶
“Provide an interface for creating families of related or dependent objects without specifying their concrete classes.”
Example with cross platform GUI¶
Implementation using the buttons themselves as factories¶
pretty trivial, notice that the abstact Button
already
provides a default implementation of create_button
that works for all the derived types in the example
from abc import ABC, abstractmethod
class Button(ABC):
@abstractmethod
def paint(self):
pass
@classmethod
def create_button(concrete_class):
return concrete_class()
class LinuxButton(Button):
def paint(self):
return "Render a button in a Linux style"
class WindowsButton(Button):
def paint(self):
return "Render a button in a Windows style"
class MacOSButton(Button):
def paint(self):
return "Render a button in a MacOS style"
def get_factory(platform):
factories = { 'linux' : LinuxButton(), 'osx' : MacOSButton(), 'win' : WindowsButton()}
return factories[platform
]
factory = get_factory('linux')
button = factory.create_button()
result = button.paint()
print(result)
Render a button in a Linux style
Resource Acquisition Is Initialization (RAII)¶
Resource acquisition is initialization (RAII)[1] is a programming idiom[2] used in several object-oriented languages to describe a particular language behavior. In RAII, holding a resource is a class invariant, and is tied to object lifetime: resource allocation (or acquisition) is done during object creation (specifically initialization), by the constructor, while resource deallocation (release) is done during object destruction (specifically finalization), by the destructor. Thus the resource is guaranteed to be held between when initialization finishes and finalization starts (holding the resources is a class invariant), and to be held only when the object is alive. Thus if there are no object leaks, there are no resource leaks. Wikipedia
We will implement RAII using the
with
statement.with the help of the
contextlib
module, its easy to create a safe context manager object for any class
import contextlib
class ExpensiveObject:
def start(self):
print('setting up', self)
def close(self):
print('tearing down', self)
def use(self):
print('using', self)
def __repr__(self):
return "ExpensiveObject"
@contextlib.contextmanager
def open_expensive_object():
obj = ExpensiveObject()
obj.start()
try:
yield obj
finally:
obj.close()
with open_expensive_object() as obj:
obj.use()
setting up ExpensiveObject
using ExpensiveObject
tearing down ExpensiveObject


In this project, I created a choropleth map in Observable to examine population density in Arkansas counties. Overall, I could've used a better classification scheme, as I had very few high density counties and many low density counties. I still learned a lot about visualization in Observable and how to join data.
In this project, I created a graduated symbol map in Observable to examine population density in Arkansas counties. The size and color of each circle represents the population density of that particular county. I think this classification scheme worked quite well as there is a good amount of each category on the map.
In this project, I created a bivariate choropleth map in Observable to examine the relationship of population density and the percent of population in poverty in Arkansas counties. I think this is my best map yet and gives a great visualization of the data. There is a great distribution of each color and with the help of the legend, we can identify the extremes in any direction along with the middle ground and form an opinion on the correlation of the two topics.
In this project, we used our new knowledge of HTML and templates to map out a state or region and display data on top of it. We also had some variables such as class numbers and classification type that could be adjusted to see results live. Looking at all four simultaneously allowed me to interpret the changes in population over time and compare it to areas in poverty. Overall, it appears that there is less poverty in the higher populated areas in the state of Arkansas.
This is an example of an isarithmic map created by professor Caglar Koylu. Isarithmic mapping is great for visualizing groups of data and their distribution over an area.
For our final project, we decided to look at wildfires caused by arson. Going in with no knowledge, our goal was to simply find out if there were any patterns relative to location or year within the data. After looking at the data on a map, it is clear that there are more cases in certain areas over others as well as some correlation to the time. After learning this, it would be interesting to do further research on why these patterns exist.


Learning is an individual experience which is different for each person, I learned so many things like knowledge, developing skills etc. Mainly in this foundation how to solve the problem in coding. Sometime i frustrated when i was stuck then took some break and then start my work.
The role of values is to develop patience, good manners and honesty etc. Empathy is an important part of human-centered design. The role of empathy involve in the learning design process, opening up more opportunities to get results that suit their needs. Empathy is usually done by teachers in understanding classroom conditions.In self awareness also important how to manage your emotions when you are working in group.
Javascript is not a easy programming.If anybody want to learn then we have to spend more time for learnings. In my learning so many challanges are surprised.because it was very hard for me when i was stuck. But i enjoyed every challange in this learning.
Because in every company need expert person in programming. EDA is a also one learning school only focus on practical programming, in my point of view we want to spend more time in practical work then we learn how to solve the problem.
I spend more time for learning. Spend more time learn more things. If anybody learn programming then need more practicing in programming.


1.6 Specific Built-in Types
This section covers numbers, strings, lists, dictionaries, tuples,
and files. Compound data types (e.g., lists, dictionaries, tuples)
can nest inside each other arbitrarily.
1.6.1 Numbers
This section covers basic number types (integers, floating-point), as
well as more advanced types (complex, unlimited-precision long
integers).
<IP_ADDRESS> Constants
Numbers are written in a variety of numeric constant forms:
- 1234, -24, 0
-
Normal integers (C longs, at least 32 bits)
- 99999999L, 42l
-
Long integers (unlimited size)
- 1.23, 3.14e-10, 4E210, 4.0e+210
-
Floating-point (C doubles)
- 0177, 0x9ff
-
Octal and hex integer constants
- 3+4j, 3.0+4.0j, 3J
-
Complex numbers
<IP_ADDRESS> Operations
Number types support all number operations (see Table 1-6). In mixed-type expressions, Python converts
operands up to the type of the "highest" type, where
integer is lower than long, which is lower than floating-point, which
is lower than complex.
In 2.2, integer operations are automatically promoted to longs
instead of overflowing, and there are two flavors of division
(/ and //).
1.6.2 Strings
Strings are immutable (unchangeable) arrays of characters, accessed
by offset.
<IP_ADDRESS> Constants
Strings are written as a series of characters in quotes:
- "Python's", 'Python"s'
-
Double and single quotes work the same, and each can embed unescaped
quotes of the other kind.
- """This is a
- multiline block"""
-
Triple-quoted blocks collect lines into a single string, with
end-of-line markers between the original lines.
- 'Python\'s\n'
-
Backslash escape code sequences (see Table 1-7)
are replaced with the special-character byte values they represent
(e.g., '\n' is a byte with binary value 012).
- "This" "is" "concatenated"
-
Adjacent string constants are concatenated.
- r'a raw\string', R'another\one'
-
Raw strings: backslashes are retained literally (handy for regular
expressions and DOS directory paths; e.g.,
r'c:\dir1\file').
- u"..."
-
Unicode string constants (see Section <IP_ADDRESS>
later).
Table 1-7. String constant escape codes
|
\newline
|
Ignored continuation
|
\t
|
Horizontal tab
|
|
\\
|
Backslash (\)
|
\v
|
Vertical tab
|
|
\'
|
Single quote (')
|
\N{id}
|
Unicode dbase id
|
|
\"
|
Double quote (")
|
\uhhhh
|
Unicode 16-bit hex
|
|
\a
|
Bell
|
\Uhhhh...
|
Unicode 32-bit hex
|
|
\b
|
Backspace
|
\xhh
|
Hex digits value
|
|
\f
|
Formfeed
|
\ooo
|
Octal digits value
|
|
\n
|
Linefeed
|
\0
|
Null (not end string)
|
|
\r
|
Carriage return
|
\other
|
Not an escape
|
<IP_ADDRESS> Operations
All sequence operations (shown earlier in Table 1-3), plus % string formatting
expressions, plus string method calls (see Section <IP_ADDRESS>). String formatting replaces
% targets on the left with values on the right
(similar to C's sprintf).
- "The knights who say %s!" % "Ni!"
-
Result: "The knights
who say Ni!"
- "%d %s %d you" % (1, 'spam', 4.0)
-
Result: "1 spam
4 you"
- "%(n)d %(x)s" % {"n":1, "x":"spam"}
-
Result: "1 spam"
- %[( name)][ flags][ width][. precision] code
-
General target format
flags include "-" (left
justify), "+" (numeric sign), and "0" (zero
fill); width is total field width;
precision gives digits after
"."; and code is a character
from Table 1-8. Also see Section 1.17 and Section 1.19, and related built-in functions. Hint:
%s converts any object to its print representation
string.
Table 1-8. % string formatting codes
s
|
String (or any object)
|
X
|
x with uppercase
|
r
|
s, but uses repr( ) not
str( )
|
e
|
Floating-point exponent
|
c
|
Character
|
E
|
e with uppercase
|
d
|
Decimal (integer)
|
f
|
Floating-point decimal
|
i
|
Integer
|
F
|
f with uppercase
|
u
|
Unsigned (integer)
|
g
|
Floating-point e or f
|
o
|
Octal integer
|
G
|
Floating-point E or F
|
x
|
Hex integer
|
%
|
Literal `%'
|
<IP_ADDRESS> String methods
Starting in Python 2.0, most of the functions previously available in
the standard string module are now also available
as methods of string objects. If X references a
string object, then a string module function call:
import string
res = string.replace(X, 'span', 'spam')
is usually equivalent to a string method call:
res = X.replace('span', 'spam')
But string methods require no module imports. Note that the
string.join(list, delim)
operation becomes a method of the delimiter string:
delim.join(list).
Table 1-9 lists available string method calls.
String methods that modify text always return a new string and never
modify the object in-place (strings are immutable). See Section 1.17 for additional details on
most of the calls in this table.
Note that some string module calls many not be
available as string methods, and some string methods are not
available in the string module. The following
calls in Table 1-9 are currently unique:
endswith and startswith (suffix
and prefix match); splitlines (split on line
breaks); title (similar to
string.capwords); encode
(string encoding—see Section <IP_ADDRESS>); and
all is*( ) Boolean content tests. The
is*( ) Boolean tests work on strings of any
length.
Table 1-9. String method calls
S.capitalize( )
|
S.center(width)
|
S.count(sub [, start [, end]])
|
S.encode([encoding [,errors]])
|
S.endswith(suffix [, start [, end]])
|
S.expandtabs([tabsize])
|
S.find(sub [, start [, end]])
|
S.index(sub [, start [, end]])
|
S.isalnum( )
|
S.isalpha( )
|
S.isdigit( )
|
S.islower( )
|
S.isspace( )
|
S.istitle( )
|
S.isupper( )
|
S.join(seq)
|
S.ljust(width)
|
S.lower( )
|
S.lstrip( )
|
S.replace(old, new [, maxsplit])
|
S.rfind(sub [,start [,end]])
|
S.rindex(sub [, start [, end]])
|
S.rjust(width)
|
S.rstrip( )
|
S.split([sep [,maxsplit]])
|
S.splitlines([keepends])
|
S.startswith(prefix [, start [, end]])
|
S.strip( )
|
S.swapcase( )
|
S.title( )
|
S.translate(table [, deletechars])
|
S.upper( )
|
<IP_ADDRESS> Unicode strings
Python supports Unicode (wide) character strings, which represent
each character with 16 bits, not 8.
<IP_ADDRESS>.1 Constants
Unicode strings are written as
u"string".
Arbitrary Unicode characters may be written using a new (in 2.0)
escape sequence,
\uHHHH, where
HHHH is a four-digit hexadecimal number
from 0000 to FFFF. The
traditional \xHH escape
sequence can also be used, and octal escapes can be used for
characters up to +01FF, which is represented by
\777.
<IP_ADDRESS>.2 Operations
Like normal strings, all immutable sequence operations apply. Normal
and Unicode string objects may be freely mixed; combining 8-bit and
Unicode strings always coerces to Unicode, using the default ASCII
encoding (e.g., the result of 'a'
+ u'bc' is
u'abc'). Mixed-type operations assume the 8-bit
string contains a 7-bit U.S. ASCII data. The
encode string method applies a desired encoding
scheme to Unicode strings. A handful of related modules (e.g.,
codecs) and built-in functions are also available.
See the Python Library Reference for details.
1.6.3 Lists
Lists are mutable (changeable) arrays of object references, accessed
by offset.
<IP_ADDRESS> Constants
Lists are written as comma-separated series of values enclosed in
square brackets.
- []
-
An empty list
- [0, 1, 2, 3]
-
A four-item list: indexes 0..3
- alist = ['spam', [42, 3.1415], 1.23, {}]
-
Nested sublists: alist[1][0] fetches 42
<IP_ADDRESS> Operations
All sequence operations (see Table 1-3), plus all
mutable sequence operations (see Table 1-4), plus
the following list methods:
- alist.append(x)
-
Inserts the single object x at the end of
alist, changing the list in-place.
- alist.sort([func])
-
Sorts alist in-place in ascending order, or per a
passed-in two-argument comparison function func
(which returns -1, 0, or +1, to mean before, same, or after
ordering). Note: sort + reverse is quicker than
sort(func).
- alist.reverse( )
-
Reverses items in alist in-place.
- alist.index(x)
-
Returns the offset of the first occurrence of object
x in alist; raises an exception
if not found. A search method.
- alist.insert(i, x)
-
Inserts object x into alist at
offset i (like alist[i:i]
= [x], for positive
i).
- alist.count(x)
-
Returns the number of occurrences of x in
alist.
- alist.remove(x)
-
Deletes the first occurrence of object x from
alist; raises an exception if not found.
- alist.extend(x)
-
Inserts each item in any sequence x at the end of
alist in-place (an in-place "+"). Like
alist[len(alist):] =
list(x).
- alist.pop([i])
-
Deletes and returns the last (or offset i) item in
alist. Use with append to
implement stacks. Same as x=alist[i];
del alist[i];
return x, where
i defaults to -1, the last item.
<IP_ADDRESS> List comprehension expressions
A list literal enclosed in square brackets ([...])
may be a simple list of expressions or a list comprehension
expression of the following form:
[expression for expr1 in sequence1 [if condition]
for expr2 in sequence2 [if condition] ...
for exprN in sequenceN [if condition] ]
List comprehensions construct result lists: they collect all values
of expression, for each iteration of all
nested for loops, for which each optional
condition is true. The second through
nth for loops and all
if parts are optional, and
expression and
condition may use variables assigned by
nested for loops. Names bound inside the
comprehension are created in the scope where the comprehension
resides.
Comprehensions are similar to the map built-in
function:
>>> [ord(x) for x in 'spam']
[115, 112, 97, 109]
>>> map(ord, 'spam')
[115, 112, 97, 109]
but can often avoid creating a temporary function:
>>> [x**2 for x in range(5)]
[0, 1, 4, 9, 16]
>>> map((lambda x: x**2), range(5))
[0, 1, 4, 9, 16]
Comprehensions with conditions are similar to
filter:
>>> [x for x in range(5) if x % 2 == 0]
[0, 2, 4]
>>> filter((lambda x: x % 2 == 0), range(5))
[0, 2, 4]
Comprehensions with nested for loops are like
normal for:
>>> [y for x in range(3) for y in range(3)]
[0, 1, 2, 0, 1, 2, 0, 1, 2]
>>> res = []
>>> for x in range(3):
... for y in range(3):
... res.append(y)
>>> res
[0, 1, 2, 0, 1, 2, 0, 1, 2]
1.6.4 Dictionaries
Dictionaries are mutable tables of object references, accessed by
key, not position. They are unordered collections, implemented
internally as dynamically expandable hash tables.
<IP_ADDRESS> Constants
Dictionaries are written as comma-separated series of
key:value
pairs inside curly braces. Assigning to new keys generates new
entries. Any immutable object can be a key (e.g., string, number,
tuple); class instances can be keys if they inherit hashing protocol
methods; tuple keys support compound values (e.g.,
D[(1,2,3)]).
- {}
-
An empty dictionary
- {'spam': 2, 'eggs': 3}
-
A two-item dictionary: keys 'spam' and
'eggs'
- adict = { 'info': { 42: 1, type("): 2 }, 'spam': [] }
-
Nested dictionaries: adict['info'][42] fetches 1
<IP_ADDRESS> Operations
All mapping operations (see Table 1-5), plus the
following dictionary-specific methods:
- adict.has_key(k)
-
Returns 1 (true) if adict has a key
k, or 0 otherwise.
- adict.keys( )
-
A new list holding all of adict's
keys.
- adict.values( )
-
A new list holding all the stored values in adict.
- adict.items( )
-
A new list of tuple pairs (key,
value), one for each entry in
adict.
- adict.clear( )
-
Removes all items from adict.
- adict.copy( )
-
Returns a shallow (top-level) copy of adict.
- dict1.update(dict2)
-
Merges all of dict2's entries into
dict1, in-place. Like for
(k, v) in
dict2.items( ): dict1[k]
= v.
- adict.get(key [, default])
-
Similar to adict[key], but returns
default (or None if no
default) instead of raising an exception when
key is not found in adict.
- adict.setdefault(key, [, default])
-
Same as adict.get(key,
default), but also assigns key
key to default if it is not
found in adict.
- adict.popitem( )
-
Remove and return an arbitrary (key,
value) pair.
1.6.5 Tuples
Tuples are immutable arrays of object references, accessed by offset.
<IP_ADDRESS> Constants
Tuples are written as comma-separated series of values enclosed in
parentheses. The enclosing parentheses may sometimes be omitted
(e.g., in for loop headers and
= assignments).
- ( )
-
An empty tuple
- (0,)
-
A one-item tuple (not a simple expression)
- (0, 1, 2, 3)
-
A four-item tuple
- 0, 1, 2, 3
-
Another four-item tuple (same as prior line); not valid in function
calls
- atuple = ('spam', (42, 'eggs'))
-
Nested tuples: atuple[1][1] fetches
'eggs'
<IP_ADDRESS> Operations
All sequence operations (see Table 1-3).
1.6.6 Files
The built-in open function creates a stdio file
object, the most common file interface. File objects export the
method calls in the next section. Also see the
open function in Section 1.12, the anydbm,
shelve, and pickle modules in
Section 1.20, the os module
descriptor-based file functions and the os.path
directory path tools in Section 1.18, and the
Python SQL database API in Section 1.25.
<IP_ADDRESS> Input files
- input = open('data.txt', 'r')
-
Creates input file ('r' means read). The filename
string (e.g., 'data.txt') maps to the current
working directory, unless it includes a directory path prefix (e.g.,
'c:\\dir\\data.txt'). The mode argument (e.g.,
'r') is optional and defaults to
'r'.
- input.read( )
-
Reads entire file, returning its contents as a single string. In text
mode ('r'), line-ends are translated to
'\n'. In binary mode ('rb'),
the result string may contain nonprintable characters (e.g.,
'\0').
- input.read(N)
-
Reads at most N bytes (1 or more).
- input.readline( )
-
Reads next line (through end-of-line marker).
- input.readlines( )
-
Reads entire file into a list of line strings.
- input.xreadlines( )
-
Optimized readlines. Loads only a few lines at a
time into memory, when used in a for loop header.
<IP_ADDRESS> Output files
- output = open('/tmp/spam', 'w')
-
Creates output file ('w' means write).
- output.write(S)
-
Writes string S onto file (all bytes in
S). In text mode, '\n' is
translated to the platform-specific line-end marker sequence. In
binary mode, the string may contain nonprintable bytes (e.g., use
'a\0b\0c' to write a string of five bytes, two of
which are binary zero).
- output.writelines(L)
-
Writes all strings in list L onto file.
<IP_ADDRESS> Any files
- file.close( )
-
Manual close to free resources (Python currently auto-closes files
when they are garbage collected).
- file.tell( )
-
Returns the file's current position (like C's
ftell).
- file.seek(offset [, whence])
-
Sets the current file position to offset for
random access (like C's fseek).
whence may be 0 (offset from front), 1 (offset +/-
from current position), or 2 (offset from end).
whence defaults to 0.
- file.isatty( )
-
Returns 1 if the file is connected to a tty-like interactive device.
- file.flush( )
-
Flushes the file's stdio buffer (like C's
fflush). Useful for buffered pipes, if another
process (or human) is reading. Also useful for files created and read
in the same process.
- file.truncate([size])
-
Truncates file to at most size bytes (or current
position if no size is passed). Not available on all platforms.
- file.fileno( )
-
Gets file number (descriptor integer) for file. This roughly converts
file objects to descriptors that may be passed to tools in the
os module. Hints: use os.fdopen
to convert a descriptor to a file object,
socketobj.makefile to convert a socket to a file
object, and StringIO.StringIO to convert a string
to an object with a file-like interface.
<IP_ADDRESS> Attributes
- file.closed
-
True if file has been closed
- file.mode
-
Mode string (e.g., 'r') passed to
open function
- file.name
-
String name of corresponding external file
<IP_ADDRESS> Notes
Some file open modes (e.g., 'r+') allow a file to
be both input and output, and others (e.g., 'rb')
specify binary-mode transfer to suppress line-end marker conversions.
See open in Section 1.12.
File transfer operations occur at the current file position, but
seek method calls reposition the file for random
access.
File transfers may be made unbuffered: see
open in Section 1.12 and
the -u command-line flag in Section 1.3.
1.6.7 Type Conversions
Tables Table 1-10 and Table 1-11
define built-in tools for converting from one type to another.
Table 1-10. Sequence converters
list(X)
map(None, X)
[n for n in X]
|
String, tuple, user-defined sequence
|
List
|
tuple(X)
|
String, list, user-defined sequence
|
Tuple
|
''.join(X)
string.join(X, '')
|
List or tuple of strings
|
String
|
Table 1-11. String/object converters
|
eval(S)
|
String
|
Any object with a syntax (expression)
|
|
string.atoi(S)
string.atof(S)
string.atol(S)
|
String
|
Integer, float, long
|
|
int(S)
float(S)
long(S)
|
String or number
|
Integer, float, long
|
|
repr(X)
str(X)
`X` (backquotes)
|
Any Python object
|
String
|
|
X % Y
(string formatting)
|
Objects with format codes
|
String
|
|


- Marvel 1602, Neil Gaiman
- Persuasion, Jane Austen
- Breakfast at Tiffany's, Truman Capote
- Mauritius Command, Patrick O'Brian
- Smiley's People, John Le Carre
- HMS Surprise, Patrick O'Brian
- The Wave in the Mind, Ursula K. Le Guin
Next up, I'll tell you about my Quest and how you can help me.
Obviously Ellison Hawker is officially the best book shop, cos it's in Hobart and the staff are great, but otherwise Kinokuniya totally counts as the best shop going!! :)
Most of these books are ones I've wanted to buy for months now, so I'm OK with the amateur tag :)
That said, I was disappointed when I walked out and realized that none of the authors were new to me.
Try Roberto Bolano. His 2666 might be your new Infinite Jest type book.
I love Ursula Le Guin. And if she knew I existed, she'd love me too.
I'm reading "Lowboy" by John Wray atm. It's main character is a paranoid schizophrenic. Well written one.
Oh, and I do have plans to read Infinite Jest these holidays.


storagebackups
storage1
2017-05-20 15:45
storagenew
Step 1. Chose storage account with backups
Name
Type
Region
Subscription
storage1
LRS
West Europe
Pay as you go
storage2
LRS
West Europe
Pay as you go
storage3
LRS
West Europe
Pay as you go
Step 2. Chose storage account backup to restore
Storage Account Backup Snapshots
Step 3. Chose destination storage account to restore
Name
Type
Region
Subscription
storage1
LRS
West Europe
Pay as you go
storage2
LRS
West Europe
Pay as you go
storage3
LRS
West Europe
Pay as you go


I just finished the proof-of-concept MVC framework for my new programming language. It works nice and very clear code, for example:
class MyApp { member system = new System(); member engine = new Engine(); method error(context) { var page = this.engine.render("error.html"); context.response.end(page); } method index(context) { var page = this.engine.render("index.html"); context.response.end(page); } } class Main { method start() { var app = new App(); app.run(new MyApp()); } }
It's not perfect yet, and I reminded that the creator of the C++ programming
language once said:
No programming language is perfect.


A free, responsive, one page application to conveniently read your favorite
XKCD comics
This project along with JavaScript and PHP files is hosted on Github repository. You can follow the link below to check out the source
Visit Source PageFeel free to email me to provide some feedback on this single page application. Please report any bugs or request for new feature to this app
Copyright ©Jayesh Kawli 2015


Laws of attraction apply
Five Corners real estate agents are kind, considerate, and professional on the outside. Underneath, they're tenacious, smart, and aggressive. Our agents move fast using uncanny market know-how to guide and fiercely protect you at every step of buying or selling process. That's what it takes to close a deal in today's complicated New York and Connecticut real estate markets.
We work with other real estate agents every day, and even we know it's hard to tell one agent from the next. All REALTORS use similar technology tools and do business under the same set of real estate laws. Their ads use words like expert, trusted, and dependable. So when it comes to choosing an agent... your perfect agent... the laws of attraction apply.
Of course, when you're buying or selling a home you want a qualified and skilled professional. Those qualities are a given with any Five Corners agent. But you also want to work with an agent who takes better advantage of the tools available and has a few of their own up their sleeves. You need a real estate agent you'll enjoy being around. After all, you're going to be spending a lot of time with him or her.
Meet our real estate agents. No matter what type of agent you're looking for, there's a Five corners agent that's a match.


To review
Please review each of the following people
Your team
{% for user in team %}
{% include 'includes/profile.html' %}
{% endfor %}
Other requests
{% for user in others %}
{% include 'includes/profile.html' %}
{% endfor %}


A Weightlifting Logo
After seeing my previous logo designs — my
Initially, he gave me a picture with insufficient contrast, which would be a lot of work for me, since the Image Trace from Adobe Illustrator wouldn't be able to work that well. And, thus, I asked him for a picture with more lighting; Image Trace works better when there is great contrast for making icons, i.e., extracting the most iconic features of the image.
I suggested he took a picture similar to one in which Dmitry Klokov, and others, are holding the barbell and the plates trying to emulate a warrior's pose.
I've shared the design process on Instagram, but you can also check it out on YouTube. As a bonus, I've managed to make the snatch logo originally on his T-Shirt more abstract and, thus, creating a new logo in and of itself.


Toggle navigation
@letslost
Close
@letslost
General
Treveling, Owner
PartySeeker
100%
FoodHunter
100%
SnapShoots
100%
Wonderer
100%
ShopHolic
100%
SleepyHead
100%


Add to Calendar
09/21/2018 07:00 PM
09/23/2018 5:00 PM
America/New_York
Hack for the Sea 2018
Hack for the Sea is a marine hackathon where participants take on some
of the toughest challenges present in marine science, research, and industry.
American Legion Post 3, 8 Washington St, Gloucester, MA 01930


East Carolina University presented unprecedented scale and diversity of opportunity. In my two years at ECU, curriculum comprises of challenging course which expand knowledge and grip with differnet programming languages.
Recently, I worked as Softwar Developer intern at Dell EMC Corporation, Raleigh, NC. Internship gave me hands-on experience with Agile Methodology driven Software development life cycle which gave me cofidence in writing quality software. During my Master's I got an opprotunity to work as Graduate Tech Assistant, my duties as assitant was to assist differnet professors with Video conference tools. I have even sssisted professor with developing Websites using PHP and MySQL.
Resume/CVThis summer was a rite of passage into software engineering professionalism. I got an opprotunity to work with a dynamic team. Internship gave me hands-on experience with Agile Methodology driven Software development life cycle which gave me cofidence in writing quality software. Developers and designers blew me away with their willingness to share their time and wisdom. The trust my teammates placed in me did wonders for my confidence. My main role was to develope microservices which will test enviorment on pivotal cloud foundry. That microservice will accept dummy data similar to real world data to verfiy sanity of other microservice in PCF enviorment. Microservice was implemeted using Spring MVC Framework, Java, RabbitMQ, Artifactory and Spring Tool Suit
During my Master's I got an opprotunity to work as Graduate Tech Assistant, my duties as assitant was to assist differnet professors with Video conference tools. Assisted students with videoconference tool like Saba-meeting and mIRC. Design modules to guide students. I have even Assisted professor with developing Websites using PHP and MySQL.
Embelink, started in 2005, is a leading technology driven organization dealing in Embedded Electronics with specilization in Product design, Product consultancy and Application development. As part of my internshp, dealt with various electronic components like Micro-Controller, Heart Rate Sensor,GSM SIM 300. Progarmming language used to code those components were C, C++ and BASCOM.


Untitled 2:
June 8th 2009
There was no more time for your song
the words strung out the meaning is long gone
long done and figured
dried skin to bony faces
There they are not there
On so numerous occasion
flex your fingers there is causation
draw tenseness there is intention
-a force to be reckoned with
as if we could come aside intention
get a touch of and run with
photographed unconsciously
growing thin
such as we are standing
admits the fragmentation of our understanding
-the narrowness of our evidence