F:\WorkingKnowles\Oracle\Utility\12i\PT\PerformanceTuning_CheatSheet.md
When hosting our web applications, we often have one public IP
address (i.e., an IP address visible to the outside world)
using which we want to host multiple web apps. For example, one
may wants to host three different web apps respectively for
example1.com
, example2.com
, and example1.com/images
on
the same machine using a single IP address.
How can we do that? Well, the good news is Internet browsers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The get() method on dicts | |
# and its "default" argument | |
name_for_userid = { | |
382: "Alice", | |
590: "Bob", | |
951: "Dilbert", | |
} | |
def greeting(userid): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d r w x r w x r w x | |
Owner Group Other | |
Directory Read Write Execute Read Write Execute Read Write Execute | |
(R) (W) (X) | |
0 No No No | |
1 No No Yes | |
2 No Yes No | |
3 No Yes Yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Aggregation Pipeline | |
// first match then sort and project name note : _id:0 couse not show _id if not set show _id | |
db.companies.aggregate([ | |
{ $match : { founded_year : 2011 } }, | |
{ $sort : {name:-1} }, | |
{ $project : { _id : 0, name : 1 } } | |
]) | |
// query 2 | |
db.companies.aggregate([ | |
{ $match: { founded_year: { $gte: 2010 } } }, |