Wednesday, 17 August 2011

BizSpark - oprogramowanie Microsoftu praktycznie za darmo

BizSpark to program MS-u dla start-up’ów. Aby wziąć udział, należy zarejestrować swoją firmę na stronie programu. Po weryfikacji (albo przez lokalnego partnera, albo bezpośrednio przez MS), firma, która weźmie w nim udział ma dostęp do szkoleń, promocji i tym podobnych rzeczy.

Najlepsze jest jednak to, że dostaje się subskrypcję MSDN, czyli można pobrać dowolne oprogramowanie (systemy operacyjne, Office, narzędzia dla programistów, bazy danych, itp…) ze strony firmy i wygenerować klucze. Zarejestrować mogą się firmy, które będą tworzyć systemy lub oprogramowanie w oparciu o technologie Microsoftu. Są jeszcze dodatkowe kryteria, takie jak obrót roczny, czy czas od powstania. Firma może być w programie przez 3 lata, ale co rok należy pamiętać o przedłużeniu subskrypcji (wystarczy kliknąć w link wysłany e-mailem). Przy kończeniu współpracy może być konieczne zapłacenie kwoty 100 USD, ale jak dotąd nie spotkałem się z tym, żeby MS faktycznie wystawił fakturę.

Jeśli będziesz używać oprogramowania w swojej firmie, przeczytaj jednak dokładnie warunki licencji. W szczególności, które programy mogą być używane produkcyjnie, a które tylko na maszynach developerskich lub testowych. Sprawdź też, ile możesz dokonać instalacji. Według GW, większość firm w Polsce używa nielegalnego oprogramowania i to wcale nie świadomie. Najczęściej problemem jest przekroczenie ilości instalacji lub użycie oprogramowania niezgodnie z licencją.

Więcej informacji: www.bizspark.com

Wednesday, 13 April 2011

GUIDs of some of built in fields

SPBuiltInFieldId.Titlefa564e0f-0c70-4ab9-b863-0177e6ddd247
SPBuiltInFieldId.Author1df5e554-ec7e-46a6-901d-d85a3881cb18
SPBuiltInFieldId.ContentTypeId 03e45e84-1992-4d42-9116-26f756012634
SPBuiltInFieldId.Created_x0020_By 4dd7e525-8d6b-4cb4-9d3e-44ee25f973eb
SPBuiltInFieldId.Created_x0020_Date 998b5cff-4a35-47a7-92f3-3914aa6aa4a2

Monday, 28 March 2011

Default types of SharePoint list fields.

This list summarizes all default types of fields used when creating new list definition in SharePoint.

AllDayEvent » Specifies an all day event. Corresponds to the bit SQL data type.
Attachments » Stores the URLs for attachments. Corresponds to the bit SQL data type.
Boolean » Used to store a TRUE/FALSE value (stored in the database as 0 or 1). This field is sortable and groupable. Corresponds to the bit SQL data type and represented by the SPFieldBoolean class.
Calculated » Specifies a field whose value is calculated based on other columns. Corresponds to the sql_variant SQL data type and represented by the SPFieldCalculated class.
Choice » Allows the user to specify a predetermined set of values that can be used to enter data into the field. TheChoice and Lookup types are the most important fields for sorting and grouping. The BaseType and Formatattributes can be used for choice fields. This field is sortable and groupable. When a value is given for a choice option, then that value is used as the submitted value for the field selection. When no value is given, that choice is submitted as the text value of the choice. In all cases, the text value of the choice is what is displayed in the UI (drop-down list or radio button text). The order in which choices appear in the editing UI is always the order that items are specified within the CHOICES element. Use the MultiChoice type to specify a Choice field that implements check boxes and allows the user to select multiple values. Corresponds to the nvarchar SQL data type and represented theSPFieldChoice class.
Computed » Specifies a field that depends on another field for its contents. For example, a LinkTitleNoMenu field amounts to surrounding a Title field value with a hyperlink. Represented by the SPFieldComputed class.
ContentTypeId » Contains a content type ID. For information about the format of content type IDs, see Content Type IDs. Corresponds to the varbinary SQL data type.
Counter » Generally used only for the internal ID field. Its integer value is set automatically to be unique with respect to every other item in the current list. The Counter type is always read-only and cannot be set through a form post. This field is sortable but not groupable. Corresponds to the int SQL data type.
CrossProjectLink » Used to connect an event in a SharePoint list with a Meeting Workspace site; refers specifically to the field type of the checkbox used in New and Edit Item forms to create a Meeting Workspace site for the item. Corresponds to the bit SQL data type and represented by the SPFieldCrossProjectLink class.
Currency » Allows for a currency value to be entered. Each currency field is tied to a specific locale’s currency. In all other respects, it is treated like the Number field type. Use the LCID attribute to indicate a currency of a specific locale. The Decimals, Max, and Min attributes can be used for currency types. This field is sortable and groupable. Corresponds to the float SQL data type and represented by the SPFieldCurrency class.
DateTime » Allows for storage of a fully qualified date or time of day. Use the Format attribute to specify date formatting, and use the StorageTZ attribute to determine how date/time values are stored. This field is sortable and groupable. For Display mode, the order of date formatting derives from the regional settings ("M/D/Y" or "D/M/Y"). In Edit mode (or in New mode for Default element value), date/times are rendered in universal format: M/D/Y hh:mm am/pm. Corresponds to the datetime SQL data type and represented the SPFieldDateTime class.
File » Contains a file. Corresponds to the uniqueidentifier SQL data type.
GridChoice » Contains a rating scale for surveys. Corresponds to the ntext SQL data type and represented by theSPFieldRatingScale class.
Guid » Allows for globally unique identifiers (GUIDs). Corresponds to the uniqueidentifier SQL data type.
Integer » Allows for positive or negative integer values. The Commas and NegativeFormat attributes are used to specify integer formatting. Corresponds to the int SQL data type.
Lookup » Behaves very similarly to a Choice field, except that the available options come from another list rather than being a hard-coded selection of values. The List and ShowField attributes can be used for Lookup fields. This field is sortable and groupable. For sorting and grouping, use the DisplayField value (Title, by default) rather than the foreign key stored in the list. Corresponds to the int SQL data type and represented by the SPFieldLookup class.
LookupMulti » A Lookup field that can contain more than one value. Parent type: Lookup.
ModStat » Contains content approval status. Possible values include Approved (default), Rejected, and Pending(stored in the database as 0, 1, or 2, respectively). Corresponds to the int SQL data type.
MultiChoice » Specifies a Choice field that implements check boxes and allows the user to select multiple values. Corresponds to the ntext SQL data type and represented by the SPFieldMultiChoice class.
MultiColumn » A Note field that emulates a field containing multiple values. For an example of a multicolumn field type, see How to: Create a Custom Field Type Definition. For information on multicolumn fields, see Custom Multicolumn Field Classes. Parent type: Note.
Note » Allows users to enter multiple lines of text. This field is not sortable or groupable. All text is defined to be straight ASCII characters without HTML markup. Anything that looks like HTML markup or a URL is simply quoted (for example, Server.HTMLEncode) to look like straight text. The control for editing this format is a simple TEXTAREA block. Use the NumLines attribute to specify the number of lines to display. Corresponds to the ntext SQL data type and represented by the SPFieldMultiLineText class.
Number » Allows for a floating point number to be entered. This field is sortable and groupable. Numbers entered are parsed according to the current locale settings for decimal points and thousand separators. Negative numbers can be indicated by wrapping them in parentheses or by using a negative symbol. The following attributes can be used in conjunction with the Number attribute to specify number formatting: Decimals, Div, Max, Min, Mult, andPercentage.
Corresponds to the float SQL data type and represented by the SPFieldNumber class.
PageSeparator » Inserts a page break in a survey list. Represented by the SPFieldPageSeparator class.
Recurrence » Used to edit and define the recurrence pattern for an item in an events list. Corresponds to the bitSQL data type.
Text » A single line of text entered in an edit box. This field is sortable and groupable. Use the MaxLength attribute to set a maximum number of characters allowed. Corresponds to the nvarchar SQL data type and represented by the SPFieldText class.
ThreadIndex » Contains the ID that indicates the relative position of a message within a conversation thread. Corresponds to the varbinary SQL data type.
Threading » The Threading field type is used in the creation and display of threaded discussion-like views. Any list can contain a threading column, but a special UI is generated when it is used. (It is never displayed as a standard editable field in a form nor as a normal column in a view.) If a sort is performed on a threading field, a pre-order traversal of all the records in a parent-child relationship is returned. This is accomplished by saving the concatenation of the creation date and ID number of all the parent records of a particular record. Corresponds to the varchar SQL data type.
URL » Used to create a freeform hyperlink. A URL field is displayed as <A HREF="URL">Description</A>. If no description is given, it is displayed as <A HREF="URL">URL</A>. The URL text is itself stored in the URLs (DocMd) table, which stores all the URLs in SharePoint databases on the server. This is done so that any URLs that are local on the server can be updated through link fixup when their destination moves. When a record with a URL field contained within it is deleted, the corresponding referenced record from the URL table is also deleted. This field is sortable and groupable. (The sort is defined according to the textual description rather than the contents of the URL; if no description is given, it sorts the same as blank.) When Type is URL, the LinkType attribute can be used to specify the type of link. Corresponds to the nvarchar SQL data type and represented by the SPFieldUrl class.
User » A Lookup field that references the UserInfo database table. Corresponds to the int SQL data type and represented by the SPFieldUser class.
UserMulti » A User field that can contain more than one value. Parent type: LookupMulti.
WorkflowEventType » Specifies a workflow event type as represented by the SPWorkflowHistoryEventTypeenumeration. Parent type: Integer.
WorkflowStatus » Specifies workflow status as represented by the SPWorkflowStatus enumeration. Corresponds to the nvarchar SQL data type.

(From MSDN)

Saturday, 12 March 2011

Sprawdzenie przynależności numeru w sieci

Od momentu wprowadzenia w Polsce możliwości przeniesienia numeru pomiędzy operatorami sieci komórkowych, nie jest możliwe jednoznaczne określenie przynależności numeru do konkretnego operatora na podstawie tzw. prefiksu.

Poniższa strona pozwala sprawdzić, do której sieci w Polsce należy szukany numer: http://bit.ly/97SMBr 

Wednesday, 2 February 2011

Google Apps blocks .tk TLD

Obviously Google blocks using Apps service for all domains, that end with .tk.

.tk is top-level domain of Tokelau. They offer free domains for anybody. You can go to dot.tk and register your own domain and simply set redirection. Or, if you are more advanced, you can use their DNS servers to set records to route to your site. You can also set MX record for e-mail. 

I used .tk for e-mail in connection with Google Docs. Few months ago my .tk domain stopped working. When trying to log into my admin account, I get "This account has been disabled".

Trying to set up new google account on this domain also fails. All you gonna get, is this lousy excuse: 
Our systems have detected unusual traffic from your computer network. Please try your request again later. Why did this happen?
Of course, there is no unusual traffic from my network. Trying to set ANY other domain works fine.

Looks like I'm going to set my e-mail on Windows Live. (Windows Live works well with .tk domains)

Thursday, 13 January 2011

SharePoint package deployment using STSADM

Just, so I don't need to check stsadm doc over and over again:
stsadm -o retractsolution -name MySolutionFile.wsp -immediate -allcontenturls
stsadm -o deletesolution -name MySolutionFile.wsp -override
stsadm -o addsolution -filename MySolutionFile.wsp
stsadm -o deploysolution -name MySolutionFile.wsp -url http://myserver -immediate -allowgacdeployment

Monday, 8 November 2010

Serialize and deserialize to XML string


private static string XmlSerialize(T obj)
{
    var stream = new MemoryStream();
    var writer = new XmlTextWriter(stream, Encoding.ASCII);

    XmlSerializer ser = new XmlSerializer(typeof(T));
    ser.Serialize(writer, obj);
    stream = (MemoryStream)writer.BaseStream;
    var bytes = stream.ToArray();
    var encoding = new UTF8Encoding();
    string result = encoding.GetString(bytes);

    return result;
}

private static T XmlDeserialize(string xml)
{
    XmlSerializer xs = new XmlSerializer(typeof(T));

    UTF8Encoding encoding = new UTF8Encoding();
    Byte[] byteArray = encoding.GetBytes(xml);

    MemoryStream memoryStream = new MemoryStream(byteArray);
    XmlTextWriter xmlTextWriter = new XmlTextWriter(memoryStream, Encoding.UTF8);
    object obj = xs.Deserialize(memoryStream);
    return (T)obj;
}

Friday, 17 September 2010

Znów błąd w SharePoincie

Szukając przyczyny błędu, otworzyłem w Reflectorze bibliotekę Microsoft.Sharepoint.dll z SharePoint'a 2010. Gdzieś tam w Microsoft.SharePoint.Administration.Claims.SPClaimsAuthMembershipProvider nagle ujrzałem następująca metodę:

public override MembershipUser GetUser(string name, bool userIsOnline)
{
    throw new NotImplementedException();
}

No comment.

Tuesday, 17 August 2010

Jak pobrać listę raportów ?

Okazuje się to bardzo proste. Report server wykorzystuje do tego procedurę składowaną FindObjectsNonRecursive.


string cnxstr = "Data Source=moja_nazwa_serwera;Initial Catalog=ReportServer;Integrated Security=SSPI;"; //connection string
using (SqlConnection connection = new SqlConnection(cnxstr))
{
    connection.Open(); 
    SqlCommand command = new SqlCommand();
    command.Connection = connection; 
    command.CommandType = CommandType.StoredProcedure; 
    command.CommandText = "FindObjectsNonRecursive";
    command.Parameters.Add(new SqlParameter("@Path", "/nazwa_mojego_folderu"));
    command.Parameters.Add(new SqlParameter("@AuthType", 1));
    SqlDataReader reader = null
    try
    {
        reader = command.ExecuteReader(); 
        while (reader.Read())
        {
            string sciezka = reader["Path"].ToString(); 
            //teraz możesz np. wyświetlić ją na liście
        }
    }
    finally
    {  
        if (reader != null
            reader.Close(); 
    }
}

UrlEncode


public static string UrlEncode(string url)
{
    if (url == null)
        return null;
    StringBuilder bld = new StringBuilder(url.ToLower());
    bld.Replace("!", "%21");
    bld.Replace("*", "%2A");
    bld.Replace("'", "%27");
    bld.Replace("(", "%28");
    bld.Replace(")", "%29");
    bld.Replace(";", "%3B");
    bld.Replace(":", "%3A");
    bld.Replace("@", "%40");
    bld.Replace("&", "%26");
    bld.Replace("=", "%3D");
    bld.Replace("+", "%2B");
    bld.Replace("$", "%24");
    bld.Replace(",", "%2C");
    bld.Replace("/", "%2F");
    bld.Replace("?", "%3F");
    bld.Replace("#", "%23");
    bld.Replace("[", "%5B");
    bld.Replace("]", "%5D");
    return bld.ToString();
}


Tylko że można to zastąpić metodą HttpUtility.UrlEncode