Java 4-Ever
Written on June 25, 2010 – 7:16 am | by tihomir_wwf |for the fans of Java and .not
for the fans of Java and .not
You may become in the following situation: You have some class and you want to add some enum for it, then you begin wandering should you add a new file for the enum. I think if the enum will be used by a single class then you should add the enum declaration inside the class. [...]
You may want to declare a static Dictionary variable in you code, here’s a simple example how it can be done in C#: using System.Collections.Generic; … public static Dictionary<string, string> dict = new Dictionary<string, string>() { {“key 1″, “value 1″}, {“key 2″, “value 2″}, {“key 3″, “value 3″} }; That’s all. It’s similar to the [...]
I needed a url pattern that recognizes the following urls: http://site.com www.site.com https://site.com https://www.site.com Even more, I wanted after url detection, it to be replaced with: http://site.com -> http://site.com www.site.com -> http://www.site.com https://site.com -> https://site.com https://www.site.com -> https://www.site.com I use Regex’s Replace method. It detects all urls and replaces them with the correct format. Here [...]
Here’s simple example how can we export some table data to docx file using Open XML SDK. If you are not familiar with Open XML SDK, you can check out first Introduction to Open XML SDK. In this example: 1) Create some string array that represent table data 2) Create a new Docx file and [...]
Currently, I work with Open XML SDK 2.0 and in this post, I’ll try to explain simple introduction to it: What is Open XML and Open XML SDK? Open XML is an open standard that defines a set of XML schemas for representing spreadsheets, presentations, charts and word processing documents. Microsoft Office 2007 applications (Word, [...]
If you have experience with the standard .net web services you may find useful the following table of comparison between WCF Web Services and Standard Web Services. Standard Web Services WCF Web Services client for the service are generated by command-line tool WSDL.EXE ServiceMetadata tool(svcutil.exe) class attribute [WebService] [ServiceContract] method exposed to client attribute [WebMethod] [...]