What is a BLOb?
BLOb, Binary Large OBject : is a collection of binary data stored as a single entity in a database management system. Blobs are typically images, audio or other multimedia objects. Database support for blobs is not universal. Blobs were originally just big amorphous chunks of data invented by Jim Starkey at DEC(Digital Equipment Corporation)
The four BLOB types are
- TINYBLOB : A BLOB column with a maximum length of 255 (28 – 1) bytes. Each TINYBLOB value is stored using a one-byte length prefix that indicates the number of bytes in the value
- BLOB : A BLOB[(M)] column with a maximum length of 65,535 (216 – 1) bytes. Each BLOB value is stored using a two-byte length prefix that indicates the number of bytes in the value.
An optional length M can be given for this type. I
- MEDIUMBLOB : A BLOB column with a maximum length of 16,777,215 (224 – 1) bytes. Each MEDIUMBLOB value is stored using a three-byte length prefix that indicates the number of bytes in the value.
- LONGBLOB : A BLOB column with a maximum length of 4,294,967,295 bytes or 4GB (232 – 1). Each LONGBLOB value is stored using a four-byte length prefix that indicates the number of bytes in the value.
I came across this line #!/usr/bin/env and was wondering what is this and for what? I browsed some articles to get some overview about it. Any script beginning with #! is called shebang(other names are hashbang, sha-bang etc). When a script with shebang is run, it passes the file as an argument to the specified program instead of trying to execute it.
The form of a shebang interpreter directive is as follows:
- #! interpreter [optional-arg]
The interpreter must be an absolute path to an executable
In order to run the script, we need to tell the shell three things:
That the file is a script –>accomplished using shebang #!
Which interpreter we want to execute the script
The path of said interpreter
2 and 3 is accomplished using env.
Some typical shebang lines:
#!/bin/sh — Execute the file using sh
#!/usr/bin/perl — Execute using Perl
#!/usr/bin/python — Execute using Python
Shebang lines may include specific options that are passed to the interpreter.
What is so special about frameworks? We hear about these web frameworks frequently like Django, Cake PHP, Rails etc. Let’s dive into frameworks.
Framework gives you a ready-made code base which has been tested and designed by many developers and is ready to use solution for common generic problems. That is, it provides with a generic functionality which has flexibility to be changed, which helps you take advantage of this generality. It provides powerful template where the logic can be injected, helps in simplifying complex things.
- Saves lot of time, DRY(Don’t Repeat Yourself) means fewer lines of code
- Provides a standard through which the user can develop the module or a complete application instead of starting from lower level details.
- More time can be devoted in developing the software and not in preparing the environment and tools of development.
- Code is extensible for future use with clean code
Heads Up! Framework doesn’t work everywhere, for instance smaller projects which require simple coding seems to work faster than setting up a framework.
Tip for those running python script on Notepad++
Press F5 to run current script and to avoid output screen disappear instantaneously type in command: cmd /k python -i “$(FULL_CURRENT_PATH)”.
Reason:( ) have higher precedence, first the innermost printf statement prints the value assigned to i, i.e. 567. The second printf then counts the number of characters previous printf statement; value of i[i.e.3] and the outermost printf statement counts no. of characters of previous printf statement i.e.1
Reason: prints value assigned to i, which is equal to 50.
Output: 54 or 52 depending on size of int used by respective compiler is 4 or 2.
Reason: increment a pointer whose value is 50. It goes to the next address location, which is 50 + sizeof(data pointed) = 50 + sizeof(int).
Reason: prints the ASCII value of ‘a’.
Output: prints value of a+5
Reason: value at a has address of p assigned to it. The program first scans value of a and prints value of a(though, it is p+5; value of a holds address of p) by adding constant 5 to it.