Is it safe to use free domain names? I have one on this page but I really don't know what to think, why give something for free, right?
Andrés Muñoz's questions
class Pregunta(object):
# método
def foo(self):
pass
# ¿Esto es una variable o tiene algun otro nombre?
bar = 'tijuana'
Are variables within a class given another name just like functions are called methods?
What does the 1, the 0 and the car mean? flex: 1 0 auto;
when using flexbox.
What does this selector mean .panel > * { ... }
in CSS ?
Why in the method filter
do I have to use .bind(this)
as follows: onChange={this.filter.bind(this)}
, instead of just using the method filter
without .bind(this)
as in onChange={this.filter}
?
export default class TodoList extends React.Component {
filter(event) {
this.props.store.filter = event.target.value
}
render() {
return <div>
<h1>toDos</h1>
<input className="filter" onChange={this.filter.bind(this)} />
</div>
}
}
In some redux tutorials I came across the following way to declare a function that will act as middleware, the question is what is happening in this part of the function: (store) => (next) => (action) =>
const logger = (store) => (next) => (action) => {
// logger body...
next(action)
}
I mean take input store and then what happens?
operating system: OS X El Capitan
I am running an app locally using App Engine in development mode on my computer. And I want through chrome to access the API explorer "localhost:8080/_ah/api/explorer", but it gives me an error because chrome expects https connection and my app running local only gives http.
https://developers.google.com/explorer-help/#hitting_local_api according to this article the solution is:
[path-to-Chrome] --user-data-dir=test --unsafely-treat-insecure-origin-as-secure= http://localhost:port
I've already tried running things like: open -a "Google Chrome" --args --unsafely-treat-insecure-origin-as-secure= http://localhost:8080/_ah/api/explorer
but I can't get it to work, I wonder what is the correct way to run in the terminal to make chrome run in non-secure mode:
[path-to-Chrome] --user-data-dir=test --unsafely-treat-insecure-origin-as-secure= http://localhost:port
or is there any other way to do it.
What is the meaning of; underscore, double underscore, etc? when naming objects in python?
When taking the values of one <form ...>
I found that I can store them in these two ways, user_post = ...
or using self.user_post = ...
, I would like to know what is the correct way to do it, or what is the difference between one and the other, in both ways the code works which is what stranger to me.
Without self
:
class SignUpHandler(Handler):
def get(self):
self.render('signUp.html')
def post(self):
user_post = self.request.get('username')
passwd_post = self.request.get('password')
With self
:
class SignUpHandler(Handler):
def get(self):
self.render('signUp.html')
def post(self):
self.user_post = self.request.get('username')
self.passwd_post = self.request.get('password')
I have the following class and I would like to know what the @classmethod
above of each method of the class is for.
class User(db.Model):
name = db.StringProperty(required = True)
pw_hash = db.StringProperty(required = True)
email = db.StringProperty()
@classmethod
def by_id(cls, uid):
return User.get_by_id(uid, parent = users_key())
@classmethod
def by_name(cls, name):
u = User.all().filter('name =', name).get()
return u
@classmethod
def register(cls, name, pw, email = None):
pw_hash = make_pw_hash(name, pw)
return User(parent = users_key(),
name = name,
pw_hash = pw_hash,
email = email)
@classmethod
def login(cls, name, pw):
u = cls.by_name(name)
if u and valid_pw(name, pw, u.pw_hash):
return u
This class is used to create an entity for the App Engine datastore.
I see that they produce the same result, is the difference in speed? Why are there 2 functions for the same thing?
> range(5)
[0, 1, 2, 3, 4]
>>> xrange(5)
xrange(5)
>>> for i in range(5):
... print i
...
0
1
2
3
4
>>> for i in xrange(5):
... print i
...
0
1
2
3
4
I came across the function os.chroot()
and well if I understand that it is to change the root, but I wonder what I want/is it for changing the root, that is, what is the use of this function?
I have seen that many times these lines are used #!/usr/bin/python
and #!/usr/bin/env python
at the beginning of the scripts and I was wondering if there was any difference, if there is, which one is more recommended to use?
I am configuring Google App Engine for Python, in the file app.yaml
there is the option threadsafe
.
What does it affect to activate/deactivate this option?
application: blog-119911
version: 1
runtime: python27
api_version: 1
threadsafe: yes
Reading the Kali Linux documentation I came across this:
In addition, misuse of security and penetration testing tools within a network, particularly without specific authorization, may cause irreparable damage...
I would really like to experiment with Kali Linux tools, but I want to understand well what are these irreparable damages that I can cause if I use it wrong or make a mistake? Is it just software damage or could it damage hardware?
I'm trying to run this script, I got it from here ( http://www.tutorialspoint.com/python/os_mknod.htm ) I use OS: OSX EL Capitan v.10.11.2, Python: 2.7.10:
# !/usr/bin/python
import os
import stat
filename = '/tmp/tmpfile'
mode = 0600|stat.S_IRUSR
# filesystem node specified with different modes
os.mknod(filename, mode)
running it in the terminal without sudo (python testOs.py) returns me:
Traceback (most recent call last):
File "testOs.py", line 10, in <module>
os.mknod(filename, mode)
OSError: [Errno 1] Operation not permitted
and running it with sudo (sudo python testOs.py):
Traceback (most recent call last):
File "testOs.py", line 10, in <module>
os.mknod(filename, mode)
OSError: [Errno 22] Invalid argument
What am I doing wrong ? What are the correct arguments or where is the error ?
In the Python documentation I came across this method for objects like:
archivo = open('archivo', 'r');
archivo.isatty()
which returns True
/ False
whether the file is a tty or not. and i was wondering
- What is a tty file?
- What is a tty file used for?
file.isatty()
Return
True
if the file is connected to a tty(-like) device, elseFalse
.Note: If a file-like object is not associated with a real file, this method should not be implemented.
https://docs.python.org/2/library/stdtypes.html?highlight=file%20flush#file.isatty
I'm new to this thread thing and reading about it on various sites I realized that it was not easy for me to understand the subject with the re-contra technical explanations of what happens in the hardware. Is there an analogy that can help me understand the concept?
The general idea of what I want to do is to connect to a Wi-Fi network but from Python and I was wondering what is the most recommended module to achieve this functionality, preferably a solution for OSX, the modules I found do not have a very clear documentation I am looking for something easy to use.