Windows 7 autofill login ON OFF

HOWTO disable logon screen on Windows 7 or enable it again? Just type netplwiz in Start menu.
By default user must enter password on logon screen. If you want to remove it you should clean check box and click OK button and vice verse.


Enjoy it!

OTRS: hide -Move- dropdown with ACL

If you want to disable ticket move action for tickets in some states you can use ACL rules. Below you can see an example how to block movement of ticket if ticket is closed.

[Kernel/Config.pm]
        
# Ticket ACL - Disable move for closed
$Self->{TicketAcl}->{'ACL-dont-move'} = {
 # match properties
 Properties => {
  # all closed tickets
  Ticket => {
   State => ['closed', 'closed successful', 'closed unsuccessful', ], 
  },
  
  #disable on AgentTicketZoom page only
  Frontend => {
 Action => [
  'AgentTicketZoom',
 ],
  },
 },

# return possible options (white list)
 Possible => {
  # shouldn't be moved (0)
  Action => {
   AgentTicketMove =>  0,
  },
 }, 

};

Internet Information Services (IIS) 8.0 Express Release Candidate


IIS 8.0 Express is a simple and self-contained version of IIS 8.0 that is optimized for developers

Overview



IIS 8.0 Express enhances your ability to develop and test web applications on Windows by combining the power of IIS 8.0 with the convenience of a lightweight web server like the ASP.NET Development Server (also known as Cassini). IIS Express 8.0 is included with Microsoft WebMatrix, an integrated suite of tools designed to make developing web applications on Windows simple and seamless. IIS 8.0 Express can also be used with Microsoft Visual Studio as a powerful alternative to Cassini. The benefits of using IIS 8.0 Express include:
  • The same web server that runs on your production server is now available on your development computer.
  • Most tasks can be done without the need for administrative privileges.
  • IIS 8.0 Express runs on Windows Vista and all later versions of Windows.
  • Many users can work independently on the same computer.
This package installs only IIS 8.0 Express. For an integrated development experience, also install Microsoft WebMatrix or Microsoft Visual Studio.

more

Visual Studio 2012 RC is now available to download.

Pivot (crosstab) table in C#

How to create pivot table in C# and display it in DataGrid?

NOTE: it is available version 2.0 of PivotTable


It exists well-know solution for pre-sorted and pre-grouped values.
What if we would like to pivot free set? Sample below will pivot any DataTable and produce new summarized DataTable. You can pivot Array or ArrayList also, first you should convert your Array to DataTable and then call Pivot method. Data is ready to display in grid.

     public DataTable Pivot(
            DataTable src,
            string VerticalColumnName,
            string HorizontalColumnName,
            string ValueColumnName ) 
        {

                DataTable dst = new DataTable();
                if (src == null || src.Rows.Count == 0)
                    return dst;

                // find all distinct names for column and row
                ArrayList ColumnValues  = new ArrayList();
                ArrayList RowValues     = new ArrayList();
                foreach (DataRow dr in src.Rows)
                {
                    // find all column values
                    object column = dr[VerticalColumnName];
                    if (!ColumnValues.Contains(column))
                        ColumnValues.Add(column);

                    //find all row values
                    object row = dr[HorizontalColumnName];
                    if (!RowValues.Contains(row))
                        RowValues.Add(row);
                }

                ColumnValues.Sort();
                RowValues.Sort();

                //create columns
                dst = new DataTable();
                dst.Columns.Add(VerticalColumnName, src.Columns[VerticalColumnName].DataType);
                Type t = src.Columns[ValueColumnName].DataType;
                foreach (object ColumnNameInRow in RowValues) {
                    dst.Columns.Add(ColumnNameInRow.ToString(), t);
                }

                //create destination rows
                foreach (object RowName in ColumnValues) {
                    DataRow NewRow = dst.NewRow();
                    NewRow[VerticalColumnName] = RowName.ToString();
                    dst.Rows.Add(NewRow);
                }

                //fill out pivot table
                foreach (DataRow drSource in src.Rows) {
                    object key = drSource[VerticalColumnName];
                    string ColumnNameInRow = Convert.ToString(drSource[HorizontalColumnName]);
                    int index = ColumnValues.IndexOf(key);
                    dst.Rows[index][ColumnNameInRow] = sum(dst.Rows[index][ColumnNameInRow], drSource[ValueColumnName]);
                }

                return dst;
        }

        dynamic sum(dynamic a, dynamic b) {
            if (a is DBNull && b is DBNull)
                return DBNull.Value;
            else if (a is DBNull && !(b is DBNull))
                return b;
            else if (!(a is DBNull) && b is DBNull)
                return a;
            else
                return a + b;
        }
Proof:
            object DBNULL = DBNull.Value;
            DataTable src = new DataTable();
            DataTable dst = null;

            src.Columns.Add("City", typeof(string));
            src.Columns.Add("Product", typeof(string));
            src.Columns.Add("Value", typeof(float));
            
            src.Rows.Add("City A", "Product 1", 1.2f);
            src.Rows.Add("City C", "Product 2", 0.3f);
            src.Rows.Add("City A", "Product 1", 1.0f);
            src.Rows.Add("City B", "Product 3", 2.2f);
            src.Rows.Add("City B", "Product 1", 1.5f);
            src.Rows.Add("City A", "Product 2", 0.8f);
            src.Rows.Add("City A", "Product 4", 1.1f);

            PivotTable test = new PivotTable();
            dst = test.Pivot(src, "City", "Product", "Value");

            CollectionAssert.AreEqual(new object[] { "City A", 2.2f,    0.8f,   DBNULL, 1.1f   }, dst.Rows[0].ItemArray);
            CollectionAssert.AreEqual(new object[] { "City B", 1.5f,    DBNULL, 2.2f,   DBNULL }, dst.Rows[1].ItemArray);
            CollectionAssert.AreEqual(new object[] { "City C", DBNULL,  0.3f,   DBNULL, DBNULL }, dst.Rows[2].ItemArray);


Enjoy!

C# (c sharp) function list


C# has no functions in the ordinary sense. So you if you are looking for absolute value you can't call abs() any more and should use static method from Math class!

Math.Abs(foo_bar);

So you can forget right now about function and find some useful methods of class which grouped in namespaces.

Namespace overview you will find here. Base classes are collected in System namespace. And useful list and hashes are located in System.Collections namespace.

Enjoy!

how to change proxy in samsung galaxy android



changing proxy settings on android smartphones (samsung, galaxy, htc, etc)


EN: Wireless & networks > Wi-Fi settings > Proxy Settings and  Manual

DE: WLAN Einstellungen > Menütaste: Erweitert > Proxy/Port


RU: Беспроводные сети > Настройки WiF  >  Настройка сети  >  Настройки прокси-сервера и Ручные




get asp.net sources


ASP.NET is a free web framework for building great web sites and applications.
This site is the home of the ASP.NET MVC, Web API, and Web Pages source code. If you want to use the released versions of these products to develop your applications, visit http://www.asp.net to find official installers, documentation, tutorials, samples, and videos.
These products are actively developed and supported by the Microsoft ASP.NET team in collaboration with a community of open source developers. Together we are dedicated to creating the best possible platform for web development.

Enjoy!

Asterisk AST_SORCERY function

 AST_SORCERY gets a field from a sorcery object. Sorcery is always created for PJSIP aors, endpoints and identifies in asterisk. It allows y...