Software engineering facts, information, and skills categorized as Software Engineering

HttpRequest methods

Priya Philip 1 year, 1 month ago
HttpRequest represents an incoming HTTP request, including all HTTP headers and user-submitted data

HttpRequest attributes

Priya Philip 1 year, 1 month ago

Django uses request and response objects to pass state through the system. When a page is requested, Django creates an HttpRequest object that contains metadata about the request. Then Django loads the appropriate view, passing the HttpRequest as the first argument to the view function. Each view is responsible for returning an HttpResponse object.

Git aliases

Priya Philip 1 year, 1 month ago

The term 'alias' is synonymous with a shortcut. Alias creation is a common pattern found in other popular utilities like `bash` shell. Aliases are used to create shorter commands that map to longer commands. Aliases enable more efficient workflows by requiring fewer keystrokes to execute a command. 

Get a file's size with C++17

Priya Philip 1 year, 1 month ago

std:: experimental:: filesystem:: file_size

<filesystem> (added in C++17) makes this straightforward.

The as-if rule

Priya Philip 1 year, 1 month ago

Allows any and all code transformations that do not change the observable behavior of the program.

Infinite iterators in Python

Priya Philip 1 year, 1 month ago

An object representing a stream of data. Repeated calls to the iterator’s __next__() method (or passing it to the built-in functionnext()) return successive items in the stream. When no more data are available a StopIteration exception is raised instead. At this point, the iterator object is exhausted and any further calls to its __next__() method just raise StopIteration again. Iterators are required to have an __iter__() method that returns the iterator object itself so every iterator is also iterable and may be used in most places where other iterables are accepted. One notable exception is code which attempts multiple iteration passes. A container object (such as a list) produces a fresh new iterator each time you pass it to the iter() function or use it in a for loop. Attempting this with an iterator will just return the same exhausted iterator object used in the previous iteration pass, making it appear like an empty container.

__str__ vs __repr__ in Python

Priya Philip 1 year, 1 month ago

Both __repr__ and __str__ are used to represent objects in different ways.The default implementation of __repr__ for a str value can be called as an argument to eval, and the return value would be a valid string object.

Difference between null=True, blank=True in django

Priya Philip 2 years, 5 months ago

The main differnce for null and blank is 

How to deal with “SubfieldBase has been deprecated. Use Field.from_db_value...

Varghese Chacko 2 years, 5 months ago

How to deal with "SubfieldBase has been deprecated. Use Field.from_db_value instead." On upgrade to Django 1.9, we may now get the warning

Let us talk!

We take the vision which comes from dreams and apply the magic of science and mathematics, adding the heritage of our profession and our knowledge to create a design.