Skip to main content

Posts

Showing posts from 2013

DevExpress C# Chart Tutorial

Hello , this blog post about Charting in DevExpress , I faced many problems I visited hundreds of pages to solve this problems , actually it was the first time I use DevExpress Charts, Work is not like school or university , in school if you don't know thing you can learn it any time you want , in work you have to do today task yesterday, I like to share my knowledge and skills with you , I hope this Post help you . // clear series on chart  chart.Series.Clear(); // clear Titles of chart chart.Titles.Clear(); // legend alignment  chart.Legend.AlignmentHorizontal = LegendAlignmentHorizontal.Center; chart.Legend.AlignmentVertical = LegendAlignmentVertical.Bottom; chart.Legend.Direction = LegendDirection.LeftToRight; // creating series // series view Type example Line DevExpress.XtraCharts.Series series = new DevExpress.XtraCharts.Series("series name ", ViewType.Line); // add title  DevExpress.XtraCharts.ChartTitle chtTitle = new DevExpress.XtraCharts.Cha

C# Witting XML Document

Hi I'm Writing application , the application require a knowledge and skills in C# dotNet framework , I'll write my experience about C# XML .   XmlDocument xmlDoc = new XmlDocument(); // create xml document Object  XmlElement xmlRoot = xmlDoc.CreateElement("RootTag"); // create root tag  XmlElement Attributes = xmlDoc.CreateElement("Attributes"); // I create another tag called it  Attributes of course you can change it.   XmlElement element; // create reference for XML element     element = xmlDoc.CreateElement("child");   element.InnerText = "Hello World from Child";   Attributes.AppendChild(element); // append XML Element to parent node              XmlElement parameters =   xmlDoc.CreateElement("parameters");   for (int i = 0; i < 10; i++) { XmlElement node = xmlDoc.CreateElement(" parameter ");   node.SetAttribute("id", "value"); // adding attribute    node.SetAttribute(&quo

Writing One Dimensional Array as Image ( Java )

Welcome back ,I'm still writing the application from the last post, I founded that I must redraw the image to show the result , I faced Many problems while writing the Method write Image first the image was totally black which is not correct , I searched the web for a solution especially stack overflow site , I'm gonna tell you what I gain , I hope the post help you in shaa Allah . public void write_image(int[] image_1d, int width, int height) throws IOException {            WritableRaster raster= Raster.createWritableRaster         (new PixelInterleavedSampleModel(0, width,height, 1,          1920,new int[] {0}), new Point(0,0));         int k =0 ;         for(int i = 0 ; i < width ; i++ )          {          for(int j = 0 ; j < height ; j++)          {              raster.setSample(i,j,0,image_1d[k]);              k++;          }          }         BufferedImage image =new BufferedImage(width,height,                                  BufferedImage.

Reading Image in 1 Dimensional Array

Hello , I'm writing an application and I need to write a method which can read an Image, I found it hard complicated in some times, I wrote a One and I'd like to share it with you note it is written with Java and it convert gray-scale images to binary 0-1 .  public int [] read_image_in_1d () throws IOException{         // array to be returned          int image_1d []= null ;         // File object to hold the destination          File f = new File("test.jpg");         // buffer for the Image          BufferedImage  image = ImageIO.read(f);         // raster to the image         Raster raster = image.getData();         // width          int width = raster.getWidth();         // height          int height = raster.getHeight();         // initialization for the Array          image_1d = new int[width * height];         int k = 0;         //get the image in the array         for(int i = 0 ; i < width ; i++)             for(int j = 0 ; j < height

Measuring Efficiency of Algorithms

Hello it is long time since last time I wrote a blog post , I'm Okay and passion to write more and more posts , I'll talk about measuring efficiency of Algorithms . there exist two approaches : using the Concept of bench mark we focus on two aspects : is the output of the program correct ? how much time and resources are needed by the program to produce the correct output? estimate ! DON'T MEASURE , and we will talk about this approach in details in the next sections.  discussing approach (bench mark) cost money , resources and time, it used for small problems or execution time relatively  small ,this push us - computer scientists not me of course - directly to find  a new way , estimation of execution time. we gonna use a new term " Asymptotic Analysis   ": Asymptotic analysis is an analytical approach to analyze the running time of the algorithms under the following assumptions  : the size of the input . estimating the number of steps r