Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| //http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript | |
| Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15); |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| void GetDefaultPaperSize() | |
| { | |
| var devMode = PInvoke.PrinterHelper.GetPrinterDevMode(null); | |
| string s = String.Format("{0} : {1} x {2}", devMode.dmPaperSize, devMode.dmPaperWidth, devMode.dmPaperLength); | |
| Console.WriteLine(s); | |
| } | |
| void SetDefaultPaperSize() | |
| { | |
| string formName = "User defined"; |
| # -*- coding: utf-8 -*- | |
| """ | |
| Python logging tuned to extreme. | |
| """ | |
| __author__ = "Mikko Ohtamaa <mikko@opensourcehacker.com>" | |
| __license__ = "MIT" |
| from cProfile import Profile | |
| import pstats | |
| def profile(sort_args=['cumulative'], print_args=[10]): | |
| profiler = Profile() | |
| def decorator(fn): | |
| def inner(*args, **kwargs): | |
| result = None |
HTTP is a stateless protocol. Sessions allow us to chain multiple requests together into a conversation between client and server.
Sessions should be an option of last resort. If there's no where else that the data can possibly go to achieve the desired functionality, only then should it be stored in the session. Sessions can be vulnerable to security threats from third parties, malicious users, and can cause scaling problems.
That doesn't mean we can't use sessions, but we should only use them where necessary.