1.download CPUZ from >here
2.Run and open memory tab :
mplayer.exe -cache 1024 -speed 1.77 %1\*.*
mplayer.exe -cache 1024 -shuffle %1\*.*
mplayer.exe -cache 1024 -shuffle -playlist %1
string resTime = DateTime.Now.ToString("yyyy.MM.dd HH:mm:ss:ffff");
Console.WriteLine(resTime);
public class myClass
{
public int RecordID { get; set; }
public string Field1 { get; set; }
}
public void GetDataAndCallBusinessMethod()
{
using (DBDataContext db = new DBDataContext)
{
IEnumerable<myClass> Recs =
from tab in db.table
select new myClass
{
RecordID = tab.RecordID,
Field1 = tab.Field1
};
BusinessLayer.Businessmethod(Recs);
}
}
Hashtable ht = new Hashtable() {
{"key1", "value1"},
{"key2", "value2"}
};
public string GetServerInfo(Assembly _assembly)
{
StringBuilder r = new StringBuilder();
try
{
r.AppendLine("Version:" + _assembly.GetName().Version.ToString());
r.Append("Build: " + System.IO.File.GetLastWriteTime(_assembly.Location).ToString("dd/MM/yyyy HH:mm"));
}
catch (Exception ex)
{
Logger.prn(ex);
}
return r.ToString();
}
^wn - new window
^ws - horizontal split
^wv - vertical split
^wr - rotate windows
^ww/^wW - move to the next/previous window
^w= - make all windows equal size
^wc - close the active window
<asp:Panel ID="PlaceHolderPanel" runat="server">
</asp:Panel>
string AlreadyLoaded=null;
private void loadControl(string ctr){
if (!string.IsNullOrEmpty(ctr) && AlreadyLoaded!=ctr ) {
Control ctrl = LoadControl(ctr);
ctrl.ID="ctr1";
PlaceHolderPanel.Controls.Clear();
PlaceHolderPanel.Controls.Add(ctrl);
ControlName = ctr;
AlreadyLoaded=ctr;
}
}
protected void Page_Load(object sender, EventArgs e){
loadControl("~/Controls/mycontrol.ascx");
}
// 1.call all functions in prerender only
protected override void OnPreRender(EventArgs e){
SetFilterValues();
Bind();
base.OnPreRender(e);
}
// create iterator method
public IEnumerable<decimal?> BucketIterator(Accounts_basic a ) {
int cycle = 0;
for (int i=7 ; i > 0 ; i--){
switch (i) {
case 1:yield return a.dd_15;break;
case 2 :yield return a.dd_30; break;
case 3:yield return a.dd_60; break;
case 4:yield return a.dd_90; break;
case 5 :yield return a.dd_120; break;
case 6:yield return a.dd_150; break;
case 7:yield return a.dd_180; break;
default : yield break;
}
}
// use iterator method as follows
foreach (decimal? amount in BucketIterator(accounts_basic)) {
// use amount here
}
<system.net>
<connectionManagement>
<addaddress="*"maxconnection="40"/>
</connectionManagement>
</system.net>
try:
.... your code here ....
except Exception, e:
print "Error",i,e
using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Reflection;
using System.Collections.Generic;
using System.Linq.Expressions;
public static class Extenders
{
public static List<T> Sort<T>(this List<T> source, string sortExpression)
{
string[] sortParts = sortExpression.Split(' ');
var param = Expression.Parameter(typeof(T), string.Empty);
try
{
var property = Expression.Property(param, sortParts[0]);
var sortLambda = Expression.Lambda<Func<T, object>>(Expression.Convert(property, typeof(object)), param);
if (sortParts.Length > 1 && sortParts[1].Equals("desc", StringComparison.OrdinalIgnoreCase))
{
return source.AsQueryable<T>().OrderByDescending<T, object>(sortLambda).ToList<T>();
}
return source.AsQueryable<T>().OrderBy<T, object>(sortLambda).ToList<T>();
}
catch (ArgumentException)
{
return source;
}
}
}
public class GridCell {
public string page_name{get;set;}
public string link_code { get; set; }
public int page_state { get; set; }
public int landing_pages_id { get; set; }
}
LandingPagesDataContext lpdc = new LandingPagesDataContext();
var query = from p in lpdc.landing_pages
select new { p.page_name, p.link_code, p.page_state, p.landing_pages_id };
bind(query.Select(p=>new GridCell{page_name = p.page_name, link_code = p.link_code, page_state = p.page_state, landing_pages_id = p.landing_pages_id }).ToList<GridCell>());
import os
import re
import sys
fileHandle = open (sys.argv[1])
linesToPatch = fileHandle.readlines()
f = open(sys.argv[2])
for aline in f:
for rline in linesToPatch:
p=re.compile(rline.strip())
if p.search(aline.strip()):
print aline
-- get next business day
-- assumption: first day of the week is Sunday
CREATE FUNCTION NextBusinessDay
(@date DATETIME)
RETURNS VARCHAR(12)
AS
BEGIN
DECLARE @date1 DATETIME,
@m INT
SELECT @date1 = @date, @m = 0
WHILE @m < 1
BEGIN
SET @date1 = DATEADD(DD,1,@date1)
/* ** the following line checks for non-business days (1 and 7)
** IF your business days are different, change the following line to
** comply with your schedule
*/
IF DATEPART(DW,@date1) NOT IN (1,7)
BEGIN
SET @m = @m + 1
END
END
RETURN CAST(@date1 AS VARCHAR(12))
END
<script type="text/javascript">
alert (unescape('Hello%20World'));
alert (escape('Hello World'));
</script>
DECLARE @Accounts1 AS TABLE
(
customer NUMERIC(9, 0),
sub TINYINT,
tp1 VARCHAR(100)
)
insert into @Accounts1
execute usp_AccountDifferentialReportSelector @Did,@CycID
public bool OrderExists(int order_index) {
DataView dv1 = (DataView)CategoriesDataSource.Select(new DataSourceSelectArguments());
foreach( DataRow d in dv1.Table.Rows){
if ((int)d["order_index"] == order_index) {
gvMerchantCategoriesLabel.Text = "Update Not Successful, Order Index Already exists";
gvMerchantCategoriesLabel.Style.Add("color", "#FF0000");
return true;
}
}
return false;
}
public bool OrderExists(int order_index)
{
foreach (GridViewRow r in gvMerchantCategories.Rows)
{
int ord1 = 0;
if (int.TryParse(r.Cells[2].Text, out ord1) && ord1 == order_index)
{
gvMerchantCategoriesLabel.Text = "Update Not Successful, Order Index Already exists";
gvMerchantCategoriesLabel.Style.Add("color", "#FF0000");
return true;
}
}
}
SELECT TOP 10
hphone + ', ' as [text()]
from
person
for
xml path('')
SET ANSI_PADDING OFF
GO
ALTER TABLE [dbo].[web_contracts] WITH NOCHECK ADD CONSTRAINT [CK_web_contracts] CHECK NOT FOR REPLICATION (([payment_source]=(3) AND len(isnull([eft_routing_number],''))=(9)))
GO
ALTER TABLE [dbo].[web_contracts] CHECK CONSTRAINT [CK_web_contracts]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Routing number is not specified' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'web_contracts', @level2type=N'CONSTRAINT',@level2name=N'CK_web_contracts'
public interface ITriggerable {
void RegisterPostbackTrigger(Control parent,Control trigger);
}
public void RegisterPostbackTrigger(Control parent,Control button){
PostBackTrigger trigger = new PostBackTrigger();
trigger.ControlID =((Button) button).UniqueID;
UpdatePanel1.Triggers.Add(trigger);
}
protected override void OnInit(EventArgs e){
base.OnInit(e);
((ITriggerable)this.Page).RegisterPostbackTrigger(this, btnRename);
}
public bool ImageExists(string url) {
Uri urlCheck = new Uri(url);
WebRequest request = WebRequest.Create(urlCheck);
request.Credentials = CredentialCache.DefaultCredentials;
request.Timeout = 15000;
WebResponse response;
try {
//get URL web response
response = request.GetResponse();
return true;
}
catch (Exception){
return false; //url does not exist
}
}
function re_init(p1,p2){
$('a[name=modal]').click(function(e) {
// Add your jquery bindings here
// ...
//
}
}
$(document).ready(function() {
re_init(null,null);
// add re-initialisation after update panel reloading
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(re_init);
});
using System.Security;
public User Login(string login_name, string password){
ICredValidator cv = new LdapCredValidator(); //LanCredValidator();
User u = new User(conn);
if (cv.ValidateCred("MY-DOM", login_name, password))
{
// validation sucess
}else Throw("Login failed for {0}",login_name);
return u;
}
public void AD_ComputerList()
{
DirectoryEntry entry = new DirectoryEntry("LDAP://my-dom");
DirectorySearcher mySearcher = new DirectorySearcher(entry);
mySearcher.Filter = ("(objectClass=computer)");
Console.WriteLine("Listing of computers in the Active Directory");
Console.WriteLine("============================================");
foreach(SearchResult resEnt in mySearcher.FindAll())
{
Console.WriteLine("Name: {0}", resEnt.GetDirectoryEntry().Name.ToString());
}
Console.WriteLine("=========== End of Listing =============");
}
public void WinIdentity() {
System.Security.Principal.WindowsIdentity i = System.Security.Principal.WindowsIdentity.GetCurrent();
Console.WriteLine("name: {0}, token: {1}", i.Name, i.Groups[0].ToString());
Assert.IsNotNull(i);
}
<httpModules>
<add name="RequestResponseLogger" type="LoggingFilter, LoggingFilter"/>
</httpModules>
<customErrors mode="Off"/>
</system.web>
<microsoft.web.services2>
<diagnostics>
<trace enabled="true" input="D:\Logs\in.txt" output="D:\Logs\out.txt"/>
</diagnostics>
</microsoft.web.services2>
</configuration>
<?
function web_service($serv,$plain_data){
$curl_handle = curl_init();
curl_setopt($curl_handle, CURLOPT_URL, "https://myserver.com/myService.asmx/".$serv);
curl_setopt($curl_handle, CURLOPT_HEADER, 1);
curl_setopt($curl_handle, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl_handle, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl_handle, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($curl_handle, CURLOPT_POST, 1);
curl_setopt($curl_handle, CURLOPT_POSTFIELDS, $plain_data);
$response = curl_exec ($curl_handle) or die ( "There has been an error connecting");
#echo $response;
curl_close ($curl_handle);
$response= strstr($response, '<?xml version="1.0" encoding="utf-8"?>');
$re = str_replace('>','>',str_replace('<','<',$response));
$re1= str_replace('<string xmlns="http://tempuri.org/">',"<string>",$re);
return $re1;
}
function web_method($f,$u){
$data="Subscriber=".$f['studid']."&Affiliate=".$u['referral']
$re1= msi_service("MyMethodName1",$data);
$xml = simplexml_load_string($re1);
$result = $xml->xpath("/string"); // <- parsing result
foreach($result as $result_code) {
return $result_code;
}
return $re1;
}
?>
CREATE PROCEDURE TestProc
(
@Param1 varchar(50) = NULL,
@Param2 varchar(50) = NULL,
@Param3 varchar(50) = NULL
)
AS
SELECT
*
FROM
TestTable
WHERE
((@Param1 IS NULL) OR (col1 = @Param1)) AND
((@Param2 IS NULL) OR (col2 = @Param2)) AND
((@Param3 IS NULL) OR (col3 = @Param3))
public static int CacheDyration = 10;
/// <summary>
/// Cached Merchant table
/// </summary>
public static Hashtable MerchantHash
{
get
{
Hashtable retValue = null;
// Check if cache has Merchant saved
if (HttpContext.Current.Cache["MerchantHash"] != null)
{ // Return cached version
retValue = (Hashtable)HttpContext.Current.Cache["MerchantHash"];
}
else
{
// initializing new instance, you can change this initialization with using BLL classes
MerchantTableAdapter da = new MerchantTableAdapter();
retValue = Hashmaker.Hash(da.GetData(), "merchant_id", "merchantname");
if (retValue.Count > 0)
{
HttpContext.Current.Cache.Insert("MerchantHash", retValue, null, Cache.NoAbsoluteExpiration, new TimeSpan(0, CacheDyration, 0));
}
}
return retValue;
}
set
{ // Check if item is already in there
if (HttpContext.Current.Cache["MerchantHash"] != null)
{
// Remove old item
HttpContext.Current.Cache.Remove("MerchantHash");
} // Place a new one
HttpContext.Current.Cache.Insert("MerchantHash", value, null, Cache.NoAbsoluteExpiration, new TimeSpan(0, CacheDyration, 0));
}
}
Private Sub ClearCache()
For Each CacheKey As DictionaryEntry In Cache
If CacheKey.Key.GetType.Equals(GetType(System.String)) Then
Dim MyKey As String = CacheKey.Key
Cache.Remove(CacheKey.Key)
End If
Next
End Sub
from httplib2 import Http
from urllib import urlencode
url = 'http://de.gigajob.com/req.ax'
#body = {'USERNAME': 'foo', 'PASSWORD': 'bar'}
#headers = {'Content-type': 'application/x-www-form-urlencoded'}
body={'xajax':'ajax_get_sgd_html_display' ,'xajaxargs':'<xjxobj><e><k>searchword</k><v>C%23</v></e><e><k>zip</k><v></v></e><e><k>adtype</k><v>offer</v></e><e> <k>distance</k><v>25</v></e><e><k>country</k><v>all</v></e><e><k>language</k><v>de</v></e><e><k>page</k><v>1</v></e><e><k>sort</k><v>age</v></e><e><k>location</k><v></v></e><e><k>age</k><v>999</v></e></xjxobj>' ,'xajaxargs':'1' ,'xajaxargs':'1' ,'xajaxr':'1234400546535'}
h = Http()
response, content = h.request(url,'POST',urlencode(body))
print response
print content
more...
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler.exe -v "/beta " -p "beta\\" -u -f -d -fixednames "PrecompiledWeb\beta\\" -errorstack
sndrec32.exe /play /embedding c:\tools\saundz\phone_1.wav
pause
:set expandtab
:retab!
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim regFind As String = "<AccountNumber>(?'f'\d?)\d\d\d\d\d\d\d\d\d\d(?'e'.*?)</AccountNumber>"
Dim regReplace As String = "<AccountNumber>${f}**${e}</AccountNumber>"
TextBox1.Text = Regex.Replace(TextBox1.Text, regFind, regReplace)
End Sub
DECLARE @x XML;
SELECT @x = N'<?xml version="1.0" ?>
<Address>
<Street>1 MICROSOFT WAY</Street>
<City>REDMOND</City>
<State>WA</State>
<Zip>98052</Zip>
<Country>US</Country>
<Website></Website>
</Address>';
SET @x.modify('
delete /Address/Website
');
SELECT @x;
$Keys = Get-ChildItem HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall
$Items = $keys |foreach-object {Get-ItemProperty $_.PsPath}
foreach ($item in $items)
{
echo $item.Displayname
echo $item.DisplayVersion
echo $item.Publisher
echo $item.InstallDate
echo $item.HelpLink
echo $item.UninstallString
}
2. convert into MP3 the result of step 1 (audiodump.wav).
lame audiodump.wav "Song 1.mp3"
3. delete large wav file created in step 1(audiodump.wav)
var okno;
okno=window.open("", "Debug", "left=0,top=0,width=300,height=700,scrollbars=yes," +"status=yes,resizable=yes");
function log(msg){
okno.document.write("<br>"+msg);
}
string r =
@"(?x)" + // Ignore spaces within regex expression, for readability
@"^" + // Anchor at start of string
@"(?=.* ( \d | \p{P} | \p{S} ))" + // String must contain a digit or punctuation char or symbol
@".{6,}"; // String must be at least 6 characters in length
Console.WriteLine (Regex.IsMatch ("abc12", r));
Console.WriteLine (Regex.IsMatch ("abcdef", r));
Console.WriteLine (Regex.IsMatch ("ab88yz", r));
// The following groups purchases by year, then returns only those groups where
// the average purchase across the year was greater than $1000:
from p in Purchases
group p.Price by p.Date.Year into salesByYear
where salesByYear.Average (x => x) > 1000
select new
{
Year = salesByYear.Key,
TotalSales = salesByYear.Count(),
AvgSale = salesByYear.Average(),
TotalValue = salesByYear.Sum()
}
Customer[] customers = Customers.ToArray();
Purchase[] purchases = Purchases.ToArray();
var slowQuery =
from c in customers
from p in purchases where c.ID == p.CustomerID
select c.Name + " bought a " + p.Description;
var fastQuery =
from c in customers
join p in purchases on c.ID equals p.CustomerID
select c.Name + " bought a " + p.Description;
slowQuery.Dump ("Slow local query with SelectMany");
fastQuery.Dump ("Fast local query with Join");
var customers =
new XElement ("customers",
from c in Customers
select
new XElement ("customer", new XAttribute ("id", c.ID),
new XElement ("name", c.Name),
new XElement ("buys", c.Purchases.Count)
)
);
customers.Dump();
XMLStarlet Toolkit: Command line utilities for XML
Usage: xml [] [ ]
whereis one of:
ed (or edit) - Edit/Update XML document(s)
sel (or select) - Select data or query XML document(s) (XPATH, etc)
tr (or transform) - Transform XML document(s) using XSLT
val (or validate) - Validate XML document(s) (well-formed/DTD/XSD/RelaxNG)
fo (or format) - Format XML document(s)
el (or elements) - Display element structure of XML document
c14n (or canonic) - XML canonicalization
ls (or list) - List directory as XML
esc (or escape) - Escape special XML characters
unesc (or unescape) - Unescape special XML characters
pyx (or xmln) - Convert XML into PYX format (based on ESIS - ISO 8879)
p2x (or depyx) - Convert PYX into XMLare:
--version - show version
--help - show help
Wherever file name mentioned in command help it is assumed
that URL can be used instead as well.
Type: xml--help for command help
XMLStarlet is a command line toolkit to query/edit/check/transform
XML documents (for more information see http://xmlstar.sourceforge.net/)
<script type="text/javascript">
var container = document.getElementById("header-inner");
container.innerHTML ="http://sourcefield.blogspot.com";
</script>
WebHost failed to process a request.
Sender Information: System.ServiceModel.Activation.HostedHttpRequestAsyncResult/25773083
Exception: System.ServiceModel.ServiceActivationException: The service '/Business/Service.svc' cannot be activated due to an exception during compilation.
The exception message is: Service 'Business.WebService.Service' has zero application (non-infrastructure) endpoints. This might be because no configuration file was found for your application, or because no service element matching the service name could be found in the configuration file, or because no endpoints were defined in the service element..
System.InvalidOperationException: Service 'Business.WebService.Service' has zero application (non-infrastructure) endpoints. This might be because no configuration file was found for your application, or because no service element matching the service name could be found in the configuration file, or because no endpoints were defined in the service element.
at System.ServiceModel.Description.DispatcherBuilder.EnsureThereAreNonMexEndpoints(ServiceDescription description)
at System.ServiceModel.Description.DispatcherBuilder.InitializeServiceHost(ServiceDescription description, ServiceHostBase serviceHost)
at System.ServiceModel.ServiceHostBase.InitializeRuntime()
at System.ServiceModel.ServiceHostBase.OnBeginOpen()
at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(String normalizedVirtualPath)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)
--- End of inner exception stack trace ---
at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result)
Process Name: w3wp
Process ID: 1680
Private Function Transform(xml_string, xsl_file) As String
Dim xsl, XML
Set xsl = CreateObject("Microsoft.XMLDOM")
Set XML = CreateObject("Microsoft.XMLDOM")
xsl.Load (xsl_file)
XML.LoadXml (xml_string)
Transform = XML.transformNode(xsl)
End Function
public static void NonEmpty<T>(IEnumerable<T> source,string m){
if (source == null) Throw(m);
if (!source.Any()) Throw(m);
}
private IQueryable<Invoice> AttachInvoices(LinqDataObjectsDataContext dc,string sInvoices) {
List<InvArg> ral = new List<InvArg>();
ral = (List<InvArg>)CXMLConv.Load(sInvoices, ral.GetType(), "ArrayOfInvArg") ;
IEnumerable<InvArg> ra = ral;
var inv = from i in dc.Invoices
join r in ra on i.InvoiceID equals r.InvoiceID
select i;
return inv;
}
private List<Invoice> AttachInvoices(LinqDataObjectsDataContext dc,string sInvoices) {
List<InvArg> ral = new List<InvArg>();
ral = (List<InvArg>)CXMLConv.Load(sInvoices, ral.GetType(), "ArrayOfInvArg");
long[] s=ral.Select(p => p.InvoiceID).ToArray();
var inv = from i in dc.Invoices
where s.Contains(i.InvoiceID)
select i;
return inv.ToList();
}
Private Sub ShowHtml(s As String)
Browser.Navigate ("about:blank")
' Dim doc As IHTMLDocument2
Set boxDoc = Browser.Document
boxDoc.Write (s)
boxDoc.Close
End Sub
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="Binding1" closeTimeout="00:11:00" openTimeout="00:11:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" allowCookies="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="9965536" maxBufferPoolSize="9524288" maxReceivedMessageSize="9965536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" >
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings>
<endpoint address="" binding="basicHttpBinding" contract="Business.WebService.IService" bindingConfiguration="Binding1">
indx={}
with open(filename) as f:
for n,line in enumerate(f):
for word in line.split():
indx.setdefault(word,[]).append(n)
#emit in alphabetical order
for word in sorted(indx):
print "%s:" % word
for n in indx[word]: print n,
#property sample
class blah(object)
def getter(self):
return ...
def setter(self,value):
....
name=property(getter,setter)
inst=blah()
print inst.name #calls inst.getter()
inst.name=23 #like call inst.setter(23)
class fib(object):
def __init__(self): self.i=self.j=1
def __iter__(self): return self
def next(self):
r,self.i=self.i,self.j
self.j+=r
return r
for r in fib():
print r,
if r > 100: break
1 1 2 3 5 8 13 21 34 55 89 144
Types of arguments:
#default values:
def sub1( a,b='default',i=0)named arguments
def info(spacing=15, object=odbchelper):tuple (args,params)
def sumsq2(*a): return sum(x*x for x in a)dictionary
def sumsq2(**a):generators in python - used yield insted of return
def fibonacci()
i=j=1
while True:
r,i,j = i,j,i+j
yield r
for rabbits in fibonacci():
print rabbits
if rabbit > 100 : break
>>
1 1 2 3 5 8 13 21 34 55 89 144Closures
def makeAdder(addend):
def adder(augend):
return audend + addend
return adder
a23=MakeAdder(23)
a42=MakeAdder(42)
print a23(100) , a42(100) , a23(a42(100))
>> 123 142 165decorators
@<decor>
def <name>
#is like
def (name)
name = <decor>(<name>)
#or another example
@dec2
@dec1
def func(arg1, arg2, ...):
pass
#This is equivalent to:
def func(arg1, arg2, ...):
pass
func = dec2(dec1(func))and singleton example
def singleton(cls):
instances = {}
def getinstance():
if cls not in instances:
instances[cls] = cls()
return instances[cls]
return getinstance
@singleton
class MyClass:
...
to make ubuntu business casual - make it black remove background: gsettings set org.gnome.desktop.background picture-options ...