by alexander white ©
#!/usr/bin/python | |
import cProfile | |
from faker import Faker | |
from timeit import Timer | |
from collections import Counter | |
from collections import defaultdict | |
# old style using dictionary: | |
def get_count1(sequence): |
Dear all,
I am trying to start a FAQ kind of forum for python related questions.
All questions are mostly related to python version 2.7. Some question may not be applicable to 3.x and above.
- Why can't you delete a dictionary key while doing dict.iteritems() ?
- And why is it allow you to delete dictionary key while doing dict.items() ?
- Difference between a name startswith single underscore vs double underscore ?
- What is first class object in python ?
I want to be extremely clear about three things. First, this is my personal opinion – insert full standard disclaimer. Second, this is not a condemnation of everyone at RSA, present and past. I assume most of them are pretty okay, and that the problem is confined to a few specific points in the company. However, “unknown problem people making major decisions at RSA” is a bit unwieldy, so I will just say RSA. Third, I'm not calling for a total boycott on RSA. I work almost literally across the street from them and I don’t want to get beat up by roving gangs of cryptographers at the local Chipotle.
RSA's denial published last night is utter codswallop that denies pretty much everything in the world except the actual allegations put forth by Reuters and hinted at for months by [other sources](http://li
When connecting to a remote server via SSH it is often convenient to use SSH agent forwarding so that you don't need a separate keypair on that server for connecting to further servers.
This is enabled by adding the
ForwardAgent yes
option to any of your Host
entries in ~/.ssh/config
(or alternatively with the -A
option). Don't set this option in a wildcard Host *
section since any user on the remote server that can bypass file permissions can now als use keys loaded in your SSH agent. So only use this with hosts you trust.
class YourResource(ModelResource): | |
def wrap_view(self, view): | |
""" | |
Wraps views to return custom error codes instead of generic 500's | |
""" | |
@csrf_exempt | |
def wrapper(request, *args, **kwargs): | |
try: |
#!/usr/bin/env python2 | |
""" | |
Other Repositories of python-ping | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
* https://github.com/l4m3rx/python-ping supports Python2 and Python3 | |
* https://bitbucket.org/delroth/python-ping | |
# recursive_dictionary.py | |
# Created 2009-05-20 by Jannis Andrija Schnitzer. | |
# | |
# Copyright (c) 2009 Jannis Andrija Schnitzer | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is |