Search Results

Search found 12 results on 1 pages for 'shamal karunarathne'.

Page 1/1 | 1 

  • Why write clean, refactored code?

    - by Shamal Karunarathne
    Hi programming lovers, This is a question I've been asking myself for a long time. Thought of throwing out it to you. From my experience of working on several Java based projects, I've seen tons of codes which we call 'dirty'. The unconventional class/method/field naming, wrong way of handling of exceptions, unnecessarily heavy loops and recursion etc. But the code gives the intended results. Though I hate to see dirty code, it's time taking to clean them up and eventually comes the question of "is it worth? it's giving the desired results so what's the point of cleaning?" In team projects, should there be someone specifically to refactor and check for clean code? Or are there situations where the 'dirty' codes fail to give intended results or make the customers unhappy? Do feel free to comment and reply. And tell me if I'm missing something here. Thanks.

    Read the article

  • BlazeDS rejected connection from some IP address

    - by Shamal Karunarathne
    Hi, I'm using the BlazeDS binary version with Apache tomcat 6.0. And it seems there's a developer mode active and it only allows 3 IPs to connect to the application (Server). This is what the log says: [BlazeDS]MessageBroker '__default__' rejected connection from address 'xxx.xxx.xx.x'; Developer mode addresses already in use: xxx.x.xxx.xx, xxx.xxx.xxx.xxx, xx.xxx.xxx.xx (IP addresses are masked with 'x' for privacy) I have not added any special configuration to make developer mode active. I couldn't find any resources related to this scenario either. Please help. Thanks in Advance.

    Read the article

  • Draw a rectangle using Winforms

    - by C. Karunarathne
    Can I draw a rectangle with mouseClick?My code is not working so far.Can you help me? private void panel1_MouseClick(object sender, MouseEventArgs e) { Graphics g = this.CreateGraphics(); Pen pen = new Pen(Color.Black, 2); g.DrawRectangle(pen, 100,100, 100, 200); }

    Read the article

  • Delete rectangle using c#?

    - by C. Karunarathne
    Can I delete the old rectangle which I have drawn and draw a new rectangle? private void panel1_MouseClick(object sender, MouseEventArgs e) { Graphics g = this.panel1.CreateGraphics(); Pen pen = new Pen(Color.Black, 2); g.DrawRectangle(pen, 100,100, 100, 200); g.dispose(); }

    Read the article

  • Delete rectangle using .NET?

    - by C. Karunarathne
    Can I delete the old rectangle which I have drawn and draw a new rectangle? private void panel1_MouseClick(object sender, MouseEventArgs e) { Graphics g = this.panel1.CreateGraphics(); Pen pen = new Pen(Color.Black, 2); g.DrawRectangle(pen, 100,100, 100, 200); g.dispose(); }

    Read the article

  • Move controls when Drag and drop on panel in C#

    - by C. Karunarathne
    I want to drag controls on panel and when dragging I want to move the control and get its location to drop on to panel.I have tried out mouseUp,mouseDown,MouseMove events of control.But that is not what I am looking for.I want to fire DragDrop event on panel and move control.Can I do this?If you can give me an idea it will be great.Thank you

    Read the article

  • Change the size of the panel dynamically

    - by C. Karunarathne
    Hi! I am implementing an application that needs to drag and drop image boxes in a panel.Image boxes are added dynamically from the program and so I have set the autoscroll property to true in panel.But when I have drag out the boxes at bottom in the panel the panel size got reduced.I have put autosize property false in panel.The panel is docked in another panel.I want to set the size of panel at run time.How can I achieve this. public form1(int[,] dummy, int columnSize, int rowSize) { this.dummy= dummy; numOfColumns = columnSize; numOfRows = rowSize; getData(); addIds = addIdArray; data = mylist; InitializeComponent(); //panel1.MinimumSize = new Size(columnSize * 40, rowSize * 40); //panel1.Height = rowSize * 40; //panel1.Width = columnSize * 40; //panel4.Height = rowSize * 40; //panel4.Width = columnSize * 40; int x, y; Structures.EmptyRectSpace space = new Structures.EmptyRectSpace(); for (int i = 0; i < data.Count; i++)// set picture boxes { space = (Structures.EmptyRectSpace)data[i]; x = space.startingJ; y = space.startingI; int h, w; h = space.length; w = space.width; p = new PictureBox(); p.Width = w * 40; p.Height = h * 40; p.BackColor = Color.DarkGreen; p.Image = Properties.Resources.v; p.BorderStyle = BorderStyle.FixedSingle; p.Name = addIdArray[i].ToString(); p.Location = new Point((x + 1 - w) * 40, (y + 1 - h) * 40); this.panel1.Controls.Add(p); } foreach (Control c in this.panel1.Controls) { if (c is PictureBox) { c.MouseDown += new MouseEventHandler(pictureBox1_MouseDown); } } this.panel1.DragOver += new System.Windows.Forms.DragEventHandler(this.panel1_DragOver); panel1.DragOver += new DragEventHandler(panel1_DragOver); panel1.DragDrop += new DragEventHandler(panel1_DragDrop); panel1.AllowDrop = true; panel2.AllowDrop = true; foreach (Control c in this.panel2.Controls) { c.MouseDown += new MouseEventHandler(pictureBox1_MouseDown); } this.panel2.DragOver += new System.Windows.Forms.DragEventHandler(this.panel2_DragOver); panel2.DragOver += new DragEventHandler(panel2_DragOver); panel2.DragDrop += new DragEventHandler(panel2_DragDrop); } This is the constructor of the form that contained panel.When it loaded the picture boxes must be added to the panel and there drag drop events of panel are implemented. Please give me a helping hand..

    Read the article

  • Vacations on Rodrigues 2014

    And now something completely different compared to the usual technical or community related articles here on this blog. Yes, this time I'm writing some lines on my (and my family's) activities during our long weekend stay on Rodrigues. So, please bear with me, it's eventually a bit more personal... Grab a soda, some popcorn and a cosy place to continue to read. var googleAlbumLink = "https://plus.google.com/photos/117698191428446859536/albums/6047895311458281985"; //optional----------------------- var mySlideWidth = 580; var mySlideHeight = 340; var mySlideDelay = 7000; //delay in milliseconds Special promotions during school holidays Originally, our children started to ask more frequently about going on the plane again. Obviously, after their aunty from Germany was around during May, they were really eager to travel again. So, we decided that it might be a great opportunity to book some vacations during their school holidays. And just in time the local hotels and hotel groups started to advertise their special promotions for citizens and residents. After collecting multiple brochures over several days, we got attracted by various hotel packages on Rodrigues - most interestingly the expenses for the stay and flight ticket were less compared to other resorts here on the main island. As we have been to Rodrigues already back in 2008, we followed up on this idea and got in touch with a couple travel agencies. Well, I have to report that you should be really careful about the promotions from some of them. We had a very negative experience with Shamal Travel Agency in Quatre Bornes regarding their adverts and the actual price levels and age definition for children. Please, stay away from them if you are interested in transparent cost and services. Anyway, after some arrangements with two other close families we managed to confirm our stay at the Cotton Bay Hotel in Rodrigues. Given the fact that we already stayed there, and the hotel has been renovated recently, and it is under new management all looked very promising and relaxed for our vacation. Counting the days... As we already booked in July our children were counting down the days. And it got more interesting as soon as they were on school holidays finally. Well, the day arrived and waking them up at 2:30 hrs wasn't a problem after all. Quite the opposite it was fascinating for us parents to watch them waiting for the transport and later on during the airport transfer. Despite the early hours both didn't fall asleep and it was all so exciting. We are taking the plane! Well organised by the Cotton Bay Hotel Honestly, it was a breeze and a smooth ride during our stay at the hotel. From the airport transfer, the cleanliness of our bungalow, the organisation of our day trips, and the SPA - all very well and enjoyable. The children had great fun, and although it was a bit too windy to plunge into the pool they had a lot of fun with other activities on the beach and at the Kid's Club. Oh, and we had our private petting zoo with cows, sheep and goats just close to the terrace. Some of us went to check out the SPA facilities and I have to admit that the services regarding Hammam and Sauna are better than at some other hotels in Mauritius. I don't know after how many months or years I was once again enjoying a very hot sauna. Little draw-back but nothing to worry about... There is no cold water or at least ice cubes to cool down the body, but hey there was a nice breeze coming over the hills. Some day trips to mention Based on a friend's recommendation we walked to a "restaurant" called Chez Solange & Robert. Hahaha, restaurant is widely stretched in this case, as we enjoyed a great BBQ with fresh lobster, whole fish, and pieces of chicken breast in an open cottage. Just some wooden structure covered with dried palm leaves on the roof - island feeling pure! The other day we went to the Giant Tortoise & Cave Reserve Francois Leguat to observe the giant Aldabra turtles and to visit the Grande Caverne. The biggest limestone cave on the island. Compared to our last visit this was a novelty after checking out the Caverne Partate. The formations of stalactites and stalagmites are very impressive and imaginative. Our guide had lots of funny terms and despite the low light conditions the kids had a great time wandering around on the narrow wooden paths and stairs. And last but not least, we decided to check out the Tyrodrig zip lines... Everyone was allowed to join the trip through the air, and our little ones stayed close to our field guides. But finally went on their own on the very last traversal. Puuuh, it was astounishing to glide over the valley, and for sure something to repeat next time. Impressions of our vacation on Rodrigues 2014   Next stay has been discussed already Oh yes, Rodrigues baby! We are going to come again! Tentative dates have been discussed already and now it's up to us to earn enough our next holiday on that wonderful remote piece of paradise. Eventually, a little bit longer than this time. We'll see...

    Read the article

1