SE Radio 703: Sahaj Garg on Low Latency AI
23 hours ago
js / python / linux / .NET C# F# / MS-SQL / postgresql / maths / data / logic / thought / SmartCard / EMV / django / HTML
$ python -m SimpleHTTPServer
def kos_root():
"""Return the pathname of the KOS root directory."""
global _kos_root
if _kos_root: return _kos_root
...
Notes:
def function(a, b):
"""function(a, b) -> list"""
def function(a, b):
"""Do X and return a list."""
(Of course "Do X" should be replaced by a useful description!)
def complex(real=0.0, imag=0.0):
"""Form a complex number.
Keyword arguments:
real -- the real part (default 0.0)
imag -- the imaginary part (default 0.0)
"""
if imag == 0.0 and real == 0.0:
return complex_zero
...
$ sudo add-apt-repository ppa:umang/indicator-stickynotes $ sudo apt-get update $ sudo apt-get install indicator-stickynotes
var Bx = Math.cos(φ2) * Math.cos(λ2-λ1); var By = Math.cos(φ2) * Math.sin(λ2-λ1); var φ3 = Math.atan2(Math.sin(φ1) + Math.sin(φ2), Math.sqrt( (Math.cos(φ1)+Bx)*(Math.cos(φ1)+Bx) + By*By ) ); var λ3 = λ1 + Math.atan2(By, Math.cos(φ1) + Bx);
function Apple (type) {
this.type = type;
this.color = "red";
this.getInfo = function() {
return this.color + ' ' + this.type + ' apple';
};
}
function Apple (type) {
this.type = type;
this.color = "red";
}
Apple.prototype.getInfo = function() {
return this.color + ' ' + this.type + ' apple';
};
var apple = {
type: "macintosh",
color: "red",
getInfo: function () {
return this.color + ' ' + this.type + ' apple';
}
}
Or in other words, if i want to use python to implement a server which can be put into use of business, what also should i do?There are already python-based web servers, such as CherryPy (which I think is intended to be a web server solution on the same stack level as Apache; it is more python-based though, and Apache has been around a lot longer).
edit /etc/default/apport, e.g.
$ sudo gedit /etc/default/apport
then set 'enabled' to 0, and save
#region Dump Output Dates to File
string filePath = "c:/dev/projected_dates.csv";
string actualDatesCSV = string.Join(",",
actualDates
.OrderBy(x => x)
.Select(x => x.ToShortDateString())
);
using (var sw = new System.IO.StreamWriter(filePath))
{
sw.Write(actualDatesCSV.Replace(",", "\n"));
}
#endregion
use [target_database] select 'drop table [' + name + ']' from sys.objects where type = 'U'
EXEC SP_MSFOREACHTABLE 'drop table ?'