Posts from all authors
Ubuntu 8.04LTS Server Virtual Machine Edition
Beginning with 8.04LTS release, Ubuntu officially packages and supports an other kind of server package called JeOS. JeOS is targetted to be run inside virtual machines. This slim server comes with a special kernel optimized for VMWare Server and ESX.Unfortunately the VMWare doesn't distribute their VMWare Toolsin debian format for Ubuntu so it has to be compiled from sources manually.
We installed one as build and test server in EPAM. At startup it eats 35-50 Mb out of the provided memory. So far it is running stable and looks promising. I'll update you about it when I have more information!
Author:
Doki
Published:
May 16, 2008 9:13:22 PM
Tags:
Java, Linux, Ubuntu
An idea for metrics
All that JMX stuff we (should) incorporate in the products may show "performance counters" like files open, cache hits, response time, number of queries, number of processed messages/transactions. Another story not covered yet is performance metrics of user interface. I remember one rant that Oracle has done versus MS SQL (or was that MS vs Oracle?) when they have compared nice new shining Oracle management Java gozilla against plain old C-based MS SQL Enterprise Manager (or was that Oracle Enterprise manager, too?) The bottom line was that "typical Oracle task is 57% simpler to do"; or course this is worser lie than statistics but still the idea of comparison is intriguing. From business point of view, this is also important: know thy ROI, personnel skills level, product management spends etc.
I imagine, in such measurements, that exposure time of every "choser" screen should be counted and then associated with the end task being performed (or final report page that was the user needed to see). That statistic should (might) be collected. So for example "usability statistics" would be like:
* database shrinking: 17 times a year, 52 seconds average to navigate to and 65 seconds to perform;
* database restore: 3 times a year, 12.7 minutes to find and enter the data and 22 minutes to perform - etc.
First problem is with collecting this statistics, usually there will be one DB admin in one non-IT company. Would be great to collect such stats in internet, despite some security risk.
Second is that user may have a break in the middle of work. Often he will not even lock the workstation if he is hotly debating new corporate policy sitting at the same chair. Or when he is reading the letter about it in Outlook. Not sure if Windows event model allows catching such things. Maybe such stats should be dropped out.
Author:
Vladimir
Published:
April 28, 2008 10:32:41 AM
Tags:
SqlBulkCopy: copy data quickly
It is possible to copy data from table to table with the help of SqlBulkCopy. Special class can help you.
public class CopyData
{
string sourceConnectionString;
string destinationConnectionString;
public CopyData(string sourceConnectionString, string destinationConnectionString)
{
this.sourceConnectionString = sourceConnectionString;
this.destinationConnectionString = destinationConnectionString;
}
public void CopyTable(string tableName)
{
CopyTable(tableName, tableName);
}
public void CopyTable(string sourceTableName, string destinationTableName)
{
using (SqlConnection source = new SqlConnection(sourceConnectionString))
{
string sql = string.Format("SELECT * FROM [{0}]", sourceTableName);
SqlCommand command = new SqlCommand(sql, source);
source.Open();
IDataReader dr = command.ExecuteReader();
using (SqlBulkCopy copy = new SqlBulkCopy(destinationConnectionString))
{
copy.DestinationTableName = destinationTableName;
copy.WriteToServer(dr);
}
}
}
}
Copying table data is as simple as:
string connectionString1 = "Data Source=(local);Initial Catalog=TAK-SPK;Integrated Security=true";
string connectionString2 = "Data Source=(local);Initial Catalog=TEST;Integrated Security=true";
string tableName = "C_LOOKUP";
CopyData copier = new CopyData(connectionString1, connectionString2);
copier.CopyTable(tableName);
It's easy!
Also SqlBulkCopy class has special property ColumnMappings and you can define mapping between source and destination columns.
Author:
Pavel
Published:
April 24, 2008 9:08:47 AM
Tags:
SQL, NET
How to read Excel file by interop
using Excel;
using System;
using System.IO;
using System.Reflection;
namespace ExcelReader
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
ApplicationClass application = null;
string filename;
Workbook workbook;
Worksheet worksheet;
object objsheet, objrange;
Range range;
// Should be full name!
filename = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory , @"test.xls");
try
{
application = new ApplicationClass();
application.Visible=false;
application.DisplayAlerts=false;
workbook = application.Workbooks.Open(
filename,
Missing.Value,
Missing.Value,
Missing.Value,
Missing.Value,
Missing.Value,
Missing.Value,
Missing.Value,
Missing.Value,
Missing.Value,
Missing.Value,
Missing.Value,
Missing.Value
);
objsheet = workbook.ActiveSheet;
if (objsheet != null)
{
worksheet = (Worksheet) objsheet;
objrange = worksheet.Cells[1, 1];
if (objrange != null)
{
range = (Range) objrange;
range.Font.Name="Tahoma";
range.Font.Size=8;
range.Font.Bold=false;
range.Value = "new value";
range = null;
}
objrange = null;
worksheet = null;
}
objsheet = null;
workbook.Save();
workbook = null;
}
catch(Exception ex)
{
Console.WriteLine(ex.ToString());
}
finally
{
if (application != null)
{
application.Quit();
}
application = null;
}
}
}
}
Author:
Pavel
Published:
April 22, 2008 3:08:07 PM
Tags:
NET, Excel
How to read Excel file by OLE
using System;
using System.Data;
using System.Data.OleDb;
namespace ExcelDataTest
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
// File name
string filename = @"book1.xls";
// connection string
string ConnectionString= String.Format(
"Provider=Microsoft.Jet.OLEDB.4.0;Extended Properties=\"Excel 8.0;HDR=Yes;IMEX=1\";Data Source={0}", filename);
// Open connection
DataSet ds=new DataSet("EXCEL");
OleDbConnection cn=new OleDbConnection(ConnectionString);
cn.Open();
// Get sheet list from file
DataTable schemaTable =
cn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables,
new object[] {null, null, null, "TABLE"});
// Show sheets
for (int i=0; i< schemaTable.Rows.Count; i++)
{
// name
Console.WriteLine(schemaTable.Rows[i].ItemArray[2]);
// modification date
Console.WriteLine(schemaTable.Rows[i].ItemArray[7]);
}
// Get name of first sheet
string sheet1 = (string) schemaTable.Rows[0].ItemArray[2];
// Get data from first sheet
string select = String.Format("SELECT * FROM [{0}]", sheet1);
OleDbDataAdapter ad = new OleDbDataAdapter(select, cn);
ad.Fill(ds);
DataTable tb=ds.Tables[0];
// Show data
foreach (DataRow row in tb.Rows)
{
foreach(object col in row.ItemArray)
{
Console.Write(col+"\t");
}
Console.WriteLine();
}
}
}
}
Important! Parameter IMEX=1 is very important. If you remove it you will have empty values cell. This problem is described in article http://support.microsoft.com/kb/194124/EN-US/.
Author:
Pavel
Published:
April 22, 2008 3:05:51 PM
Tags:
NET, Excel, OLE
How to find the list of reports from MS SQL Report Service?
As first step you should add reference to ReportService2005.asmx:
Now you can use ReportingService2005 class:
ReportingService2005 reportService = new ReportingService2005();
// Fill credentials and URL
reportService.Credentials = new NetworkCredential("PVA", "123");
reportService.Url = "http://eprusarw0229t1/ReportServer/ReportService2005.asmx";
// Get items from report folder
string reportRoot = "/MedPoint";
CatalogItem[] catalogItems = reportService.ListChildren(reportRoot, false);
// Select only reports and add it to dropdown
foreach (CatalogItem item in catalogItems)
{
if (item.Type == ItemTypeEnum.Report)
ddReportList.Items.Add(item.Name);
}
// Get parameters of first report
if (ddReportList.Items.Count > 0)
{
string reportPath = reportRoot + "/" + ddReportList.Items[0];
ReportParameter[] parametersArray = reportService.GetReportParameters(reportPath, null, false, null, null);
foreach(ReportParameter parameter in parametersArray)
{
ddReportParameters.Items.Add(parameter.Name);
}
}
Author:
Pavel
Published:
April 16, 2008 2:32:45 PM
Tags:
SQL, MS
Facebook, REST, NetBeans and Me
I had an interesting day last Friday. In the morning I've just read that NetBeans 6.1 RC1 is available for download. I downloaded the full pack and installed it, then I browsed around the new features I've never installed before and I saw that the useful WebService-s catalog is back, with many new entries.
During this time I heard the talks behind me. Two friend of mine were chosen to be pioneer on the field of writing a Facebook web client application. They started from almost nothing just a quick googling on the available API-s and samples. Well, I can imagine that starting a new project and getting the required resources set up and ready is not that easy. So Ii just listened them downloading the newest Tomcat and installing it, then bind it with their project. It took one hour or so to set up everything (including libraries) and they started to work with Facebook. Then came several try and fail discussion behind me about RESTful WebServices and Facebook API, it went on till early afternoon, when I their problem draw my attention.
It just popped in my mind that I've just seen Facebook among popular WebServices in NetBeans, so I gave it a try. I'm not a power user of that part of NetBeans, still it required about an hour work to create some Web Application which was printing out some Facebook info on the a page.
Now, I can do it much faster, about one or two minutes, from the scratch. I'm going to show how it is done in a new blog entry soon.
Author:
Doki
Published:
April 12, 2008 2:50:24 PM
Tags:
NetBeans, facebook, REST
ASP.NET Dynamic Data Preview Available
A few months ago we released an ASP.NET 3.5 Extensions Preview that contained a bunch of new features that will be shipping later this year (including ASP.NET AJAX Improvements, ASP.NET MVC, ASP.NET Silverlight Support, and ASP.NET Dynamic Data).
The ASP.NET Dynamic Data support within that preview provided a first look at a cool new feature that enables you to quickly build data driven web-sites that work against a LINQ to SQL or LINQ to Entities object model. ASP.NET Dynamic Data allows you to automatically render fully functional data entry and reporting pages that are dynamically constructed from your ORM data model meta-data. In addition to supporting a dynamic rendering mode, it also allows you to optionally override and customize any of the view templates using any HTML or code you want (given you full control of the experience).
Introduction to ASP.NET Dynamic Data
ASP.NET Dynamic Data is a powerful new feature that provides two significant usability improvements to working with data controls in ASP.NET Web sites and Web applications.
The first improvement is for existing applications that use DetailsView, FormView, GridView, or ListView controls. The DetailsView and GridView controls have been extended to display fields by using templates instead of by using hard-coded rules that are programmed in the controls. These templates are part of the project, and you can customize them to change their appearance or to specify what controls they use for rendering. This makes it very easy to make a change in one place that specifies how to present dates for editing, as one example. FormView and ListView controls can implement similar behavior by using a DynamicControl control in their templates and by specifying which field in the row to display. Dynamic Data will then automatically build the UI for these controls based on the templates that you specify.
The second improvement is that the controls look at the metadata for a LINQ to SQL or Entity Framework data model and provide automatic validation based on the model. For example, if a column in the database is limited to 50 characters, and if a column is marked as not nullable, a RequiredFieldValidator control is automatically enabled for the column. (The controls also automatically support data-model-level validation.) You can apply other metadata to take further control over display and validation.
http://weblogs.asp.net/scottgu/archive/2008/04/10/asp-net-dynamic-data-preview-available.aspx
Author:
Oleh
Published:
April 11, 2008 9:55:13 AM
Tags:
ASPNET, Dynamic, Data
Programming PMC from NetBeans 6.x
Well it's been a long time I've been blogging about NetBeans and PMC. Well I've been quite busy during the last months. I didn't give up NetBeans, PMC, Ubuntu and Glassfish works, but I'm working a bit specific areas that don't really worth to share.
I hear a number of attempts for integration PMC with Something. If it happens that any of you are using NetBeans the following NetBeans Modules can be really helpful in your work.
First you need to download the EPAM Update Center module in order be able to retrieve NetBeans plugins form EPAM's own Update Center.
Currently only one module is available on this update center:
Then you can easily add PMC EJB Libraries to your Project:
The best thing is that these libraries are regularly updated with PMC Updates and comes with sources and JavaDoc included which could be really helpful if you are just started to explore the PMC Open API.
Note: The newest package contains a sightly modified version of wlclient.jar. I took the jndi.properties from it so you can easily embed these libraries into another application server (see my previous post on this.).
Author:
Doki
Published:
March 27, 2008 2:56:09 PM
Tags:
PMC, NetBeans, EJB, WebLogic
What is CDP about? (or "will-you-promote-me-if-i'll-join-CDP")
Almost every day of my life I meet PMs and there is much the same list of topics for every dialogue. It is necessary to develop qualitative specification, it is necessary to manage the requirements, it is necessary to keep the team, it is necessary to install normal testing. And every time I hear the same: "you're lucky...", "well, then I should go to G.M. and tell the thing...", "oh, but I don't have credentials for it..."
And it is much of a surprise to hear the like as this is not a PM speaking. Those real PMs are quite different. So here are just few thoughts on what a real veteran PM is.
I do remember being crazy on those books about corsairs in my childhood. Louis Boussenard, Louis Zhakolio, Raphael Sabatini. With "Captain Blood's Odyssey" as my desk book and sir Henry Morgan being my true hero I dreamed of boarding, exploring and I saw gold of Santa-Maria just like I saw myself walking down the Pall-Moll with a black-pearl shining, that very pearl I had gotten in the raid on Marakaibo. And I was as desperate as anyone who feels like being born in a wrong time. I'm not the one meant for dull vegetating near the machine or keyboard. My destiny is to be a captain of a frigate. I'm the one to raise a pennant in the morning and to swap cannon shots near the shore of Haiti. I'm the one to be the first on the foe's galleon board with a cutlass in my hand and to jingle gold doubloons in the taverns of Tortugas! And I thought my time had elapsed beyond retrieve.
Then lively 90-s came. It was a time of boundless possibilities and courageous people. And that was a very dangerous time. I started trading on the market as purchasing merchandise then coming through borders and customs still alive and wealthy is much of a Caribbean adventure of the 16th century. And traders' vans were the brigantines of new corsairs in the vasts of CIS. And their captains were as different as corsairs of my favorite books. Yet honest or not, rough or refined, courageous or coward, foul or honorable all shared the same questions: to be a scoundrel or a hero, privateer or filibuster, how to get money and how to plan a new raid. But it's always up to you to decide who you are. - Blood or Isterling? A Person or a Scoundrel?
And then I understood: there is a place for real adventure in every century.
And the 21st century with its globalization, "blue collars" and exquisite swop of dibs from one pocket to another is still not an exception. There are many professions for those active and adventurous, those able to stay on the 16th century frigate's board: expropriation for bloodthirsty corsairs, trading for pitiless rats, realty trading for small and varmint polecats, project management for captains bloods. Many of corsairs have chosen project management today and have raised their pennants on the projects.
Besides, here are some more features that a person needs to have for being a sterling corsair's captain.
1. It should be unnaturally interesting for you to do your work. That's why a real Jedi usually starts with creation of new unique products or services. Recall the definition of the word "project": "a project is a unique set of relative action..." That's why I (and I emphasize: I) and some other colleagues have got into project management - you can do unique things in a unique way - it's a great way to salve your adventurism. You turn out a kind of modern Captain Cook. Project management is a way of self-expression for me.
2. You should appreciate your work as an essence of all your life. It means you should worry about it like a captain worries about his ship and take everything you do there accordingly.
3. It is necessary to have rights to punish and to reward and to do so to the full extent of your power. Did your employee save the project? Then you can give him not a bonus but a BONUS. Did he practically torpedo it? Just kick him out!
I try to get across this idea to my colleagues every time they come to complain to me of their life. I tell them about the pennant and the boarding (my favourite poster is: "Every build is the main one!")
And I am used to listening to the same phrases: "It's easy for you to tell such things, because you have possibilities!.." , or "you are lucky and you can decide everything by yourself!.."
And now attention, please! A question! How could it come out that I can decide everything by myself and I have credentials? Maybe someone-in-white came and told me: "Here are your credentials, you may decide everything by yourself"? You know, the credentials rarely fall from the sky (so rarely, that it's always somebody's other hand to catch them, due to Murphy's Law). You should fight hardly for the credentials and for the right to make decisions by yourself. You should fight continuously. Every day. Five times an hour. And here is the main difference between real Jedi and common project administrator, who renews actuals in the plan of the project. True PM ENJOYS the process.
"And let the abyss' wide fill you with no hopelessness and fear but with the ecstasy of abyss and with stern comprehension of the bridge having to be projected without slackness."
Stop nagging! Nobody will give you anything: either credentials, or the right to make decisions, or money. Realize this fact. And, damn, start moving! Be a master of your life, it doesnt matter are you working as PM or as Architect. You probably already got my point... :)
So the simple answer to question "will-you-promote-me-if-i'll-join-CDP" is "no, its not the goal". We don't build program to promote you. We have program that gives you knowledge and skill sufficient to get your promotion - by putting pressure, experience, knowledge, experts & additional work on you. Do you understand? We don't plan to give you anything. But we educate you to give you chance. It will cost you work, time, blood, pressure. But's it's the price of your chance. Everything, everywhere. Remember it and start enjoing.
Author:
Denis
Published:
March 26, 2008 8:15:47 PM
Tags:
CDP