tag:blogger.com,1999:blog-48803402387844551242024-03-05T21:31:41.294-08:00ගවේෂක - The ExplorerLahiru Dhananjayahttp://www.blogger.com/profile/04904665996384999048noreply@blogger.comBlogger31125tag:blogger.com,1999:blog-4880340238784455124.post-63075523221400431162023-09-12T19:44:00.006-07:002023-09-12T19:48:22.511-07:00AWS Backup Service<p><b>Creating a hourly scheduled backup</b></p><p>If you already using aws rds instances , you may face this issue when it comes to the production environments.</p><p>All database need a closest restore point if some disaster happens. But do we actually setup such as a hourly backup using current backup option ? No in AWS if you refer most of the instances only support up to daily backups.</p><p> Yes it is not having an option for a hourly backups. In this post I will give an solution for an alternative method by using an AWS service, AWS Backup.</p><p>First you need to identify your environments and actual customer base because you must have an idea of importance of protecting your data if there is some disaster or failure happens. </p><p>Let move with the original topic as how to over come with hourly backups. </p><p>To achieve this we have two optimal solutions</p><p><b><i>1.Use a lambda function,s3 and trigger an event to take a snapshot. Use may have to use AWS Event bridge(With event rules) or Scheduler (Recently introduced by AWS which is a cost effective way than event rules) - Old Way</i></b></p><p></p><ol style="text-align: left;"><li>Create a lambda function and invoke it hourly via scheduler or event rule</li><li>Update the lambda implementation to trigger the backup and save to a s3 bucket</li></ol><p></p><p>Here I am not going to talk with the implementation as this purpose of the post is not about it.</p><p><b><i>2.Using AWS Backup Service inorder order achieve the given problem</i></b></p><p>Please refer the following steps to implement this approach</p><p></p><ol style="text-align: left;"><li>Create the cloudformation template</li><li>Deploy the resources</li><li>Monitor resources and backups with</li></ol><p></p><p>Using a CloudFormation template to create AWS Backup Service</p><div style="background-color: #1f1f1f; color: #cccccc; font-family: Consolas, "Courier New", monospace; line-height: 19px; white-space: pre;"><div><span style="font-size: xx-small;"><span style="color: #569cd6;">AWSTemplateFormatVersion</span>: 2010-09-09</span></div><div><span style="font-size: xx-small;"><span style="color: #569cd6;">Description</span>: <span style="color: #ce9178;">'RDS MySQL Backup Service'</span></span></div><div><span style="font-size: xx-small;"><span style="color: #569cd6;">Parameters</span>: </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">CreatedBy</span>:</span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">Description</span>: <span style="color: #ce9178;">Who is creating the cloudformation stack</span></span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">Type</span>: <span style="color: #ce9178;">String</span></span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">Default</span>: <span style="color: #ce9178;">CodePipeline</span></span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">BackupPlanName</span>: </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">Description</span>: <span style="color: #ce9178;">Enter the name of the backup plan (Required)</span> </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">Type</span>: <span style="color: #ce9178;">String</span> </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">Default</span>: <span style="color: #ce9178;">"hourly-backup"</span></span></div><div><span style="font-size: xx-small;"> </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">CronExpression</span>: </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">Description</span>: <span style="color: #ce9178;">Enter the cron expression for your backup plan (Required). Currently setup to occur hourly.</span> </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">Type</span>: <span style="color: #ce9178;">String</span> </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">Default</span>: <span style="color: #ce9178;">"cron(0 * ? * * *)"</span> </span></div><div><span style="font-size: xx-small;"> </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">Retention</span>: </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">Description</span>: <span style="color: #ce9178;">This value will identify how many days your backup will be expired after (Required)</span> </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">Type</span>: <span style="color: #ce9178;">String</span> </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">Default</span>: <span style="color: #b5cea8;">3</span> </span></div><div><span style="font-size: xx-small;"> </span></div><div><span style="font-size: xx-small;"><span style="color: #569cd6;">Metadata</span>: </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">AWS::CloudFormation::Interface</span>: </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">ParameterGroups</span>: </span></div><div><span style="font-size: xx-small;"> - </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">Label</span>: </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">default</span>: <span style="color: #ce9178;">BackupPlan Configurations (Mandatory)</span> </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">Parameters</span>: </span></div><div><span style="font-size: xx-small;"> - <span style="color: #ce9178;">BackupPlanName</span> </span></div><div><span style="font-size: xx-small;"> - </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">Label</span>: </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">default</span>: <span style="color: #ce9178;">Backup Rule configuration</span> </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">Parameters</span>: </span></div><div><span style="font-size: xx-small;"> - <span style="color: #ce9178;">CronExpression</span> </span></div><div><span style="font-size: xx-small;"> - <span style="color: #ce9178;">Retention</span> </span></div><div><span style="font-size: xx-small;"><span style="color: #569cd6;">Resources</span>: </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">BackupVault</span>: </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">Type</span>: <span style="color: #ce9178;">"AWS::Backup::BackupVault"</span> </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">Properties</span>: </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">BackupVaultName</span>: <span style="color: #569cd6;">!Sub</span> <span style="color: #ce9178;">${BackupPlanName}-vault</span> </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">AccessPolicy</span>: </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">Version</span>: <span style="color: #ce9178;">'2012-10-17'</span> </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">Statement</span>: </span></div><div><span style="font-size: xx-small;"> - </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">Sid</span>: <span style="color: #ce9178;">'Vault-Access-Policy'</span> </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">Effect</span>: <span style="color: #ce9178;">Deny</span> </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">Principal</span>: <span style="color: #ce9178;">"*"</span> </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">Action</span>: <span style="color: #ce9178;">"backup:DeleteRecoveryPoint"</span> </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">Resource</span>: </span></div><div><span style="font-size: xx-small;"> - <span style="color: #ce9178;">"*"</span> </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">BackupPlan</span>: </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">Type</span>: <span style="color: #ce9178;">"AWS::Backup::BackupPlan"</span> </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">Properties</span>: </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">BackupPlan</span>: </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">BackupPlanName</span>: <span style="color: #569cd6;">!Ref</span> <span style="color: #ce9178;">BackupPlanName</span> </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">BackupPlanRule</span>: </span></div><div><span style="font-size: xx-small;"> - </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">RuleName</span>: <span style="color: #569cd6;">!Sub</span> <span style="color: #ce9178;">${BackupPlanName}-rule</span> </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">TargetBackupVault</span>: <span style="color: #569cd6;">!Ref</span> <span style="color: #ce9178;">BackupVault</span> </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">ScheduleExpression</span>: <span style="color: #569cd6;">!Ref</span> <span style="color: #ce9178;">CronExpression</span> </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">Lifecycle</span>: </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">DeleteAfterDays</span>: <span style="color: #569cd6;">!Ref</span> <span style="color: #ce9178;">Retention</span> </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">StartWindowMinutes</span>: <span style="color: #b5cea8;">60</span></span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">CompletionWindowMinutes</span>: <span style="color: #b5cea8;">120</span></span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">DependsOn</span>: <span style="color: #ce9178;">BackupVault</span> </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">TagBasedBackupSelection</span>:</span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">Type</span>: <span style="color: #ce9178;">"AWS::Backup::BackupSelection"</span></span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">Properties</span>:</span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">BackupSelection</span>:</span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">SelectionName</span>: <span style="color: #569cd6;">!Sub</span> <span style="color: #ce9178;">${BackupPlanName}-job-assignment</span> </span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">IamRoleArn</span>: <span style="color: #569cd6;">!Sub</span> <span style="color: #ce9178;">"arn:aws:iam::${AWS::AccountId}:role/service-role/AWSBackupDefaultServiceRole"</span></span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">ListOfTags</span>:</span></div><div><span style="font-size: xx-small;"> -</span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">ConditionType</span>: <span style="color: #ce9178;">"STRINGEQUALS"</span></span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">ConditionKey</span>: <span style="color: #ce9178;">"aws:cloudformation:stack-name"</span></span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">ConditionValue</span>: <span style="color: #569cd6;">!Sub</span> <span style="color: #ce9178;">"rds"</span></span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">BackupPlanId</span>: <span style="color: #569cd6;">!Ref</span> <span style="color: #ce9178;">BackupPlan</span></span></div><div><span style="font-size: xx-small;"> <span style="color: #569cd6;">DependsOn</span>: <span style="color: #ce9178;">BackupPlan</span></span></div><span style="font-size: 14px;"><br /></span></div><div class="separator" style="clear: both;"><br /></div><div class="separator" style="clear: both;">Make sure you update your CloudFormation execution role with below permissions.</div><div class="separator" style="clear: both;"><br /></div><div class="separator" style="clear: both; text-align: center;"><div style="background-color: #1f1f1f; color: #cccccc; font-family: Consolas, "Courier New", monospace; font-size: 14px; line-height: 19px; white-space: pre;"><div style="text-align: left;"> {</div><div style="text-align: left;"> <span style="color: #ce9178;">"Action"</span>: [</div><div style="text-align: left;"> <span style="color: #ce9178;">"backup:*"</span></div><div style="text-align: left;"> ],</div><div style="text-align: left;"> <span style="color: #ce9178;">"Resource"</span>: <span style="color: #ce9178;">"*"</span>,</div><div style="text-align: left;"> <span style="color: #ce9178;">"Effect"</span>: <span style="color: #ce9178;">"Allow"</span>,</div><div style="text-align: left;"> <span style="color: #ce9178;">"Sid"</span>: <span style="color: #ce9178;">"backup"</span></div><div style="text-align: left;"> },</div><div style="text-align: left;"> {</div><div style="text-align: left;"> <span style="color: #ce9178;">"Action"</span>: [</div><div style="text-align: left;"> <span style="color: #ce9178;">"kms:*"</span></div><div style="text-align: left;"> ],</div><div style="text-align: left;"> <span style="color: #ce9178;">"Resource"</span>: <span style="color: #ce9178;">"*"</span>,</div><div style="text-align: left;"> <span style="color: #ce9178;">"Effect"</span>: <span style="color: #ce9178;">"Allow"</span>,</div><div style="text-align: left;"> <span style="color: #ce9178;">"Sid"</span>: <span style="color: #ce9178;">"kms"</span></div><div style="text-align: left;"> },</div><div style="text-align: left;"> {</div><div style="text-align: left;"> <span style="color: #ce9178;">"Action"</span>: [</div><div style="text-align: left;"> <span style="color: #ce9178;">"backup-storage:*"</span></div><div style="text-align: left;"> ],</div><div style="text-align: left;"> <span style="color: #ce9178;">"Resource"</span>: <span style="color: #ce9178;">"*"</span>,</div><div style="text-align: left;"> <span style="color: #ce9178;">"Effect"</span>: <span style="color: #ce9178;">"Allow"</span>,</div><div style="text-align: left;"> <span style="color: #ce9178;">"Sid"</span>: <span style="color: #ce9178;">"backupstorage"</span></div><div style="text-align: left;"> }</div><div><br /></div></div></div><p><b></b></p><div class="separator" style="clear: both; text-align: center;"><b><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisTjY-KkPPponZGFtf7nY8oh9T17b-dhWWOspvXnCSSJYjumOtSA4XdpdJy-JebSMkaXUHC84sAhinpKf_ZG2Wx-COSHp0NBlcs3I8DZqQc1JnIkHYMEeAB49cfsZ5fhpAiDbLIVNaJZwjY5JwhQlU5AEp-cgVmI5TwXH7k7_a5MridiBavr9A_MUsMV5R/s2670/Screenshot%202023-09-13%20at%2011.36.32.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1452" data-original-width="2670" height="217" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisTjY-KkPPponZGFtf7nY8oh9T17b-dhWWOspvXnCSSJYjumOtSA4XdpdJy-JebSMkaXUHC84sAhinpKf_ZG2Wx-COSHp0NBlcs3I8DZqQc1JnIkHYMEeAB49cfsZ5fhpAiDbLIVNaJZwjY5JwhQlU5AEp-cgVmI5TwXH7k7_a5MridiBavr9A_MUsMV5R/w400-h217/Screenshot%202023-09-13%20at%2011.36.32.png" width="400" /></a></b></div><b><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixQ-SqZcHNmCXBUhSUCYWaZMKsVzlusT4lPCwaby67RxmCT2VZajes1sQREEdbWEAXO2YCmn1_1u5PMvTL-EFUOdMaEsBs8Bjg1FuJ40GUBHuYqyyYtFAHy6YI331um1PeRuTEftWH3gy4gW556sVTfAFXbDo5q0TTgSeEJEprZ4VZ_Tlud9HztJCd5xRi/s2658/Screenshot%202023-09-13%20at%2011.39.10.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1252" data-original-width="2658" height="189" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixQ-SqZcHNmCXBUhSUCYWaZMKsVzlusT4lPCwaby67RxmCT2VZajes1sQREEdbWEAXO2YCmn1_1u5PMvTL-EFUOdMaEsBs8Bjg1FuJ40GUBHuYqyyYtFAHy6YI331um1PeRuTEftWH3gy4gW556sVTfAFXbDo5q0TTgSeEJEprZ4VZ_Tlud9HztJCd5xRi/w400-h189/Screenshot%202023-09-13%20at%2011.39.10.png" width="400" /></a></div><br /><div class="separator" style="clear: both; text-align: center;"><br /></div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfnua6NhosIvZ7Nj2i4b8Gf5mC0PqHIJnn7NljtuOpDK9BTqqA6IJ5r7JOxyOJ3wIn9L-TJ3fRuu0gYymmqzxlgqAZr-1F43EW56C2vISyFsD4tdxls8f4bdPA8RZqBvWmWb56dRYQ53wwa9CVhu41oolb7cxDx8R4QQfGVKS5401RiErhmkJ0yZbPCSWt/s2650/Screenshot%202023-09-13%20at%2011.40.41.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="754" data-original-width="2650" height="114" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfnua6NhosIvZ7Nj2i4b8Gf5mC0PqHIJnn7NljtuOpDK9BTqqA6IJ5r7JOxyOJ3wIn9L-TJ3fRuu0gYymmqzxlgqAZr-1F43EW56C2vISyFsD4tdxls8f4bdPA8RZqBvWmWb56dRYQ53wwa9CVhu41oolb7cxDx8R4QQfGVKS5401RiErhmkJ0yZbPCSWt/w400-h114/Screenshot%202023-09-13%20at%2011.40.41.png" width="400" /></a></div><br /><i><br /></i></b><p></p><p><br /></p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZlnEzVRdBTuagHDiY7HnK8LUCktl_wokDmZDUefEQS4aKDQU-gU35hy43jCIIU-vDx_pNTB63b3zZ-QCevg0UWSXRZlMrFmnJQUNZvsGYZ32bJpME2VClcqg8rmXHEppUdwEr-ADidmISORGI-C_DBQg64FFQb-MSDnvMbpvzoxcQhIgjbbMLkjAyHNGV/s1856/Screenshot%202023-09-13%20112025.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="835" data-original-width="1856" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZlnEzVRdBTuagHDiY7HnK8LUCktl_wokDmZDUefEQS4aKDQU-gU35hy43jCIIU-vDx_pNTB63b3zZ-QCevg0UWSXRZlMrFmnJQUNZvsGYZ32bJpME2VClcqg8rmXHEppUdwEr-ADidmISORGI-C_DBQg64FFQb-MSDnvMbpvzoxcQhIgjbbMLkjAyHNGV/w400-h180/Screenshot%202023-09-13%20112025.png" width="400" /></a></div><br /><div class="separator" style="clear: both; text-align: center;"><div class="separator" style="clear: both; text-align: left;">Backup vault: A container for storing backups. Backup vaults are created in AWS Regions and can be used to store backups of AWS resources from multiple accounts.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">Backup plan: A set of instructions that defines how backups are created and stored. Backup plans can be used to automate the backup process and ensure that backups are created on a regular basis.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">Recovery point: A snapshot of a resource that can be used to restore the resource to a previous state. Recovery points are created by backup plans and stored in backup vaults.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">Resource assignment/backup selection: A set of instructions that defines which resources should be backed up. Resource assignments can be used to back up specific resources or groups of resources.</div></div><br />You may refer following links for more information and get familiarize with the available features.<p></p><p>-Backup plan</p><p><a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/API_BackupPlan.html">https://docs.aws.amazon.com/aws-backup/latest/devguide/API_BackupPlan.html</a></p><p><a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/creating-a-backup-plan.html">https://docs.aws.amazon.com/aws-backup/latest/devguide/creating-a-backup-plan.html</a></p><p>-Backup vault</p><p><a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/vaults.html">https://docs.aws.amazon.com/aws-backup/latest/devguide/vaults.html</a></p><p>-Backup rule</p><p><a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/API_BackupRule.html">https://docs.aws.amazon.com/aws-backup/latest/devguide/API_BackupRule.html</a></p><p>-Backup Assignee/Selection</p><p><a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/API_BackupSelection.html">https://docs.aws.amazon.com/aws-backup/latest/devguide/API_BackupSelection.html</a></p><p>-Backup Vault</p><p><a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-backup-backupvault.html">https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-backup-backupvault.html</a></p><p><br /></p><p>Visual Design of our Backup</p><p><b></b></p><p></p><p></p><p></p><div class="separator" style="clear: both; text-align: center;"><b><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrb0EdAMx7nC1QAOEnWXLcOPhxAGZIVqfkf0nRX4Nn6HMrKQkh4RIAhVabpUwGBrHtZlCk8eibA766RKqVT2Bny2cgektiwOy_ziIi4wxJEa89pmSD3fEEb8U5wwMkwt5ItyUcVNHl7sjmwVGelEnc1JydAufkWAGLFcMbsqKepoVsGGUqYkm2230pvzP0/s869/new-designer.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="644" data-original-width="869" height="296" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrb0EdAMx7nC1QAOEnWXLcOPhxAGZIVqfkf0nRX4Nn6HMrKQkh4RIAhVabpUwGBrHtZlCk8eibA766RKqVT2Bny2cgektiwOy_ziIi4wxJEa89pmSD3fEEb8U5wwMkwt5ItyUcVNHl7sjmwVGelEnc1JydAufkWAGLFcMbsqKepoVsGGUqYkm2230pvzP0/w400-h296/new-designer.png" style="cursor: move;" width="400" /></a></b></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><br /></div><p><b>Snapshots vs Continuous backups</b></p><p>When you doing deployment and getting backups you will get a question about doing a comparison with backup types. Because there are several options and selections are vary.</p><p>You can get more information by following below link</p><p><a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/integrate-cloudformation-with-aws-backup.html">https://docs.aws.amazon.com/aws-backup/latest/devguide/integrate-cloudformation-with-aws-backup.html</a></p><p><a href="https://www.nucleustechnologies.com/blog/aws-snapshot-vs-backup/">https://www.nucleustechnologies.com/blog/aws-snapshot-vs-backup/</a></p><p>References</p><p>Pricing - <a href="https://aws.amazon.com/backup/pricing/" target="_blank">https://aws.amazon.com/backup/pricing/</a></p><p><a href="https://www.druva.com/documents/pf/white-papers/8-tips-to-simplify-aws-backup-and-recovery.pdf">https://www.druva.com/documents/pf/white-papers/8-tips-to-simplify-aws-backup-and-recovery.pdf</a></p><p><br /></p><p><br /></p>Lahiru Dhananjayahttp://www.blogger.com/profile/04904665996384999048noreply@blogger.com0tag:blogger.com,1999:blog-4880340238784455124.post-87215939995219900042023-08-02T18:15:00.002-07:002023-08-02T18:15:18.965-07:00Static Web hosting with Azure + Angular + Github + DNS<p>We are going to setup an Angular static web site in Azure using Github. The domain provider is a separate vendor. Follow the easy steps to do the things.</p><p></p><ol style="text-align: left;"><li>Install Angular and write you basic app</li><li>Commit the changes to github repo</li><li>Create an Azure account if you don't have and enable free subscription(Trial) </li><li>Create a static web app in Azure</li><ol><li>Create a new Resource Group</li><li>Set Deployment details as GitHub</li><li>Attach your Github Account and give the repo and branch details</li><li>Review and Create</li><li>Once you saved GitHub Action will start to run and deploy the latest code in the selection branch (Sometimes this may failed as you don't have the build folder in the angular project path.So please create in this error occurred).</li></ol></ol><div><span> </span><span> </span><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8o62WASr1E6lxL3DLB-7u9ozH01PfhnJzgl1X0FF5NZae9LeEz60uXCp-IYDftJfQP8SgCC_RVmeIg1qhOXncR_Q52IN3622L5wpqQRGa4T-4cIG_gUGMT4iG5HLj8LhVWnA5NYT2oAc748LpoA1us34reiOHZqc1nz508Am7d8M-L_QBcAURN80ZsWxJ/s958/Screenshot%202023-08-03%20at%209.53.23.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="958" data-original-width="834" height="509" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8o62WASr1E6lxL3DLB-7u9ozH01PfhnJzgl1X0FF5NZae9LeEz60uXCp-IYDftJfQP8SgCC_RVmeIg1qhOXncR_Q52IN3622L5wpqQRGa4T-4cIG_gUGMT4iG5HLj8LhVWnA5NYT2oAc748LpoA1us34reiOHZqc1nz508Am7d8M-L_QBcAURN80ZsWxJ/w444-h509/Screenshot%202023-08-03%20at%209.53.23.png" width="444" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_IZCdl-FSWGYly8siaoOrfGWdF1BKWaqoA4vxbLMAd3nPEhW-LCiaBcgCRVhecAd7lR-4ojCzYaM_DrAJlqUiDgH95OHrdipIrO8ALzPP7KfM5Ujt4M0LfanqdzAxfFY4Rcgo6U8TXrdBrv4YU_lzYWztRsYsJ-4BFQ9m2MdrcIFamdzab4Jz2JOk_THs/s1640/Screenshot%202023-08-03%20at%209.58.57.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="497" data-original-width="1640" height="154" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_IZCdl-FSWGYly8siaoOrfGWdF1BKWaqoA4vxbLMAd3nPEhW-LCiaBcgCRVhecAd7lR-4ojCzYaM_DrAJlqUiDgH95OHrdipIrO8ALzPP7KfM5Ujt4M0LfanqdzAxfFY4Rcgo6U8TXrdBrv4YU_lzYWztRsYsJ-4BFQ9m2MdrcIFamdzab4Jz2JOk_THs/w508-h154/Screenshot%202023-08-03%20at%209.58.57.png" width="508" /></a></div><br /><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: left;">5. Now you have almost complete with the deployment. Next you have to link with the domain which you already purchased.</div><div class="separator" style="clear: both; text-align: left;"><span> </span><br /></div><div class="separator" style="clear: both; text-align: left;"><span>6. Go to the static web app custom domain and get the alias. After that go to your domain provider and link with (You can use CNAME or A Record according to the type of t he domain).</span></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimG9aFFaAm6qQzSHWDLsDaY2ui1Tts3fg1lt248P_YGYmcew_fvnPJ-8jsl3HXbxSSJfyDzT9m_JqomWOxuZzjxLRwBEtq5Jy_phbSWqAvfPIPYWp0BDqVsT1ueaw2HMG1xmjBpoQQElyvRqDX9JdglhU7qHrIvOnYS4wdpAiLcbCTYZoAGvji98_CvzbK/s1900/Screenshot%202023-08-03%20at%2010.02.24.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="424" data-original-width="1900" height="143" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimG9aFFaAm6qQzSHWDLsDaY2ui1Tts3fg1lt248P_YGYmcew_fvnPJ-8jsl3HXbxSSJfyDzT9m_JqomWOxuZzjxLRwBEtq5Jy_phbSWqAvfPIPYWp0BDqVsT1ueaw2HMG1xmjBpoQQElyvRqDX9JdglhU7qHrIvOnYS4wdpAiLcbCTYZoAGvji98_CvzbK/w643-h143/Screenshot%202023-08-03%20at%2010.02.24.png" width="643" /></a></div><br /><div class="separator" style="clear: both; text-align: left;"><br /></div><p></p>Lahiru Dhananjayahttp://www.blogger.com/profile/04904665996384999048noreply@blogger.com0tag:blogger.com,1999:blog-4880340238784455124.post-14928124359747886482023-08-02T17:40:00.001-07:002023-08-02T17:40:08.678-07:00Enable SSL in Your Angular App to resolve most of native OS issues (IOS/Android)<p><br /></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhG7UshhkWn9PBJjt5InjhXKuv7b2AnuBso382jGcbl4iBH60Q6WfNTgq-htRjF52MMQzenznxGulnDNAJ1YP0FOF3svcBUpWRM-zM-NojLEPEMbP7Tw_9IANMQECFzjl9pIVX7iMnRiZHCtkymo9nBcREk1vw1t4W_vshXzTiRCbJbXWqsmkUl93zXYl7T/s1080/Linode-Install-SSL-Certificate.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1080" data-original-width="1080" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhG7UshhkWn9PBJjt5InjhXKuv7b2AnuBso382jGcbl4iBH60Q6WfNTgq-htRjF52MMQzenznxGulnDNAJ1YP0FOF3svcBUpWRM-zM-NojLEPEMbP7Tw_9IANMQECFzjl9pIVX7iMnRiZHCtkymo9nBcREk1vw1t4W_vshXzTiRCbJbXWqsmkUl93zXYl7T/s320/Linode-Install-SSL-Certificate.png" width="320" /></a></div><br /><p><br /></p><p>Today we are talking about an issue which is more painful to developers when we are doing the deployments to outside of localhost(To your local ip address with a port) in Angular.</p><p><br /></p><p>If you are targeting IOS/Android operating system to launch you angular app, this will probably a good tip.</p><p>Enable SSL in your angular app by using a certificate. Create below file and keep inside your folder path and name it as <b>certificate.cnf</b>.</p><p><b>[req]</b></p><p><b>default_bits = 2048</b></p><p><b>prompt = no</b></p><p><b>default_md = sha256</b></p><p><b>x509_extensions = v3_req</b></p><p><b>distinguished_name = dn</b></p><p><b><br /></b></p><p><b><br /></b></p><p><b>[dn]</b></p><p><b>C = BE</b></p><p><b>ST = digem</b></p><p><b>L = brussels</b></p><p><b>O = EY</b></p><p><b>OU = PAS</b></p><p><b>emailAddress = lahiru.dhananjaya@randomsoftware.net</b></p><p><b>CN = <serving address></b></p><p><b><br /></b></p><p><b><br /></b></p><p><b>[v3_req]</b></p><p><b>subjectAltName = @alt_names</b></p><p><b><br /></b></p><p><b><br /></b></p><p><b>[alt_names]</b></p><p><b>DNS.1 = <serving address></b></p><p><br /></p><p>Then you have to run this command to create the certificate in your terminal.</p><p><b>openssl req -new -x509 -newkey rsa:2048 -sha256 -nodes -keyout localhost-remote.key -days 3560 -out localhost-remote.crt -config certificate.cnf</b></p><p class="p1" style="font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size: 11px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variation-settings: normal; line-height: normal; margin: 0px;"><span class="s1" style="font-variant-ligatures: no-common-ligatures;"><br /></span></p><p class="p1" style="font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size: 11px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variation-settings: normal; line-height: normal; margin: 0px;"><span style="font-family: Times; font-size: medium;">You can try below command in the terminal inside your angular project path</span></p><p class="p1" style="font-family: Menlo; font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-size: 11px; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variation-settings: normal; line-height: normal; margin: 0px;"><span style="font-family: Times; font-size: medium;"><br /></span></p><p class="p1" style="font-feature-settings: normal; font-kerning: auto; font-optical-sizing: auto; font-stretch: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-variation-settings: normal; line-height: normal; margin: 0px;"><b>ng serve --host 192.168.x.x --port 4200 </b><span style="color: var(--highlight-color); font-family: inherit; font-size: var(--_pr-code-fs); font-style: inherit; font-variant-caps: inherit; font-variant-ligatures: inherit; white-space: inherit;"><b>--ssl --ssl-key <key-path> --ssl-cert <cert-path></b></span></p><p>or you can add this to .angular-cli.json</p><p><b>{</b></p><p><b> "$schema": "./node_modules/@angular/cli/lib/config/schema.json",</b></p><p><b> "defaults": {</b></p><p><b> "serve": {</b></p><p><b> "sslKey": "<relative path from .angular-cli.json>/server.key",</b></p><p><b> "sslCert": "<relative path from .angular-cli.json>/server.crt",</b></p><p><b> ...</b></p><p><b> }, ...</b></p><p><b> }, ...</b></p><p><b>}</b></p><p><b><br /></b></p><p>After following the steps , you will get the change to smoothly use https over your ip and do debugging easily.This will enable most native features which Chrome/Safari has (Such as settings for the page camera etc)</p>Lahiru Dhananjayahttp://www.blogger.com/profile/04904665996384999048noreply@blogger.com0tag:blogger.com,1999:blog-4880340238784455124.post-67361425344052989252023-06-07T21:50:00.001-07:002023-06-07T21:51:12.548-07:00Play with Git SQUASH<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNcglyNh_a_6ix_0T4jqudQTmNWwotC-2ZPuvy75v_TQavuFTcvTgOM9Y8seEdpVKOmvtO3jFCLUOTFWpsCmCnhbfJX7IMGXY3W8FRURe1QpXps3ilO9FoAR8ulCfUUcM8CUfsmORNxrvaQROC8CljS6I0rpg2zvkI8oNuKGxel7iX4XuJKxNQG2W4ng/s571/Screenshot%202023-06-08%20134927.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="287" data-original-width="571" height="161" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNcglyNh_a_6ix_0T4jqudQTmNWwotC-2ZPuvy75v_TQavuFTcvTgOM9Y8seEdpVKOmvtO3jFCLUOTFWpsCmCnhbfJX7IMGXY3W8FRURe1QpXps3ilO9FoAR8ulCfUUcM8CUfsmORNxrvaQROC8CljS6I0rpg2zvkI8oNuKGxel7iX4XuJKxNQG2W4ng/s320/Screenshot%202023-06-08%20134927.jpg" width="320" /></a></div><br /><p><br /></p><p>Git squash refers to the act of merging multiple commits into a single one. This can be accomplished using Git's "Interactive Rebase" feature, which allows you to perform this action at any given moment. Squashing commits is typically performed when merging branches.</p><p>Below are the syntaxes when you perform squash in the git branch</p><p></p><ol style="text-align: left;"><li>git log --oneline</li><ul><li>Enter letter 'q' to exit from the current line</li></ul><li>git rebase -i HEAD~3</li><ul><li>Change sub commit from pick to s</li><li>Then press ESC and type :wq to exit</li><li>Then again change the commit message and press ESC, type :wq to exit</li></ul><li>git push -f</li></ol><div><br /></div><div>If something went wrong in above steps use git rebase --abort to cancel the process and start again.</div><p></p><p><br /></p>Lahiru Dhananjayahttp://www.blogger.com/profile/04904665996384999048noreply@blogger.com0tag:blogger.com,1999:blog-4880340238784455124.post-61374400550160719912018-04-18T07:58:00.000-07:002018-04-18T07:58:40.229-07:00Dot Net Core Preview Tool 3 Missing Issue with yeoman asp core generator with VS 2017 Sample ProjectIf you have installed VS 2017 RC previously and upgraded to VS 2017 Community version and when you are working with the sample which provided by yeoman asp core generator,you might see this error occurred,<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHNUqVSkfPKRpRFPO1VBbanTYZi4OwRMDYbzqbvjhZPbjQ9LIjSukQ9b0zMeQX58gKxaGFgKI3ZZ7-j5TGZZP1d1ZPGQfy0v1pCpWzlOeP1njzf6x0PV8pqIJEq64KYujebz_tLD1aeGTW/s1600/Untitled.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="44" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHNUqVSkfPKRpRFPO1VBbanTYZi4OwRMDYbzqbvjhZPbjQ9LIjSukQ9b0zMeQX58gKxaGFgKI3ZZ7-j5TGZZP1d1ZPGQfy0v1pCpWzlOeP1njzf6x0PV8pqIJEq64KYujebz_tLD1aeGTW/s640/Untitled.png" width="640" /></a></div>
<br />
<br />
Previously There was separate .NET Core SDK preview tool installation but now it is missing with their web sites.<br />
<br />
To build the VS 2017 project with preview tool 3 you need to visit this <a href="https://github.com/dotnet/cli/releases" target="_blank">url</a> and download<br />
<h1 class="release-title" style="background-color: white; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; margin: 0px 60px 0px 0px;">
<a href="https://github.com/dotnet/cli/releases/tag/v1.0.0-preview3-004056" style="background-color: transparent; box-sizing: border-box; color: #0366d6; text-decoration: none;"><span style="font-size: small;">.NET Core 1.0.0 SDK – Preview 3-004056</span></a></h1>
<br />
<br />
<br />Lahiru Dhananjayahttp://www.blogger.com/profile/04904665996384999048noreply@blogger.com0tag:blogger.com,1999:blog-4880340238784455124.post-52068147054219151172018-04-14T09:52:00.005-07:002018-04-14T10:01:27.700-07:00Azure IoT Getting StartedHello after a long time.. Today will have a quick post with Azure IoT.<br />
<br />
Internet of Things going in Enterprise level and we have to get ready for the upcoming challenges in large scale. To prepare with it let's begin with Azure IoT.<br />
<br />
In this article I am going to do the practice of simulating a IoT device and communicate with Azure IoT Hub (Uses MQTT Protocol).<br />
<br />
First of all we need to have a Azure account created and enable a free tier subscription or if you already have a that's better.<br />
<br />
<br />
1. Goto <a href="https://portal.azure.com/" target="_blank">https://portal.azure.com </a><br />
<div>
<br />
2. Search and create the IoT hub<br />
<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikKkbCIeDZdTkXB0DKkdSQc2FE2R7-faxDzqNoyiGLeiSJZSwYQ1eO4avg8emtpK2MfzYyRHZ3TkYAu8mpt1T_3CzwUlR-IBSKMvBOx_nLPcTWZsBtxOR5-eU345_CYIDloy51RmM9VjT3/s1600/1.png" imageanchor="1"><img border="0" height="312" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikKkbCIeDZdTkXB0DKkdSQc2FE2R7-faxDzqNoyiGLeiSJZSwYQ1eO4avg8emtpK2MfzYyRHZ3TkYAu8mpt1T_3CzwUlR-IBSKMvBOx_nLPcTWZsBtxOR5-eU345_CYIDloy51RmM9VjT3/s320/1.png" width="320" /></a><br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHyqnvKY9v1aUKHaqj5_EiacaiC2Pg6D7Fw0_lkPteHg4Lb2VBbhsWpUWB_t8LSKN3n7yMtwAI8NGcrwSjqCuMGZbDaAQHuEYpr45_6HRfGok3Fhwju561P1DPPasgX0KJYsBiDJMAZBlL/s1600/2.png" imageanchor="1"><img border="0" height="262" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHyqnvKY9v1aUKHaqj5_EiacaiC2Pg6D7Fw0_lkPteHg4Lb2VBbhsWpUWB_t8LSKN3n7yMtwAI8NGcrwSjqCuMGZbDaAQHuEYpr45_6HRfGok3Fhwju561P1DPPasgX0KJYsBiDJMAZBlL/s320/2.png" width="320" /></a><br />
<br />
3.It will take several minutes to complete the Azure IoT Hub creation.Once it compete you can navigate inside to it.You need to get some important names and keys from the overview section and shared policies section.<br />
<br />
<b>Overview </b><br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwSNON4Oe2uiv6Y_Ao_0cw1ovkRpWh58socpOtQXiDanxeo89a6FSRJpSronbMGVltqv7SkREdJwUikbEZQBQ6OHzPqsNlCzFYPYbzcsPp-OA_OnS0rDCOerbG36HpJDx8m921hHEI7VFT/s1600/3.png" imageanchor="1"><img border="0" height="160" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwSNON4Oe2uiv6Y_Ao_0cw1ovkRpWh58socpOtQXiDanxeo89a6FSRJpSronbMGVltqv7SkREdJwUikbEZQBQ6OHzPqsNlCzFYPYbzcsPp-OA_OnS0rDCOerbG36HpJDx8m921hHEI7VFT/s320/3.png" width="320" /></a><br />
<br />
Then select shared access policies and click on the iothubowner row inorder show the keys and connection strings.<br />
<br />
<b>Shared access policies</b><br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0NZCVk6mTHRbDIhcHQU2RGHU6hzizsIpXv-lCbr7PyBM0gJ_yVaRW_0ad2-QrQOWcR3kSfF-w1l2wgTiuN2v821IcdG2MTHsQLPVv6juNQ2NJlDK2bpumj21-debz_h3nhbCDpj3WiRk6/s1600/4.png" imageanchor="1"><img border="0" height="144" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0NZCVk6mTHRbDIhcHQU2RGHU6hzizsIpXv-lCbr7PyBM0gJ_yVaRW_0ad2-QrQOWcR3kSfF-w1l2wgTiuN2v821IcdG2MTHsQLPVv6juNQ2NJlDK2bpumj21-debz_h3nhbCDpj3WiRk6/s320/4.png" width="320" /></a><br />
<br />
<br />
4.Next step is to integrate with the devices.To do that we have to simulate a device from the code. Here I am using a .net console applications to work as a device. You can download the given sample project from github or just run the command if you have git bash.<br />
<br />
<span style="background-color: #f9f9f9; font-family: "consolas" , "menlo" , "monaco" , "lucida console" , "liberation mono" , "dejavu sans mono" , "bitstream vera sans mono" , "courier new" , monospace , sans-serif; font-size: 14px; white-space: pre;">git clone https://github.com/Azure-Samples/iot-hub-dotnet-simulated-device-client-app.git</span><br />
<br />
<br />
5.Once you get the clone you can open the solution in Visual Studio.There are 3 main console applications<br />
i.Create Device Identity - Add the simulated device to IoT Hub<br />
ii.Read Device to Cloud Messages - Read the messages sent from the IoT Hub<br />
iii.Simulated Device - Sending messages to the IoT Hub<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpkttWbJs6fAizd9BDgGj5iDq87nYel56SMfeXxpXQxWDRqCyEHopWFKMaLZ_fgVTXFtf8oNAZFUUoDGecmTcGUuVo_CVYySB5eNRyyV1VyxRO-qQzMeE3CU-4TYeunmZL8mHwjfayvzp3/s1600/5.png" imageanchor="1"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpkttWbJs6fAizd9BDgGj5iDq87nYel56SMfeXxpXQxWDRqCyEHopWFKMaLZ_fgVTXFtf8oNAZFUUoDGecmTcGUuVo_CVYySB5eNRyyV1VyxRO-qQzMeE3CU-4TYeunmZL8mHwjfayvzp3/s320/5.png" width="260" /></a><br />
<br />
Just add the all related parameters with correct values which are represented in IoT Hub.<br />
<br />
6.Set the Create Device Identity project as startup and run it (Add the correct values for properties).<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFTjXoDVhB0C-AzFYcgcjTcIJIZN0sITRISTubDJlZoMak3NOobj707mBu5qNIxeU7Gt_wHH1AmS7EcIcb5BNoX0_MqTqU4djhxEb4b7P02YthaYpeQrWxXjSwA0mZZXc_Mo9v9IBQupbu/s1600/6.png" imageanchor="1"><img border="0" height="146" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFTjXoDVhB0C-AzFYcgcjTcIJIZN0sITRISTubDJlZoMak3NOobj707mBu5qNIxeU7Gt_wHH1AmS7EcIcb5BNoX0_MqTqU4djhxEb4b7P02YthaYpeQrWxXjSwA0mZZXc_Mo9v9IBQupbu/s320/6.png" width="320" /></a><br />
<br />
Once you run the application you will see a device key in the console.Note it down and add that key into the Simulated Device project program.cs DeviceId property.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3lfC2o14Va3lCPrFSuzOcZi_XFaR-JA-cCExkA6Sf3ZsL_i4TzsjeJyYTmZ-xZb5txvOPHrWipU_cS7YtIQciq_XMPlA8hRALUDLaTfTgbor_pK0CNOi4YiwIXf2S4klGGwsMm6EGlXzC/s1600/8.png" imageanchor="1"><img border="0" height="144" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3lfC2o14Va3lCPrFSuzOcZi_XFaR-JA-cCExkA6Sf3ZsL_i4TzsjeJyYTmZ-xZb5txvOPHrWipU_cS7YtIQciq_XMPlA8hRALUDLaTfTgbor_pK0CNOi4YiwIXf2S4klGGwsMm6EGlXzC/s320/8.png" width="320" /></a><br />
<br />
Also check in the Azure portal, it will show up the added device.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivht5Nna7YzBe4hgMQIKI3X3UlIGy2WTxQdcp9QMwWheCzwqOIyP6EZOS2Sp30c9GujU0nodk0_BNMvZR734fq02KVCcv-Y9kb5mjTSWnQWVOvpdgefx0QMeKebVCkd9X_uuiGtL63Vx3S/s1600/9.png" imageanchor="1"><img border="0" height="160" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivht5Nna7YzBe4hgMQIKI3X3UlIGy2WTxQdcp9QMwWheCzwqOIyP6EZOS2Sp30c9GujU0nodk0_BNMvZR734fq02KVCcv-Y9kb5mjTSWnQWVOvpdgefx0QMeKebVCkd9X_uuiGtL63Vx3S/s320/9.png" width="320" /></a><br />
<br />
Now it's time to get the messages from cloud and send the messages from the device.<br />
<br />
Set the required properties as the correct values and run the project Read Device To Cloud Messages.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgihRWHVqMufSqKMXYaoo7lIH4y3IWe7gWkTbGJj7uKR_5iu7OjhXcuYA5X4H3Qs-frrugH2ZF-1MDl64ldFkjX2bCwmPtNbnbTwWrfIohLqcKbygX_Nc5bheXB1OCB2YFZviXq_LCK5L54/s1600/7.png" imageanchor="1"><img border="0" height="144" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgihRWHVqMufSqKMXYaoo7lIH4y3IWe7gWkTbGJj7uKR_5iu7OjhXcuYA5X4H3Qs-frrugH2ZF-1MDl64ldFkjX2bCwmPtNbnbTwWrfIohLqcKbygX_Nc5bheXB1OCB2YFZviXq_LCK5L54/s320/7.png" width="320" /></a><br />
<br />
<br />
Sending a message to the device from the IoT Hub<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmzru31MglCjBzfWThrczy54yhf6rIWhiTlVRdw7-WwI_5xI0OqWXrx8RNVxrOrNqye0jtnSgF-4L5-KTfxp3gXOeowDvxul6xeDZHlNMvR9iknYxDmTor94uaFS8a4_GaatEjvpBIGivW/s1600/10.png" imageanchor="1"><img border="0" height="136" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmzru31MglCjBzfWThrczy54yhf6rIWhiTlVRdw7-WwI_5xI0OqWXrx8RNVxrOrNqye0jtnSgF-4L5-KTfxp3gXOeowDvxul6xeDZHlNMvR9iknYxDmTor94uaFS8a4_GaatEjvpBIGivW/s320/10.png" width="320" /></a><br />
You will receive the messages sent from the IoT hub you can see all the messages in the console.<br />
<br />
7. Run Device to Cloud Console application and run a message from the IoT hub using Message to Device option.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-pGHFxZaM7KtyG-WmsJRnSvxL_JXXcHYI-eQFU8qKQ0e5QnGMYpWP0emtj5MCKwbiGlakgjFi8zm52V4mjPC67jp_FfXOElxUQ5o1SFjnaKJHxaVS9IJt0bVCdPCgHr0ExhNu2PkzsdIs/s1600/10.png" imageanchor="1"><img border="0" height="136" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-pGHFxZaM7KtyG-WmsJRnSvxL_JXXcHYI-eQFU8qKQ0e5QnGMYpWP0emtj5MCKwbiGlakgjFi8zm52V4mjPC67jp_FfXOElxUQ5o1SFjnaKJHxaVS9IJt0bVCdPCgHr0ExhNu2PkzsdIs/s320/10.png" width="320" /></a><br />
<br />
8.Finally run the Simulated Device Console application to send the data to IoT hub.<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3Tb6-lkdWfAmefh0s9VggI18clNvQTvWF-HTRf3H2JjjZf8clrKDe1-r5yYdyxc2whprocR4oa9EpKcgFQPBrURu3W7_hyphenhyphenfTDEiGk6N1gfI15c1qnrOvyaf7uSRRr9JL5h6PromGHFxvZ/s1600/11.png" imageanchor="1"><img border="0" height="158" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3Tb6-lkdWfAmefh0s9VggI18clNvQTvWF-HTRf3H2JjjZf8clrKDe1-r5yYdyxc2whprocR4oa9EpKcgFQPBrURu3W7_hyphenhyphenfTDEiGk6N1gfI15c1qnrOvyaf7uSRRr9JL5h6PromGHFxvZ/s320/11.png" width="320" /></a><br />
<br />
You can see set of messges received from the azure portal IoT hub.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9JfN_c5FQKqBWPHp4nItgEzCU3Oly7dVtX-dfZpMWFzkXeiK_ZY8bqeSbbJuvh22_Zik0S04hDHWr0ArUOJL-kz_Y3UYNnEcuO35dzDEmVq2FnQ9tFAzk6zSNxqYHjpE9rDu42fhtkQX2/s1600/12.png" imageanchor="1"><img border="0" height="221" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9JfN_c5FQKqBWPHp4nItgEzCU3Oly7dVtX-dfZpMWFzkXeiK_ZY8bqeSbbJuvh22_Zik0S04hDHWr0ArUOJL-kz_Y3UYNnEcuO35dzDEmVq2FnQ9tFAzk6zSNxqYHjpE9rDu42fhtkQX2/s320/12.png" width="320" /></a><br />
<br />
That's all for today with a quick go through .See you next time with an advanced article.<br />
<br />
(References - Azure documentation for IoT Hub with .NET <a href="https://docs.microsoft.com/en-us/azure/iot-hub/" target="_blank">(https://docs.microsoft.com/en-us/azure/iot-hub/)</a>)<br />
<br />
<br />
<br /></div>
Lahiru Dhananjayahttp://www.blogger.com/profile/04904665996384999048noreply@blogger.com0tag:blogger.com,1999:blog-4880340238784455124.post-55468505806818001982016-10-05T19:26:00.001-07:002016-10-05T19:38:08.316-07:00IBM Watson cloud with node JsT<span style="font-family: "times" , "times new roman" , serif;">oday I'm going to expose you about the IBM Watson Developer cloud using IBM Bluemix cloud platform.</span><br />
<span style="font-family: "times" , "times new roman" , serif;"><br /></span>
<span style="font-family: "times" , "times new roman" , serif;"><b><span style="background-color: white;">IBM </span><span style="background-color: white;">Watson</span><span style="background-color: white;"> Developer </span><span style="background-color: white;">Cloud</span><span style="background-color: white;">.</span></b></span><br />
<span style="font-family: "times" , "times new roman" , serif;"><span style="background-color: white;">Use language, vision, speech and data insight APIs to add cognitive functionality to your application or service.</span></span><br />
<span class="selectable" id="js-intext-string-0">(Ibm.com, 2016)</span><br />
<span style="background-color: white;"><span style="font-family: "times" , "times new roman" , serif;"><br /></span></span>
<span style="font-family: "times" , "times new roman" , serif;"><span style="background-color: white; font-weight: bold;">Bluemix</span><span style="background-color: white;"> is an open standards, cloud platform for building, running, and managing apps and services.</span></span><br />
<span class="selectable" id="js-intext-string-0">(Console.ng.bluemix.net, 2016)</span><br />
<span class="selectable"><br /></span>
<span class="selectable">In this post there will discussions on,</span><br />
<span class="selectable">1. Speech to text</span><br />
<span class="selectable">2.Text to speech</span><br />
<span class="selectable">3.Tone analyser</span><br />
<span class="selectable">4.Speech to tone analyser</span><br />
<span class="selectable"><br /></span>
<span class="selectable"><br /></span>
<span class="selectable">First go to <a href="https://console.ng.bluemix.net/" target="_blank">https://console.ng.bluemix.net/</a> and sihnup for a free account and follow the instructions to proceed with the application development.Here I will be more discussing about the Speech to tone analyser.</span><br />
<span class="selectable"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1feH1KH8KvrjRsOafSqtrka0aNiHM3r5d4Dmn-eOIxPCVZyIU_ojd8O-5uYqXlWOIMIP6dtJU1qjFLEuaReJnwRcNJHgNe6bOe6qlSvEmSjEMxsaWkUroX7X6nhrjjtj8B7ALgvVPMV2T/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="156" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1feH1KH8KvrjRsOafSqtrka0aNiHM3r5d4Dmn-eOIxPCVZyIU_ojd8O-5uYqXlWOIMIP6dtJU1qjFLEuaReJnwRcNJHgNe6bOe6qlSvEmSjEMxsaWkUroX7X6nhrjjtj8B7ALgvVPMV2T/s320/1.png" width="320" /></a></div>
<span class="selectable"><br /></span>
<span class="selectable"><br /></span>
<span class="selectable"><b>1.Speech to text</b></span><br />
<span class="selectable"><b><br /></b></span>
There will be a application locally hosted using nodejs. Please follow the following git url and do the practicals as mentioned.<br />
<span class="selectable"><b><br /></b></span>
<span class="selectable"><a href="https://github.com/watson-developer-cloud/speech-to-text-nodejs" target="_blank">https://github.com/watson-developer-cloud/speech-to-text-nodejs</a></span><br />
<span class="selectable"><br /></span>
<span class="selectable">If you needs to have a look about how it works, please visit</span><br />
<span class="selectable"><br /></span>
<span class="selectable"><a href="https://speech-to-text-demo.mybluemix.net/" target="_blank">https://speech-to-text-demo.mybluemix.net/</a></span><br />
<br />
<span class="selectable"><b>2.Text to speech</b></span><br />
<span class="selectable"><b><br /></b></span>
Please follow the following git url and do the practicals as mentioned.<br />
<span class="selectable"><b><br /></b></span>
<span class="selectable"><a href="https://github.com/watson-developer-cloud/text-to-speech-nodejs" target="_blank">https://github.com/watson-developer-cloud/text-to-speech-nodejs</a></span><br />
<span class="selectable"><br /></span>
<span class="selectable">If you needs to have a look about how it works, please visit</span><br />
<span class="selectable"><br /></span>
<span class="selectable"><a href="https://text-to-speech-demo.mybluemix.net/" target="_blank">https://text-to-speech-demo.mybluemix.net/</a></span><br />
<br />
<br />
<span class="selectable"><b>3.Tone analyser</b></span><br />
<span class="selectable"><b><br /></b></span>
Please follow the following git url and do the practicals as mentioned.<br />
<span class="selectable"><b><br /></b></span>
<a href="https://github.com/watson-developer-cloud/tone-analyzer-nodejs" target="_blank">https://github.com/watson-developer-cloud/tone-analyzer-nodejs</a><br />
<span class="selectable"><br /></span>
<br />
<span class="selectable"><br /></span>
<span class="selectable"><b>4. Speech to tone analyser</b></span><br />
<span class="selectable"><b><br /></b></span>
Please follow the following git url and do the practicals as mentioned.<br />
<br />
<a href="https://github.com/IBM-Bluemix/real-time-tone-analysis" target="_blank">https://github.com/IBM-Bluemix/real-time-tone-analysis</a><br />
<span class="selectable"><br /></span>
(When you creating tone anlyser service try standard instead of beta .Because this free plan will not give you access to create that beta service.)<br />
<br />
<span class="selectable"></span><br />
Also make sure to change the <b>manifest.yml </b>file to change the service plan text.In my application I have changed it.So make sure to do the change in your application as well.,<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVfNS8ePwVYuZnVsERV87JQ-hplOwV09UOnkpqsxG7r7zLib3eg5sStrr25vJ6NUvVF5Tx4C8T3QSu_ZH-l4RA2zB682UPQBldNA708eupKfQla2sSyK6wscrglDwqjldogroRQa4anFCI/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVfNS8ePwVYuZnVsERV87JQ-hplOwV09UOnkpqsxG7r7zLib3eg5sStrr25vJ6NUvVF5Tx4C8T3QSu_ZH-l4RA2zB682UPQBldNA708eupKfQla2sSyK6wscrglDwqjldogroRQa4anFCI/s320/2.png" width="212" /></a></div>
<br />
<br />
<span class="selectable">In this phase you have to get the application credentials using the command <span style="background-color: white;"><span style="font-family: "times" , "times new roman" , serif;">"</span></span></span><span style="background-color: white;"><span style="font-family: "times" , "times new roman" , serif;">cf env <span class="pl-k" style="box-sizing: border-box;"><</span>application-name<span class="pl-k" style="box-sizing: border-box;">></span>"</span></span><br />
<span style="background-color: white;"><span style="font-family: "times" , "times new roman" , serif;"><br /></span></span>
<span style="background-color: white;"><span style="font-family: "times" , "times new roman" , serif;">Then change the username and password according to it in <b>vcap-local.json</b></span></span><br />
<span style="background-color: white;"><span style="font-family: "times" , "times new roman" , serif;"><b><br /></b></span></span>
<span style="font-family: "times" , "times new roman" , serif;"><span style="background-color: white;">Check <b>manifest.yml</b> file whether it is having the correct service names of the speech to text and tone analyser services.</span></span><br />
<span style="font-family: "times" , "times new roman" , serif;"><span style="background-color: white;"><br /></span></span>
<span style="font-family: "times" , "times new roman" , serif;"><span style="background-color: white;">So following these steps you can be able to to up and run a locally hosted application using node js.</span></span><br />
<span style="font-family: "times" , "times new roman" , serif;"><span style="background-color: white;">If you need to deploy directly push it to the web, try "cf push" in the command prompt. </span></span><br />
<span style="font-family: "times" , "times new roman" , serif;"><span style="background-color: white;"><br /></span></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7WFals3YJT4fgLIg1ffTO7bMoSu5qwXvXytZQeqBMaag8q7i_ge4nFWXHfHyh3gqjPZzpbsX1nnxT1vAJv2SuktKm3OB6cESqTkogI4snxZbjL28uuTazOyO0g8kbEBe87Fj72iwkH-lq/s1600/Real+Time+Tone.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7WFals3YJT4fgLIg1ffTO7bMoSu5qwXvXytZQeqBMaag8q7i_ge4nFWXHfHyh3gqjPZzpbsX1nnxT1vAJv2SuktKm3OB6cESqTkogI4snxZbjL28uuTazOyO0g8kbEBe87Fj72iwkH-lq/s640/Real+Time+Tone.png" width="432" /></a></div>
<span style="font-family: "times" , "times new roman" , serif;"><span style="background-color: white;"><br /></span></span>
<span style="font-family: "times" , "times new roman" , serif;"><span style="background-color: white;"><br /></span></span>
<span style="font-family: "times" , "times new roman" , serif;"><span style="background-color: white;"><br /></span></span>
<span style="font-family: "times" , "times new roman" , serif;"><span style="background-color: white;">Hope you got some idea about IBM cloud services.Cheers.</span></span><br />
<span style="font-family: "times" , "times new roman" , serif;"><span style="background-color: white;"><br /></span></span>
<span style="font-family: "times" , "times new roman" , serif;"><span style="background-color: white;"><br /></span></span>
<span style="font-family: "times" , "times new roman" , serif;"><span style="background-color: white;"><br /></span></span>
<span style="background-color: white;"><span style="font-family: "times" , "times new roman" , serif;"><b><br /></b></span></span>
<span style="background-color: white;"><span style="font-family: "times" , "times new roman" , serif;"><b><br /></b></span></span>
<span class="selectable"></span><br />
<br />
<span class="selectable"><br /></span>
<span class="selectable"><br /></span>
<span class="selectable"><br /></span>
<span class="selectable"><br /></span>
<br />
<br />
<span class="selectable"><b><br /></b></span>
Lahiru Dhananjayahttp://www.blogger.com/profile/04904665996384999048noreply@blogger.com0tag:blogger.com,1999:blog-4880340238784455124.post-54856021508701703962016-09-18T07:14:00.001-07:002016-09-18T07:14:04.655-07:00Oracle installation and Migration to MS SQL Server This is a short blog post about how you can involve in migrating a Oracle based database to SQL Server.<br />
<br />
Firstly make sure you have the both latest versions of SQL Server and Oracle.<br />
<br />
Oracle - <a href="http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html">http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html</a><br />
<br />
SQL Server - <a href="https://www.microsoft.com/en-us/download/details.aspx?id=42299">https://www.microsoft.com/en-us/download/details.aspx?id=42299</a><br />
<br />
Sometimes installing oracle may be a bit difficult task for you as beginner. So let see how to do it quickly .<br />
<br />
First you run the setup and wait for the installation window<br />
<span id="goog_810829488"></span><span id="goog_810829489"></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwuz27fpH8zlHDOzGIBOzaiFKl8Kfs5l9TwffFRxJCtetniwX1zv_g31eCTH3JJoeLdEHPITpLwAbeaXgmxlTgGoNXIU54bEHUvWdeQcZh1TSU0rxBsd_Tl_vrBqORzO4esdVskWUleio0/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="126" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwuz27fpH8zlHDOzGIBOzaiFKl8Kfs5l9TwffFRxJCtetniwX1zv_g31eCTH3JJoeLdEHPITpLwAbeaXgmxlTgGoNXIU54bEHUvWdeQcZh1TSU0rxBsd_Tl_vrBqORzO4esdVskWUleio0/s640/1.png" width="640" /></a></div>
<br />
After a while you get the setup.So it is time to follow the steps ,<br />
In the first view you can enter email and continue the setup<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_LqQPdZophpNHbG5ch24CJVMbSdyP4jQD4aGZ2VdQMWamvsgkZjvP-Zce_jIhZq3Q9xZkKRTSltRgeNAjMXqrcG6GZVFxV47yOive9Auj5bpmk9LrYY2-Hq28UN5nB2LAsqOQYF_Zo8_2/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="488" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_LqQPdZophpNHbG5ch24CJVMbSdyP4jQD4aGZ2VdQMWamvsgkZjvP-Zce_jIhZq3Q9xZkKRTSltRgeNAjMXqrcG6GZVFxV47yOive9Auj5bpmk9LrYY2-Hq28UN5nB2LAsqOQYF_Zo8_2/s640/2.png" width="640" /></a></div>
<br />
<br />
Then you have a selection of installations. Better to select the first option.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLqnq2HTa3mr6uRpa7KvvGYjitU9bsylQK5p4j3adqrs9U-lAN5yPsNHlWfj_GQVUDApyOkHzGjgiC3Y7dmnou5Xyji1KFcG3m3P8zcw5KjBwzOEZ0G4PBrccIileIwWhJQ7IWeWrZYzAR/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLqnq2HTa3mr6uRpa7KvvGYjitU9bsylQK5p4j3adqrs9U-lAN5yPsNHlWfj_GQVUDApyOkHzGjgiC3Y7dmnou5Xyji1KFcG3m3P8zcw5KjBwzOEZ0G4PBrccIileIwWhJQ7IWeWrZYzAR/s640/3.png" width="640" /></a></div>
<br />
Then they ask you whether the configurations for the desktop environment or a server.Surely select the desktop class and continue it.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjK_F45ZbgNgL9pb_xoNp1Rt0ye5644MpPl5V_prERMjdolz1Fnaol7KWjzkh0vCl15zQ6kX_4AWer6sM-aW5jIMHHsB6oWlj69HOQvy3XuqqWajoMfFIDONxgrpTXcMpgPEpcQudRw4AYr/s1600/4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="484" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjK_F45ZbgNgL9pb_xoNp1Rt0ye5644MpPl5V_prERMjdolz1Fnaol7KWjzkh0vCl15zQ6kX_4AWer6sM-aW5jIMHHsB6oWlj69HOQvy3XuqqWajoMfFIDONxgrpTXcMpgPEpcQudRw4AYr/s640/4.png" width="640" /></a></div>
<br />
Then it is time to create a new user for the oracle database home user.So i recommend you to create a new windows user by selecting the second option.This enables a separate user to work with the oracle.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsWsIhbnJa14CcqF4hj-fwWK2uBkMLEusfhdsd5jTAan7QOlooaajS2Efni4qhkPz2jIEKaGWf5q95Y-4tPkqZ13_6zJs-t-pcVMIqo3NmQg1Q4XQHqvSuiXQHsNlh9dnZpFx9ynEXLTPj/s1600/5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="472" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsWsIhbnJa14CcqF4hj-fwWK2uBkMLEusfhdsd5jTAan7QOlooaajS2Efni4qhkPz2jIEKaGWf5q95Y-4tPkqZ13_6zJs-t-pcVMIqo3NmQg1Q4XQHqvSuiXQHsNlh9dnZpFx9ynEXLTPj/s640/5.png" width="640" /></a></div>
<br />
Then the configurations with settings the paths and global name.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHpLMt0IESgiu5oehrIAHCSB-P-AGbmpMcjxIAGiYzHzWEYbatVFxFfNcs7kGN7kRqF-gENh6afn7gxcqL7twAxOaAthS6epOR5HgzJf6VZSnssQtqzAxNVKpmc3U88yaHN5qCD1fBhCvl/s1600/6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="484" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHpLMt0IESgiu5oehrIAHCSB-P-AGbmpMcjxIAGiYzHzWEYbatVFxFfNcs7kGN7kRqF-gENh6afn7gxcqL7twAxOaAthS6epOR5HgzJf6VZSnssQtqzAxNVKpmc3U88yaHN5qCD1fBhCvl/s640/6.png" width="640" /></a></div>
<br />
Next is the installation process starts and after the setup completion you get the software installed.<br />
<br />
If all the things are successfully completed , then type dbca in the command prompt to create a new database for oracle.Here you can manage the database instances as usually .<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7K_2TBABKQj0vg_dxhkh9PRNs4cZ2n5jMfnZOZl-_LclruDT7sdpUWlc7UXl85vphdur5D7K1fYS6IroyL4xt3lJx4HvIBpmN_CCghiDXD7WnCqyNGwdenPz752E6Vu4cJ3XsmaC2Htui/s1600/7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7K_2TBABKQj0vg_dxhkh9PRNs4cZ2n5jMfnZOZl-_LclruDT7sdpUWlc7UXl85vphdur5D7K1fYS6IroyL4xt3lJx4HvIBpmN_CCghiDXD7WnCqyNGwdenPz752E6Vu4cJ3XsmaC2Htui/s640/7.png" width="640" /></a></div>
<br />
Let's create a new database<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXUBuJEMieFDoZUwnb2_O8GgXKOoKBR2WSbw2Sndhw8MZ9PkzgcQTVAohHs45XcQR8MyUD9_jGAWfuvfBAH2JznK2Qc-GKnklHqwToUMPDbSovwk_T0Uk7B7DJ07GxXZgNckeNJttT8hAH/s1600/8.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="482" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXUBuJEMieFDoZUwnb2_O8GgXKOoKBR2WSbw2Sndhw8MZ9PkzgcQTVAohHs45XcQR8MyUD9_jGAWfuvfBAH2JznK2Qc-GKnklHqwToUMPDbSovwk_T0Uk7B7DJ07GxXZgNckeNJttT8hAH/s640/8.png" width="640" /></a></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhff3xS4V88UDH33csBLD_Yj6mXz6WPL1B1Uk5dsQ99Vr1QLPJ214NN43oAb3f0Iyne8d0cBhCXH_e02zDjsrJH3j0edLJ-6qVS85EEEqifak_pUgcgsEBFJgigsbS8mnqI4iGjIdzobiK1/s1600/9.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="426" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhff3xS4V88UDH33csBLD_Yj6mXz6WPL1B1Uk5dsQ99Vr1QLPJ214NN43oAb3f0Iyne8d0cBhCXH_e02zDjsrJH3j0edLJ-6qVS85EEEqifak_pUgcgsEBFJgigsbS8mnqI4iGjIdzobiK1/s640/9.png" width="640" /></a></div>
<br />
Next is the prerequisite checks<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3K3SyWK_oNLt_duuGvi3jXzbVttlIG7i5BtB-nAMGHmTJRZkD_mM9Bfztan8qj3_S90Ir8HuaWyfoSMaMOvNh0jx8auCDXju3k6elwy6k7-7bY8owWCeebvXddwC45-Ou9Eejy95rMgtl/s1600/10.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="482" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3K3SyWK_oNLt_duuGvi3jXzbVttlIG7i5BtB-nAMGHmTJRZkD_mM9Bfztan8qj3_S90Ir8HuaWyfoSMaMOvNh0jx8auCDXju3k6elwy6k7-7bY8owWCeebvXddwC45-Ou9Eejy95rMgtl/s640/10.png" width="640" /></a></div>
<br />
Then you get a summary before creating the database instance<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoheQv-nVZ3YySEUqyZHzVuWjEw6V73vC0KpSCzwfT7GZIsnBdJ5gbV54H-m1sT0kdjfv0JICDeyO43py_A9J58ID0S9yoE8tT0h90FJ5J1GdBG2H6dBOsDlbcYci781XwJQ4Ij0RY1RmK/s1600/11.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="472" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoheQv-nVZ3YySEUqyZHzVuWjEw6V73vC0KpSCzwfT7GZIsnBdJ5gbV54H-m1sT0kdjfv0JICDeyO43py_A9J58ID0S9yoE8tT0h90FJ5J1GdBG2H6dBOsDlbcYci781XwJQ4Ij0RY1RmK/s640/11.png" width="640" /></a></div>
<br />
Finally you are creating the database and ready for the migration .<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3R_viSFKyBliS4gSZIWzR4MyTuK2OfXVc8DgPzlMg1vk6ypFU165OLq3YP7T7cZJ_3yKnws6JjVDILgY3FGSObf7l5xDPDeECA75_kJjpFBXdyV57MvDhqnIFzJXC84eAQsmnhdpAX3vw/s1600/12.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="486" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3R_viSFKyBliS4gSZIWzR4MyTuK2OfXVc8DgPzlMg1vk6ypFU165OLq3YP7T7cZJ_3yKnws6JjVDILgY3FGSObf7l5xDPDeECA75_kJjpFBXdyV57MvDhqnIFzJXC84eAQsmnhdpAX3vw/s640/12.png" width="640" /></a></div>
<br />
<br />
After that you can insert data by creating the tables .So I will not going to do that, I will continue with the database migration tool.<br />
<br />
If you need to manipulate the databases and tables you can download SQL Developer tool and continue the work.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcqrBmVA2wiLmHP3KccQOAo-qrd6n-PzHMU-TG741QN3LIAr4DESf9az1JhrJ8N3DLqrySxY33m_rB5z6CBS4wlHo_n26pUScPWAxqDcmbQnwqGns1wAdClYzvijmaWU5MFuab64XKHD30/s1600/16.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="340" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcqrBmVA2wiLmHP3KccQOAo-qrd6n-PzHMU-TG741QN3LIAr4DESf9az1JhrJ8N3DLqrySxY33m_rB5z6CBS4wlHo_n26pUScPWAxqDcmbQnwqGns1wAdClYzvijmaWU5MFuab64XKHD30/s640/16.png" width="640" /></a></div>
<br />
<br />
There is a tool called SQL Server Migration Assistance for Oracle - <a href="https://www.microsoft.com/en-us/download/details.aspx?id=43689">https://www.microsoft.com/en-us/download/details.aspx?id=43689</a><br />
<br />
After the installation you get a icon like below<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOxx6vqHYwsxCX_QpgxEyIsEdMy5WRhVg5FFDLPDI_KGehn99cLu863X5oZ7NGCI7F56fBthgLxlAcReYwgm4G8xfQKoSt0D1ykgQQsEGREjjtm5-Dz56OdivNM6M-WwOpR2VlFTgD2LgX/s1600/17.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOxx6vqHYwsxCX_QpgxEyIsEdMy5WRhVg5FFDLPDI_KGehn99cLu863X5oZ7NGCI7F56fBthgLxlAcReYwgm4G8xfQKoSt0D1ykgQQsEGREjjtm5-Dz56OdivNM6M-WwOpR2VlFTgD2LgX/s1600/17.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Open the software and you can see a interface as below</div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3YTIb6nMfuyeKGlybUOxxLIk0R9Ma1yzGWyW2mPW6CDN5W4uFugAVPxZcsYG_Zho1BIXTYK_Q28Hc3knN_zz8SlXFdh4C5BSsxXAvwy8BFRY1U_s-200zvwidemvfqi6zVtmz7Kjng_vn/s1600/13.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="340" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3YTIb6nMfuyeKGlybUOxxLIk0R9Ma1yzGWyW2mPW6CDN5W4uFugAVPxZcsYG_Zho1BIXTYK_Q28Hc3knN_zz8SlXFdh4C5BSsxXAvwy8BFRY1U_s-200zvwidemvfqi6zVtmz7Kjng_vn/s640/13.png" width="640" /></a></div>
<br />
So next is the connecting both oracle and SQL Server to this migration tool by giving each servers credentials. You can do it by clicking Connect to oracle and connect to MSSQL Server buttons in left top corner.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifzEs9dQdk1oxqF4rcknXbONFCWV727Kni1y73gksCpygssl-Jfqwx5shLpNmDaJu03QLApRGn7CIEqyXLZw4-kI0GBMtLcGSJRwelaB65lJfAWWAeS_Txiz9lIS4z0lq9winJtHDIlqbj/s1600/14.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="248" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifzEs9dQdk1oxqF4rcknXbONFCWV727Kni1y73gksCpygssl-Jfqwx5shLpNmDaJu03QLApRGn7CIEqyXLZw4-kI0GBMtLcGSJRwelaB65lJfAWWAeS_Txiz9lIS4z0lq9winJtHDIlqbj/s320/14.png" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_EZZCduPd3NNqb9shiZDfwVFvUcgDe89MgZlUnmonTm2BhWZkGlLWDbnCx6xlfSrZiw6ZfUE4yp2QcbevAyq3jcOLnuRr4AwGphhL9ZYiNH_jbUaAJzPLW3upg8jfxlUeHjO4IkfztbN_/s1600/15.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="269" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_EZZCduPd3NNqb9shiZDfwVFvUcgDe89MgZlUnmonTm2BhWZkGlLWDbnCx6xlfSrZiw6ZfUE4yp2QcbevAyq3jcOLnuRr4AwGphhL9ZYiNH_jbUaAJzPLW3upg8jfxlUeHjO4IkfztbN_/s320/15.png" width="320" /></a></div>
<br />
After establishing the connection ,you can access to both databases at once and then select the database you need to migrate and click the button Migrate data or convert schema .You can select some option to be compatible with the data types and other fields information.<br />
<br />
So that is the end of this short post and hope you will understand the instructions. Cheers .<br />
<br />Lahiru Dhananjayahttp://www.blogger.com/profile/04904665996384999048noreply@blogger.com0tag:blogger.com,1999:blog-4880340238784455124.post-83850294095305580282015-06-20T10:13:00.001-07:002015-06-20T10:13:45.360-07:00Internet of Things(IoT) and Arduinoහුග දවසකට පස්සෙ අද ගවේෂක ඔයාලට අරන් ආව Electronic සම්බන්ද මේ දවස් වල ජනප්රිය #IoT හා සම්බන්ද දෙයක්.<br />
<br />
Arduino ගැන අහල ඇතිනෙ කවුරුත් ඒත් දන්නෙ නැත්නම් #IoT වලට Indtroduction එක්කින්ම පටන් ගන්නම්.<br />
<br />
"<span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px;">The </span><b style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px;">Internet of Things</b><span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px;"> (</span><b style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px;">IoT</b><span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px;">, sometimes </span><b style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px;">Internet of Everything</b><span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px;">) is the network of physical objects or "things" embedded</span><span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px;"> with electronics, software, sensors</span><span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px;"> and connectivity to enable it to achieve greater value and service by exchanging data with the manufacturer, operator and/or other connected devices based on the infrastructure of </span>International Telecommunication Union<span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px;">'s Global Standards Initiative</span>" - WIKI<br />
<br />
සරලවම සිංහලෙන් කිව්වොත් electronic උපකරණ භාවිතයෙන් manual දේ automated කිරීමයි.<br />
එමෙන්ම ඒ සදහා යොදාගන්නා Hardware Platform කිහිපයක් නම් ,<br />
<br />
<ul>
<li>Arduino</li>
</ul>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfweLmr4RRMcYIcwqGqjWe6Yc9_SG5JLxvzXZ1vjZxZYtv0pHUk3PUK1aBh9Hba0wNxOPAHTx8siqPrgbJ8KovvQ4p9ETYOrxWTeuD9vCzaddUlxR2EPjB5F36JnunD7GXi4lnp4i5MyJB/s1600/220px-Arduino_Uno_-_R3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfweLmr4RRMcYIcwqGqjWe6Yc9_SG5JLxvzXZ1vjZxZYtv0pHUk3PUK1aBh9Hba0wNxOPAHTx8siqPrgbJ8KovvQ4p9ETYOrxWTeuD9vCzaddUlxR2EPjB5F36JnunD7GXi4lnp4i5MyJB/s1600/220px-Arduino_Uno_-_R3.jpg" /></a></div>
<div>
<br /></div>
<ul>
<li>Raspberry Pi</li>
</ul>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiP8-YPhq8gPFia0GHSCzt0k1dzrUfH7XAaBS-kVgkLUINfoOAdUkKUqh6M5rjW6gkieYgsPzBS4HTnP6su-xHNbhzVP3lilIDImyE8DsqBWTXwYb0EEM2-1drmv-cpAw9OKuWqBQD75Z2Q/s1600/51MrYF3ct0L._SX300_.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiP8-YPhq8gPFia0GHSCzt0k1dzrUfH7XAaBS-kVgkLUINfoOAdUkKUqh6M5rjW6gkieYgsPzBS4HTnP6su-xHNbhzVP3lilIDImyE8DsqBWTXwYb0EEM2-1drmv-cpAw9OKuWqBQD75Z2Q/s1600/51MrYF3ct0L._SX300_.jpg" /></a></div>
<div>
<br /></div>
<ul>
<li>Banana Pi</li>
</ul>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaZOcrRvd8J-ArpLejnn0u0n76IsP9D7K2xFg5pDQm-X1ZtH5ngjqotcWGYomfRzljIs9Edl96PzAhfNfn_nQWv2HMajiNeIaygBvL038zwI9TBRnRUGgBiNWXcYiW_jifm_v5HMJ1rGpt/s1600/BananaPi-A-45degree.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="273" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaZOcrRvd8J-ArpLejnn0u0n76IsP9D7K2xFg5pDQm-X1ZtH5ngjqotcWGYomfRzljIs9Edl96PzAhfNfn_nQWv2HMajiNeIaygBvL038zwI9TBRnRUGgBiNWXcYiW_jifm_v5HMJ1rGpt/s320/BananaPi-A-45degree.jpg" width="320" /></a></div>
<div>
<br /></div>
<ul>
<li>Intel Galileo</li>
</ul>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRqWeXsq2zrBophGwKyuYPfTiYrhybGBpL32XdyONllWQCcFciu4C9IFQd3bbr-MK06kk4DcVA5WxZxfmnmq_2KOEaFLCIDsr3BIjYfYx2TyokvlzB9LTiQ4utLb37xOXjDOevo6Q53V6h/s1600/IntelGalileo_fabD_Front_450px.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="210" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRqWeXsq2zrBophGwKyuYPfTiYrhybGBpL32XdyONllWQCcFciu4C9IFQd3bbr-MK06kk4DcVA5WxZxfmnmq_2KOEaFLCIDsr3BIjYfYx2TyokvlzB9LTiQ4utLb37xOXjDOevo6Q53V6h/s320/IntelGalileo_fabD_Front_450px.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
අද වනවිට බොහෝ ව්යාපාර IoT පිළිබද විශාල උනන්දුවක් දක්වනවා. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
උදාහරණයක් විදියට කාර්යාලයක කටයුතු ගත් විට බොහෝ සෙයින් එය ස්වයංක්රිය පද්ධතියක් බවට පත් වී තිබෙනවා.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisSObrJKy6bm5UHZlhAKA0f0F69faC3kL0rG1eySp6gl5cW3XG7n665gss4C03_eu2M90w9HippkKH_m-D0OXQlMVM96jT7zPBnLSfV0pCK4b4v0Wg9XaQRLpyLxchz9KFbT7HIJc7rfSr/s1600/1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="427" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisSObrJKy6bm5UHZlhAKA0f0F69faC3kL0rG1eySp6gl5cW3XG7n665gss4C03_eu2M90w9HippkKH_m-D0OXQlMVM96jT7zPBnLSfV0pCK4b4v0Wg9XaQRLpyLxchz9KFbT7HIJc7rfSr/s640/1.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
ඉහත රූපයේ පරිදි සියලු උපකරනණ එකිනෙක හා සම්බන්ධ වී තිබෙනවා. යම් විටක ගෑස් කාන්කදුවක්,භාහිර පුද්ගලයින් කාර්යාලයට ඇතුලුවීමක් වුවහොත් ඒ බව එසැනින් දැනුම් දීමක් සිදු කරනවා.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
ඉතින් මේ වගේ සංකිර්ණ පද්ධති වල අඩිතාලම වෙන්නෙ කුඩා කුඩා circuit වල එකතුවකි. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
ඒ නිසා ගවේෂක අද Arduino use කරන විදිය මුල සිටම ඔයාලට අරන් එනවා .</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
අපිට මේ සදහා අවශ්යය උපකරණ,</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<ol>
<li>Arduino Borad(Nano/Mega/Uno)</li>
<li>LED Bulb</li>
<li>Resistor 1K</li>
</ol>
<div>
ඉන්පසු LED බල්බය Resistor සමග පහත පරිදි සකසාගන්න. </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiH2fyZPJxWU_fV5Ics2ha3cye3BFX29ujzGDrSH0Rn068z8NabdYstMlUz9XS9X0n9T35nDd4v6AVI4qgfj0mWRjyirkNp0znTU1cOUeeHudmrxVKr5fZZwkixcmInUt_goETyVZ7sNQH1/s1600/ExampleCircuit_bb.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiH2fyZPJxWU_fV5Ics2ha3cye3BFX29ujzGDrSH0Rn068z8NabdYstMlUz9XS9X0n9T35nDd4v6AVI4qgfj0mWRjyirkNp0znTU1cOUeeHudmrxVKr5fZZwkixcmInUt_goETyVZ7sNQH1/s320/ExampleCircuit_bb.png" width="304" /></a></div>
<div>
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: left;">
(+) අග්රය Arduino Borad හි Pin 13 ටත්</div>
<div class="separator" style="clear: both; text-align: left;">
(-) GND වෙතත් සම්බන්ද කරගන්න</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
දැන් USB Cable මගින් Arduino Board එක පරිගනකය හා සම්බන්ද කරගනිමු.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
ඉන්පසු Arduino Software එක Open කරගන්න</div>
<div class="separator" style="clear: both; text-align: left;">
(To Download Arduino - http://www.arduino.cc/en/Main/Software)</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
දැන් පහත පරිදි ඔබගේ නිවැරදි Arduino Board එක තෝරාගන්න</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgf6WLmL8cnAUcuXuGLfqZIzuEfYox6hnC5oYvvkcFk-1UVDNszu6BEdPCzl8OitaZP95kryrKUxEoZvYfg1SjVovSmjw94e1trVihxZmsFEEua8aUSQhXdceBfWTKkMMmlb9pVQNLplLYi/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="371" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgf6WLmL8cnAUcuXuGLfqZIzuEfYox6hnC5oYvvkcFk-1UVDNszu6BEdPCzl8OitaZP95kryrKUxEoZvYfg1SjVovSmjw94e1trVihxZmsFEEua8aUSQhXdceBfWTKkMMmlb9pVQNLplLYi/s400/2.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
දැන් Sample Blink Program එක තෝරාගන්න</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVAVot97MzzBIYhZOLxb9sfTabIV-PIistAaL-30pw7QFiRMufv-gshekLxS42GY7V9NzdejP3JPHWI4mfiLNzAFtK7G3158pvLBXZBeZSCZCpXhR5mbwoh37iM6PHdpf01YCbq2RzArJG/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVAVot97MzzBIYhZOLxb9sfTabIV-PIistAaL-30pw7QFiRMufv-gshekLxS42GY7V9NzdejP3JPHWI4mfiLNzAFtK7G3158pvLBXZBeZSCZCpXhR5mbwoh37iM6PHdpf01YCbq2RzArJG/s400/1.png" width="376" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
පහත පරිදි දැන් ඔබට දිස්වේ </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
// the setup function runs once when you press reset or power the board</div>
<div class="separator" style="clear: both;">
void setup() {</div>
<div class="separator" style="clear: both;">
// initialize digital pin 13 as an output.</div>
<div class="separator" style="clear: both;">
pinMode(13, OUTPUT);</div>
<div class="separator" style="clear: both;">
}</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
// the loop function runs over and over again forever</div>
<div class="separator" style="clear: both;">
void loop() {</div>
<div class="separator" style="clear: both;">
digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)</div>
<div class="separator" style="clear: both;">
delay(1000); // wait for a second</div>
<div class="separator" style="clear: both;">
digitalWrite(13, LOW); // turn the LED off by making the voltage LOW</div>
<div class="separator" style="clear: both;">
delay(1000); // wait for a second</div>
<div class="separator" style="clear: both;">
}</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
දැන් ඔබේ program එක ,compile කර upload කරගන්න</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6ObCzDWeUVLBCZdWDlBFZFHxgtg1r5lu36AJP_7_qfRSlHIUMe7Qq-egTMIPHiJ3GcBGPlnX4jZEJMcqZpkWKHY_5WM0xRjJEouU2VhvnvD-a2jPDPz7IyGM61PFu6HWsLxNnvjQPpAb3/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6ObCzDWeUVLBCZdWDlBFZFHxgtg1r5lu36AJP_7_qfRSlHIUMe7Qq-egTMIPHiJ3GcBGPlnX4jZEJMcqZpkWKHY_5WM0xRjJEouU2VhvnvD-a2jPDPz7IyGM61PFu6HWsLxNnvjQPpAb3/s1600/3.png" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihyphenhyphen4FHdIcii95tibKVRmWw-VbynYSa7UjPqOc5g7F6WmIvea9y8UgmIO7dFbo39mYRYRckGQO9csVIQ1Qw8gDRKvrztcTq7sqDtmq7eG8C_TYFhHn5su9g2IXxfrRlpu1PxqsAzbd5bjhR/s1600/4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihyphenhyphen4FHdIcii95tibKVRmWw-VbynYSa7UjPqOc5g7F6WmIvea9y8UgmIO7dFbo39mYRYRckGQO9csVIQ1Qw8gDRKvrztcTq7sqDtmq7eG8C_TYFhHn5su9g2IXxfrRlpu1PxqsAzbd5bjhR/s1600/4.png" /></a></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
ඔබ ඔබගේ .program එක Arduino Board එකට Upload කර ඇත. දැන් LED බල්බය Blink වන ආකාරය ඔබට දැක ගත හැකිය.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
Lahiru Dhananjayahttp://www.blogger.com/profile/04904665996384999048noreply@blogger.com2tag:blogger.com,1999:blog-4880340238784455124.post-57267076174582326282015-02-21T06:19:00.001-08:002015-02-21T06:19:37.324-08:00Trigger an email after submitting Google Formඅද ඔයාලට ගවේෂක Google Forms and Triggers ගැන කියන්නයි යන්නෙ..<br />
<br />
Event Registrations සදහා වර්තමානයේ ගොඩක්ම ජනප්රිය දෙයක් තමයි Google Forms කියන්නෙ. ඔයාල එහෙම Form එකක් submit කරාම ඔයාලගේ mail account එකට email එකක් ඇවිත් එහෙම ඇති නේද ?<br />
<br />
ඉතින් අපි බලමු කොහොමද ඒ වැඩේ කරගන්නෙ කියලා.<br />
<br />
First you need to goto your google drive and create a form application.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9GYsXUacOUZvtYuFPORdkYaIHDKMTjBwO434774mWXt9Gq1w_LTb47BLoatSZE0SZZHvxlngid2zBvRBFOh7bEmtd1yMtSd8S2CzEvhwxbYCnXCvcOw8dIM2LjruVsficPl6mhAGaldCB/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9GYsXUacOUZvtYuFPORdkYaIHDKMTjBwO434774mWXt9Gq1w_LTb47BLoatSZE0SZZHvxlngid2zBvRBFOh7bEmtd1yMtSd8S2CzEvhwxbYCnXCvcOw8dIM2LjruVsficPl6mhAGaldCB/s1600/1.png" height="320" width="195" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Then give a suitable name for it and add your fields for the form . In this case i added only the email address to enter in the form.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYe11a2NLMCqPBFXYEzE6oBLUm6VbeqaiRIpiogsUHTw2nkAabdzKqfXYKbYq8eMqTntLw25LS5s_bjKrl8PZ5eOBMwTmNxNqVlEwv7WS6k-IaxnNXN8JqyxSSLiQa27avFvbT23sFZ_1_/s1600/11.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYe11a2NLMCqPBFXYEzE6oBLUm6VbeqaiRIpiogsUHTw2nkAabdzKqfXYKbYq8eMqTntLw25LS5s_bjKrl8PZ5eOBMwTmNxNqVlEwv7WS6k-IaxnNXN8JqyxSSLiQa27avFvbT23sFZ_1_/s1600/11.png" height="93" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Then goto Tools -> Script editor </div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNTrK4xYfNNN8hIJQaAsT9CwRTGOx0kR5zeR-Hr1AkY71HYOGCihLcCm2CM6P1ayL2kYHum16ZrSqfYjLbMjB-ERVZ2agU_us00H-f390y64JeUZmApEL3g0Ig33px2gYRz9dxsOBBGSD2/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNTrK4xYfNNN8hIJQaAsT9CwRTGOx0kR5zeR-Hr1AkY71HYOGCihLcCm2CM6P1ayL2kYHum16ZrSqfYjLbMjB-ERVZ2agU_us00H-f390y64JeUZmApEL3g0Ig33px2gYRz9dxsOBBGSD2/s1600/2.png" height="48" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Choose blank project </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwU4_GTHdcOIGf1b_fIg6PCL6vEcRHKcBpaeKR2pytwMvni0GeCIW0CqVRoCPnoNzZRI7MXhw8LuIFxCUuTTRHMJc5FVgJfZdKlPp1kws6Fh-H8iqanSnhjTkY0RoyftJo2f5gQHG6dZC3/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwU4_GTHdcOIGf1b_fIg6PCL6vEcRHKcBpaeKR2pytwMvni0GeCIW0CqVRoCPnoNzZRI7MXhw8LuIFxCUuTTRHMJc5FVgJfZdKlPp1kws6Fh-H8iqanSnhjTkY0RoyftJo2f5gQHG6dZC3/s1600/3.png" height="259" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
Then add the follow code<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSPRGJbpdqzycmHACfCAciNXZYp3KjcQjIq7-1RZwdJgwf7sQzbq_8dM8VrEcdYR5fo41_NoIKNxSW6mvjDitcWAyOe-pEq47Zf0ZIIdrIG7VXnc1LyEagfk_yNW1pc8zVVujWLgxmCZJe/s1600/5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSPRGJbpdqzycmHACfCAciNXZYp3KjcQjIq7-1RZwdJgwf7sQzbq_8dM8VrEcdYR5fo41_NoIKNxSW6mvjDitcWAyOe-pEq47Zf0ZIIdrIG7VXnc1LyEagfk_yNW1pc8zVVujWLgxmCZJe/s1600/5.png" height="385" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
var message, means the message you need to send for each registration.It can be manuslly added in your spread sheet.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Also we set a column for email status to check whether email confirmation has been sent or not</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiL81AvvkEfq-G9eaV0YR5Ghdc_iu5G1SnhdmmH_o7yf61dZ81IiYiNGMKymIi-gknP7LVFTNAjW2KFryBufecA4Vn3wxS-LPT9spIgSkW-01ETKYnUbvOgq1NU8ct2I399Ngk_6aiJo7Y6/s1600/4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiL81AvvkEfq-G9eaV0YR5Ghdc_iu5G1SnhdmmH_o7yf61dZ81IiYiNGMKymIi-gknP7LVFTNAjW2KFryBufecA4Vn3wxS-LPT9spIgSkW-01ETKYnUbvOgq1NU8ct2I399Ngk_6aiJo7Y6/s1600/4.png" height="87" width="320" /></a></div>
<br />
So to set the code to be run as a trigger goto Resources->Current Project's triggers<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIhhuG3TA3C73f_1evhqKy7PaafvgED-oyKtfp30bdugZ99qizj4JTv6cwSAXHh0PTl3bKVjoiNzm5As0LnW2nWMAKFMS4gEMPaOaGdQBnSxVh-fG0xLMU2q62-96DRFeVCBydUjvI-e4g/s1600/6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIhhuG3TA3C73f_1evhqKy7PaafvgED-oyKtfp30bdugZ99qizj4JTv6cwSAXHh0PTl3bKVjoiNzm5As0LnW2nWMAKFMS4gEMPaOaGdQBnSxVh-fG0xLMU2q62-96DRFeVCBydUjvI-e4g/s1600/6.png" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkHGhrHzI6J27cOx2DawjoX1NLU0Swhgq_pwVNzkqCEpCCPZfirpmcvQExcX-ciHjms7LMuo-76s2miD6W0gfOE0RW5QC0_0Iy0wXLNQuyHy0asy2rWklkQ1Z8hPSVCCU9O352m0gYiS8i/s1600/7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkHGhrHzI6J27cOx2DawjoX1NLU0Swhgq_pwVNzkqCEpCCPZfirpmcvQExcX-ciHjms7LMuo-76s2miD6W0gfOE0RW5QC0_0Iy0wXLNQuyHy0asy2rWklkQ1Z8hPSVCCU9O352m0gYiS8i/s1600/7.png" height="66" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<br />
Add it as On Form submit then save it<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzNTX1bSt5sKfOS0Dcr0fw3ezyIw57OHB8lsJTrZjgEc6P2CsxmHh3ynHJfpGLa2AsVMUCu18LeV1kMeyesdMsQ_2acH5f0bUgHbevFQU9cbJ8cLmg7Wh5C9fjiyWWVhndoNlm6h5o2xs0/s1600/8.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzNTX1bSt5sKfOS0Dcr0fw3ezyIw57OHB8lsJTrZjgEc6P2CsxmHh3ynHJfpGLa2AsVMUCu18LeV1kMeyesdMsQ_2acH5f0bUgHbevFQU9cbJ8cLmg7Wh5C9fjiyWWVhndoNlm6h5o2xs0/s1600/8.png" height="77" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Then goto your form and enter your email and submit.</div>
<div class="separator" style="clear: both; text-align: left;">
After that you can see the following record is there and the email status is changed to "EMAIL_SENT".</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYbUMVmZEjn4c4wt5e8MZiFhyphenhyphensZSCDsz3hhRYM1VSbsbxtZqExo7v9rDBECqOV1WCf8nI7b987xxy4CIlaLua1Gh37HyB7K3tquiZ06LhU_lEGZaA8ofZgWFlBgXshWWstamK_i6h-1zsp/s1600/9.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYbUMVmZEjn4c4wt5e8MZiFhyphenhyphensZSCDsz3hhRYM1VSbsbxtZqExo7v9rDBECqOV1WCf8nI7b987xxy4CIlaLua1Gh37HyB7K3tquiZ06LhU_lEGZaA8ofZgWFlBgXshWWstamK_i6h-1zsp/s1600/9.png" height="57" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Finally chheck your emails :)</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhG6MzIePIW3MInHJg2rrb0thab4hjOE9LSh31fami_fOBLEdCmj3EnbV6V4sRKV8bfWldcI2kozSoN_5XYTFFlZ37ctFefVGbBQuD2fne2rbQc5-AZdI8FPY2r2iLy92qgrdSnbpDvwJyt/s1600/10.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhG6MzIePIW3MInHJg2rrb0thab4hjOE9LSh31fami_fOBLEdCmj3EnbV6V4sRKV8bfWldcI2kozSoN_5XYTFFlZ37ctFefVGbBQuD2fne2rbQc5-AZdI8FPY2r2iLy92qgrdSnbpDvwJyt/s1600/10.png" height="55" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I hope you will understand how it was done using triggers .So keep in touch with the explorer. We will meet on next Post .</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<br />
<br />
<br />Lahiru Dhananjayahttp://www.blogger.com/profile/04904665996384999048noreply@blogger.com0tag:blogger.com,1999:blog-4880340238784455124.post-21509243204963310412015-02-11T19:56:00.001-08:002015-02-13T06:56:26.132-08:00Facebook App- Buddy Cricket<div class="separator" style="clear: both; text-align: left;">
ඔන්න අද World Cup එකට හදපු facebook app එකක තොරතුරු ගවේෂක ඔයාලට ගේනවා </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUGemEHOgOjAwiV4IRvy-esEVTDyvNwXWjkmMJgOlIyds1bQ72XuJSqT11lYMKVUWk2G7kVYrmRP5brpnw42jSG50dqi-AG_o8JKzR_Nps-vKf9seOgYAlx_5dQw6vjcubW9qBEq_R8UvM/s1600/10967886_382518715262966_1719357427_n.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUGemEHOgOjAwiV4IRvy-esEVTDyvNwXWjkmMJgOlIyds1bQ72XuJSqT11lYMKVUWk2G7kVYrmRP5brpnw42jSG50dqi-AG_o8JKzR_Nps-vKf9seOgYAlx_5dQw6vjcubW9qBEq_R8UvM/s1600/10967886_382518715262966_1719357427_n.jpg" height="218" width="400" /></a></div>
<div align="center" class="separator" style="margin-bottom: .0001pt; margin: 0in; text-align: center;">
<br /></div>
<div style="margin-bottom: .0001pt; margin: 0in;">
<br /></div>
<div style="margin-bottom: .0001pt; margin: 0in; text-align: justify;">
<span lang="SI-LK" style="font-family: 'Iskoola Pota', sans-serif; font-size: 13.5pt;">වසර හතරකට වරක් එළඹෙන </span><span style="font-size: 13.5pt;">2015</span><span lang="SI-LK" style="font-family: 'Iskoola Pota', sans-serif; font-size: 13.5pt;"> ලෝක කුසලාන ක්රිකට් තරගාවලියේ උණුසුමත් සමග අපට
දක්නට ලැබෙන නොයෙක් අන්දමේ වැඩසටහන් අතුරින් අන්තරජාලය හා වෙනත් ක්රම තුලින් මේ
දිනවල අපට නිතරම පාහේ දකින්න අහන්න ලැබෙන ජනප්රිය මාතෘකාවක් තමයි </span><span style="font-size: 13.5pt;">Buddy Cricket </span><span lang="SI-LK" style="font-family: 'Iskoola Pota', sans-serif; font-size: 13.5pt;">කියන්නේ.
මොකක්ද මේ </span><span style="font-size: 13.5pt;">Buddy Cricket </span><span lang="SI-LK" style="font-family: 'Iskoola Pota', sans-serif; font-size: 13.5pt;">කියන්නේ කියලා තමයි අද අපි මේ ලිපියෙන් කතා කරන්න යන්නේ.</span><span style="font-size: 13.5pt;"><o:p></o:p></span></div>
<div style="margin-bottom: .0001pt; margin: 0in; text-align: justify;">
<br /></div>
<div style="margin-bottom: .0001pt; margin: 0in; text-align: justify;">
<span style="font-size: 13.5pt;">2015</span><span lang="SI-LK" style="font-family: 'Iskoola Pota', sans-serif; font-size: 13.5pt;"> ලෝක
කුසලාන </span><span style="font-size: 13.5pt;">Cricket </span><span lang="SI-LK" style="font-family: 'Iskoola Pota', sans-serif; font-size: 13.5pt;">තරඟාවලිය වෙනුවෙන් දක්නට ලැබෙන වැඩසටහන් අතුරින්</span><span style="font-size: 13.5pt;"> </span><span lang="SI-LK" style="font-family: 'Iskoola Pota', sans-serif; font-size: 13.5pt;">ඩ්රීම්
විෂන් ආයතනය මගින් ක්රිකට් ක්රීඩා වැඩසටහනක් හඳුන්වා දීමට නියමිතය. මේ අපි අද
කතා කරන </span><span style="font-size: 13.5pt;">Buddy Cricket </span><span lang="SI-LK" style="font-family: 'Iskoola Pota', sans-serif; font-size: 13.5pt;">කියන්නේ මේ ක්රීඩා වැඩසටහනට තමයි. තවද ඩ්රීම් විෂන් ආයතනය මගින්
පසුගිය කාලය පුරාවට තොරතුරු තාක්ෂණික ක්ෂේත්රයේ දැවැන්ත කාර්යයන් කීපයක්ම සිදු කල
අතර. එමගින් තොරතුරු තාක්ෂණික ක්ෂේස්ට්රයේ ඉහල තැනක් ලබා ගැනීමට ඔවුන්ට හැකියාව
ලැබුනා.</span><span style="font-size: 13.5pt;"><o:p></o:p></span></div>
<div style="margin-bottom: .0001pt; margin: 0in; text-align: justify;">
<br /></div>
<div style="margin-bottom: .0001pt; margin: 0in; text-align: justify;">
<span style="font-size: 13.5pt;">Facebook </span><span lang="SI-LK" style="font-family: 'Iskoola Pota', sans-serif; font-size: 13.5pt;">සමාජ
වෙබ් අඩවිය ඉලක්ක කර ගනිමින් ක්රියාත්මක කරනු ලබන මෙම වැඩසටහන හුදෙක් වැඩසටහනක්ම
පමණක් නොව ක්රීඩාවක් යනුවෙන් ද හඳුන්වා දිය හැකිය. මෙම නව ආරේ විනෝදකාමී වැඩසටහන
මගින් ලංකාවේ ක්රීඩා ලෝලීන්ට ඔවුන් සතුව පවතින ක්රිකට් ක්රීඩාව පිලිම්බන්දව
පවතින දැනුම</span><span style="font-size: 13.5pt;">, </span><span lang="SI-LK" style="font-family: 'Iskoola Pota', sans-serif; font-size: 13.5pt;">තරංග මාලාවේ ජයග්රාහී කණ්ඩායම් මොනවද යන බව</span><span style="font-size: 13.5pt;">, </span><span lang="SI-LK" style="font-family: 'Iskoola Pota', sans-serif; font-size: 13.5pt;">ඔවුන්
රැස් කරන ලකුණු ගණන සහ තරඟයේ වීරයා කව්ද යන්න වැනි තවත් නොයෙකුත් ක්රියාකාරකම් මේ
වැඩසටහන මගින් පරිශ්ලකයින්ට අත් විඳීමට හැකියාව ලැබේ.</span><span style="font-size: 13.5pt;"><o:p></o:p></span></div>
<div style="margin-bottom: .0001pt; margin: 0in; text-align: justify;">
<br /></div>
<div style="margin-bottom: .0001pt; margin: 0in; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjy24Y85Lxm2uDrSC_pSFVMexyf1QValc-QQZXw2vh0y28NbCVMMXpwN1y5c2m9P55_sqWdFQ3IQ-0hJBLYETh8eIPR3TojwCD1hyw9y_GZ-YQK9CH0utVnxT9vFIQDJPy1v_1pDjfmDnho/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjy24Y85Lxm2uDrSC_pSFVMexyf1QValc-QQZXw2vh0y28NbCVMMXpwN1y5c2m9P55_sqWdFQ3IQ-0hJBLYETh8eIPR3TojwCD1hyw9y_GZ-YQK9CH0utVnxT9vFIQDJPy1v_1pDjfmDnho/s1600/1.png" height="209" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBsZIQx-hi8VwqLCX7xcVxUCmKd0Oe0rM4_ogdcur7cijGY-_0_M7ohYP7iW557oWovg9CqclOmyA3vn4pEIwXCMWJdys5DtFtVjpND3CxScWfeqHhX6iek9v8MA5hUqeFxMVk6juQLYl9/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBsZIQx-hi8VwqLCX7xcVxUCmKd0Oe0rM4_ogdcur7cijGY-_0_M7ohYP7iW557oWovg9CqclOmyA3vn4pEIwXCMWJdys5DtFtVjpND3CxScWfeqHhX6iek9v8MA5hUqeFxMVk6juQLYl9/s1600/2.png" height="209" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZA16RsF-IpMFkCOC-z5YvQNx5M2TD_lSin1eFsLn8FqGctVs8lruVEJzeRF-KBcTiIVzArzO2M4SnqCp0vuLS6ylFUFzuIgVZYk293DCGHAFjTjoPmXhPkmBGRzXy_Ch8X9ij_xzsCd9v/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZA16RsF-IpMFkCOC-z5YvQNx5M2TD_lSin1eFsLn8FqGctVs8lruVEJzeRF-KBcTiIVzArzO2M4SnqCp0vuLS6ylFUFzuIgVZYk293DCGHAFjTjoPmXhPkmBGRzXy_Ch8X9ij_xzsCd9v/s1600/3.png" height="209" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixEMsaIXnTeQXKmL4ruUDwMsjcyLTRxFOhCY-A-HRm5OGJtNKOkwpPDZmALqdopE9iMii9H6HhncWThGJwnGICPx9YAl3WMMBb5zXqjg6Gt6vKauywxOmtrM2I3Z9Ydi4v3rgOtbajxZfa/s1600/5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixEMsaIXnTeQXKmL4ruUDwMsjcyLTRxFOhCY-A-HRm5OGJtNKOkwpPDZmALqdopE9iMii9H6HhncWThGJwnGICPx9YAl3WMMBb5zXqjg6Gt6vKauywxOmtrM2I3Z9Ydi4v3rgOtbajxZfa/s1600/5.png" height="209" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjO0cOuN0NzUjE1wlCerHW3K9pylSXidAC8ILPY7S6bauCH2MnL6fdQyVIOoegcPcZpnMM4lndFka0WrsfpwF6fK_HrcGArT96tbMFF9MhCs4wDgriYxjoHuiAkXRwzashxaCDB94ozi2eD/s1600/welcome+.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjO0cOuN0NzUjE1wlCerHW3K9pylSXidAC8ILPY7S6bauCH2MnL6fdQyVIOoegcPcZpnMM4lndFka0WrsfpwF6fK_HrcGArT96tbMFF9MhCs4wDgriYxjoHuiAkXRwzashxaCDB94ozi2eD/s1600/welcome+.jpg" height="179" width="320" /></a></div>
<div align="center" class="separator" style="margin-bottom: .0001pt; margin: 0in; text-align: center;">
<br /></div>
<div align="center" class="separator" style="margin-bottom: .0001pt; margin: 0in; text-align: center;">
<br /></div>
<div align="center" class="separator" style="margin-bottom: .0001pt; margin: 0in; text-align: center;">
<span lang="SI-LK" style="font-family: 'Iskoola Pota', sans-serif; font-size: 13.5pt;">ක්රීඩාවේ අතුරු මුහුණත් කීපයක්</span><span style="font-size: 13.5pt;"><o:p></o:p></span></div>
<div style="margin-bottom: .0001pt; margin: 0in; text-align: justify;">
<br /></div>
<div style="margin-bottom: .0001pt; margin: 0in; text-align: justify;">
<br /></div>
<div style="margin-bottom: .0001pt; margin: 0in; text-align: justify;">
<span lang="SI-LK" style="font-family: 'Iskoola Pota', sans-serif; font-size: 13.5pt;">ක්රීඩාවේ ස්වභාවය ගැන යමක් කියනවනම් නිත්ය ඕවරය යටතේ ප්රශ්න </span><span style="font-size: 13.5pt;">06</span><span lang="SI-LK" style="font-family: 'Iskoola Pota', sans-serif; font-size: 13.5pt;">ක් ද</span><span style="font-size: 13.5pt;">, </span><span lang="SI-LK" style="font-family: 'Iskoola Pota', sans-serif; font-size: 13.5pt;">සුපිරි
ඕවරය යටතේ ප්රශ්න </span><span style="font-size: 13.5pt;">03</span><span lang="SI-LK" style="font-family: 'Iskoola Pota', sans-serif; font-size: 13.5pt;">ක් ද</span><span style="font-size: 13.5pt;">, </span><span lang="SI-LK" style="font-family: 'Iskoola Pota', sans-serif; font-size: 13.5pt;">තරංග පදනම් කර ගත වීඩියෝ පට අනුසාරයෙන් අනුමාන ප්රශ්නයකටද පිළිතුරු
සැපයීමටද අවස්ථාව පරිශීලකයින්ට උදාවෙනවා. ආරංචි විදියට මෙම ක්රීඩාවේ ජයග්රාහකයින්ට ත්යාග පිරි නැමීමට ඩ්රීම් විෂන් ආයතනය පියවර අරන් තියෙනවා.</span><span style="font-size: 13.5pt;"> <o:p></o:p></span></div>
<div style="margin-bottom: .0001pt; margin: 0in; text-align: justify;">
<br /></div>
<br />
<div style="margin-bottom: .0001pt; margin: 0in; text-align: justify;">
<span lang="SI-LK" style="font-family: 'Iskoola Pota', sans-serif; font-size: 13.5pt;">මෙවැනි වැඩසටහනක් නිර්මාණය කිරීමේ එක් ප්රධාන බලාපොරොත්තුවක් නම් ක්රිකට්
ලෝලිත්වය වැඩි කරමින් මෙවර ලෝක කුසලානය ලංකාවට හිමිකර දීමට ජනතාව උද්යෝගිමත්
කිරීමට දායක වීම. කෙසේ වෙතත් </span><span style="font-size: 13.5pt;">Facebook
</span><span lang="SI-LK" style="font-family: 'Iskoola Pota', sans-serif; font-size: 13.5pt;">රසිකයින් මෙම වැඩසටහන සමග අත්වැල් බැඳගනු නොඅනු මානයි.</span><span style="font-size: 13.5pt;"><o:p></o:p></span></div>
Lahiru Dhananjayahttp://www.blogger.com/profile/04904665996384999048noreply@blogger.com0tag:blogger.com,1999:blog-4880340238784455124.post-56326886650343800592015-02-07T23:03:00.003-08:002015-02-07T23:03:52.910-08:00Create your First Chrome Application<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiq4PJWeU95__1R0Xka7k4-aUQXk_qcdoyIo09fTlQ1yViwJ5cX_DGv2p6gh_L0nbIHwsURXKBrNrq8MxDcMl5D70rtDYLVHGQ-xhCNIpAdztW9rAcENy9f2Q3Ea1KXg-MvFZ2qhE66phtL/s1600/chrome_web_store_logo-100029795-gallery.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiq4PJWeU95__1R0Xka7k4-aUQXk_qcdoyIo09fTlQ1yViwJ5cX_DGv2p6gh_L0nbIHwsURXKBrNrq8MxDcMl5D70rtDYLVHGQ-xhCNIpAdztW9rAcENy9f2Q3Ea1KXg-MvFZ2qhE66phtL/s1600/chrome_web_store_logo-100029795-gallery.jpg" height="214" width="320" /></a></div>
<br />
අද අපි ඉතාමත් සරල Chrome එකක් හදාගන්නෙ කොහොමද කියලා බලමු.<br />
<br />
ඒ සදහා අපිට පහත file structure එක හදාගන්න වෙනවා<br />
<br />
background.js<br />
manifest.json<br />
window.html<br />
<br />
මෙහි. window.html මගින් App එකෙහි UI එකට අදාල කොටසත් manifest.json මගින් App එකෙහි තොරතුරුත් background.js මගින් chrome එකෙහි App එක run වීමට අදාල js script එකත් අන්තර් ගත වෙනවා .<br />
<br />
ඉස්සෙල්ලම එහෙනම් App එකේ config file එක හදාගමු .<br />
<br />
<u>manifest.json</u><br />
<u><br /></u>
<span style="color: blue;">{</span><br />
<span style="color: blue;"> "name": "Hello </span><span style="color: blue;">Explorer</span><span style="color: blue;">!",</span><br />
<span style="color: blue;"> "description": "My first Chrome App",</span><br />
<span style="color: blue;"> "version": "1",</span><br />
<span style="color: blue;"> "manifest_version": 2,</span><br />
<span style="color: blue;"> "app": {</span><br />
<span style="color: blue;"> "background": {</span><br />
<span style="color: blue;"> "scripts": ["background.js"]</span><br />
<span style="color: blue;"> }</span><br />
<span style="color: blue;"> },</span><br />
<span style="color: blue;"> "icons": { "16": "first-16.png", "128": "</span><span style="color: blue;">first</span><span style="color: blue;">-128.png" }</span><br />
<br />
<span style="color: blue;">} </span><br />
<br />
මෙම file එක තුල අදාල js file එකෙහි path එකත් define කරයි .එමෙන්ම icons ලෙස 16*16 සහ 128*128 pixels පරිමාණයේ ඔබ කැමති png images දෙකක්ද අදාල folderය තුලට include කරගන්න.<br />
<br />
<u>window.html</u><br />
<u><br /></u>
<span style="color: blue;"><!DOCTYPE html></span><br />
<span style="color: blue;"><html></span><br />
<span style="color: blue;"> <head></span><br />
<span style="color: blue;"> </head></span><br />
<span style="color: blue;"> <body></span><br />
<span style="color: blue;"> <div>Hello, Explorer!</div></span><br />
<span style="color: blue;"> </body></span><br />
<br />
<span style="color: blue;"></html></span><br />
<span style="color: blue;"><br /></span>
<u>background.js</u><br />
<u><br /></u>
<span style="color: blue;">chrome.app.runtime.onLaunched.addListener(function() {</span><br />
<span style="color: blue;"> chrome.app.window.create('window.html', {</span><br />
<span style="color: blue;"> 'bounds': {</span><br />
<span style="color: blue;"> 'width': 400,</span><br />
<span style="color: blue;"> 'height': 500</span><br />
<span style="color: blue;"> }</span><br />
<span style="color: blue;"> });</span><br />
<br />
<span style="color: blue;">});</span><br />
<span style="color: blue;"><br /></span>
දැන් Chrom හි More Tools->Extensions වෙත ගොස් Load unpacked extension මගින් ඔබේ App එකට අදාල folder එකෙහි path එක ලබා දෙන්න .<br />
<br />
දැන් ඔබේ App එක Launch කරන්න .ක<br />
<br />
<span style="color: blue;"><br /></span>Lahiru Dhananjayahttp://www.blogger.com/profile/04904665996384999048noreply@blogger.com0tag:blogger.com,1999:blog-4880340238784455124.post-13065633463850984812015-01-08T09:06:00.003-08:002015-02-07T22:36:42.360-08:00USSD Idea Pro Application Developing (Php) - Part II<div>
<span style="font-family: Arial, Helvetica, sans-serif;">අද අපි බලමු කොහොමද USSD Menu එකක් අපිට ඕන විදියට හදාගන්නෙ කියලා</span></div>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<a href="http://explorer0101.blogspot.com/2014/11/ussd-idea-pro-application-developing.html" target="_blank"><span style="font-family: Arial, Helvetica, sans-serif;">USSD Idea Pro Application Developing (Php) - Part I</span></a><br />
<div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">Let's say that you are going to implement a system for a shop which needed to have a menu with</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<br />
<ol>
<li><span style="font-family: Arial, Helvetica, sans-serif;">Item Category</span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">Purchase Items</span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">Contact Us</span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">Exit</span></li>
</ol>
<ol>
</ol>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;">Also there can be sub menu's as you prefered.</span></div>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;">eg - In item category there can be sub categories </span></div>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;">දැන් අපි සාමාන්යයෙන් මේ වගේ menu එකක් implement කරන්න යනකොට එ් අදාල code එක සදහා වැඩියෙන්ම භාවිතා කරන්නෙ switch cases තමයි . අපිට if else වලිනුත් ඒ විදියටම කරන්න පුලුවන් නමුත් code එක complex වෙන්න වෙන්න වඩාත්ම use කරන්න හොද switch cases.</span></div>
<div>
<br /></div>
<div>
<span style="background-color: white;"><span style="color: #20124d; font-family: Courier New, Courier, monospace; font-size: x-small;">switch (n) {<br /> case label1:<br /> code to be executed if n=label1;<br /> break;<br /> case label2:<br /> code to be executed if n=label2;<br /> break;<br /> case label3:<br /> code to be executed if n=label3;<br /> break;<br /> ...<br /> default:<br /> code to be executed if n is different from all labels;<br />}</span></span></div>
<div>
<span style="background-color: white;"><span style="color: #351c75;"><span style="font-family: Consolas, 'courier new'; font-size: 14.4444446563721px;"><br /></span></span></span>
<span style="background-color: white;"><span style="font-family: Arial, Helvetica, sans-serif;">ඉස්සෙල්ලම අපි main menu එක load කරන විදිය බලමු</span></span></div>
<div>
<span style="background-color: white;"><span style="color: #351c75;"><span style="font-family: Consolas, 'courier new'; font-size: 14.4444446563721px;"><br /></span></span></span>
<span style="background-color: white; color: #351c75; font-family: Consolas, courier new; font-size: 14px;">$responseMsg </span><span style="background-color: white; font-family: Arial, Helvetica, sans-serif;">කියන variable එකෙ තමයි අපි ඉස්ලේලම menu එකේ එන text එක දාන් නෙ.</span><br />
<br />
<span style="color: #073763; font-family: Arial, Helvetica, sans-serif; font-size: x-small;"><span style="background-color: white;">$responseMsg = array(</span></span><br />
<span style="color: #073763; font-family: Arial, Helvetica, sans-serif; font-size: x-small;"><span style="background-color: white;"> "main" =>" </span>Welcome To First USSD Tutorial</span><br />
<span style="color: #073763; font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> 1.Item Category</span><br />
<span style="color: #073763; font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> 2.Purchase Item</span><br />
<span style="color: #073763; font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> 3.Contact Us</span><br />
<span style="color: #073763; font-family: Arial, Helvetica, sans-serif; font-size: x-small;"> 99.Exit",</span><br />
<span style="color: #073763; font-family: Arial, Helvetica, sans-serif; font-size: x-small;"><span style="background-color: white;"> );</span></span><br />
<span style="background-color: white; font-family: Arial, Helvetica, sans-serif;"><br /></span>
මෙහි value parameters වන main ප්රථමයෙන්ම main menu එකහි load වී<span style="font-family: Arial, Helvetica, sans-serif;"><span style="background-color: white;"> ඉන් පසුව අවශ්යය session menu's add කිරීම මෙම array එකෙහි value parameters වෙනස් කිරීමෙන් ලබාගත හැක.</span></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="background-color: white;"><br /></span></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="background-color: white;">USSD Operation '<b>mo-init</b>' and '<b>mo-cont</b>' ලෙස කොටස් දෙකකට වෙන් කර හැක. මෙහි </span></span><b style="font-family: Arial, Helvetica, sans-serif;">mo-init </b><span style="font-family: Arial, Helvetica, sans-serif;">යනු USSD Code එක Mobile එකෙන් dial කරන විටදී එන පලමු view එකත් </span><b style="font-family: Arial, Helvetica, sans-serif;">mo-cont </b><span style="font-family: Arial, Helvetica, sans-serif;">යනු User Input ලබාදෙන විටදී කේතය තුල යොදන විධානයකි.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhm69E1Oaj7FoGs13JEfOc7r_iNkMVsyiqc46BXLIDbLUftHW_J7pn6byTaI7gXkoKofUw2N8qgK7j-hkpzrjBZb7XpjBHuPiCHTAJavfncJ6x50SSmb1EGUWmh3ZqFX6MD-lEQ6gnVfyeX/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhm69E1Oaj7FoGs13JEfOc7r_iNkMVsyiqc46BXLIDbLUftHW_J7pn6byTaI7gXkoKofUw2N8qgK7j-hkpzrjBZb7XpjBHuPiCHTAJavfncJ6x50SSmb1EGUWmh3ZqFX6MD-lEQ6gnVfyeX/s1600/1.png" height="158" width="400" /></a></div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<br />
<span style="font-family: Arial, Helvetica, sans-serif;">මෙහි <b>mo-init </b>තුල ප්රධාන view එකත් ඉන් පසු <b>mo-cont </b>තුල user input වලට ගැලපෙන ආකාරයෙනුත් implement කරනු ලැබේ.</span><br />
<br />
<span style="background-color: white; color: #073763; font-family: Arial, Helvetica, sans-serif; font-size: x-small;">$responseMsg </span><span style="background-color: white; font-family: Arial, Helvetica, sans-serif;">array එකෙහි අදාල value parameters දී අවශ්යය වටදී ඒවා session එකකට save කිරීම මගින් නිසියාකාරව steps පියවරෙන් පියවර Display වීමට යෙදිය හැක.</span><br />
<span style="background-color: white; font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="background-color: white; font-family: Arial, Helvetica, sans-serif;"><b><u>User Inputs වලට අදාලව menu එක සැකසීම</u></b></span><br />
<span style="background-color: white; font-family: Arial, Helvetica, sans-serif;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYzx7Jct3Vgh3vI27t0M5kQCr9bn6zHv3YEtB4CboTw-GYTi9S6Kl4yrz-WZFuSBdFyZ0vBZ1b5hyohi_rf0l2LDzJEF1dT502_izD4JMx2BiJpvoZJkyzrG1OX5GcgnfpwVW6ETkSz-x5/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYzx7Jct3Vgh3vI27t0M5kQCr9bn6zHv3YEtB4CboTw-GYTi9S6Kl4yrz-WZFuSBdFyZ0vBZ1b5hyohi_rf0l2LDzJEF1dT502_izD4JMx2BiJpvoZJkyzrG1OX5GcgnfpwVW6ETkSz-x5/s1600/2.png" height="306" width="320" /></a></div>
<span style="background-color: white; font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<span style="background-color: white;"><span style="font-family: Arial, Helvetica, sans-serif;">ඉහත පරිදි ප්රධාන menu ව වෙත පිවිසීමෙන් අනතුරුව User Input No 1 නම් itemCategory ලෙස session එක නමි කර ඊට අදාල implementation කොටස වෙනත් case එකක් තුල implement කරනු ලැබේ .</span></span><br />
<span style="background-color: white;"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="background-color: white;">මෙලෙස ප්රධාන categories දැමීමෙන් අනතුරුව No : 99 input කරවිට පවතින menu වෙන් වනලෙස සැකසිය යුතුයි.එය පහත පරිදි වේ.</span></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="background-color: white;"><br /></span></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiznsDUNLAxcFrxrlRKL_Yc5GHAancKkJRmsNszI2N81QuZGy01nsMHFWsOeketK1AC-EhuLLoauNRQ7tzsvCnbb62MA6vqR7pw5KkBxZsrueQ3WdUsxnVBS8xV9spU3iOHiKpy8StOqOqe/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiznsDUNLAxcFrxrlRKL_Yc5GHAancKkJRmsNszI2N81QuZGy01nsMHFWsOeketK1AC-EhuLLoauNRQ7tzsvCnbb62MA6vqR7pw5KkBxZsrueQ3WdUsxnVBS8xV9spU3iOHiKpy8StOqOqe/s1600/3.png" height="171" width="640" /></a></div>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="background-color: white;"><br /></span></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="background-color: white;"><br /></span></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="background-color: white;">මෙම පැහැදිලි කිරීම් අනුව සුදුසු ලෙස. USSD එකට අදාල ලෙස implementation කිරීම සිදුකරගතහැකි ආකාර පිලිබද මනා අවබෝධයක්ක ඇති වේ යැයි ගවේෂක බලාපොරොත්තු වෙයි.</span></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="background-color: white;"><br /></span></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="background-color: white;">දැන් ඔබට අව්යය ලෙස ඔබේ USSD Application එක සාදා ගැනීමට උත්සාහ කරන්න. ප්රශ්න ඇතොත් එවා පහතින් comment කරන්න. </span></span><br />
.</div>
</div>
Lahiru Dhananjayahttp://www.blogger.com/profile/04904665996384999048noreply@blogger.com5tag:blogger.com,1999:blog-4880340238784455124.post-56710282542032559842014-11-26T19:47:00.003-08:002015-02-07T22:36:21.962-08:00USSD Idea Pro Application Developing (Php) - Part Iඅද ගවේෂක ඔයාලට ගේන්නෙ නැවුම්වු අද්දැකීමක්. ඒ තමයි Dialog Ideamart Platform එකෙහි තිබෙන USSD Api එක ගැන , කොහොමද Idea Pro App එකක් Develop කරන්නෙ කියලා.<br />
<br />
<br />
මේ tutorial එකෙන් ගොඩක්ම ප්රයෝජනයක් තියෙන්නෙ<br />
අලුතින්ම Application හදන අයටයි , Idea Apps හදලා තියෙන Idea Pro App හදන්නෙ කොහොමද කියලා දැන ගන්න ඔින අයටයි .<br />
<br />
මොකක්ද මේ USSD කියන්නෙ ?<br />
<br />
Unstructured Supplementary Service Data.<br />
<br />
ඒ කිව්වේ ??????????? :o<br />
<br />
දැන් ඔයාල ඔයාලගේ Mobile වලින් Short Codes Type කරලා Menu එකක් Popup කරගන්නෙ....<br />
<br />
අන්න ඒ Service එක තමයි USSD කියන්නෙ . සාමාන්යයෙන් dialog users ලගෙ *#456# වගේ Short Code වගේ ඒවා ....<br />
<br />
http://www.ideamart.lk/idea-pro සයිට් එකට ගිහින් Developer Bundle එක Download කරගන්න<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzP1mZPrBLDcaB0QTs9BSJZckmNCdSeM7PTPE8T-8oWDohq8sVDTogCjNrv6v96gGv0x5-LIPMGa5UgtA-uPczOmz_iu8bJKKCWIWnfZaYdZUC7drBawU_l_55rfiAJFasRNNwixmxrue4/s1600/s1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzP1mZPrBLDcaB0QTs9BSJZckmNCdSeM7PTPE8T-8oWDohq8sVDTogCjNrv6v96gGv0x5-LIPMGa5UgtA-uPczOmz_iu8bJKKCWIWnfZaYdZUC7drBawU_l_55rfiAJFasRNNwixmxrue4/s1600/s1.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
දැන් ඔබ download කරගත් location එකට command prompt එක භාවිතාකර path එක සාදා ගන්න</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSdH8f3K2NKfeqVU7AtltNfvkSR8zQLt8HNXfHIMZPvj4h7dWUd32prB8a5eF6bMy3fpHRzssFrjZeED9Sj5CpGTTHo6V7tJM1FtjbhZ_08Z-gCFicI03GvlNC7P-5BShq4eV9czZxSGdP/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSdH8f3K2NKfeqVU7AtltNfvkSR8zQLt8HNXfHIMZPvj4h7dWUd32prB8a5eF6bMy3fpHRzssFrjZeED9Sj5CpGTTHo6V7tJM1FtjbhZ_08Z-gCFicI03GvlNC7P-5BShq4eV9czZxSGdP/s1600/1.png" height="345" width="640" /></a></div>
<br />
දැන් sdp-simulator.bat console , command එක යොදා Wrapper එක start කරගන්න<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFSI5iwYhbkZH5oZgn730Jt69BTWVIgNp5U8Sg0hHnXs0VAY8a2XIJZckliJyAsBDq6nPHHK-T93mGl0tASXtYheu0xjHbXeCBnEB40e8fUr2zAG-3DLR0Jrdq5C1tpwMMuEL_Wm5BN-QS/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFSI5iwYhbkZH5oZgn730Jt69BTWVIgNp5U8Sg0hHnXs0VAY8a2XIJZckliJyAsBDq6nPHHK-T93mGl0tASXtYheu0xjHbXeCBnEB40e8fUr2zAG-3DLR0Jrdq5C1tpwMMuEL_Wm5BN-QS/s1600/2.png" height="324" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtBDij2vo1EBUx-sLKwiSA2lk2BX9npxnxN-opg8naXQm97jiTYN4CfPBHb_fKK65JFBPpdnZi6KWo5d73fyIFb7J1gvF9Na2mus1lz1SmjU8Ee39GWq8EceQGDjQHiIs0jbbu4vCqj9v5/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtBDij2vo1EBUx-sLKwiSA2lk2BX9npxnxN-opg8naXQm97jiTYN4CfPBHb_fKK65JFBPpdnZi6KWo5d73fyIFb7J1gvF9Na2mus1lz1SmjU8Ee39GWq8EceQGDjQHiIs0jbbu4vCqj9v5/s1600/3.png" height="324" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgm8MKdDWIp7g-AxlFMdapP4s47a57rRHJz6sDRaA9pWlPiM99NF8cM2IFKMzTVJe5SVK-FTLzyfPTShKlwGs3fNAcnzsYXkOUs3DkS25F2NaTcQBvHvLU86HZeUhdIuVtKsHiLk6G7UFnR/s1600/4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgm8MKdDWIp7g-AxlFMdapP4s47a57rRHJz6sDRaA9pWlPiM99NF8cM2IFKMzTVJe5SVK-FTLzyfPTShKlwGs3fNAcnzsYXkOUs3DkS25F2NaTcQBvHvLU86HZeUhdIuVtKsHiLk6G7UFnR/s1600/4.png" height="322" width="640" /></a></div>
<br />
දැන් ඔබ ideamart simulator එක run කිරීම සදහා අවශ්යය මුලික පියවර අනුගමනය කර අවසානය<br />
<br />
simulator එකෙහි අපි run කරන php file එක localhost server එක තුල අලුතින් folder එකක් සාදා එයට ඔබ download කරගත් sample ussd php application එක paste කරගන්න.<br />
<br />
මෙහි A යනු ඔබ ideamart dveloper bundle එක බාගත කරගත් ස්ථානය වන අතර B යනු wamp sever එකෙහි localhost server එකට අදාල ස්ථානයයි.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEhxZdxmUxuaV3rll7k-2_UPI3SD7DoBlzE0x3mCgUG_jNafeeDxNdXEi8ZA13l9dHw0Q6S3BO6S44Ke7Qytg_ZbR9Ly_HZClD1xCU9JuUllsxF8DtA24D9Ffuph-6uyMxCVLP9BcMr3Uf/s1600/9.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEhxZdxmUxuaV3rll7k-2_UPI3SD7DoBlzE0x3mCgUG_jNafeeDxNdXEi8ZA13l9dHw0Q6S3BO6S44Ke7Qytg_ZbR9Ly_HZClD1xCU9JuUllsxF8DtA24D9Ffuph-6uyMxCVLP9BcMr3Uf/s1600/9.png" height="138" width="640" /></a></div>
<br />
<br />
ඊළගට ussd සදහා අවශ්යය වන libraries පහත අාකාරයට සුදුසු ස්ථානයට copy paste කරගන්න<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmHOoCxp0Xn7h3DEJ2xKywSZU1BC8Fjp9bCLUfd6mjQ0S_Qkj0fFQ86pAOFac6AxUE_8FUfaSXBcuDJSWx3s2-j_6UyqZ2W9mGfQuZGHJXC65wBGKlPHM1eidLcXkD6doiD3AKKrHaRkmQ/s1600/10.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmHOoCxp0Xn7h3DEJ2xKywSZU1BC8Fjp9bCLUfd6mjQ0S_Qkj0fFQ86pAOFac6AxUE_8FUfaSXBcuDJSWx3s2-j_6UyqZ2W9mGfQuZGHJXC65wBGKlPHM1eidLcXkD6doiD3AKKrHaRkmQ/s1600/10.png" height="96" width="640" /></a></div>
<br />
<br />
දැන් ඔබේ wamp හෝ xampp server එක run කරගන්න<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaurFUClotuK6p3i33Pm6jLv7TlSpeXXNtMGsDJKShlTQZYyvYG3rIaDdiTznKutNUveClFwDxxTDrhphsWsQE-OlnchaG469zu9jvOHMQHHimuCqIMJAnWrpFjye4cvt53sJ5oLPJDt16/s1600/5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaurFUClotuK6p3i33Pm6jLv7TlSpeXXNtMGsDJKShlTQZYyvYG3rIaDdiTznKutNUveClFwDxxTDrhphsWsQE-OlnchaG469zu9jvOHMQHHimuCqIMJAnWrpFjye4cvt53sJ5oLPJDt16/s1600/5.png" height="180" width="400" /></a></div>
<br />
ඔබ wamp server නිසි ආකාරව open කරගත්තානම් පහත පරිදි දිස්වනු ඇත<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgObNA0y94FP_FhDYRf5twCrpigyPanJWtVQ5c2zNFQCBb7fAn6QkCqGPaAngP_4BGpHx0PznYTwmwEV1Mv3D285M8wPGwTXJhYO9bA07lLe0n-8gPqofBJ6fW-asHNg3atijQXPC6jo3pH/s1600/6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgObNA0y94FP_FhDYRf5twCrpigyPanJWtVQ5c2zNFQCBb7fAn6QkCqGPaAngP_4BGpHx0PznYTwmwEV1Mv3D285M8wPGwTXJhYO9bA07lLe0n-8gPqofBJ6fW-asHNg3atijQXPC6jo3pH/s1600/6.png" style="cursor: move;" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
දැන් අපි simulator එක මගින් ussd app එක run වීම සදහා අවශ්යය පියවරයන් බලමු</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
පහත ආකාරයට browser එකෙහි url එක සකසාකගන්න<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1gThVeFELxwhtTxNwVJt2Z_bjteTgI29o2zL6W3HJZFMQ1Mkpnic53GMjeE3UWrym7XVWtSlUjSOvRBZIVwDIQVgeW0EEk6BngeBQBl-4YSvStjLgXQgiACXgRiPWKSJX9j4vqfzhhYvn/s1600/7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1gThVeFELxwhtTxNwVJt2Z_bjteTgI29o2zL6W3HJZFMQ1Mkpnic53GMjeE3UWrym7XVWtSlUjSOvRBZIVwDIQVgeW0EEk6BngeBQBl-4YSvStjLgXQgiACXgRiPWKSJX9j4vqfzhhYvn/s1600/7.png" height="338" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
ඉන් පසු USSD Tab එක select කර ගන්න<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-e8fyoqRJ2OkEuqzKfCiJdKfDPNvnlNIOMOIn2KyazFe80awOjnKaVH-1qrWH4b6m_mP5F0DDlU6YHN3pQXmIW-lKlWymGCqY6o2s9zY-8eDYq3ZGC2-II3rFuOwwPAL45achcvirT7CT/s1600/8.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-e8fyoqRJ2OkEuqzKfCiJdKfDPNvnlNIOMOIn2KyazFe80awOjnKaVH-1qrWH4b6m_mP5F0DDlU6YHN3pQXmIW-lKlWymGCqY6o2s9zY-8eDYq3ZGC2-II3rFuOwwPAL45achcvirT7CT/s1600/8.png" height="208" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
දැන් ඔබ ඔබගේ SampleUssdApp.php file එකෙහි නිසියාකරව libraries add කර ඇත් දැයි බලන්න</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVxoZvWA6PoDDfkvrNkwZNVy9N6OAiL2u9A1eIp1lUXcsWMKyKyWke9xk9rbaJbBSoYjVnbuwznHVpWFBA8WsOwj9-tqXapn1TSaEeGYWb3I8jcryEjWUT_5AZD40S2R_J7CGu2x3Zn5zm/s1600/12.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVxoZvWA6PoDDfkvrNkwZNVy9N6OAiL2u9A1eIp1lUXcsWMKyKyWke9xk9rbaJbBSoYjVnbuwznHVpWFBA8WsOwj9-tqXapn1TSaEeGYWb3I8jcryEjWUT_5AZD40S2R_J7CGu2x3Zn5zm/s1600/12.png" height="116" width="640" /></a></div>
<br />
<br />
මෙහි MtUssdSender.php සහ MoUssdReceiver.php යනු අත්යාවශ්යය file වේ Log file එකක් දැමීමද සුදුසු වේ .<br />
<br />
<br />
දැන් නැවත simulator view එකට පිවිසෙන්න<br />
<br />
එහි පහත ලෙස ඔබේ URL එක සකසා ගන්න<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmHOoCxp0Xn7h3DEJ2xKywSZU1BC8Fjp9bCLUfd6mjQ0S_Qkj0fFQ86pAOFac6AxUE_8FUfaSXBcuDJSWx3s2-j_6UyqZ2W9mGfQuZGHJXC65wBGKlPHM1eidLcXkD6doiD3AKKrHaRkmQ/s1600/10.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmHOoCxp0Xn7h3DEJ2xKywSZU1BC8Fjp9bCLUfd6mjQ0S_Qkj0fFQ86pAOFac6AxUE_8FUfaSXBcuDJSWx3s2-j_6UyqZ2W9mGfQuZGHJXC65wBGKlPHM1eidLcXkD6doiD3AKKrHaRkmQ/s1600/10.png" height="96" width="640" /></a></div>
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghjjIIxiOF0iyfWO0CPeZGYRwUYFqkACI3dHPPRRcp-OS7oYR9ewWtWyzPaTv7iBgEQxplwLNWX2Os00m7w3a6XMAlA4g6QvQyZbQCfPx8j6yacCrvVekDh5paX5GyM3gZm1UG-MJOJQoc/s1600/11.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghjjIIxiOF0iyfWO0CPeZGYRwUYFqkACI3dHPPRRcp-OS7oYR9ewWtWyzPaTv7iBgEQxplwLNWX2Os00m7w3a6XMAlA4g6QvQyZbQCfPx8j6yacCrvVekDh5paX5GyM3gZm1UG-MJOJQoc/s1600/11.png" height="33" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
මෙහි localhost හි port එක ඔබගේ පරිගණකයේ වෙනස් විය හැක</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
දැන් ideamart simulator එකෙහි send button click කරන්නත</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWoOAtZSEBt30ujoTzmAmtDDUVz7EVMhbIiXy32Jaa-9lJnlhZ7TkIlx48UunGTXV8nK4uIOvGrAB3SzQYWZPtm2-baP-c1aNfC_jNFE_QcHZQmD-XnPTKe9NAwopVFodgvso4IQG669Sn/s1600/13.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWoOAtZSEBt30ujoTzmAmtDDUVz7EVMhbIiXy32Jaa-9lJnlhZ7TkIlx48UunGTXV8nK4uIOvGrAB3SzQYWZPtm2-baP-c1aNfC_jNFE_QcHZQmD-XnPTKe9NAwopVFodgvso4IQG669Sn/s1600/13.png" height="490" width="640" /></a></div>
ඔබගේ ussd application එක පහත ආකාරයට නිසියාකාරව preview වේ දැයි බලන්න<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBVh_2WM2wX_umf1ojUw4-ULZMNFEFQA3LD0VXuujG6X5sEHQ99i8O2IgS6K8vvyFeS57t_bvOvVn7eg7gxH34HyEiai2MqXWO8S8qMw4TQKBwzpRcuEMiuVkAwUukgdAHiwJ2yKGOb0q3/s1600/14.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBVh_2WM2wX_umf1ojUw4-ULZMNFEFQA3LD0VXuujG6X5sEHQ99i8O2IgS6K8vvyFeS57t_bvOvVn7eg7gxH34HyEiai2MqXWO8S8qMw4TQKBwzpRcuEMiuVkAwUukgdAHiwJ2yKGOb0q3/s1600/14.png" height="320" width="153" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
මෙම tutorial එක මගින් මුලික වශයෙන් ussd application එකක් run කිරීමට අව්යය දේ පමණක් සදහන් කර ඇත.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />Lahiru Dhananjayahttp://www.blogger.com/profile/04904665996384999048noreply@blogger.com2tag:blogger.com,1999:blog-4880340238784455124.post-80938185645777598992014-11-10T10:45:00.000-08:002014-11-10T21:09:00.847-08:00C# Essentials<div>
<br /></div>
මොකක්ද මේ C# ?<br />
<br />
ගොඩක් දෙනෙක් Java ගැන කියපු ගමන් අනිත් අය කියන්නෙ කියන්නෙ "නෑ නෑ C# තමා හොද Java වලට වඩා"<br />
<br />
තව කට්ටියක් C# ගැන කියපු ගමන් අනිත් අය කියන්නෙ කියන්නෙ "නෑ නෑ Java තමා හොද C#වලට වඩා"<br />
<br />
:D :D :D<br />
<br />
ගවේෂකනම් Java , C# දෙකටම කැමතියි :D<br />
<br />
අපි Java Tutorial ගැන බලපු නිසා දැන් C# ගැනත් බලමු<br />
<br />
C# කියන්නෙ Microsoft ලගෙ Language එකක් . .NET FRAMEWORK එක මත පදනම් වු Object Oriented වු තවත් පරිගනක භාෂාවක්.<br />
<br />
<span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px;"> [ </span>multi-paradigm programming language<span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px;"> encompassing </span>strong typing<span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px;">, </span>imperative<span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px;">,</span>declarative<span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px;">, </span>functional<span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px;">, </span>generic<span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px;">, </span>object-oriented<span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px;"> (</span>class<span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px;">-based), and </span>component-oriented<span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px;"> programming ]</span><br />
<br />
අපි මෙහිදී C# වල සාමාන්යයෙන් දැනගෙන සිටීම අත්යාවශය යැයි සැලකෙන දේ පමණක් කතා කරනු ලබනවා.<br />
<br />
<u><br /></u>
<u>.NET FRAMEWORK</u><br />
<br />
.NET Framework පහත පරිදි Layers ගනනාවකින් යුක්ත වේ.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixrWii8Fgv743aszySLTeFkOUo4Nyq_qhYapiy0UB86-BgjkMlyONRfDl9vWmHE2vq44ChJjwu3SwyM3-T7CtLjYgj0l8-Xu3hMFrhkQ8r1YhQxVMmg8uKSyGRi72e6v4n-1XNg-_HBccl/s1600/dotNetFramework.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixrWii8Fgv743aszySLTeFkOUo4Nyq_qhYapiy0UB86-BgjkMlyONRfDl9vWmHE2vq44ChJjwu3SwyM3-T7CtLjYgj0l8-Xu3hMFrhkQ8r1YhQxVMmg8uKSyGRi72e6v4n-1XNg-_HBccl/s1600/dotNetFramework.png" height="320" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
.NET හි Execution වීමේ පටිපාටිය පහත පරිදි වේ</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBKkBLjPl6ojpGqPRpjAGz8GcYMGu6_kXzHoI-AGaKZmxdFsD30D-jgAg_FTSAUrghx-GD_R4rhhRlWRSjt772L9xRzjJqMo7gge0RGAYIBjlyMoIGJdIIvL9bo9j-io7jGaWsJcyx7GDe/s1600/NET_Compilation_and_Execution.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBKkBLjPl6ojpGqPRpjAGz8GcYMGu6_kXzHoI-AGaKZmxdFsD30D-jgAg_FTSAUrghx-GD_R4rhhRlWRSjt772L9xRzjJqMo7gge0RGAYIBjlyMoIGJdIIvL9bo9j-io7jGaWsJcyx7GDe/s1600/NET_Compilation_and_Execution.jpg" height="212" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<br />
<br />
<u>C# With SQLSERVER</u><br />
<br />
මෙහිදී database එකකට Data Insert, Edit , Update සහ Delete වීම සම්බන්දව සලකාබලමු<br />
<br />
පලමුව Windows Form Application එකක් Create කරගන්න<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAPVqEjWjZfl8wpLsliVb5W32gnSTRQzslvBTHKMuwCLatHXRWhcS3mJ3N-Tqs0YJTI91FLbJb6s7yKegoGjutYvcJpKNQNh3rGnJ2LTHzPQwdNuWOEXm1nDZcEJLTwxtlvQesB6ONxkzs/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAPVqEjWjZfl8wpLsliVb5W32gnSTRQzslvBTHKMuwCLatHXRWhcS3mJ3N-Tqs0YJTI91FLbJb6s7yKegoGjutYvcJpKNQNh3rGnJ2LTHzPQwdNuWOEXm1nDZcEJLTwxtlvQesB6ONxkzs/s1600/2.png" height="337" width="640" /></a></div>
<br />
<br />
ඉන්පසු පහත සදහන් Designs ඒ ආකාරයටම ඔබද නිරිමාණය කරගන්න<br />
<br />
Form1 මෙලෙසද (CRUD Opertaion සහ DataGrid එකක් Button ලෙස)<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjY4w6lgvSJVCP0I21LGJLZnGoDfOBptq4OJJZsEFGtB65ygRHNhTskCzSfnhW_ab1iEmuyOSZMkWy2RACAsYkDENX7ORtQkvcvJ1CA_6pC_g7YWaZg4L8aUX_tNGfV1kOAHBcnXG28tZAe/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjY4w6lgvSJVCP0I21LGJLZnGoDfOBptq4OJJZsEFGtB65ygRHNhTskCzSfnhW_ab1iEmuyOSZMkWy2RACAsYkDENX7ORtQkvcvJ1CA_6pC_g7YWaZg4L8aUX_tNGfV1kOAHBcnXG28tZAe/s1600/3.png" height="233" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
CRUD Opertaion මත Click කල විට තවත් Form එකක් open වීමට මෙම button double එක Click කර පහත පරිදි Code කරන්න<br />
<br />
<span style="color: #444444;">Form2 f2 = new Form2();</span><br />
<span style="color: #444444;"> f2.Show();</span><br />
<span style="color: #444444;">------------------------------------------------------------------------------------------------------------------------</span><br />
<span style="color: #444444;">ඊට අදාල Form2 පහත පරිදි වේ</span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk9s38nS3kD_XFDUVwLAg77nOD711AMFXHkunGjXZXYCchn7_bdVMGrBrFy1-YCB4WzmKioVaf0V9El3dXfXZ2rYomKwYGuwQRAJbpnAJK9JEL8PwdsTVdCHWX7OYQ-OXo4bUPbmOkSSeg/s1600/4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk9s38nS3kD_XFDUVwLAg77nOD711AMFXHkunGjXZXYCchn7_bdVMGrBrFy1-YCB4WzmKioVaf0V9El3dXfXZ2rYomKwYGuwQRAJbpnAJK9JEL8PwdsTVdCHWX7OYQ-OXo4bUPbmOkSSeg/s1600/4.png" height="210" width="400" /></a></div>
<br />
-------------------------------------------------------------------------------------------------------------------------<br />
<br />
මෙහිදී Add,View,Delete,Update යන button සදහා පොදුවේ database connections සාදනු ලබයිග<br />
[ ඔබට එය කැමති පරිදි සිදු කල හැක --- Singleton Pattern , MVC ]<br />
<br />
Database Connection ,Command සදහා<br />
<br />
<span style="color: #444444;"> SqlConnection cn = new SqlConnection();</span><br />
<span style="color: #444444;"> SqlCommand cm = new SqlCommand();</span><br />
<span style="color: #444444;"> //Connection </span><br />
<span style="color: #444444;"> cn.ConnectionString = "<<>>Put Your Connection String";</span><br />
<span style="color: #444444;"> cm.Connection = cn;</span><br />
<span style="color: #444444;"><br /></span>
ඉහත සදහන් code පොදු වේ<br />
<br />
පහත කේත Add,View,Delete,Update වලට අදාපව බලමු<br />
<br />
<u><b>ADD</b></u><br />
<br />
<span style="color: #444444;"> cm.CommandText = "INSERT INTO test values(@a,@b,@c,@d)";</span><br />
<span style="color: #444444;"> cm.Parameters.AddWithValue("a",textBox1.Text);</span><br />
<span style="color: #444444;"> cm.Parameters.AddWithValue("b", textBox2.Text);</span><br />
<span style="color: #444444;"> cm.Parameters.AddWithValue("c", textBox3.Text);</span><br />
<span style="color: #444444;"> cm.Parameters.AddWithValue("d", textBox4.Text);</span><br />
<span style="color: #444444;"> try</span><br />
<span style="color: #444444;"> {</span><br />
<span style="color: #444444;"> cn.Open();</span><br />
<span style="color: #444444;"> cm.ExecuteNonQuery();</span><br />
<span style="color: #444444;"> MessageBox.Show("Data Added");</span><br />
<span style="color: #444444;"> cn.Close();</span><br />
<span style="color: #444444;"> }</span><br />
<span style="color: #444444;"> catch (Exception)</span><br />
<span style="color: #444444;"> {</span><br />
<span style="color: #444444;"> MessageBox.Show("Error ");</span><br />
<span style="color: #444444;"> </span><br />
<span style="color: #444444;"> }</span><br />
<span style="color: #444444;"> </span><br />
<br />
<b><u>VIEW</u></b><br />
<br />
<span style="color: #444444;">cm.CommandText = "SELECT * FROM test WHERE emp_id='"+textBox1.Text+"'";</span><br />
<span style="color: #444444;"> </span><br />
<span style="color: #444444;"> try</span><br />
<span style="color: #444444;"> {</span><br />
<span style="color: #444444;"> cn.Open();</span><br />
<span style="color: #444444;"> SqlDataReader ed=cm.ExecuteReader();</span><br />
<span style="color: #444444;"> while (ed.Read())</span><br />
<span style="color: #444444;"> {</span><br />
<span style="color: #444444;"> textBox2.Text=ed["name"].ToString();</span><br />
<span style="color: #444444;"> textBox3.Text=ed["address"].ToString();</span><br />
<span style="color: #444444;"> textBox4.Text=ed["contact"].ToString();</span><br />
<span style="color: #444444;"> }</span><br />
<span style="color: #444444;"><br /></span>
<span style="color: #444444;"> MessageBox.Show("Done");</span><br />
<span style="color: #444444;"> cn.Close();</span><br />
<span style="color: #444444;"> }</span><br />
<span style="color: #444444;"> catch (Exception)</span><br />
<span style="color: #444444;"> {</span><br />
<span style="color: #444444;"> MessageBox.Show("Error ");</span><br />
<span style="color: #444444;"><br /></span>
<span style="color: #444444;"> }</span><br />
<span style="color: #444444;"><br /></span>
<span style="color: #444444;"><br /></span>
<b><u>EDIT</u></b><br />
<br />
මෙහිදී වෙනස්වන හා අවශ්ය Command එක පමණක් සදහන් කර ඇත<br />
එමෙන්ම textbox හි සදහන් values list එකකට convert කර ඇත<br />
<br />
<span style="color: #444444;">cm.CommandText = "UPDATE employee set emp_name='" + list[1] + "',emp_address='" + list[2] + "',emp_contact='" + list[3] + "' where emp_id='"+list[0]+"'";</span><br />
<br />
<b><u>DELETE</u></b><br />
<b><u><br /></u></b>
<br />
මෙහිදී වෙනස්වන හා අවශ්ය Command එක පමණක් සදහන් කර ඇත<br />
<br />
<span style="color: #444444;">cm.CommandText = "DELETE FROM employee where emp_id='" + </span><span style="color: #444444;">textBox1.Text</span><span style="color: #444444;"> + "'";</span><br />
<br />
<span style="color: #444444;"><br /></span>
-------------------------------------------------------------------------------------------------------------------------<br />
<br />
මෙයට අදාල Database එක පහත පරිදි සකසා ගන්න<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdwbXEWZQMztPQGktSHXOu7crUJk3507DKeD7uKPD9Bes_tnOQNopqgZJjCJHcvlEIdTvGeXahjeWpjuUzZ54ejXgWZ8qoH9vfjr4AiyyfGjdb7603zrfIiFQTrxglPIZ9-FE8dyUFKfl8/s1600/db.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdwbXEWZQMztPQGktSHXOu7crUJk3507DKeD7uKPD9Bes_tnOQNopqgZJjCJHcvlEIdTvGeXahjeWpjuUzZ54ejXgWZ8qoH9vfjr4AiyyfGjdb7603zrfIiFQTrxglPIZ9-FE8dyUFKfl8/s1600/db.png" height="152" width="400" /></a></div>
<br />
<br />
දැන් ඔබේ Employee Details ඇතුලත් කිරීමේ වැඩසටහන නිසියාකාරව ක්රියාකරන්නේදැයි බලන්න<br />
<br />
<br />
<u>Delegates</u><br />
<u><br /></u>
ඔයාලා දැනටමත් දන්නා ඇති Delegates වලින් Event Handle කරනවා කියලා. ඉතින් අපි බලමු කොහොමද Implementation එක කියලා<br />
<br />
Delegates ගැන වැඩි විස්තර Microsoft ගෙන්ම අහගන්න :D - http://msdn.microsoft.com/en-us/library/ms173171.aspx<br />
<br />
දැන් පහත ආකාරයට Design එක කරගන්න Form3 සහ Form2<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjL4t2PBwCJ4-n1IkaRpBQirKUCYtgvWB4awOAAbvRxti6M-csPQLaYfa7tgzD8rTuXvSORloInoMEw0yqFLOgp9QAaNecX2dJHd9Z8ONWpxK0a2i6KYOPW8xtkCLwbb01Htfk_GdtHaPit/s1600/del_result.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjL4t2PBwCJ4-n1IkaRpBQirKUCYtgvWB4awOAAbvRxti6M-csPQLaYfa7tgzD8rTuXvSORloInoMEw0yqFLOgp9QAaNecX2dJHd9Z8ONWpxK0a2i6KYOPW8xtkCLwbb01Htfk_GdtHaPit/s1600/del_result.png" height="296" width="640" /></a></div>
<br />
<br />
Form2 හි පහත ලෙස code කරන්න<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0nrlppQkzfxx0KBumzGKrUQBty_c301EuyZdy7IHYuP1BAY2Nnmhl2QIvx7X4_WVLfKl6mDoX4w62i0ilCc-oW-sCHPatphEZw7awBgMBziIs_B2-RxgwrUAyxPGilu44UITzNSfyxDSE/s1600/del_f2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0nrlppQkzfxx0KBumzGKrUQBty_c301EuyZdy7IHYuP1BAY2Nnmhl2QIvx7X4_WVLfKl6mDoX4w62i0ilCc-oW-sCHPatphEZw7awBgMBziIs_B2-RxgwrUAyxPGilu44UITzNSfyxDSE/s1600/del_f2.png" height="361" width="400" /></a></div>
<br />
ඉහත += මගින් එයට සිදු වීමට අව්යය දෑ Assign කරයි<br />
<br />
Form3 හි පහත ලෙස code කරන්න<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTIgsTpxFJyTUuymxbRr3uQb7TUP3b-Szkok10GBEAzH2-14uLpS0bNz9egmWBPVJVD8vlggIfeJ-zQVlTj2vZGaeBSAIu1fPkn4-Pj8l8lcwIe4JY-CGsKye34rOPPkQnKehIlVmACkHN/s1600/del_f3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTIgsTpxFJyTUuymxbRr3uQb7TUP3b-Szkok10GBEAzH2-14uLpS0bNz9egmWBPVJVD8vlggIfeJ-zQVlTj2vZGaeBSAIu1fPkn4-Pj8l8lcwIe4JY-CGsKye34rOPPkQnKehIlVmACkHN/s1600/del_f3.png" height="221" width="400" /></a></div>
<br />
Delegate එක MyDelegate ලෙසදක. event එන listner ලෙසද ගනී<br />
<br />
Button Click කරන විටදී listner event එක call කරනු ලබයි. එමගින් එයට සම්බන්ධිත Form2 හි listbox එකෙහි Values වැඩිවේ<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC8mUWT3iV8GO8JU8RM4xZnTLSakjN2ACgVyfSPMw5PC5ogCFqA-3B9RN70dKGOVL14-y_ARJ-yr-LJFRAv2C6eDvcn_mN54YRwyHcVlx_Y964r_4zq7PIp8HYfWMr-9QGwKXmXGOq5HhP/s1600/del_result1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC8mUWT3iV8GO8JU8RM4xZnTLSakjN2ACgVyfSPMw5PC5ogCFqA-3B9RN70dKGOVL14-y_ARJ-yr-LJFRAv2C6eDvcn_mN54YRwyHcVlx_Y964r_4zq7PIp8HYfWMr-9QGwKXmXGOq5HhP/s1600/del_result1.png" height="289" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMbMpJJJck_TNd1TYdMpEeXUTj3x1MFJgquIO-oELROGkD0CiHBjGgWsUgL14kpC2rJu3ldGc2UzwXu-f8PKVPJ5jUZ-5oh2aFn5x9n41kxCLKDYwBJcI7yPm3lRrW1qe3s58XG7ADXr7r/s1600/del_result2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMbMpJJJck_TNd1TYdMpEeXUTj3x1MFJgquIO-oELROGkD0CiHBjGgWsUgL14kpC2rJu3ldGc2UzwXu-f8PKVPJ5jUZ-5oh2aFn5x9n41kxCLKDYwBJcI7yPm3lRrW1qe3s58XG7ADXr7r/s1600/del_result2.png" height="294" width="640" /></a></div>
<br />
ඔබට මෙම ආකාරයම Static keyword භාවිතයෙන් සිදු කල හැක<br />
--------------------------------------------------------------------------------------------------------------------------<br />
Special Key words in C#<br />
<br />
<br />
<ul>
<li>New</li>
</ul>
<br />
<span style="color: #444444;"><code><span style="font-size: 10.0pt;">New </span></code>keyword is also used
in polymorphism concept, but in the case of method overloading So what does
overloading means, in simple words we can say procedure of hiding your base
class through your derived class.<o:p></o:p></span><br />
<div>
<span style="color: #444444;">It is implemented as:<o:p></o:p></span><br />
<pre><span style="color: #444444;"><span class="code-keyword"><span lang="CS" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-ansi-language: CS;">class</span></span><span lang="CS" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-ansi-language: CS;"> A<o:p></o:p></span></span></pre>
<pre><span lang="CS" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-ansi-language: CS;"><span style="color: #444444;"> {<o:p></o:p></span></span></pre>
<pre><span lang="CS" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-ansi-language: CS;"><span style="color: #444444;"> <span class="code-keyword">public</span> <span class="code-keyword">void</span> show()<o:p></o:p></span></span></pre>
<pre><span lang="CS" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-ansi-language: CS;"><span style="color: #444444;"> {<o:p></o:p></span></span></pre>
<pre><span lang="CS" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-ansi-language: CS;"><span style="color: #444444;"> Console.WriteLine(<span class="code-string">"Hello: Base Class!"</span>);<o:p></o:p></span></span></pre>
<pre><span lang="CS" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-ansi-language: CS;"><span style="color: #444444;"> Console.ReadLine();<o:p></o:p></span></span></pre>
<pre><span lang="CS" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-ansi-language: CS;"><span style="color: #444444;"> }<o:p></o:p></span></span></pre>
<pre><span lang="CS" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-ansi-language: CS;"><span style="color: #444444;"> }<o:p></o:p></span></span></pre>
<pre><span lang="CS" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-ansi-language: CS;"><span style="color: #444444;"> </span></span></pre>
<pre><span lang="CS" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-ansi-language: CS;"><span style="color: #444444;"> <span class="code-keyword">class</span> B : A<o:p></o:p></span></span></pre>
<pre><span lang="CS" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-ansi-language: CS;"><span style="color: #444444;"> {<o:p></o:p></span></span></pre>
<pre><span lang="CS" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-ansi-language: CS;"><span style="color: #444444;"> <span class="code-keyword">public</span> <span class="code-keyword">new</span> <span class="code-keyword">void</span> show()<o:p></o:p></span></span></pre>
<pre><span lang="CS" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-ansi-language: CS;"><span style="color: #444444;"> {<o:p></o:p></span></span></pre>
<pre><span lang="CS" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-ansi-language: CS;"><span style="color: #444444;"> Console.WriteLine(<span class="code-string">"Hello: Derived Class!"</span>);<o:p></o:p></span></span></pre>
<pre><span lang="CS" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-ansi-language: CS;"><span style="color: #444444;"> Console.ReadLine();<o:p></o:p></span></span></pre>
<pre><span lang="CS" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-ansi-language: CS;"><span style="color: #444444;"> }<o:p></o:p></span></span></pre>
<pre><span lang="CS" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-ansi-language: CS;"><span style="color: #444444;"> }</span><o:p></o:p></span></pre>
</div>
<br />
<ul>
<li>Virtual</li>
</ul>
<br />
<span style="color: #444444;"><code><span style="font-size: 10.0pt;">Virtual </span></code>keyword is used
for generating a virtual path for its derived classes on implementing method
overriding. <code><span style="font-size: 10.0pt;">Virtual </span></code>keyword
is used within a set with <code><span style="font-size: 10.0pt;">override </span></code>keyword.
It is used as<o:p></o:p></span><br />
<div>
<br /></div>
<div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;">class MyBaseClass<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;">{<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;"> // virtual
auto-implemented property. Overrides can only <o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;"> // provide
specialized behavior if they implement get and set accessors. <o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;"> public virtual string
Name { get; set; }<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<br /></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;"> // ordinary virtual property with backing
field <o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;"> private int
num;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;"> public virtual int
Number<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;"> {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;"> get { return
num; }<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;"> set { num =
value; }<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;"> }<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;">}<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<br /></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<br /></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;">class MyDerivedClass : MyBaseClass<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;">{<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;"> private string
name;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<br /></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;"> // Override
auto-implemented property with ordinary property <o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;"> // to provide
specialized accessor behavior. <o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;"> public override string
Name<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;"> {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;"> get<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;"> {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;"> return
name;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;"> }<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;"> set<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;"> {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;"> if (value
!= String.Empty)<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;"> {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;"> name =
value;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;"> }<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;"> else<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;"> {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;"> name =
"Unknown";<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;"> }<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;"> }<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;"> }<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<br /></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;">}</span><o:p></o:p></span></div>
</div>
<ul>
<li>Out</li>
</ul>
<div>
<div class="MsoNormal">
<span style="color: #444444;"><span style="font-family: 'Times New Roman', serif; font-size: 12pt; line-height: 107%;">The<span class="apple-converted-space"> </span></span><span class="input">out</span><span class="apple-converted-space"> keyword
causes arguments to be passed by reference. This is like the<span class="apple-converted-space"> </span></span><span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 107%;">ref<span class="apple-converted-space"> keyword, except that<span class="apple-converted-space"> </span><span class="input">ref</span><span class="apple-converted-space"> requires
that the variable be initialized before it is passed. To use an<span class="apple-converted-space"> </span></span><span class="input">out</span>parameter,
both the method definition and the calling method must explicitly use the<span class="apple-converted-space"> </span><span class="input">out</span><span class="apple-converted-space"> keyword. For example:</span></span><o:p></o:p></span></span></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 107%;"><span class="apple-converted-space"><span class="apple-converted-space"><span style="color: #444444;"><br /></span></span></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;">class OutExample<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;">{<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;"> static void
Method(out int i)<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;"> {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;"> i = 44;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;"> }<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;"> static void
Main()<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;"> {<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;"> int value;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;"> Method(out value);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;"> // value is
now 44<o:p></o:p></span></span></div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;"> }<o:p></o:p></span></span></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal" style="line-height: 13.15pt; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"><span style="color: #444444;">}</span><o:p></o:p></span></div>
</div>
<br />
<br />
<br />
ගැටලු සදහා මෙහි පහතින් Comment කරන්න<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />Lahiru Dhananjayahttp://www.blogger.com/profile/04904665996384999048noreply@blogger.com0tag:blogger.com,1999:blog-4880340238784455124.post-46456064232834802982014-07-30T20:47:00.000-07:002014-07-30T20:51:46.632-07:00WEET (Way of Expressway E Ticketing)What is WEET? What is is it about ? How was it begun ?<br />
<br />
Actually WEET is a mobile Telco application which provides the facility of booking your ticket in ExpressWay .<br />
<br />
In TADHACK 2014 Competition it was originally created with the USSD ,SMS ,CAS, and as a web services .<br />
<br />
There three parties invovled in this application process<br />
<br />
<ol>
<li>User(Passenger )</li>
<li>Bus Driver</li>
<li>Bus Owner</li>
</ol>
<div>
<b>User (Passenger </b>)can dial the USSD code #771*933# from his Dialog mobile and he access to the E ticketing System .</div>
<div>
<b></b></div>
<div>
Then he will get a menu and he can choose his route,time he will pay the ticket amout via this application.</div>
<div>
After completing these steps he will get a confirmation SMS with the reference number.</div>
<div>
<br /></div>
<div>
In the same time <b>Bus Driver </b>receive that ticket purchasing details into the tab which is in the bus.So he can get the count total income and other details.</div>
<div>
<br /></div>
<div>
Not only that , also this transaction process can view by the <b> Bus Owner </b>through a Web Application or a mobile apllication. </div>
<div>
<br /></div>
<div>
The income directly transfer in to <b>Bus Owner's</b> bank account when the Passenger purchase his ticket.</div>
<br />
<br />
<br />
<ul><ul>
<li>So no need to be a in a huge queue until bus reaches</li>
<li>No need to pay using cash</li>
<li>Every process is transparent to the bus owner</li>
</ul>
</ul>
<br />
<br />
Watch the WEET Apllication Demo and get a clear idea about how it works<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/2gEtL6nf-Uw?feature=player_embedded' frameborder='0'></iframe></div>
<br />
<br />
<br />Lahiru Dhananjayahttp://www.blogger.com/profile/04904665996384999048noreply@blogger.com0tag:blogger.com,1999:blog-4880340238784455124.post-5909613081623470212014-07-28T23:20:00.003-07:002014-07-29T06:25:02.304-07:00Important points in Java Networking/ RMI / Socket Programming/Regular Expressions<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPiaAcgytAqcjk4MgIvOfiE4QKDReUh-Mo-_EjOSsVFD04TqPCZBnPmx9PANwSb-fbKmkO7mbZo0NR63hbL-aRUrTLAYn-iwUnNa8PSSHovuHIq22JJo8tl5EVyYpvzqKAdS2k69W_YFj2/s1600/Untitled.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPiaAcgytAqcjk4MgIvOfiE4QKDReUh-Mo-_EjOSsVFD04TqPCZBnPmx9PANwSb-fbKmkO7mbZo0NR63hbL-aRUrTLAYn-iwUnNa8PSSHovuHIq22JJo8tl5EVyYpvzqKAdS2k69W_YFj2/s1600/Untitled.png" height="194" width="320" /></a></div>
ඔන්න Java EE ඉගන ගන්න අයට Java Networking/ RMI / Socket Programming වැදගත් කොටස් කිහිපයක විස්කරයක් කරන්නයි යන්නෙ ගවේෂක අද.<br />
<br />
<span style="font-size: large;"> <b><u>Java Networking</u></b></span><br />
<span style="font-size: large;"><b><u><br /></u></b></span>
In java networking we can divide it into two categories and let's see the comparision<br />
<br />
<ol>
<li>Stream Based(TCP)</li>
<ul>
<li>Connection based</li>
<li>Reliable</li>
</ul>
<li>Packet Based(UDP)</li>
<ul>
<li>Connectionless</li>
<li> Not Reliable</li>
</ul>
</ol>
<div>
<br /></div>
<div>
Establish a simple Server using Stram Socket</div>
<div class="" style="clear: both; text-align: left;">
<b>1.Server Socket</b></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div>
<div>
ServerSocket server=new ServerSocket (Port_Number,Queue_Lengh);</div>
<div>
<br /></div>
<div>
<b>2.Accept Client</b></div>
<div>
<br /></div>
<div>
Socket Connection=Server.accept();</div>
<div>
<br /></div>
<div>
<b>3.Open Path</b></div>
<div>
<br /></div>
<div>
Input and OutPut Stream</div>
<div>
<br /></div>
<div>
<b>4.Processing Part</b></div>
<div>
<br /></div>
<div>
Communication</div>
<div>
<br /></div>
<div>
<b>5.Server Close</b></div>
<div>
<b style="text-align: center;"><span style="font-family: 'Times New Roman', serif; font-size: 13.5pt;"><br /></span></b></div>
<div>
<b style="text-align: center;"><span style="font-family: 'Times New Roman', serif; font-size: 13.5pt;">************************************************************************</span></b></div>
<div>
<strong style="background-color: white;"><u><span style="font-family: inherit;">Client/Server Communication Process Using TCP</span></u></strong></div>
<div>
<strong style="background-color: white;"><u><span style="font-family: inherit;"><br /></span></u></strong></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaGqAtnt0jAlAAArUjRBdG0-NiY2yUhPj6tgjASb30JxRvv1Vx70FV6eO_gZIrDr0RNFY12EIp8pwWY7ickS_5AbHJ6G5RDI5YjU7fOojS9LXtVFgSx88NwHYh4JHO07zb8_Percyo2H7u/s1600/vm-0570a.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaGqAtnt0jAlAAArUjRBdG0-NiY2yUhPj6tgjASb30JxRvv1Vx70FV6eO_gZIrDr0RNFY12EIp8pwWY7ickS_5AbHJ6G5RDI5YjU7fOojS9LXtVFgSx88NwHYh4JHO07zb8_Percyo2H7u/s1600/vm-0570a.gif" height="400" width="180" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div>
<ol>
<li style="background-color: white;"><span style="font-family: inherit;">Server issues a call to create a listening socket.</span></li>
<li style="background-color: white;"><span style="font-family: inherit;">Server and client create a socket.</span></li>
<li style="background-color: white;"><span style="font-family: inherit;">Server and client bind socket. (This step is optional for a client.)</span></li>
<li style="background-color: white;"><span style="font-family: inherit;">Server converts an unconnected socket into a passive socket (LISTEN state).</span></li>
<li style="background-color: white;"><span style="font-family: inherit;">Server issues an <tt>accept()</tt> and process blocks waiting for a connection request.</span></li>
<li style="background-color: white;"><span style="font-family: inherit;">Client sends a connection request.</span></li>
<li style="background-color: white;"><span style="font-family: inherit;">Server accepts the connection; a new socket is created for communication with this client.</span></li>
<li style="background-color: white;"><span style="font-family: inherit;">Server receives device information from the local host.</span></li>
<li style="background-color: white;"><span style="font-family: inherit;">Data exchange takes place.</span></li>
<li style="background-color: white;"><span style="font-family: inherit;">Client and server delete the socket.</span></li>
<li style="background-color: white;"><span style="font-family: inherit;">Server deletes the listener socket when the service to the client is terminated.</span></li>
</ol>
<div>
<span style="background-color: white;"><u><b><span style="font-family: inherit;">UDP Socket Communication Process</span></b></u></span></div>
</div>
<div>
<span style="background-color: white;"><u><b><span style="font-family: inherit;"><br /></span></b></u></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxRidQlKBsDC1Qenu1Vxy4TYrb8KA0bwMlb_6kST6hlJA99xwLKG9iUM9NjogXZag-0fpIHBs7wm140pRkKNa0TqlEgItavLp7WxXfFHe5Xd0tu5NWQve6DNs-uH4Dyf0BZpQgPKYaUwBS/s1600/vm-0571a.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxRidQlKBsDC1Qenu1Vxy4TYrb8KA0bwMlb_6kST6hlJA99xwLKG9iUM9NjogXZag-0fpIHBs7wm140pRkKNa0TqlEgItavLp7WxXfFHe5Xd0tu5NWQve6DNs-uH4Dyf0BZpQgPKYaUwBS/s1600/vm-0571a.gif" height="400" width="302" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div>
<ol>
<li style="background-color: white;"><span style="font-family: inherit;">Server and client create a socket.</span></li>
<li style="background-color: white;"><span style="font-family: inherit;">Server and client bind the socket name.</span></li>
<li style="background-color: white;"><span style="font-family: inherit;">Data exchange takes place.</span></li>
<li style="background-color: white;"><span style="font-family: inherit;">Server and client delete the socket.</span></li>
</ol>
<div>
<span style="font-size: 12px;"><br /></span></div>
</div>
<div>
<b><u>Port Vs Socket(Referenced)</u></b></div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgT7bVYwX74xVJ0PcfCL5Pqwc7O-YmUgL37Y_dNfz8Zs3tUc2-ScYvdjA9MJ-ZUSIan0hVFu4xPNEh880ctMd9blwoBYxWNykoiLck6XC-WBBt0I6wHkIaN8UsOrqaddmyfBzGumaIOe8ZA/s1600/sockets_thumb%5B1%5D.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgT7bVYwX74xVJ0PcfCL5Pqwc7O-YmUgL37Y_dNfz8Zs3tUc2-ScYvdjA9MJ-ZUSIan0hVFu4xPNEh880ctMd9blwoBYxWNykoiLck6XC-WBBt0I6wHkIaN8UsOrqaddmyfBzGumaIOe8ZA/s1600/sockets_thumb%5B1%5D.gif" height="184" width="320" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<span style="font-family: inherit;"><span style="background-color: white; color: #333333; line-height: 19.600000381469727px; text-align: justify;">A </span><strong style="background-color: white; color: #333333; line-height: 19.600000381469727px; text-align: justify;">port</strong><span style="background-color: white; color: #333333; line-height: 19.600000381469727px; text-align: justify;"> is a logical connection method two end points communicate with. Ports operate at the </span><a href="http://en.wikipedia.org/wiki/Transport_Layer" style="-webkit-transition: color 0.3s; background-color: white; color: #009eb8; display: inline; line-height: 19.600000381469727px; outline: none; text-align: justify; text-decoration: none; transition: color 0.3s;" target="_blank">Transport layer of the OSI</a><span style="background-color: white; color: #333333; line-height: 19.600000381469727px; text-align: justify;">. </span></span><br />
<div style="background: rgb(255, 255, 255); border: 0px; clear: both; line-height: 17.80480194091797px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
<span style="font-family: inherit;"><span style="background: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">A TCP socket is <em style="background: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">not</em> a connection</span>, it is the endpoint of a specific connection.</span></div>
<div style="background: rgb(255, 255, 255); border: 0px; clear: both; line-height: 17.80480194091797px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
<span style="font-family: inherit;"><span style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">There can be concurrent connections to a service endpoint</span>, because a connection is identified by <em style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">both its local and remote</em> endpoints, allowing traffic to be routed to a specific service instance.</span></div>
<span style="font-family: inherit;"><strong style="background-color: white; color: #333333; line-height: 19.600000381469727px; text-align: justify;">Sockets</strong><span style="background-color: white; color: #333333; line-height: 19.600000381469727px; text-align: justify;"> are a means of plugging the </span><a href="http://en.wikipedia.org/wiki/Application_Layer" style="-webkit-transition: color 0.3s; background-color: white; color: #009eb8; display: inline; line-height: 19.600000381469727px; outline: none; text-align: justify; text-decoration: none; transition: color 0.3s;" target="_blank">application layer</a><span style="background-color: white; color: #333333; line-height: 19.600000381469727px; text-align: justify;"> in. Sockets are determined by an IP address and port number.A socket is one end point of a connection.</span></span></div>
<div>
<span style="background-color: white; color: #333333; line-height: 19.600000381469727px; text-align: justify;"><span style="font-family: inherit;"><br /></span></span></div>
<div>
<div style="background: rgb(255, 255, 255); border: 0px; clear: both; font-size: 13.333333969116211px; line-height: 17.80480194091797px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
<span style="font-family: inherit;">A socket consists of three things:</span></div>
<ol style="background: rgb(255, 255, 255); border: 0px; font-size: 13.333333969116211px; line-height: 17.80480194091797px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 1em 30px; padding: 0px; vertical-align: baseline;">
<li style="background: transparent; border: 0px; font-size: 13.333333969116211px; margin: 0px; padding: 0px; vertical-align: baseline;"><span style="font-family: inherit;">An IP address</span></li>
<li style="background: transparent; border: 0px; font-size: 13.333333969116211px; margin: 0px; padding: 0px; vertical-align: baseline;"><span style="font-family: inherit;">A transport protocol</span></li>
<li style="background: transparent; border: 0px; font-size: 13.333333969116211px; margin: 0px; padding: 0px; vertical-align: baseline;"><span style="font-family: inherit;">A port number</span></li>
</ol>
<div style="background: rgb(255, 255, 255); border: 0px; clear: both; font-size: 13.333333969116211px; line-height: 17.80480194091797px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
<span style="font-family: inherit;">A port is a number between 1 and 65535 inclusive that signifies a logical gate in a device. Every connection between a client and server requires a unique socket.</span></div>
<div style="background: rgb(255, 255, 255); border: 0px; clear: both; font-size: 13.333333969116211px; line-height: 17.80480194091797px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
<span style="font-family: inherit;">For example:</span></div>
<ul style="background: rgb(255, 255, 255); border: 0px; font-size: 13.333333969116211px; line-height: 17.80480194091797px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 1em 30px; padding: 0px; vertical-align: baseline;">
<li style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; font-size: 13.333333969116211px; margin: 0px; padding: 0px; vertical-align: baseline;"><span style="font-family: inherit;">1030 is a port.</span></li>
<li style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; font-size: 13.333333969116211px; margin: 0px; padding: 0px; vertical-align: baseline;"><span style="font-family: inherit;">(10.1.1.2 , TCP , port 1030) is a socket.</span></li>
</ul>
<div>
<span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; line-height: 17.80480194091797px; margin: 0px; padding: 0px; vertical-align: baseline;">A port is a virtualisation identifier</span><span style="background-color: white; line-height: 17.80480194091797px;"> </span><span style="background-color: white; line-height: 17.80480194091797px;">defining a service endpoint (as distinct from a service</span><span style="background-color: white; line-height: 17.80480194091797px;"> </span><em style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; line-height: 17.80480194091797px; margin: 0px; padding: 0px; vertical-align: baseline;">instance</em><span style="background-color: white; line-height: 17.80480194091797px;"> </span><span style="background-color: white; line-height: 17.80480194091797px;">endpoint aka session identifier).</span></div>
</div>
<div>
<h3>
<span style="font-family: inherit; font-size: small; font-weight: normal;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; line-height: 17.80480194091797px; margin: 0px; padding: 0px; vertical-align: baseline;">A TCP socket is an endpoint <em style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">instance</em></span><span style="background-color: white; line-height: 17.80480194091797px;"> </span><span style="background-color: white; line-height: 17.80480194091797px;">defined by an IP address and a port in the context of either a particular TCP connection or the listening state.</span></span></h3>
<div style="background: rgb(255, 255, 255); border: 0px; clear: both; line-height: 17.80480194091797px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
<span style="font-family: inherit;"><span style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">There can only be one listener socket for a given address/port combination</span>.</span></div>
<div style="background: rgb(255, 255, 255); border: 0px; clear: both; line-height: 17.80480194091797px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
<span style="font-family: inherit;"><br /></span></div>
</div>
<div>
<b style="text-align: center;"><span style="font-family: 'Times New Roman', serif;"><u><span style="font-size: large;">Java Remote Method Invocation</span></u></span></b></div>
</div>
<div>
<b style="text-align: center;"><span style="font-family: 'Times New Roman', serif;"><u><span style="font-size: large;"><br /></span></u></span></b></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwVR2mgN43TTjBQ3gXfEU16i5bDANfeatGLoira_Ko811uDl4vS9Dy3zf1x1pFhUJnS_FdBwfq11t0PJjFzLGEIG1ocwz9FuCvYejCisVPCE-F2obhZ0-xQ4K4Gu6uFbywaGdmGtClV3b1/s1600/2d.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwVR2mgN43TTjBQ3gXfEU16i5bDANfeatGLoira_Ko811uDl4vS9Dy3zf1x1pFhUJnS_FdBwfq11t0PJjFzLGEIG1ocwz9FuCvYejCisVPCE-F2obhZ0-xQ4K4Gu6uFbywaGdmGtClV3b1/s1600/2d.png" height="124" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Steps of RMI</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<ul>
<li>Make sure there is these classes are available</li>
<ul>
<li><span style="font-family: 'Times New Roman', serif; text-align: justify;">Serializable Classes</span></li>
<li><span style="font-family: 'Times New Roman', serif; text-align: justify;">Remote Classes and Interfaces</span></li>
</ul>
<li style="text-align: justify;"><span style="font-family: Times New Roman, serif;">Should be as follow the programming part order</span></li>
<ul>
<li style="text-align: justify;"><span style="font-family: Times New Roman, serif;">Programming a client</span></li>
<li style="text-align: justify;"><span style="font-family: Times New Roman, serif;">Programming a server</span></li>
</ul>
<li style="text-align: justify;"><span style="font-family: Times New Roman, serif;">Finally Runing the programme should be as follows</span></li>
<ul>
<li style="text-align: justify;"><span style="font-family: Times New Roman, serif;">Run the Client First</span></li>
</ul>
</ul>
<br />
<div class="MsoNormal" style="text-align: justify;">
<u>Codings</u><br />
<u><br /></u>
<u><br /></u>
<b>Hello.java</b><br />
import java.rmi.server.*;<br />
import java.rmi.*;<br />
<br />
public class Hello extends UnicastRemoteObject implements HelloInterface{<br />
public String message;<br />
public Hello(String msg) throws RemoteException{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>message=msg;<br />
}<br />
public void login(String name, String pass) throws RemoteException{<br />
<br />
}<br />
public void logout(String name) throws RemoteException{<br />
<br />
}<br />
<br />
public String chat(String name, String msg) throws RemoteException{<br />
<br />
return message;<br />
}<br />
<br />
}<br />
<br />
<b>HelloClient.java</b><br />
import java.rmi.*;<br />
<br />
public class HelloClient{<br />
<br />
public static void main(String[] arg){<br />
<br />
try{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>HelloInterface hello = (HelloInterface)Naming.lookup("//localhost:1099/Hello");<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>hello.login("Lahiru","123");<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>System.out.println(hello.chat("Lahiru","Hi!!!"));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}catch(Exception e){<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>System.out.println("Exception :"+e.getMessage());<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
}<br />
<br />
}<br />
<br />
<b>HelloServer.java</b><br />
import java.rmi.*;<br />
import java.io.*;<br />
<br />
public class HelloServer{<br />
public static void main(String[] arg){<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>try{<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>BufferedReader br = new BufferedReader(new InputStreamReader(System.in));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>System.out.print("Login Name: ");<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>String name = br.readLine();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Naming.rebind("Hello", new Hello(name));<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>System.out.println("Hello Server Ready");<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}catch(Exception e){<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>System.out.println("Exception "+e);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
}<br />
<br />
}<br />
<br />
<b>HelloInterface.java</b><br />
import java.rmi.*;<br />
<br />
public interface HelloInterface extends Remote{<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>public void login(String name, String pass) throws RemoteException;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>public void logout(String name) throws RemoteException;<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>public String chat(String name, String pass) throws RemoteException;<br />
<br />
}</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div>
<b style="text-align: center;"><span style="font-family: 'Times New Roman', serif;"><u><br /></u></span></b></div>
<div>
<span style="text-align: center;"><span style="font-family: Times New Roman, serif; font-size: large;"><b><u>Regular Expressions</u></b></span></span></div>
<div>
<span style="text-align: center;"><span style="font-family: Times New Roman, serif; font-size: large;"><b><u><br /></u></b></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<br />
<div>
<br /></div>
<div>
<table border="1" style="background-color: white; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-spacing: 0px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 1px solid rgb(221, 221, 221); font-family: 'Droid Sans', sans-serif; font-size: 14px; margin-bottom: 18px; padding: 0px; width: 848px;"><colgroup><col align="left" class="c1"></col><col align="left" class="c2"></col></colgroup><thead>
<tr><th align="left" style="background: rgb(245, 245, 245); line-height: 18px; padding: 9px 10px; vertical-align: middle;">Regular Expression</th><th align="left" style="background: rgb(245, 245, 245); border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; line-height: 18px; padding: 9px 10px; vertical-align: middle;">Description</th></tr>
</thead><tbody>
<tr><td align="left" style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-top-width: 1px; line-height: 18px; padding: 10px 10px 9px; vertical-align: top;"><code class="code" style="font-family: 'Droid Sans Mono', Monaco, 'Bitstream Vera Sans Mono', 'Lucida Console', Terminal, monospace; font-size: 11px; line-height: 14px;">\d</code></td><td align="left" style="border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-top-width: 1px; line-height: 18px; padding: 10px 10px 9px; vertical-align: top;">Any digit, short for <code class="code" style="font-family: 'Droid Sans Mono', Monaco, 'Bitstream Vera Sans Mono', 'Lucida Console', Terminal, monospace; font-size: 11px; line-height: 14px;">[0-9]</code></td></tr>
<tr><td align="left" style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-top-width: 1px; line-height: 18px; padding: 10px 10px 9px; vertical-align: top;"><code class="code" style="font-family: 'Droid Sans Mono', Monaco, 'Bitstream Vera Sans Mono', 'Lucida Console', Terminal, monospace; font-size: 11px; line-height: 14px;">\D</code></td><td align="left" style="border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-top-width: 1px; line-height: 18px; padding: 10px 10px 9px; vertical-align: top;">A non-digit, short for <code class="code" style="font-family: 'Droid Sans Mono', Monaco, 'Bitstream Vera Sans Mono', 'Lucida Console', Terminal, monospace; font-size: 11px; line-height: 14px;">[^0-9]</code></td></tr>
<tr><td align="left" style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-top-width: 1px; line-height: 18px; padding: 10px 10px 9px; vertical-align: top;"><code class="code" style="font-family: 'Droid Sans Mono', Monaco, 'Bitstream Vera Sans Mono', 'Lucida Console', Terminal, monospace; font-size: 11px; line-height: 14px;">\s</code></td><td align="left" style="border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-top-width: 1px; line-height: 18px; padding: 10px 10px 9px; vertical-align: top;">A whitespace character, short for <code class="code" style="font-family: 'Droid Sans Mono', Monaco, 'Bitstream Vera Sans Mono', 'Lucida Console', Terminal, monospace; font-size: 11px; line-height: 14px;">[ \t\n\x0b\r\f]</code></td></tr>
<tr><td align="left" style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-top-width: 1px; line-height: 18px; padding: 10px 10px 9px; vertical-align: top;"><code class="code" style="font-family: 'Droid Sans Mono', Monaco, 'Bitstream Vera Sans Mono', 'Lucida Console', Terminal, monospace; font-size: 11px; line-height: 14px;">\S</code></td><td align="left" style="border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-top-width: 1px; line-height: 18px; padding: 10px 10px 9px; vertical-align: top;">A non-whitespace character, short for <code class="code" style="font-family: 'Droid Sans Mono', Monaco, 'Bitstream Vera Sans Mono', 'Lucida Console', Terminal, monospace; font-size: 11px; line-height: 14px;">[^\s]</code></td></tr>
<tr><td align="left" style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-top-width: 1px; line-height: 18px; padding: 10px 10px 9px; vertical-align: top;"><code class="code" style="font-family: 'Droid Sans Mono', Monaco, 'Bitstream Vera Sans Mono', 'Lucida Console', Terminal, monospace; font-size: 11px; line-height: 14px;">\w</code></td><td align="left" style="border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-top-width: 1px; line-height: 18px; padding: 10px 10px 9px; vertical-align: top;">A word character, short for <code class="code" style="font-family: 'Droid Sans Mono', Monaco, 'Bitstream Vera Sans Mono', 'Lucida Console', Terminal, monospace; font-size: 11px; line-height: 14px;">[a-zA-Z_0-9]</code></td></tr>
<tr><td align="left" style="border-top-color: rgb(221, 221, 221); border-top-style: solid; border-top-width: 1px; line-height: 18px; padding: 10px 10px 9px; vertical-align: top;"><code class="code" style="font-family: 'Droid Sans Mono', Monaco, 'Bitstream Vera Sans Mono', 'Lucida Console', Terminal, monospace; font-size: 11px; line-height: 14px;">\W</code></td><td align="left" style="border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-top-color: rgb(221, 221, 221); border-top-style: solid; border-top-width: 1px; line-height: 18px; padding: 10px 10px 9px; vertical-align: top;">A non-word character <code class="code" style="font-family: 'Droid Sans Mono', Monaco, 'Bitstream Vera Sans Mono', 'Lucida Console', Terminal, monospace; font-size: 11px; line-height: 14px;">[^\w]</code></td></tr>
</tbody></table>
</div>
<div>
Here is a code for email validation pattern</div>
<div>
</div>
<br />
<div class="filename" style="background: none 0px 0px repeat scroll rgb(230, 230, 252); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-left-color: rgb(209, 209, 232); border-left-width: 1px; border-right-color: rgb(209, 209, 232); border-right-width: 1px; border-style: solid solid none; border-top-color: rgb(209, 209, 232); border-top-left-radius: 4px; border-top-right-radius: 4px; border-top-width: 1px; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 21px; padding: 3px 10px; text-shadow: rgba(255, 255, 255, 0.74902) 1px 1px 1px; word-wrap: break-word;">
EmailValidator.java</div>
<div class="wp_syntax" style="background-color: white; color: #3c3c3c; font-family: Arial, sans-serif; font-size: 14px; line-height: 21px;">
<div class="code">
<pre class="java" style="background-color: #f7f7f9; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid rgb(209, 209, 232); color: #333333; font-size: 13px; line-height: 1.5; margin-bottom: 20px; overflow-x: auto; padding: 10px;"><span style="color: black; font-weight: bold;">package</span> <span style="color: #006699;">com.mkyong.regex</span><span style="color: #339933;">;</span>
<span style="color: black; font-weight: bold;">import</span> <span style="color: #006699;">java.util.regex.Matcher</span><span style="color: #339933;">;</span>
<span style="color: black; font-weight: bold;">import</span> <span style="color: #006699;">java.util.regex.Pattern</span><span style="color: #339933;">;</span>
<span style="color: black; font-weight: bold;">public</span> <span style="color: black; font-weight: bold;">class</span> EmailValidator <span style="color: #009900;">{</span>
<span style="color: black; font-weight: bold;">private</span> Pattern pattern<span style="color: #339933;">;</span>
<span style="color: black; font-weight: bold;">private</span> Matcher matcher<span style="color: #339933;">;</span>
<span style="color: black; font-weight: bold;">private</span> <span style="color: black; font-weight: bold;">static</span> <span style="color: black; font-weight: bold;">final</span> <span style="color: #003399;">String</span> EMAIL_PATTERN <span style="color: #339933;">=</span>
<span style="color: blue;">"^[_A-Za-z0-9-<span style="color: #000099; font-weight: bold;">\\</span>+]+(<span style="color: #000099; font-weight: bold;">\\</span>.[_A-Za-z0-9-]+)*@"</span>
<span style="color: #339933;">+</span> <span style="color: blue;">"[A-Za-z0-9-]+(<span style="color: #000099; font-weight: bold;">\\</span>.[A-Za-z0-9]+)*(<span style="color: #000099; font-weight: bold;">\\</span>.[A-Za-z]{2,})$"</span><span style="color: #339933;">;</span>
<span style="color: black; font-weight: bold;">public</span> EmailValidator<span style="color: #009900;">(</span><span style="color: #009900;">)</span> <span style="color: #009900;">{</span>
pattern <span style="color: #339933;">=</span> Pattern.<span style="color: #006633;">compile</span><span style="color: #009900;">(</span>EMAIL_PATTERN<span style="color: #009900;">)</span><span style="color: #339933;">;</span>
<span style="color: #009900;">}</span>
<span style="color: green; font-style: italic; font-weight: bold;">/**
* Validate hex with regular expression
*
* @param hex
* hex for validation
* @return true valid hex, false invalid hex
*/</span>
<span style="color: black; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">boolean</span> validate<span style="color: #009900;">(</span><span style="color: black; font-weight: bold;">final</span> <span style="color: #003399;">String</span> hex<span style="color: #009900;">)</span> <span style="color: #009900;">{</span>
matcher <span style="color: #339933;">=</span> pattern.<span style="color: #006633;">matcher</span><span style="color: #009900;">(</span>hex<span style="color: #009900;">)</span><span style="color: #339933;">;</span>
<span style="color: black; font-weight: bold;">return</span> matcher.<span style="color: #006633;">matches</span><span style="color: #009900;">(</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span>
<span style="color: #009900;">}</span>
<span style="color: #009900;">}</span></pre>
</div>
</div>
For Validate a Form Entry Data<br />
<br />
<b><u>Validate.java</u></b><br />
<b><u><br /></u></b>
/*<br />
* To change this template, choose Tools | Templates<br />
* and open the template in the editor.<br />
*/<br />
package RegularEx;<br />
import java.util.Scanner;<br />
/**<br />
*<br />
* @author Lahiru Dhananjaya<br />
*/<br />
public class Validate {<br />
public static void main(String[] args) {<br />
ValidateInput vi=new ValidateInput();<br />
<br />
Scanner s=new Scanner(System.in);<br />
<br />
System.out.println("Enter First Name");<br />
String fname=s.next();<br />
<br />
System.out.println("Enter Last Name");<br />
String lname=s.next();<br />
<br />
System.out.println("Enter Address");<br />
String address=s.next();<br />
<br />
System.out.println("Enter City");<br />
String city=s.next();<br />
<br />
System.out.println("Enter State");<br />
String state=s.next();<br />
<br />
System.out.println("Enter Zip");<br />
String zip=s.next();<br />
<br />
System.out.println("Enter Phone Number");<br />
String phone=s.next();<br />
<br />
if(!vi.validateFirstName(fname))<br />
{<br />
System.out.println("Invalid First Name");<br />
}<br />
else if(!vi.validateLastName(lname))<br />
{<br />
System.out.println("Invalid Last Name");<br />
}<br />
else if(!vi.validateAddress(address))<br />
{<br />
System.out.println("Invalid Address");<br />
}<br />
else if(!vi.validateCity(city))<br />
{<br />
System.out.println("Invalid City");<br />
}<br />
else if(!vi.validateState(state))<br />
{<br />
System.out.println("Invalid State");<br />
}<br />
else if(!vi.validateZip(zip))<br />
{<br />
System.out.println("Invalid Zip");<br />
}<br />
else if(!vi.validatePhone(phone))<br />
{<br />
System.out.println("Invalid Phone");<br />
}<br />
else<br />
{<br />
System.out.println("Ok");<br />
}<br />
<br />
<br />
<br />
}<br />
<br />
}<br />
<div>
<br /></div>
<div>
<br /></div>
<div>
<b><u>ValidateInput.java</u></b></div>
<div>
<b><u><br /></u></b></div>
<div>
<div>
/*</div>
<div>
* To change this template, choose Tools | Templates</div>
<div>
* and open the template in the editor.</div>
<div>
*/</div>
<div>
package RegularEx;</div>
<div>
<br /></div>
<div>
/**</div>
<div>
* </div>
<div>
* @author Lahiru Dhananjaya</div>
<div>
*/</div>
<div>
public class ValidateInput {</div>
<div>
public static boolean validateFirstName(String firstName)</div>
<div>
{</div>
<div>
return firstName.matches("[A-Z][a-zA-Z]*");</div>
<div>
}</div>
<div>
</div>
<div>
public static boolean validateLastName(String lastName)</div>
<div>
{</div>
<div>
return lastName.matches("[a-zA-Z]+([ '-][a-zA-Z]*)");</div>
<div>
}</div>
<div>
</div>
<div>
public static boolean validateAddress(String address)</div>
<div>
{</div>
<div>
return address.matches("\\d+\\s+[a-zA-Z]+|[a-zA-Z]+\\s[a-zA-Z]+");</div>
<div>
}</div>
<div>
</div>
<div>
public static boolean validateCity(String city)</div>
<div>
{</div>
<div>
return city.matches("[a-zA-Z]+|[a-zA-Z]+\\s[a-zA-Z]+");</div>
<div>
}</div>
<div>
</div>
<div>
public static boolean validateState(String state)</div>
<div>
{</div>
<div>
return state.matches("[a-zA-Z]+|[a-zA-Z]+\\s[a-zA-Z]+");</div>
<div>
}</div>
<div>
</div>
<div>
public static boolean validateZip(String zip)</div>
<div>
{</div>
<div>
return zip.matches("\\d{5}");</div>
<div>
}</div>
<div>
</div>
<div>
public static boolean validatePhone(String phone)</div>
<div>
{</div>
<div>
return phone.matches("[1-9]\\d{2}-[1-9]\\d{2}-\\d{4}");</div>
<div>
}</div>
<div>
</div>
<div>
</div>
<div>
}<br />
<br />
<br />
<u><b>Java Bean Class Example</b></u><br />
<u><b><br /></b></u>
<b>Edisplay.java</b><br />
<b><br /></b>
package xm_java_bean;<br />
<br />
/**<br />
*<br />
* @author Lahiru Dhananjaya<br />
*/<br />
public class Edisplay {<br />
public static void main(String[] args) {<br />
Employee em=new Employee();<br />
em.setName("Lahiru");<br />
em.setNumber("001");<br />
<br />
System.out.println(em.getName());<br />
System.out.println(em.getNumber());<br />
}<br />
<br />
}</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<u><b>Employee.java</b></u></div>
<div>
<div>
package xm_java_bean;</div>
<div>
<br /></div>
<div>
/**</div>
<div>
*</div>
<div>
* @author Lahiru Dhananjaya</div>
<div>
*/</div>
<div>
public class Employee implements java.io.Serializable {</div>
<div>
<br /></div>
<div>
private String EmployeeName;</div>
<div>
private String EmployeeNumber;<br />
<br />
//Default Constructor</div>
<div>
public Employee() {<br />
}<br />
<br /></div>
<div>
public void setName(final String EmployeeName) {</div>
<div>
this.EmployeeName = EmployeeName;</div>
<div>
}</div>
<div>
<br /></div>
<div>
public void setNumber(final String EmployeeNumber) {</div>
<div>
this.EmployeeNumber = EmployeeNumber;</div>
<div>
}</div>
<div>
</div>
<div>
public String getName() {</div>
<div>
return EmployeeName;</div>
<div>
}</div>
<div>
public String getNumber() {</div>
<div>
return EmployeeNumber;</div>
<div>
}</div>
<div>
</div>
<div>
}</div>
</div>
<div>
<br /></div>
<div>
<div style="text-decoration: underline;">
********************************************************************************</div>
<div style="text-decoration: underline;">
To view Full code in JSP(Referenced)</div>
<div style="text-decoration: underline;">
<br /></div>
<pre class="de1" style="background-attachment: initial; background-clip: initial; background-color: #f9f9f9; background-image: none; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px none white; font-family: monospace, monospace; font-size: 14px; line-height: 1.2em; padding: 0px; tab-size: 4; vertical-align: top;"><span class="kw1" style="font-weight: bold;">
</span></pre>
<pre class="de1" style="background-attachment: initial; background-clip: initial; background-color: #f9f9f9; background-image: none; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px none white; font-family: monospace, monospace; font-size: 14px; line-height: 1.2em; padding: 0px; tab-size: 4; vertical-align: top;"><span class="kw1" style="font-weight: bold;">package</span> <span class="co2" style="color: #006699;">player</span><span class="sy0" style="color: #339933;">;</span>
<span class="kw1" style="font-weight: bold;">public</span> <span class="kw1" style="font-weight: bold;">class</span> PersonBean <span class="kw1" style="font-weight: bold;">implements</span> java.<span class="me1" style="color: #006633;">io</span>.<span class="kw3" style="color: #003399;">Serializable</span> <span class="br0" style="color: #009900;">{</span>
<span class="co3" style="color: green; font-style: italic; font-weight: bold;">/**
* Property <code>name</code> (note capitalization) readable/writable.
*/</span>
<span class="kw1" style="font-weight: bold;">private</span> <span class="kw3" style="color: #003399;">String</span> name <span class="sy0" style="color: #339933;">=</span> <span class="kw2" style="color: #000066; font-weight: bold;">null</span><span class="sy0" style="color: #339933;">;</span>
<span class="kw1" style="font-weight: bold;">private</span> <span class="kw4" style="color: #000066; font-weight: bold;">boolean</span> deceased <span class="sy0" style="color: #339933;">=</span> <span class="kw2" style="color: #000066; font-weight: bold;">false</span><span class="sy0" style="color: #339933;">;</span>
<span class="co3" style="color: green; font-style: italic; font-weight: bold;">/** No-arg constructor (takes no arguments). */</span>
<span class="kw1" style="font-weight: bold;">public</span> PersonBean<span class="br0" style="color: #009900;">(</span><span class="br0" style="color: #009900;">)</span> <span class="br0" style="color: #009900;">{</span>
<span class="br0" style="color: #009900;">}</span>
<span class="co3" style="color: green; font-style: italic; font-weight: bold;">/**
* Getter for property <code>name</code>
*/</span>
<span class="kw1" style="font-weight: bold;">public</span> <span class="kw3" style="color: #003399;">String</span> getName<span class="br0" style="color: #009900;">(</span><span class="br0" style="color: #009900;">)</span> <span class="br0" style="color: #009900;">{</span>
<span class="kw1" style="font-weight: bold;">return</span> name<span class="sy0" style="color: #339933;">;</span>
<span class="br0" style="color: #009900;">}</span>
<span class="co3" style="color: green; font-style: italic; font-weight: bold;">/**
* Setter for property <code>name</code>.
* @param value
*/</span>
<span class="kw1" style="font-weight: bold;">public</span> <span class="kw4" style="color: #000066; font-weight: bold;">void</span> setName<span class="br0" style="color: #009900;">(</span><span class="kw1" style="font-weight: bold;">final</span> <span class="kw3" style="color: #003399;">String</span> value<span class="br0" style="color: #009900;">)</span> <span class="br0" style="color: #009900;">{</span>
name <span class="sy0" style="color: #339933;">=</span> value<span class="sy0" style="color: #339933;">;</span>
<span class="br0" style="color: #009900;">}</span>
<span class="co3" style="color: green; font-style: italic; font-weight: bold;">/**
* Getter for property "deceased"
* Different syntax for a boolean field (is vs. get)
*/</span>
<span class="kw1" style="font-weight: bold;">public</span> <span class="kw4" style="color: #000066; font-weight: bold;">boolean</span> isDeceased<span class="br0" style="color: #009900;">(</span><span class="br0" style="color: #009900;">)</span> <span class="br0" style="color: #009900;">{</span>
<span class="kw1" style="font-weight: bold;">return</span> deceased<span class="sy0" style="color: #339933;">;</span>
<span class="br0" style="color: #009900;">}</span>
<span class="co3" style="color: green; font-style: italic; font-weight: bold;">/**
* Setter for property <code>deceased</code>.
* @param value
*/</span>
<span class="kw1" style="font-weight: bold;">public</span> <span class="kw4" style="color: #000066; font-weight: bold;">void</span> setDeceased<span class="br0" style="color: #009900;">(</span><span class="kw1" style="font-weight: bold;">final</span> <span class="kw4" style="color: #000066; font-weight: bold;">boolean</span> value<span class="br0" style="color: #009900;">)</span> <span class="br0" style="color: #009900;">{</span>
deceased <span class="sy0" style="color: #339933;">=</span> value<span class="sy0" style="color: #339933;">;</span>
<span class="br0" style="color: #009900;">}</span>
<span class="br0" style="color: #009900;">}</span></pre>
<pre class="de1" style="background-attachment: initial; background-clip: initial; background-color: #f9f9f9; background-image: none; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px none white; font-family: monospace, monospace; font-size: 14px; line-height: 1.2em; padding: 0px; tab-size: 4; vertical-align: top;"><span class="br0" style="color: #009900;">
</span></pre>
<pre class="de1" style="background-attachment: initial; background-clip: initial; background-color: #f9f9f9; background-image: none; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px none white; font-family: monospace, monospace; font-size: 14px; line-height: 1.2em; padding: 0px; tab-size: 4; vertical-align: top;"><span class="br0" style="color: #009900;"><b style="color: #252525; font-family: sans-serif; line-height: 22.399999618530273px; white-space: normal;"><u><code style="font-family: monospace, Courier;">TestPersonBean.java</code></u></b><span style="background-color: white; color: #252525; font-family: sans-serif; line-height: 22.399999618530273px; white-space: normal;">:</span></span></pre>
<pre class="de1" style="background-attachment: initial; background-clip: initial; background-color: #f9f9f9; background-image: none; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px none white; font-family: monospace, monospace; font-size: 14px; line-height: 1.2em; padding: 0px; tab-size: 4; vertical-align: top;"><span class="kw1" style="background-color: transparent; font-size: 1em; font-weight: bold; line-height: 1.2em; text-align: center;">
</span></pre>
<pre class="de1" style="background-attachment: initial; background-clip: initial; background-color: #f9f9f9; background-image: none; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px none white; font-family: monospace, monospace; font-size: 14px; line-height: 1.2em; padding: 0px; tab-size: 4; vertical-align: top;"><span class="kw1" style="background-color: transparent; font-size: 1em; font-weight: bold; line-height: 1.2em; text-align: center;">import</span><span style="background-color: transparent; font-size: 1em; line-height: 1.2em; text-align: center;"> </span><span class="co2" style="background-color: transparent; color: #006699; font-size: 1em; line-height: 1.2em; text-align: center;">player.PersonBean</span><span class="sy0" style="background-color: transparent; color: #339933; font-size: 1em; line-height: 1.2em; text-align: center;">;</span></pre>
<pre class="de1" style="background-attachment: initial; background-clip: initial; background-color: #f9f9f9; background-image: none; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px none white; font-family: monospace, monospace; font-size: 14px; line-height: 1.2em; padding: 0px; tab-size: 4; vertical-align: top;"><span class="sy0" style="background-color: transparent; color: #339933; font-size: 1em; line-height: 1.2em; text-align: center;">
</span></pre>
<pre class="de1" style="background-attachment: initial; background-clip: initial; background-color: #f9f9f9; background-image: none; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px none white; font-family: monospace, monospace; font-size: 14px; line-height: 1.2em; padding: 0px; tab-size: 4; vertical-align: top;"><span class="sy0" style="background-color: transparent; color: #339933; font-size: 1em; line-height: 1.2em; text-align: center;"><pre class="de1" style="background: none; border: 0px none white; color: black; font-family: monospace, monospace; font-size: 1em; line-height: 1.2em; padding: 0px; tab-size: 4; text-align: start; vertical-align: top;"><span class="co3" style="color: green; font-style: italic; font-weight: bold;">/**
* Class <code>TestPersonBean</code>.
*/</span>
<span class="kw1" style="font-weight: bold;">public</span> <span class="kw1" style="font-weight: bold;">class</span> TestPersonBean <span class="br0" style="color: #009900;">{</span>
<span class="co3" style="color: green; font-style: italic; font-weight: bold;">/**
* Tester method <code>main</code> for class <code>PersonBean</code>.
* @param ARGS
*/</span>
<span class="kw1" style="font-weight: bold;">public</span> <span class="kw1" style="font-weight: bold;">static</span> <span class="kw4" style="color: #000066; font-weight: bold;">void</span> main<span class="br0" style="color: #009900;">(</span><span class="kw3" style="color: #003399;">String</span><span class="br0" style="color: #009900;">[</span><span class="br0" style="color: #009900;">]</span> args<span class="br0" style="color: #009900;">)</span> <span class="br0" style="color: #009900;">{</span>
PersonBean person <span class="sy0" style="color: #339933;">=</span> <span class="kw1" style="font-weight: bold;">new</span> PersonBean<span class="br0" style="color: #009900;">(</span><span class="br0" style="color: #009900;">)</span><span class="sy0" style="color: #339933;">;</span>
person.<span class="me1" style="color: #006633;">setName</span><span class="br0" style="color: #009900;">(</span><span class="st0" style="color: blue;">"Bob"</span><span class="br0" style="color: #009900;">)</span><span class="sy0" style="color: #339933;">;</span>
person.<span class="me1" style="color: #006633;">setDeceased</span><span class="br0" style="color: #009900;">(</span><span class="kw2" style="color: #000066; font-weight: bold;">false</span><span class="br0" style="color: #009900;">)</span><span class="sy0" style="color: #339933;">;</span>
<span class="co1" style="color: #666666; font-style: italic;">// Output: "Bob [alive]"</span>
<span class="kw3" style="color: #003399;">System</span>.<span class="me1" style="color: #006633;">out</span>.<span class="me1" style="color: #006633;">print</span><span class="br0" style="color: #009900;">(</span>person.<span class="me1" style="color: #006633;">getName</span><span class="br0" style="color: #009900;">(</span><span class="br0" style="color: #009900;">)</span><span class="br0" style="color: #009900;">)</span><span class="sy0" style="color: #339933;">;</span>
<span class="kw3" style="color: #003399;">System</span>.<span class="me1" style="color: #006633;">out</span>.<span class="me1" style="color: #006633;">println</span><span class="br0" style="color: #009900;">(</span>person.<span class="me1" style="color: #006633;">isDeceased</span><span class="br0" style="color: #009900;">(</span><span class="br0" style="color: #009900;">)</span> <span class="sy0" style="color: #339933;">?</span> <span class="st0" style="color: blue;">" [deceased]"</span> <span class="sy0" style="color: #339933;">:</span> <span class="st0" style="color: blue;">" [alive]"</span><span class="br0" style="color: #009900;">)</span><span class="sy0" style="color: #339933;">;</span>
<span class="br0" style="color: #009900;">}</span>
<span class="br0" style="color: #009900;">}</span></pre>
<pre class="de1" style="background: none; border: 0px none white; color: black; font-family: monospace, monospace; font-size: 1em; line-height: 1.2em; padding: 0px; tab-size: 4; text-align: start; vertical-align: top;"><b style="color: #252525; font-family: sans-serif; font-size: 1em; line-height: 22.399999618530273px; white-space: normal;"><u><code style="font-family: monospace, Courier;">
</code></u></b></pre>
<pre class="de1" style="background: none; border: 0px none white; color: black; font-family: monospace, monospace; font-size: 1em; line-height: 1.2em; padding: 0px; tab-size: 4; text-align: start; vertical-align: top;"><b style="color: #252525; font-family: sans-serif; font-size: 1em; line-height: 22.399999618530273px; white-space: normal;"><u><code style="font-family: monospace, Courier;">testPersonBean.jsp</code></u></b><span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 1em; line-height: 22.399999618530273px; white-space: normal;">;</span></pre>
<pre class="de1" style="background: none; border: 0px none white; color: black; font-family: monospace, monospace; font-size: 1em; line-height: 1.2em; padding: 0px; tab-size: 4; text-align: start; vertical-align: top;"><span class="br0" style="color: #009900;"><div class="mw-geshi mw-code mw-content-ltr" dir="ltr" style="border: 1px solid rgb(221, 221, 221); color: black; direction: ltr; font-family: monospace, Courier; line-height: 1.3em; padding: 1em; white-space: normal;">
<div class="html4strict source-html4strict" style="font-family: monospace, monospace; line-height: normal; tab-size: 4;">
<pre class="de1" style="background: none; border: 0px none white; font-family: monospace, monospace; font-size: 1em; line-height: 1.2em; padding: 0px; tab-size: 4; vertical-align: top;"><span class="sc2" style="color: #009900;"><% <span class="sy0" style="color: #66cc66;">//</span> Use of PersonBean in a JSP. %></span>
<span class="sc2" style="color: #009900;"><jsp:useBean <span class="kw3" style="color: #000066;">id</span><span class="sy0" style="color: #66cc66;">=</span><span class="st0" style="color: red;">"person"</span> <span class="kw3" style="color: #000066;">class</span><span class="sy0" style="color: #66cc66;">=</span><span class="st0" style="color: red;">"player.PersonBean"</span> <span class="kw3" style="color: #000066;">scope</span><span class="sy0" style="color: #66cc66;">=</span><span class="st0" style="color: red;">"page"</span><span class="sy0" style="color: #66cc66;">/</span>></span>
<span class="sc2" style="color: #009900;"><jsp:setProperty <span class="kw3" style="color: #000066;">name</span><span class="sy0" style="color: #66cc66;">=</span><span class="st0" style="color: red;">"person"</span> property<span class="sy0" style="color: #66cc66;">=</span><span class="st0" style="color: red;">"*"</span><span class="sy0" style="color: #66cc66;">/</span>></span>
<span class="sc2" style="color: #009900;"><<span class="kw2" style="color: black; font-weight: bold;">html</span>></span>
<span class="sc2" style="color: #009900;"><<span class="kw2" style="color: black; font-weight: bold;">body</span>></span>
Name: <span class="sc2" style="color: #009900;"><jsp:getProperty <span class="kw3" style="color: #000066;">name</span><span class="sy0" style="color: #66cc66;">=</span><span class="st0" style="color: red;">"person"</span> property<span class="sy0" style="color: #66cc66;">=</span><span class="st0" style="color: red;">"name"</span><span class="sy0" style="color: #66cc66;">/</span>><<span class="kw2" style="color: black; font-weight: bold;">br</span><span class="sy0" style="color: #66cc66;">/</span>></span>
Deceased? <span class="sc2" style="color: #009900;"><jsp:getProperty <span class="kw3" style="color: #000066;">name</span><span class="sy0" style="color: #66cc66;">=</span><span class="st0" style="color: red;">"person"</span> property<span class="sy0" style="color: #66cc66;">=</span><span class="st0" style="color: red;">"deceased"</span><span class="sy0" style="color: #66cc66;">/</span>><<span class="kw2" style="color: black; font-weight: bold;">br</span><span class="sy0" style="color: #66cc66;">/</span>></span>
<span class="sc2" style="color: #009900;"><<span class="kw2" style="color: black; font-weight: bold;">br</span><span class="sy0" style="color: #66cc66;">/</span>></span>
<span class="sc2" style="color: #009900;"><<span class="kw2" style="color: black; font-weight: bold;">form</span> <span class="kw3" style="color: #000066;">name</span><span class="sy0" style="color: #66cc66;">=</span><span class="st0" style="color: red;">"beanTest"</span> <span class="kw3" style="color: #000066;">method</span><span class="sy0" style="color: #66cc66;">=</span><span class="st0" style="color: red;">"POST"</span> <span class="kw3" style="color: #000066;">action</span><span class="sy0" style="color: #66cc66;">=</span><span class="st0" style="color: red;">"testPersonBean.jsp"</span>></span>
Enter a name: <span class="sc2" style="color: #009900;"><<span class="kw2" style="color: black; font-weight: bold;">input</span> <span class="kw3" style="color: #000066;">type</span><span class="sy0" style="color: #66cc66;">=</span><span class="st0" style="color: red;">"text"</span> <span class="kw3" style="color: #000066;">name</span><span class="sy0" style="color: #66cc66;">=</span><span class="st0" style="color: red;">"name"</span> <span class="kw3" style="color: #000066;">size</span><span class="sy0" style="color: #66cc66;">=</span><span class="st0" style="color: red;">"50"</span>><<span class="kw2" style="color: black; font-weight: bold;">br</span><span class="sy0" style="color: #66cc66;">/</span>></span>
Choose an option:
<span class="sc2" style="color: #009900;"><<span class="kw2" style="color: black; font-weight: bold;">select</span> <span class="kw3" style="color: #000066;">name</span><span class="sy0" style="color: #66cc66;">=</span><span class="st0" style="color: red;">"deceased"</span>></span>
<span class="sc2" style="color: #009900;"><<span class="kw2" style="color: black; font-weight: bold;">option</span> <span class="kw3" style="color: #000066;">value</span><span class="sy0" style="color: #66cc66;">=</span><span class="st0" style="color: red;">"false"</span>></span>Alive<span class="sc2" style="color: #009900;"><<span class="sy0" style="color: #66cc66;">/</span><span class="kw2" style="color: black; font-weight: bold;">option</span>></span>
<span class="sc2" style="color: #009900;"><<span class="kw2" style="color: black; font-weight: bold;">option</span> <span class="kw3" style="color: #000066;">value</span><span class="sy0" style="color: #66cc66;">=</span><span class="st0" style="color: red;">"true"</span>></span>Dead<span class="sc2" style="color: #009900;"><<span class="sy0" style="color: #66cc66;">/</span><span class="kw2" style="color: black; font-weight: bold;">option</span>></span>
<span class="sc2" style="color: #009900;"><<span class="sy0" style="color: #66cc66;">/</span><span class="kw2" style="color: black; font-weight: bold;">select</span>></span>
<span class="sc2" style="color: #009900;"><<span class="kw2" style="color: black; font-weight: bold;">input</span> <span class="kw3" style="color: #000066;">type</span><span class="sy0" style="color: #66cc66;">=</span><span class="st0" style="color: red;">"submit"</span> <span class="kw3" style="color: #000066;">value</span><span class="sy0" style="color: #66cc66;">=</span><span class="st0" style="color: red;">"Test the Bean"</span>></span>
<span class="sc2" style="color: #009900;"><<span class="sy0" style="color: #66cc66;">/</span><span class="kw2" style="color: black; font-weight: bold;">form</span>></span>
<span class="sc2" style="color: #009900;"><<span class="sy0" style="color: #66cc66;">/</span><span class="kw2" style="color: black; font-weight: bold;">body</span>></span>
<span class="sc2" style="color: #009900;"><<span class="sy0" style="color: #66cc66;">/</span><span class="kw2" style="color: black; font-weight: bold;">html</span>></span></pre>
</div>
</div>
</span></pre>
</span></pre>
</div>
</div>
Lahiru Dhananjayahttp://www.blogger.com/profile/04904665996384999048noreply@blogger.com0tag:blogger.com,1999:blog-4880340238784455124.post-54645985523948478212014-07-26T01:42:00.001-07:002014-07-27T00:57:23.811-07:00Data Structures and Algorithms with Java - Part II (Data Structures & Algorithms)ඔන්න DSA Final part එක දැන් post කරනවා ඔයාලට.....<br />
<br />
<b>Search Algorithms ගැන කතා කරොත් It can divided in to 2 categories</b><br />
<br />
1. Linear Search<br />
<ol><ul>
<li>Small and Unsorted Arrays</li>
<li>Simple to implement but slow</li>
</ul>
</ol>
<div>
මෙහිදී array එකේ මුල සිට අවසානය දක්වා search key එක ලැබෙන තෙක් search කරයි.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmsenoFlVwGmCfpyGc7Uq32szi2ix_RzwnqsOnbPxtsLTNzf3gkWewMP-OpJ5OHRVdCUZm0lCLHFUZxW5T-liaKEDZSG3nNayulCkp_2O-KaQOhr1AfJUNrjVPKulh4H18iDJRCBMCxRp5/s1600/download.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmsenoFlVwGmCfpyGc7Uq32szi2ix_RzwnqsOnbPxtsLTNzf3gkWewMP-OpJ5OHRVdCUZm0lCLHFUZxW5T-liaKEDZSG3nNayulCkp_2O-KaQOhr1AfJUNrjVPKulh4H18iDJRCBMCxRp5/s1600/download.jpg" height="176" width="200" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<u>Code</u> </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
//Code by me</div>
<div class="separator" style="clear: both; text-align: left;">
<u><br /></u></div>
<div class="separator" style="clear: both; text-align: left;">
public int linearSearch(int list[],int size,int SK){</div>
<div class="separator" style="clear: both; text-align: left;">
boolean found=false;</div>
<div class="separator" style="clear: both; text-align: left;">
int position=-1;</div>
<div class="separator" style="clear: both; text-align: left;">
int index=0;</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
while(index<list.length && !found){</div>
<div class="separator" style="clear: both; text-align: left;">
if (list[index]==SK) {</div>
<div class="separator" style="clear: both; text-align: left;">
found = true;</div>
<div class="separator" style="clear: both; text-align: left;">
position = index;</div>
<div class="separator" style="clear: both; text-align: left;">
}</div>
<div class="separator" style="clear: both; text-align: left;">
++index;</div>
<div class="separator" style="clear: both; text-align: left;">
}</div>
<div class="separator" style="clear: both; text-align: left;">
return position;</div>
<div class="separator" style="clear: both;">
</div>
<div class="separator" style="clear: both;">
<code><list .length="" code="" found="true;" if="" index="" list="" position="" return=""></list></code></div>
<div class="separator" style="clear: both; text-align: left;">
}</div>
<div class="separator" style="clear: both;">
<br /></div>
2. Binary Search<br />
<ol><ul>
<li>Large and sorted Arrays</li>
</ul>
</ol>
<div>
මෙහිදී array එක කොටස් 2 කට බෙදා එක් එක් කොටස නැවත නැවතත් බෙදා වෙන වෙනම search key ලැබෙන තෙක් search කරයි.</div>
<br />
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhn6rP6u6hxMhOtRBKY2MMlDr3gbC1llc_i_Zo4XTXriTInvgo5IR_1p3FknlrtyiYKWWC6pENAG5sscUU6mMLS4-9xIJbcuuFBhZewi67vmiLjKvqF72oxYfP4dMaHZtt1DMocrLb2WoHl/s1600/binary-search-program-shell.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhn6rP6u6hxMhOtRBKY2MMlDr3gbC1llc_i_Zo4XTXriTInvgo5IR_1p3FknlrtyiYKWWC6pENAG5sscUU6mMLS4-9xIJbcuuFBhZewi67vmiLjKvqF72oxYfP4dMaHZtt1DMocrLb2WoHl/s1600/binary-search-program-shell.gif" height="185" width="200" /></a></div>
<div>
<u>Code</u><br />
//Code by me<br />
public void binarySearch(int list[], int size, int SK) {<br />
int mid = (list.length - 1) / 2;<br />
boolean f = false;<br />
<br />
if (list[mid] > SK) {<br />
while (list[mid] != SK) {<br />
if (list[mid] == SK) {<br />
++mid;<br />
}<br />
<br />
}<br />
} else {<br />
while (list[mid] != SK) {<br />
--mid;<br />
}<br />
}<br />
<br />
}<br />
<br /></div>
<div>
<b>Sort Algorithms ගැන කතා කරොත් It can divided in to 5 categories</b><br />
<br />
<b>1. </b>Bubble sort<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIY3MCPmJUv6GvFEFKfT03ApnHhqo9_gq47jU-61dXxAAuaRKkRQV7F3bEOnKSzERBmS4Y5prd7se_o8g04MY0diDIcua_WxJRLQms5MK1B7X3mUqLjzHb5v6xX1Wm_eUUC1fyTNPdNcIC/s1600/clip_image001_thumb%5B1%5D.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIY3MCPmJUv6GvFEFKfT03ApnHhqo9_gq47jU-61dXxAAuaRKkRQV7F3bEOnKSzERBmS4Y5prd7se_o8g04MY0diDIcua_WxJRLQms5MK1B7X3mUqLjzHb5v6xX1Wm_eUUC1fyTNPdNcIC/s1600/clip_image001_thumb%5B1%5D.gif" height="216" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<u>Code</u></div>
<div class="separator" style="clear: both; text-align: left;">
//Referenced code</div>
<div class="separator" style="clear: both;">
for (int x = 0; x < n; x++) {</div>
<div class="separator" style="clear: both;">
for (int y = 0; y < n - 1; y++) {</div>
<div class="separator" style="clear: both;">
if (array[y] > array[y + 1]) {</div>
<div class="separator" style="clear: both;">
int temp = array[y + 1];</div>
<div class="separator" style="clear: both;">
array[y + 1] = array[y];</div>
<div class="separator" style="clear: both;">
array[y] = temp;</div>
<div class="separator" style="clear: both;">
}</div>
<div class="separator" style="clear: both;">
}</div>
<div class="separator" style="clear: both;">
</div>
<div class="separator" style="clear: both;">
}</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
2. Selection Sort</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJA6Bi1xuLjLFnQBKtxMFTX1wv4Qrp2cwHP5INe0gmhMh50FTyMAdXh4T8IG6F_UuAjXNls8NGj2l3IWaquDGLA5anD8rBG5H-3DyFGtj8fwZI7G3dh_peNabvi4tKkN45ez3NgPGxny9Q/s1600/Selection-sort-algorithm.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJA6Bi1xuLjLFnQBKtxMFTX1wv4Qrp2cwHP5INe0gmhMh50FTyMAdXh4T8IG6F_UuAjXNls8NGj2l3IWaquDGLA5anD8rBG5H-3DyFGtj8fwZI7G3dh_peNabvi4tKkN45ez3NgPGxny9Q/s1600/Selection-sort-algorithm.jpg" height="165" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<u>Code</u></div>
<div class="separator" style="clear: both; text-align: left;">
//Referenced code</div>
<div class="separator" style="clear: both;">
public static void selectionSort1(int[] x) {</div>
<div class="separator" style="clear: both;">
for (int i = 0; i < x.length - 1; i++) {</div>
<div class="separator" style="clear: both;">
for (int j = i + 1; j < x.length; j++) {</div>
<div class="separator" style="clear: both;">
if (x[i] > x[j]) {</div>
<div class="separator" style="clear: both;">
//... Exchange elements</div>
<div class="separator" style="clear: both;">
int temp = x[i];</div>
<div class="separator" style="clear: both;">
x[i] = x[j];</div>
<div class="separator" style="clear: both;">
x[j] = temp;</div>
<div class="separator" style="clear: both;">
}</div>
<div class="separator" style="clear: both;">
}</div>
<div class="separator" style="clear: both;">
}</div>
<div class="separator" style="clear: both;">
</div>
<div class="separator" style="clear: both;">
}</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
3. Insertion Sort</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNRbiDDDS9lG7hqMOJfcqqe22ff4EjxU85lwytEPq0H2qwKtQx1pxLNhJXvRUghgzFuH6Bqi1yo4KcV4G6VCw1PFlsfW6jPLazbxneYmwl4vfDsGVArueWBFvVn3QZQw1ov0RPqKK2Plhw/s1600/Insertion-Sort-Model11.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNRbiDDDS9lG7hqMOJfcqqe22ff4EjxU85lwytEPq0H2qwKtQx1pxLNhJXvRUghgzFuH6Bqi1yo4KcV4G6VCw1PFlsfW6jPLazbxneYmwl4vfDsGVArueWBFvVn3QZQw1ov0RPqKK2Plhw/s1600/Insertion-Sort-Model11.jpg" height="226" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<u>Code</u></div>
<div class="separator" style="clear: both; text-align: left;">
<u><br /></u></div>
<div class="separator" style="clear: both;">
//Referenced code</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
public class MyInsertionSort {</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
public static void main(String[] args) {</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
int[] input = {4, 2, 9, 6, 23, 12, 34, 0, 1};</div>
<div class="separator" style="clear: both;">
insertionSort(input);</div>
<div class="separator" style="clear: both;">
}</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
private static void printNumbers(int[] input) {</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
for (int i = 0; i < input.length; i++) {</div>
<div class="separator" style="clear: both;">
System.out.print(input[i] + ", ");</div>
<div class="separator" style="clear: both;">
}</div>
<div class="separator" style="clear: both;">
System.out.println("\n");</div>
<div class="separator" style="clear: both;">
}</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
public static void insertionSort(int array[]) {</div>
<div class="separator" style="clear: both;">
int n = array.length;</div>
<div class="separator" style="clear: both;">
for (int j = 1; j < n; j++) {</div>
<div class="separator" style="clear: both;">
int key = array[j];</div>
<div class="separator" style="clear: both;">
int i = j - 1;</div>
<div class="separator" style="clear: both;">
while ((i > -1) && (array[i] > key)) {</div>
<div class="separator" style="clear: both;">
array[i + 1] = array[i];</div>
<div class="separator" style="clear: both;">
i--;</div>
<div class="separator" style="clear: both;">
}</div>
<div class="separator" style="clear: both;">
array[i + 1] = key;</div>
<div class="separator" style="clear: both;">
printNumbers(array);</div>
<div class="separator" style="clear: both;">
}</div>
<div class="separator" style="clear: both;">
}</div>
<div class="separator" style="clear: both;">
</div>
<div class="separator" style="clear: both;">
}</div>
<div class="line number32 index31 alt1" style="background: none white !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; height: auto !important; left: auto !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;">
<code class="java plain" style="background-attachment: initial !important; background-clip: initial !important; background-color: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: inherit !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;">
</code></div>
<div class="separator" style="clear: both; text-align: left;">
4. Merger Sort</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgE3v49JzqhqcVfPDQliVADXG5BbFw0dndiug97PROrl_Wt_pgy4ZCPlQfiOzLP7szsXzX0ewl42s6DCSbE7v9HkQKr4RgSJQmL9brQBagTBENjIK5537GdirBvjy3KmsjD2dgvhi5DbruL/s1600/Merge_sort_algorithm_diagram.svg.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgE3v49JzqhqcVfPDQliVADXG5BbFw0dndiug97PROrl_Wt_pgy4ZCPlQfiOzLP7szsXzX0ewl42s6DCSbE7v9HkQKr4RgSJQmL9brQBagTBENjIK5537GdirBvjy3KmsjD2dgvhi5DbruL/s1600/Merge_sort_algorithm_diagram.svg.png" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<u>Code</u></div>
<div class="separator" style="clear: both; text-align: left;">
<u><br /></u></div>
<div class="separator" style="clear: both; text-align: left;">
//Referenced code</div>
<div class="separator" style="clear: both;">
public class MyMergeSort {</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
private int[] array;</div>
<div class="separator" style="clear: both;">
private int[] tempMergArr;</div>
<div class="separator" style="clear: both;">
private int length;</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
public static void main(String a[]) {</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
int[] inputArr = {45, 23, 11, 89, 77, 98, 4, 28, 65, 43};</div>
<div class="separator" style="clear: both;">
MyMergeSort mms = new MyMergeSort();</div>
<div class="separator" style="clear: both;">
mms.sort(inputArr);</div>
<div class="separator" style="clear: both;">
for (int i : inputArr) {</div>
<div class="separator" style="clear: both;">
System.out.print(i);</div>
<div class="separator" style="clear: both;">
System.out.print(" ");</div>
<div class="separator" style="clear: both;">
}</div>
<div class="separator" style="clear: both;">
}</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
public void sort(int inputArr[]) {</div>
<div class="separator" style="clear: both;">
this.array = inputArr;</div>
<div class="separator" style="clear: both;">
this.length = inputArr.length;</div>
<div class="separator" style="clear: both;">
this.tempMergArr = new int[length];</div>
<div class="separator" style="clear: both;">
doMergeSort(0, length - 1);</div>
<div class="separator" style="clear: both;">
}</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
private void doMergeSort(int lowerIndex, int higherIndex) {</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
if (lowerIndex < higherIndex) {</div>
<div class="separator" style="clear: both;">
int middle = lowerIndex + (higherIndex - lowerIndex) / 2;</div>
<div class="separator" style="clear: both;">
// Below step sorts the left side of the array</div>
<div class="separator" style="clear: both;">
doMergeSort(lowerIndex, middle);</div>
<div class="separator" style="clear: both;">
// Below step sorts the right side of the array</div>
<div class="separator" style="clear: both;">
doMergeSort(middle + 1, higherIndex);</div>
<div class="separator" style="clear: both;">
// Now merge both sides</div>
<div class="separator" style="clear: both;">
mergeParts(lowerIndex, middle, higherIndex);</div>
<div class="separator" style="clear: both;">
}</div>
<div class="separator" style="clear: both;">
}</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
private void mergeParts(int lowerIndex, int middle, int higherIndex) {</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
for (int i = lowerIndex; i <= higherIndex; i++) {</div>
<div class="separator" style="clear: both;">
tempMergArr[i] = array[i];</div>
<div class="separator" style="clear: both;">
}</div>
<div class="separator" style="clear: both;">
int i = lowerIndex;</div>
<div class="separator" style="clear: both;">
int j = middle + 1;</div>
<div class="separator" style="clear: both;">
int k = lowerIndex;</div>
<div class="separator" style="clear: both;">
while (i <= middle && j <= higherIndex) {</div>
<div class="separator" style="clear: both;">
if (tempMergArr[i] <= tempMergArr[j]) {</div>
<div class="separator" style="clear: both;">
array[k] = tempMergArr[i];</div>
<div class="separator" style="clear: both;">
i++;</div>
<div class="separator" style="clear: both;">
} else {</div>
<div class="separator" style="clear: both;">
array[k] = tempMergArr[j];</div>
<div class="separator" style="clear: both;">
j++;</div>
<div class="separator" style="clear: both;">
}</div>
<div class="separator" style="clear: both;">
k++;</div>
<div class="separator" style="clear: both;">
}</div>
<div class="separator" style="clear: both;">
while (i <= middle) {</div>
<div class="separator" style="clear: both;">
array[k] = tempMergArr[i];</div>
<div class="separator" style="clear: both;">
k++;</div>
<div class="separator" style="clear: both;">
i++;</div>
<div class="separator" style="clear: both;">
}</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
}</div>
<div class="separator" style="clear: both;">
</div>
<div class="separator" style="clear: both;">
}</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
5.Quick Sort</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyEDGsL8CQxvbdjZfecJE2ymmlhE8hur8ictL9nbS4WTNhUd0cO3sDT_bOxB5xeDRxbXoj_wu-Jt78qg5v1dowf4ROn5D59trLO21Kfnr4dYDiguZcf_YG304RY1OzWVJZkhkVYhATbPfx/s1600/quick1.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyEDGsL8CQxvbdjZfecJE2ymmlhE8hur8ictL9nbS4WTNhUd0cO3sDT_bOxB5xeDRxbXoj_wu-Jt78qg5v1dowf4ROn5D59trLO21Kfnr4dYDiguZcf_YG304RY1OzWVJZkhkVYhATbPfx/s1600/quick1.gif" height="320" width="287" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div>
<u>Code</u><br />
//Referenced code<br />
<br />
public class MyQuickSort {<br />
<br />
private int array[];<br />
private int length;<br />
<br />
public void sort(int[] inputArr) {<br />
<br />
if (inputArr == null || inputArr.length == 0) {<br />
return;<br />
}<br />
this.array = inputArr;<br />
length = inputArr.length;<br />
quickSort(0, length - 1);<br />
}<br />
<br />
private void quickSort(int lowerIndex, int higherIndex) {<br />
<br />
int i = lowerIndex;<br />
int j = higherIndex;<br />
// calculate pivot number, I am taking pivot as middle index number<br />
int pivot = array[lowerIndex + (higherIndex - lowerIndex) / 2];<br />
// Divide into two arrays<br />
while (i <= j) {<br />
/**<br />
* In each iteration, we will identify a number from left side<br />
* which is greater then the pivot value, and also we will<br />
* identify a number from right side which is less then the<br />
* pivot value. Once the search is done, then we exchange both<br />
* numbers.<br />
*/<br />
while (array[i] < pivot) {<br />
i++;<br />
}<br />
while (array[j] > pivot) {<br />
j--;<br />
}<br />
if (i <= j) {<br />
exchangeNumbers(i, j);<br />
//move index to next position on both sides<br />
i++;<br />
j--;<br />
}<br />
}<br />
// call quickSort() method recursively<br />
if (lowerIndex < j) {<br />
quickSort(lowerIndex, j);<br />
}<br />
if (i < higherIndex) {<br />
quickSort(i, higherIndex);<br />
}<br />
}<br />
<br />
private void exchangeNumbers(int i, int j) {<br />
int temp = array[i];<br />
array[i] = array[j];<br />
array[j] = temp;<br />
}<br />
<br />
public static void main(String a[]) {<br />
<br />
MyQuickSort sorter = new MyQuickSort();<br />
int[] input = {24, 2, 45, 20, 56, 75, 2, 56, 99, 53, 12};<br />
sorter.sort(input);<br />
for (int i : input) {<br />
System.out.print(i);<br />
System.out.print(" ");<br />
}<br />
}<br />
}<br />
<br />
<br /></div>
<div>
<b>Recursion</b></div>
<div>
<b><br /></b></div>
<div>
<ul>
<li>Recursion is the function calling it self </li>
<li>We can use instead of a loop which is in a large looping times</li>
</ul>
<div>
<u>Code</u></div>
</div>
<div>
<div>
<br /></div>
<div>
<u>Factorial</u></div>
<div>
<u><br /></u></div>
<div>
int factorial(int num ){</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>if (num <= 0) {</div>
<div>
return 1;</div>
<div>
} else {</div>
<div>
return num * factorial(--num );</div>
<div>
}</div>
<div>
}</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<u>Fabonaci</u></div>
<div>
<u><br /></u></div>
<div>
int fibonaci(int num ){</div>
<div>
<br /></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>if (num <= 0) {</div>
<div>
return 0;</div>
<div>
} else {</div>
<div>
return num + fibonaci(--num);</div>
<div>
}</div>
<div>
<br /></div>
<div>
}</div>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b><br /></b></div>
<div>
<b>Trees</b></div>
<br />
<ul>
<li>Hierarchy Concept</li>
<li>For File Systems/Java Class Hierarchy</li>
<li>Fast Searchable</li>
<li>Each Node Connect to multiple Nodes</li>
<li>Root/Parent/Child/Leaves/Height/Depth are some key words used in trees</li>
</ul>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
Tress Traversing</div>
<div>
<ul>
<li>PreOrder - VLR process</li>
<ul>
<li>Visit first Left Right</li>
</ul>
<li>PostOrder- LRV process</li>
<ul>
<li>Left Right and Visit</li>
</ul>
<li>InOrder- LVR process</li>
<ul>
<li>Left Visit Right</li>
</ul>
</ul>
<div>
<br /></div>
</div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuUkAcg7D9mHD0dPH9h2w41H4gwtx4Z-5wuGYy-_1F2Fh0TVI_4pJlLDkIYH17v8D_yMyS6iBs3EfctteAnOgUdYeLHZwn10nJ7_sl8Dqle4zJgq6iYs-RvjnhdnBgnPbe6PJfjssqYxkM/s1600/fig21-11.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuUkAcg7D9mHD0dPH9h2w41H4gwtx4Z-5wuGYy-_1F2Fh0TVI_4pJlLDkIYH17v8D_yMyS6iBs3EfctteAnOgUdYeLHZwn10nJ7_sl8Dqle4zJgq6iYs-RvjnhdnBgnPbe6PJfjssqYxkM/s1600/fig21-11.jpg" height="256" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Tree Balancing Techniques</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<ul>
<li>Global</li>
<ul>
<li>DSW Algorithm</li>
</ul>
</ul>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhz8Uw2yVsuMHBymmzct7CRTM7kn27X4vrH6di7CVoNb6p4buqIUeR02jfHpaeqY98lwQUeiI500W1Lh6JI0SqRoe3atRq47eLdk2YB1D-RTRXQnr1hEHEF5R15t0aJTOsijZEXqd19LIF5/s1600/images.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhz8Uw2yVsuMHBymmzct7CRTM7kn27X4vrH6di7CVoNb6p4buqIUeR02jfHpaeqY98lwQUeiI500W1Lh6JI0SqRoe3atRq47eLdk2YB1D-RTRXQnr1hEHEF5R15t0aJTOsijZEXqd19LIF5/s1600/images.jpg" height="146" width="400" /></a></div>
<div>
<br /></div>
<ul>
<li>Local</li>
<ul>
<li>AVL</li>
<ul>
<li>This consider about the level difference is equal to 1 or 0, it is balanced</li>
</ul>
</ul>
</ul>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpsH3KStWasuSK9ziruLD6wVfmT2WMFP8ZkaSXJaRAdfk_5KwPEIoAT3gfzV2D-EU-mWCeebDZTbFNZOyPwZdpXCNHUKjCi7gH4Z2OD5U8TyTpgB-4qWwDrmbs9aJWGi-vwIpINMD1Z0iN/s1600/download+(1).jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpsH3KStWasuSK9ziruLD6wVfmT2WMFP8ZkaSXJaRAdfk_5KwPEIoAT3gfzV2D-EU-mWCeebDZTbFNZOyPwZdpXCNHUKjCi7gH4Z2OD5U8TyTpgB-4qWwDrmbs9aJWGi-vwIpINMD1Z0iN/s1600/download+(1).jpg" height="112" width="400" /></a></div>
<div>
<br /></div>
<ul><ul>
<li>Red Black</li>
<ul>
<li>This consider about the level difference is upto 2 ,it is balanced</li>
</ul>
</ul>
</ul>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEz-lGosqqLs-YZlVHLATn8OSKzrGC5yoeOvnmlnrMcZXhD8wCeTePtUOYUk4e6jVlIQGMP4Oz1aNivvJVYE0DBBL7VfxrOI_3TENttaIuBgkLPV_jE6Cwnn48fSzwZL66WXMomZJdHTU7/s1600/rbtree.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEz-lGosqqLs-YZlVHLATn8OSKzrGC5yoeOvnmlnrMcZXhD8wCeTePtUOYUk4e6jVlIQGMP4Oz1aNivvJVYE0DBBL7VfxrOI_3TENttaIuBgkLPV_jE6Cwnn48fSzwZL66WXMomZJdHTU7/s1600/rbtree.gif" height="252" width="320" /></a></div>
<div>
<br /></div>
<br />
<br />
Tree Balancing<br />
<br />
<ul>
<li>Left Rotate </li>
<li>Right Rotate</li>
</ul>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiF2TY3nXErasLbcEhU13OvY7_Hb-bokgoKladipk65_mEG-avOsMrFj0b5uX6T3Hml4DvCTb65tC0zRKrm-Zsx8XpwbSE9fu_h0m54RgBtIroNttMqcpJAoFnk-XH720T7awFdPbq1oJJO/s1600/Tree_rotation.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiF2TY3nXErasLbcEhU13OvY7_Hb-bokgoKladipk65_mEG-avOsMrFj0b5uX6T3Hml4DvCTb65tC0zRKrm-Zsx8XpwbSE9fu_h0m54RgBtIroNttMqcpJAoFnk-XH720T7awFdPbq1oJJO/s1600/Tree_rotation.png" height="119" width="320" /></a></div>
<div>
<br /></div>
<br />
<br />
<br />
Thank you for following The Explorer's DSA Tutorial. See you in another Tutorial :D<br />
<br />
<br />
<br />
<br /></div>
Lahiru Dhananjayahttp://www.blogger.com/profile/04904665996384999048noreply@blogger.com0tag:blogger.com,1999:blog-4880340238784455124.post-30141630078961815692014-05-21T00:00:00.001-07:002014-05-21T00:00:22.238-07:00Android Application හදමු - Introduction Part IIIIf you missed the very first tutorial please visit this link - <a href="http://explorer0101.blogspot.com/2014/04/android-application-introduction-part-i.html" target="_blank">Android Tutorial Part I</a><br />
If you missed the second tutorial please visit this link - <a href="http://explorer0101.blogspot.com/2014/05/android-application-introduction-part-ii.html" target="_blank">Android Tutorial Part II</a><br />
<br />
In this part we are trying to familiar you with Emulator creating and Running the created application On the Emulator<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
දැන් ඔයාලා හදාගත්ත Android Application එක run කරන විදිය බලමු.ඒකට අපිට emulator එකක් create කරගන්න වෙනවා. පහත රූපයේ පරිදි Android Virtual Device Manager open කරගන්න.<br />
නැත්නම් මේ විදියට open කරගන්න<br />
<br />
Tools->Android->AVD Manager<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQZW16FD3pIcOfH2A28XREZePLv43rQh8F6FeHYKYmzynlSB8x83MDPcNz4BTfVwdvBGPiUU5Q1jV-noB3OPuqDjWTpA22OLIqX29IL58QmW3sHbQ4T_TbZCAGTq1Y7DIH8yfMb7IjJ_yQ/s1600/e1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQZW16FD3pIcOfH2A28XREZePLv43rQh8F6FeHYKYmzynlSB8x83MDPcNz4BTfVwdvBGPiUU5Q1jV-noB3OPuqDjWTpA22OLIqX29IL58QmW3sHbQ4T_TbZCAGTq1Y7DIH8yfMb7IjJ_yQ/s1600/e1.png" height="434" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
දැන් new button එක click කරන්න එවිට පහත window එක ලැබෙයි<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBjeqNJo4jfZZyBRWEPqJh9rQlqa4g7YWL_277J8f1xLIBUpzQNpPVr-yqCvbh7HfukLTmEnrK8c_dIA6ouMFlIjekehEvtop-Ls2c9hvPjcfTLkRtMuJ0PfDNm4rq9tlXhKxOhOw4Dr5Y/s1600/e2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBjeqNJo4jfZZyBRWEPqJh9rQlqa4g7YWL_277J8f1xLIBUpzQNpPVr-yqCvbh7HfukLTmEnrK8c_dIA6ouMFlIjekehEvtop-Ls2c9hvPjcfTLkRtMuJ0PfDNm4rq9tlXhKxOhOw4Dr5Y/s1600/e2.png" height="376" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
Give any name to AVD Name then select your most interested and preffered Device as the emulator. Target means that the Operating System contain in the Device . Select Any skin you need and set RAM to 512 and SD card size to 100. These are the normal settings we need to configure to run our application .<br />
Then Press Ok<br />
<br />
දැන් ඔයාලට දකින්න පුලුවන් ඔයාලා හදපු Device එක<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0lfMabCjVt8qoFXEZJykj3jyOBujgoMCyP5p9cA53ER1pwmY5H9WWjBZVgBnUHOvX__NoeTw7Gvt-28XDVOBUeIimu7aKJc6HJ-BNAN_3TZXAn67zw0kAyWRVzHSZcuo_qiBABjcPiUmu/s1600/e3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0lfMabCjVt8qoFXEZJykj3jyOBujgoMCyP5p9cA53ER1pwmY5H9WWjBZVgBnUHOvX__NoeTw7Gvt-28XDVOBUeIimu7aKJc6HJ-BNAN_3TZXAn67zw0kAyWRVzHSZcuo_qiBABjcPiUmu/s1600/e3.png" height="456" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
දැන් මෙහෙමයි අපිට පුලුවන් ආකාර දෙකකට මෙම emulator එක run කරන්න .මෙහිදී මම භාවිතා කරන්නේ වඩාත් කාර්යක්ෂම විදියයි.<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
click on the Start Button. Then you will pop up a window like below<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnv5AE2f4ovhDOJh9ulkiz86iKVubo8pN5fl3p7qW8fYO9gl6ZMP-biNzLZ3ph_vh1MZiA4ORy_rZEm_hxRSjOmftIguuFyF3HsrsmRvlPG1zS3RX4sRJkUjLR9SQEkDKN5N7DbyL25ieq/s1600/e4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnv5AE2f4ovhDOJh9ulkiz86iKVubo8pN5fl3p7qW8fYO9gl6ZMP-biNzLZ3ph_vh1MZiA4ORy_rZEm_hxRSjOmftIguuFyF3HsrsmRvlPG1zS3RX4sRJkUjLR9SQEkDKN5N7DbyL25ieq/s1600/e4.png" height="382" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
No need to do any changes and click on the Launch button<br />
<br />
Then you will see below window and wait for untill progress bar reach the end<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgieGAwAkw9jiNqqkGmKpE0IkSyqTl06JPg8B1OXywG3CdIZ0TRgJdM2fVBUUvD6QsTPu3zDNRUf4jxb48X03n28Fbri_J2QLKotztEGJMn8eIjRE6tkHMRNrF9Iza9nRLU79g1MOio1jBe/s1600/e5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgieGAwAkw9jiNqqkGmKpE0IkSyqTl06JPg8B1OXywG3CdIZ0TRgJdM2fVBUUvD6QsTPu3zDNRUf4jxb48X03n28Fbri_J2QLKotztEGJMn8eIjRE6tkHMRNrF9Iza9nRLU79g1MOio1jBe/s1600/e5.png" height="454" width="640" /></a></div>
<br />
දැන් ඔබට පහත window එක දකින්නට ලැබේවි.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioDsc1idkYOM4DfUrpRUlVLWbLw6SXKjUB3JbKOTphR3xZLoZWvxkzFLazhwh528b8EHNdyvgjoPV0gXObqYtj4djrV4R0VwhqKPWdZu6KUQ0Mrg9IDtMHgQC0OLYHfwFyppc9rFhX7zB-/s1600/e6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioDsc1idkYOM4DfUrpRUlVLWbLw6SXKjUB3JbKOTphR3xZLoZWvxkzFLazhwh528b8EHNdyvgjoPV0gXObqYtj4djrV4R0VwhqKPWdZu6KUQ0Mrg9IDtMHgQC0OLYHfwFyppc9rFhX7zB-/s1600/e6.png" height="346" width="640" /></a></div>
<br />
තිරය මත Android ලෙස පවතිනුයේ තවමත් emulator එක load වෙන බැවිනි.<br />
<br />
පහත තිරය එනතෙක් සිටින්න.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMlx7hEO5YBWAxPu8h2JwilCmM4yMw3GCCSzlZr00n0G5lVszC_hVw7hfJxB01Jq_54Jm-VSH6IsQ2a5b1njuZrHbT9Gk_jdhr7DMdfCZo26_WYtbwTymtulC0CY3izZ2_JJStRT35a4MQ/s1600/e7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMlx7hEO5YBWAxPu8h2JwilCmM4yMw3GCCSzlZr00n0G5lVszC_hVw7hfJxB01Jq_54Jm-VSH6IsQ2a5b1njuZrHbT9Gk_jdhr7DMdfCZo26_WYtbwTymtulC0CY3izZ2_JJStRT35a4MQ/s1600/e7.png" height="346" width="640" /></a></div>
<br />
Now you emulator has fully loaded and it is ready to run you applications . So you need to go back to the Android project view and Click Run button which appear in green color in the top center .<br />
<br />
After you click run it will popup below window and you need to press ok<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEip9wzhJa3kJwREVvS2uFqvVnoumnZOOleYw_a02L_DVi0vQ22cOMDzsedaWd0k0pmfCUgbSGMVeX6rGDfhoaN3_NY0Z_bNQzUApShamfy2g2c8jVsrL4179d03YQFUGgFJyS2W88smBIsx/s1600/e8.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEip9wzhJa3kJwREVvS2uFqvVnoumnZOOleYw_a02L_DVi0vQ22cOMDzsedaWd0k0pmfCUgbSGMVeX6rGDfhoaN3_NY0Z_bNQzUApShamfy2g2c8jVsrL4179d03YQFUGgFJyS2W88smBIsx/s1600/e8.png" height="586" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
It's saying you have a emulator already started and you can you that emulator to run you application<br />
<br />
දැන් ඔයාලට Android Project එකේ වෙනස්කම් සිදුවෙනවා දකින්න පුලුවන් වේවි.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_Va68wV4H87y2pCwbgNEKdeG9MqFvGaow1YMSOji6bC_MqhwyrRbK8KzvjI76078enHblcHWtLXI9ItPY7fkcA2AlYHi4g2Gax38sg0QW3M5ZmeOkC8foXDMq8v9uwhdvUleWv0er8njG/s1600/e9.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_Va68wV4H87y2pCwbgNEKdeG9MqFvGaow1YMSOji6bC_MqhwyrRbK8KzvjI76078enHblcHWtLXI9ItPY7fkcA2AlYHi4g2Gax38sg0QW3M5ZmeOkC8foXDMq8v9uwhdvUleWv0er8njG/s1600/e9.png" /></a></div>
<br />
මෙම process එක සිදුවුනාට පස්සෙ ඔයාගෙ emulator එකේ හදපු app එක run වෙයි.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgo7Jt_2yu2EqiV0YPmSsvxfoMd6yrPM7ki7g4sVhtRSLX7za7Jxx3OoV-20o0KqiAd8_31Y_Ls4PRCXvPnokizY2veIeoJieymsWHsW8xg4xU_JTnOuBN6NWHM8tt92kJUOS7sUlowh1vN/s1600/e10.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgo7Jt_2yu2EqiV0YPmSsvxfoMd6yrPM7ki7g4sVhtRSLX7za7Jxx3OoV-20o0KqiAd8_31Y_Ls4PRCXvPnokizY2veIeoJieymsWHsW8xg4xU_JTnOuBN6NWHM8tt92kJUOS7sUlowh1vN/s1600/e10.png" height="450" width="640" /></a></div>
<br />
ඉතින් හරි ලේසියි මේ විදියට emulator එක හදන් app එක run කරගන්න.<br />
මතකද මන් කලින් කිව්වා මං emulator එක run කරන්න use කරන්නෙ කාර්යක්ෂම විදිය කියලා. දැන් ඔයාලට හැමවෙලේම මුල ඉදන් emulator එක run කරන්න ඒන නැහැ. කරන්න තියන වෙනස් කම් code එකේ කරලා run button එක press කරාම ඉක්මනින්ම emulator එකේ app එක run වෙනවා.<br />
<br />
අපි ඊලග tutorial වලින් බලමු code කරලා button click event එකක් හදා ගන්න විදිය.<br />
ඔබට මේ සම්බන්දව ගැටලු තිබේනම් ඒවි ඉදිරිපත් කරන්න.Lahiru Dhananjayahttp://www.blogger.com/profile/04904665996384999048noreply@blogger.com0tag:blogger.com,1999:blog-4880340238784455124.post-65610179077036409562014-05-15T05:46:00.007-07:002014-05-15T06:24:45.721-07:00Android Application හදමු - Introduction Part II<a href="https://www.blogger.com/blogger.g?blogID=4880340238784455124" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></a>If you missed the very first tutorial please visit this link - <a href="http://explorer0101.blogspot.com/2014/04/android-application-introduction-part-i.html" target="_blank">Android Tutorial Part I</a><br />
<br />
දැන් කට්ටියම Android Studio Install කරගෙන ඇති කියලා මං හිතනවා.ඔයාලගෙ පහසුවට මම steps by steps Images විදියට කියලා දෙන්නම්.<br />
<br />
1. ඉස්සලම New Project ගිහින් ඔයා හදන App එකේ නම දෙන්න<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://www.blogger.com/blogger.g?blogID=4880340238784455124" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjUk815J40ZWaMB5CTDq25ymrbw1CEcwrkiKhqoGSXXZN4TlQi3hLCQcbwDiMjKmnLMrs8VHxDY5UT-wmw5gBaMWAQRfw2PvSBKab8-B0cK2P3iPVOe5MnmeVdRiidQEYDMAsuzdj7Is8t/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjUk815J40ZWaMB5CTDq25ymrbw1CEcwrkiKhqoGSXXZN4TlQi3hLCQcbwDiMjKmnLMrs8VHxDY5UT-wmw5gBaMWAQRfw2PvSBKab8-B0cK2P3iPVOe5MnmeVdRiidQEYDMAsuzdj7Is8t/s1600/1.png" height="257" width="400" /></a></div>
<br />
2.ඊට පස්සෙ App එකේ icon එකේ size එක හදාගන්න<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjO24LmolMUVjfP0jfc9ynWNvhVA2ZcWoBdcazloIqV72TBYnN3n0cSWnm4Uct2xZ7_3eQK-R8rud6iC9Z_LsHV6atJ-eVVSb1-egJgDosdKciqm2JUsJE5uy-BidAknO4UfrkGCamf7pUW/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjO24LmolMUVjfP0jfc9ynWNvhVA2ZcWoBdcazloIqV72TBYnN3n0cSWnm4Uct2xZ7_3eQK-R8rud6iC9Z_LsHV6atJ-eVVSb1-egJgDosdKciqm2JUsJE5uy-BidAknO4UfrkGCamf7pUW/s1600/2.png" height="257" width="400" /></a></div>
<br />
3. දැන් හදන App එක Blank Activity කියලා දෙන්න<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEufweDYW9e7TKh43hpFAJ9_jBDk0MMlyRc_wJtkIHvBQBRohaV2qlzJMZNsJOg3wEnFASs9M4XeeXG3qKUWOVBQK_CV3YS3xEnscMTZ1KIV2aqFn9ud4xmAtdqrQhgPH_XwuyKeSGE3Dq/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEufweDYW9e7TKh43hpFAJ9_jBDk0MMlyRc_wJtkIHvBQBRohaV2qlzJMZNsJOg3wEnFASs9M4XeeXG3qKUWOVBQK_CV3YS3xEnscMTZ1KIV2aqFn9ud4xmAtdqrQhgPH_XwuyKeSGE3Dq/s1600/3.png" height="260" width="400" /></a></div>
<br />
4.Main Activity එකට කැමති නමක්. දීලා next යන්න<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKMDEIlD-yzEFNFa_4jzVqoDf8rH0xlBU36MbTclaEHAvuZhJn35BDP6kxBq-lzWNFlGaxCrRpVtdJCy-qZ9AkSt1m2bB0UAfQ0Y1GHxlRE_vYI2zLeSttArEv_RCGyx-VbgEgaH_tGGZ7/s1600/4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKMDEIlD-yzEFNFa_4jzVqoDf8rH0xlBU36MbTclaEHAvuZhJn35BDP6kxBq-lzWNFlGaxCrRpVtdJCy-qZ9AkSt1m2bB0UAfQ0Y1GHxlRE_vYI2zLeSttArEv_RCGyx-VbgEgaH_tGGZ7/s1600/4.png" height="257" width="400" /></a></div>
<br />
5.දැන් මේ වගෙ Window එකක් එයි.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiV_9BA-E0YPql1r2CdCzYwmELVXI67MiSw6P-HAnWGFd1wf765EuATC90RO2zQ4m55khjoMDjjHx-o6OYdnkf9Nolp5t7MW4RarnOoJN_3mAo7SYfYmnWf4eYaMn7N1GIE-EFdUTyKOSA/s1600/5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiV_9BA-E0YPql1r2CdCzYwmELVXI67MiSw6P-HAnWGFd1wf765EuATC90RO2zQ4m55khjoMDjjHx-o6OYdnkf9Nolp5t7MW4RarnOoJN_3mAo7SYfYmnWf4eYaMn7N1GIE-EFdUTyKOSA/s1600/5.png" height="213" width="400" /></a></div>
<br />
6.ඒකෙ අපි දැන් configure කරපු settings වලට අදාල view එක ගන්න right side එකේ පේන path එක expand කරන්න. එතකොට designing view එකට අදාල xml file එක open වෙයි.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8Et7McR0R4B-P2MICe2Y2O8rX1fEpYcfSDIzuJmjNt9BQkGhd1aAbpkh_afySdJG5TgQCrdCcQFvxB7LuEmYd9DcbEknMjBbtVlQCGFRExRy-ytlz0_6uXjip3RrmHq_fooVAnv-DoIUX/s1600/6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8Et7McR0R4B-P2MICe2Y2O8rX1fEpYcfSDIzuJmjNt9BQkGhd1aAbpkh_afySdJG5TgQCrdCcQFvxB7LuEmYd9DcbEknMjBbtVlQCGFRExRy-ytlz0_6uXjip3RrmHq_fooVAnv-DoIUX/s1600/6.png" height="339" width="640" /></a></div>
<br />
දැන් මේ window එකේ hello world කියන text එකේ color එක වෙනස් කරමු අපි<br />
<TextView තැන android:textColor="@android:color/holo_blue_dark" කියලා type කරන්න<br />
ඔයාලගෙ පහසුවට CTRL+SPACE use කරලා suggestions ගන්න<br />
<br />
දැන් හොදට බලන්න text එක blue පාටින් පෙනෙවි.<br />
<br />
Noe lets move to design view click on the bottom tab Design and go to design view<br />
<br />
After that we will try to add a button for our app,<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhT4sv9yBaruYWWz_wm-aLNVk2lWGtCi3RBicRIXpYsWmyL1zA7lP2hxYm1aL8p-Mc37nL9s19LdBvj4jIaXhg0RQptlbXOHbFhbq1D8XhobtN3xx0iPgd1BADORn2953rvDX8z3NXbD1tV/s1600/7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhT4sv9yBaruYWWz_wm-aLNVk2lWGtCi3RBicRIXpYsWmyL1zA7lP2hxYm1aL8p-Mc37nL9s19LdBvj4jIaXhg0RQptlbXOHbFhbq1D8XhobtN3xx0iPgd1BADORn2953rvDX8z3NXbD1tV/s1600/7.png" height="342" width="640" /></a></div>
<br />
දැන් අපි button එක add කරමු, Phone view එකට right side එකේ තියන palette එකෙන් button එක Drag and Drop කරන්න. දැන් නැවතත් Text View එකට යන්න (Text view is on the Bottom right of the palette)<br />
<br />
දැන් දකින්න පුලුවන් වේවි<br />
<Button<br />
android:layout_width="wrap_content"<br />
android:layout_height="wrap_content"<br />
android:text="New Button"<br />
android:id="@+id/button"<br />
android:layout_marginTop="87dp"<br />
android:layout_below="@+id/textView"<br />
android:layout_alignParentLeft="true"<br />
android:layout_alignParentStart="true" /><br />
කියලා.....<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiySwpFFJ-8e0vhOmHbf188Yb_L9lQRE3-uKEw13alCaJlBJmhJ0Lgwx6ubzhN6LG3ip5hdj43B4fUrDKQ1ouYdRw2ZnH655VDpXPZ4DuWSPV_beI1Fp5j3xR5BJIYENYwqPOZIMpGej2ne/s1600/8.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiySwpFFJ-8e0vhOmHbf188Yb_L9lQRE3-uKEw13alCaJlBJmhJ0Lgwx6ubzhN6LG3ip5hdj43B4fUrDKQ1ouYdRw2ZnH655VDpXPZ4DuWSPV_beI1Fp5j3xR5BJIYENYwqPOZIMpGej2ne/s1600/8.png" height="340" width="640" /></a></div>
<br />
ඒකෙත් කැමති විදියකට text and color change කරන්න පුලුවන්<br />
android:text="Submit"<br />
<br />
ඔය විදියට Try කරලා interface එක පුරුදු වෙන්න .....<br />
<br />
<br />
අපි ඊලග tutorial එකෙන් බලමු App එක run කරන්නයි Java File එක edit කරලා button එක press කරාම message එකක් එන විදියයි. මං හිතනව මුල ඉදන්ම android පටන් ගන්න අයට මේ tutorial එක ගොඩක් වැදගත් වෙයි කියලා.<br />
<br />
ප්රශ්න තියනවනම් comment කරන්න ඊලග tuto එකෙන් හමුවෙමු .<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
Lahiru Dhananjayahttp://www.blogger.com/profile/04904665996384999048noreply@blogger.com0tag:blogger.com,1999:blog-4880340238784455124.post-3878813589406208212014-05-15T04:55:00.004-07:002014-05-15T04:55:50.948-07:00Data Structures and Algorithms with Java - Part I (Data Structures)<div class="separator" style="clear: both; text-align: center;">
</div>
<div align="center" class="MsoNormal" style="text-align: center;">
<br /></div>
<div class="MsoNormal">
<span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; font-size: 16.0pt; line-height: 107%; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-language: SI-LK; mso-bidi-theme-font: minor-bidi; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">#</span><span style="font-size: 16.0pt; line-height: 107%;">DSA </span><span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; font-size: 16.0pt; line-height: 107%; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-language: SI-LK; mso-bidi-theme-font: minor-bidi; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">ගැන </span><span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;">Google </span><span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; font-size: 16.0pt; line-height: 107%; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-language: SI-LK; mso-bidi-theme-font: minor-bidi; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">එකේ </span><span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;">search </span><span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; font-size: 16.0pt; line-height: 107%; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-language: SI-LK; mso-bidi-theme-font: minor-bidi; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">කරලම එපා වෙලාද? තමන්
හොයපු හරි උත්තරේ තාම හම්බුන් නැද්ද? මෙන්න සරලව ගවේෂකගෙන් </span><span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;">DSA </span><span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; font-size: 16.0pt; line-height: 107%; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-language: SI-LK; mso-bidi-theme-font: minor-bidi; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">ඉගන ගන්න. <o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; font-size: 16.0pt; line-height: 107%; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-language: SI-LK; mso-bidi-theme-font: minor-bidi; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">ඔන්න ගවේෂක </span><span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;">DSA Java</span><span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; font-size: 16.0pt; line-height: 107%; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-language: SI-LK; mso-bidi-theme-font: minor-bidi; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">ත් එක්ක පටන් ගන්නවා
කට්ටියටම මුල ඉදන් සරලව </span><span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; font-size: 16.0pt; line-height: 107%; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-language: SI-LK; mso-bidi-theme-font: minor-bidi; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">මොකක්ද </span><span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;">DSA </span><span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; font-size: 16.0pt; line-height: 107%; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-language: SI-LK; mso-bidi-theme-font: minor-bidi; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">කියන්නෙ?</span><span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;"><o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;">There are some sub topics under DSA .Let’s see what are they and I will describe
them one by one to you<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;">Actually what is an Algorithm?<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;">In a simple way Algorithm is a <u>set of steps</u> to <u>achieve a goal</u>
in a <u>particular order</u>.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; font-size: 16.0pt; line-height: 107%; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-language: SI-LK; mso-bidi-theme-font: minor-bidi; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">ඇත්තටම ඇල්ගොරිදම් එකකින් කරන්න පුලුවන් මොනාද</span><span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;">?<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; font-size: 16.0pt; line-height: 107%; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-language: SI-LK; mso-bidi-theme-font: minor-bidi; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">**********</span><span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; font-size: 16.0pt; line-height: 107%; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-language: SI-LK; mso-bidi-theme-font: minor-bidi; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">ඉස්සෙලම බලමු මොනද මේ </span><span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;">problem solving steps </span><span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; font-size: 16.0pt; line-height: 107%; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-language: SI-LK; mso-bidi-theme-font: minor-bidi; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">කියලා</span><span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; font-size: 16.0pt; line-height: 107%; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-language: SI-LK; mso-bidi-theme-font: minor-bidi; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">1</span><span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;">. Identifying the problem<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;">2. Understanding<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;">3. Identifying alternative solutions<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;">4. Select best solution<o:p></o:p></span></div>
<div class="MsoNormal">
<a href="https://www.blogger.com/blogger.g?blogID=4880340238784455124" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></a><span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;">5. List down the instruction to solve the problem<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;">6. Checking the result as it was suggested<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;">Let’s categorize the data structures,<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;">We are come with several DSA such as Array, Stack, Queue, Linked List, and
Tree.<o:p></o:p></span></div>
<div class="MsoNormal">
<b><u><span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;">Array<o:p></o:p></span></u></b></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6D0mOS3Py71J8Q7rJnDvkAIbuGOItMUQ6BO0h25AEz-IUYaH_20l-QnDRXRbv5AMxrLkkav5fe_4GX0D3tSHhCzNKHWDYB5VhcSCxIYJJF587QXFSJHP9J7UBCYRje3l8z85JbH3Z7sYc/s1600/4652147_orig.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6D0mOS3Py71J8Q7rJnDvkAIbuGOItMUQ6BO0h25AEz-IUYaH_20l-QnDRXRbv5AMxrLkkav5fe_4GX0D3tSHhCzNKHWDYB5VhcSCxIYJJF587QXFSJHP9J7UBCYRje3l8z85JbH3Z7sYc/s1600/4652147_orig.jpg" height="167" width="320" /></a></div>
<div align="center" class="MsoNormal" style="text-align: center;">
<br /></div>
<div class="MsoNormal">
<span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;">In array ,<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpFirst" style="margin-left: 1.0in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 16.0pt; line-height: 107%; mso-bidi-font-family: Symbol; mso-bidi-language: SI-LK; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;">Random Access<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpLast" style="margin-left: 1.0in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 16.0pt; line-height: 107%; mso-bidi-font-family: Symbol; mso-bidi-language: SI-LK; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;">Both can limited and not limited size<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;">Array Implementation,<o:p></o:p></span></div>
<pre class="prettyprint">/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package arraystack;
/**
*
* @author lahiru dananjaya
*/
public class array {
public static void main(String[] args) {
/**
* can add any number of elements
*/
int array_unlimited[]={2,1,6,4,8,7,8,7,8};
for (int i = 0; i < array_unlimited.length; i++) {
System.out.println("Index ["+i+"] is "+array_unlimited[i]);
}
/****************************************************************/
System.out.println();
/**
* can add limited number of elements
*/
int array_limited []=new int[4];
array_limited[0]=4;
array_limited[1]=6;
array_limited[2]=5;
array_limited[3]=1;
for (int i = 0; i < array_limited.length; i++) {
System.out.println("Index ["+i+"] is "+array_limited[i]);
}
}
}
</pre>
<div class="MsoNormal">
<span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;"> <o:p></o:p></span></div>
<div class="MsoNormal">
<b><u><span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;">Stack<o:p></o:p></span></u></b></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQbEhIki3lAY9Iv5Ew5h-crVJw_7K0gmDU4bnwUe3UhXjvwMmFhUYAWoGayu0mPnr67k-6fNNOMR3ay14iusUeHHH8f4YWRgEuDnRNn4KcdJpYtesB4FEL8AzvQ_SO3EBUbw73ED5m85_e/s1600/stack-sketchy.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQbEhIki3lAY9Iv5Ew5h-crVJw_7K0gmDU4bnwUe3UhXjvwMmFhUYAWoGayu0mPnr67k-6fNNOMR3ay14iusUeHHH8f4YWRgEuDnRNn4KcdJpYtesB4FEL8AzvQ_SO3EBUbw73ED5m85_e/s1600/stack-sketchy.png" height="181" width="320" /></a></div>
<div align="center" class="MsoNormal" style="text-align: center;">
<a href="https://www.blogger.com/blogger.g?blogID=4880340238784455124" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"></a><br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;"> In stack ,<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpFirst" style="margin-left: 1.0in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 16.0pt; line-height: 107%; mso-bidi-font-family: Symbol; mso-bidi-language: SI-LK; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;">Using LIFO(Last In First Out) method<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: 1.0in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 16.0pt; line-height: 107%; mso-bidi-font-family: Symbol; mso-bidi-language: SI-LK; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;">Can access only top index<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: 1.0in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 16.0pt; line-height: 107%; mso-bidi-font-family: Symbol; mso-bidi-language: SI-LK; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;">Based on array structure</span><br />
<div class="MsoListParagraphCxSpFirst" style="margin-left: 1.0in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 16.0pt; line-height: 107%; mso-bidi-font-family: Symbol; mso-bidi-language: SI-LK; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;">Push-insertion<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: 1.0in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 16.0pt; line-height: 107%; mso-bidi-font-family: Symbol; mso-bidi-language: SI-LK; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;">Pop-deletion<o:p></o:p></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: 1.0in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 16.0pt; line-height: 107%; mso-bidi-font-family: Symbol; mso-bidi-language: SI-LK; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;">Peek-reading top value<o:p></o:p></span></div>
<span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;">
</span><br />
<div class="MsoListParagraphCxSpLast" style="margin-left: 1.0in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 16.0pt; line-height: 107%; mso-bidi-font-family: Symbol; mso-bidi-language: SI-LK; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;">IsEmpty/IsFull- check whether empty or full<o:p></o:p></span></div>
</div>
<br />
<div class="MsoListParagraphCxSpLast" style="margin-left: 1.0in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 16.0pt; line-height: 107%; mso-bidi-font-family: Symbol; mso-bidi-language: SI-LK; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;">
</span></span><!--[endif]--><span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;">Can use for Recursion, Reverse a word and for Balance parenthesis<o:p></o:p></span><br />
<span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;"><br /></span>
<span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;"></span><br />
<div class="MsoNormal">
<span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;">Stack Implementation,<o:p></o:p></span></div>
<pre class="prettyprint"><a href="https://www.blogger.com/blogger.g?blogID=4880340238784455124" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"></a>package queue;
import java.util.Scanner;
/**
*
* @author lahiru dananjaya
*/
public class Stack {
private int top=-1;
private int size;
private int pop;
private char data[];
public void push(char val){
this.data[++top]=val;
}
public Stack(int size){
this.size=size;
this.data=new char[size];
}
public char pop(){
return data[top--];
}
public boolean isFull(){
return (top==size-1);
}
public boolean isEmpty(){
return (top==-1);
}
public static void main(String[] args) {
Scanner c=new Scanner(System.in);
System.out.println("Enter word");
String test=c.next();
Stack s=new Stack(test.length());
for (int i = 0; i < test.length(); i++) {
s.push(test.charAt(i));
}
for (int i = 0; i < test.length(); i++) {
System.out.println(s.pop());
}
}
}</pre>
<div class="MsoNormal">
<b><u><span style="font-size: 16.0pt; line-height: 107%;"><!--[if gte vml 1]><v:shapetype
id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t"
path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f">
<v:stroke joinstyle="miter"/>
<v:formulas>
<v:f eqn="if lineDrawn pixelLineWidth 0"/>
<v:f eqn="sum @0 1 0"/>
<v:f eqn="sum 0 0 @1"/>
<v:f eqn="prod @2 1 2"/>
<v:f eqn="prod @3 21600 pixelWidth"/>
<v:f eqn="prod @3 21600 pixelHeight"/>
<v:f eqn="sum @0 0 1"/>
<v:f eqn="prod @6 1 2"/>
<v:f eqn="prod @7 21600 pixelWidth"/>
<v:f eqn="sum @8 21600 0"/>
<v:f eqn="prod @7 21600 pixelHeight"/>
<v:f eqn="sum @10 21600 0"/>
</v:formulas>
<v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/>
<o:lock v:ext="edit" aspectratio="t"/>
</v:shapetype><v:shape id="_x0000_i1025" type="#_x0000_t75" style='width:230.25pt;
height:122.25pt'>
<v:imagedata src="file:///C:\Users\LAHIRU~1\AppData\Local\Temp\msohtmlclip1\01\clip_image001.jpg"
o:title="images"/>
</v:shape><![endif]--><!--[if !vml]--><!--[endif]--><o:p></o:p></span></u></b></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<b><u><span style="font-size: 16.0pt; line-height: 107%;">Queue</span></u></b><br />
<div class="separator" style="clear: both; text-align: center;">
<b><u><span style="font-size: 16.0pt; line-height: 107%;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5_f06uOCD2oUfa-Sj_rs2su-MosVnYlu_FKxWUsDW2nOSmMaXbBl3vnxm0DgwQFQ9_Zufw0nhWVtuC2xtP_UQHqfZo7TIADhbLcoOh-ntOsUCHq-kuDDu61W6enD2XM1Ih8pV5toyz3lk/s1600/300px-Data_Queue.svg.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5_f06uOCD2oUfa-Sj_rs2su-MosVnYlu_FKxWUsDW2nOSmMaXbBl3vnxm0DgwQFQ9_Zufw0nhWVtuC2xtP_UQHqfZo7TIADhbLcoOh-ntOsUCHq-kuDDu61W6enD2XM1Ih8pV5toyz3lk/s1600/300px-Data_Queue.svg.png" /></a></span></u></b></div>
<span style="font-size: 16.0pt; line-height: 107%; mso-bidi-language: SI-LK;"><o:p></o:p></span></div>
<div class="MsoNormal">
<b><u><span style="font-size: 16.0pt; line-height: 107%;"><!--[if gte vml 1]><v:shapetype
id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t"
path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f">
<v:stroke joinstyle="miter"/>
<v:formulas>
<v:f eqn="if lineDrawn pixelLineWidth 0"/>
<v:f eqn="sum @0 1 0"/>
<v:f eqn="sum 0 0 @1"/>
<v:f eqn="prod @2 1 2"/>
<v:f eqn="prod @3 21600 pixelWidth"/>
<v:f eqn="prod @3 21600 pixelHeight"/>
<v:f eqn="sum @0 0 1"/>
<v:f eqn="prod @6 1 2"/>
<v:f eqn="prod @7 21600 pixelWidth"/>
<v:f eqn="sum @8 21600 0"/>
<v:f eqn="prod @7 21600 pixelHeight"/>
<v:f eqn="sum @10 21600 0"/>
</v:formulas>
<v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/>
<o:lock v:ext="edit" aspectratio="t"/>
</v:shapetype><v:shape id="_x0000_i1025" type="#_x0000_t75" style='width:230.25pt;
height:122.25pt'>
<v:imagedata src="file:///C:\Users\LAHIRU~1\AppData\Local\Temp\msohtmlclip1\01\clip_image001.jpg"
o:title="images"/>
</v:shape><![endif]--><!--[if !vml]--><!--[endif]--><o:p></o:p></span></u></b></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 16.0pt; line-height: 107%; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><!--[endif]--><span style="font-size: 16.0pt; line-height: 107%;">First In First Out<o:p></o:p></span><br />
<span style="font-size: 16.0pt; line-height: 107%;"><br /></span></div>
<div class="MsoNormal">
<span style="font-size: 16.0pt; line-height: 107%;">Queue
Implementation,<o:p></o:p></span></div>
<pre class="prettyprint">import java.util.Scanner;
/**
*
* @author lahiru dananjaya
*/
public class Queue {
private int maxsize;
private int[] data;
private int rear=-1;
private int front=0;
private int nItem=0;
/**
*
* @return
*/
Queue(int size){
this.maxsize=size;
data=new int[maxsize];
}
public boolean isFull(){
if(nItem==maxsize){
return true;
}else{
return false;
}
}
public boolean isEmpty(){
if(nItem==0){
return true;
}else{
return false;
}
}
public void insert(int data){
this.data[++rear]=data;
nItem++;
}
public int remove(){
nItem--;
return data[front++];
}
public static void main(String[] args) {
System.out.println("Enter Queue size");
Scanner s=new Scanner(System.in);
Queue a=new Queue(s.nextInt());
while(!a.isFull()){
System.out.println("Enter Data :");
a.insert(s.nextInt());
}
while(!a.isEmpty()){
System.out.println(a.remove());
}
}
}</pre>
<div style="font-family: 'Times New Roman'; white-space: normal;">
<a href="https://www.blogger.com/blogger.g?blogID=4880340238784455124" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"></a><b><u><span style="font-size: 16pt; line-height: 22.82666778564453px;">Linked List</span></u></b><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://www.blogger.com/blogger.g?blogID=4880340238784455124" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfUUfp-N9d1UfQesnEWX0pZWQTycr7vmj-9HGiHBr-picizM-wMkbDU2nfhwzsP2APWO1jRbK6UiYkK85ejSkCu8xx1qb1hR6ol5nK7ZGG6NfOzBGNr8RbtRRlFcwZPJ5aT0R179WdOrmN/s1600/download.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfUUfp-N9d1UfQesnEWX0pZWQTycr7vmj-9HGiHBr-picizM-wMkbDU2nfhwzsP2APWO1jRbK6UiYkK85ejSkCu8xx1qb1hR6ol5nK7ZGG6NfOzBGNr8RbtRRlFcwZPJ5aT0R179WdOrmN/s1600/download.jpg" /></a></div>
<span style="font-family: Symbol; font-size: 16pt; line-height: 107%; text-indent: -0.25in;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><span style="font-size: 16pt; line-height: 107%; text-indent: -0.25in;">Ordered sequence</span></div>
<div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 16.0pt; line-height: 107%; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><!--[endif]--><span style="font-size: 16.0pt; line-height: 107%;">No random access</span></div>
<div class="MsoListParagraphCxSpLast" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 16.0pt; line-height: 107%; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; line-height: normal;"> </span></span><!--[endif]--><span style="font-size: 16.0pt; line-height: 107%;">Forward and Backward<o:p></o:p></span><br />
<span style="font-size: 16.0pt; line-height: 107%;"><br /></span>
<span style="font-size: 21px; line-height: 22.82666778564453px;">Linked List Implementation(Refere Code),</span><br />
<span style="font-size: 21px; line-height: 22.82666778564453px;"><br /></span>
<span style="font-size: 21px; line-height: 22.82666778564453px;"><br /></span></div>
</div>
</div>
<pre class="prettyprint">/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package arraystack;
/**
*
* @author lahiru dananjaya
* This is a referenced code for linked list
*/
class Node {
Node next;
int num;
public Node(int val) {
num = val;
next = null;
}
}
class LinkedList {
private Node head = null;
public void append(int val) {
Node lastNode = getLastNode();
if (lastNode == null) {
head = new Node(val);
} else {
lastNode.next = new Node(val);
}
}
public void delete(int val) {
if(head == null){
return;
}
Node prevNode = null;
Node currNode = head;
while (currNode != null && currNode.num != val) {
prevNode = currNode;
currNode = currNode.next;
}
if(prevNode == null){
head = head.next;
return;
}
if (currNode == null) {
System.out.println("A node with that value does not exist.");
return;
}
prevNode.next = currNode.next;
}
public void print() {
System.out.println("");
if(head == null){
System.out.print("EMPTY");
return;
}
Node tmpNode = head;
while (tmpNode != null) {
System.out.print(tmpNode.num + " -> ");
tmpNode = tmpNode.next;
}
}
private Node getLastNode() {
if (head == null) {
return null;
}
Node tmpNode = head;
while (tmpNode.next != null) {
tmpNode = tmpNode.next;
}
return tmpNode;
}
public static void main(String[] args) {
LinkedList myList = new LinkedList();
myList.print();
myList.append(35);
myList.append(33);
myList.print();
myList.delete(33);
myList.delete(35);
myList.delete(35);
myList.print();
}
}
</pre>
<div class="MsoNormal">
<div class="MsoListParagraphCxSpLast" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="font-size: 16.0pt; line-height: 107%;"> </span></div>
<div class="MsoListParagraphCxSpLast" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="font-size: 16.0pt; line-height: 107%;"> </span></div>
</div>
<div class="MsoListParagraphCxSpFirst" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; font-size: 16.0pt; line-height: 107%; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;"> </span></div>
Lahiru Dhananjayahttp://www.blogger.com/profile/04904665996384999048noreply@blogger.com4tag:blogger.com,1999:blog-4880340238784455124.post-73084566330022800682014-04-15T23:03:00.000-07:002014-04-15T23:03:10.054-07:00Android Application හදමු - Introduction Part I<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFXyMbSRc3rm5SMRdnZUPPaeAkAOKBr1KnDTkoefwmd2roM-UhzPeW_TblUXJD5DUbDESqfTCk6C22ubL1LfyJ6vRn5TL1VMjnekfX-Pvwqz3n56PZF9dUg3rba_DVddWP0-uWX0w9riWe/s1600/android.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFXyMbSRc3rm5SMRdnZUPPaeAkAOKBr1KnDTkoefwmd2roM-UhzPeW_TblUXJD5DUbDESqfTCk6C22ubL1LfyJ6vRn5TL1VMjnekfX-Pvwqz3n56PZF9dUg3rba_DVddWP0-uWX0w9riWe/s1600/android.png" height="241" width="640" /></a></div>
<br />
ඔන්න මේ දවස් වල ගොඩක් අය කැමැත්තෙන් ඉන්නෙ Android ගැන ඉගනගන්න. ඉතින් ගවේෂක අද ඉදන් Android ගැන කියලා දෙන්න හදන්නෙ.<br />
<br />
<br />
Android කියන්නෙ Open Source Operating Systemඑකක්.මේක Mainly run වෙන්නෙ Mobile & Tabs වල ඒ වගේම Normal Computers වලත් run කරන්න පුලුවන්.<br />
<br />
Specially Symbian OS එකෙන් පස්සෙ Smart Phone වල OS එක විදියට Android Mobile Revolution එකක් සමග කරලියට පැමිණියා.<br />
Google එකෙන් තමයි Android Versions Release කරන්නෙ. එයාලගේ ලගදි නිකුත් කරපු version එක තමයි API 19 හෙවත් Android 4.4 (KITKAT).<br />
ඒ වගේම Android Versions මේ විදියට පෙල ගස්වන්න පුලුවන්.<br />
(උපුටා ගැනීම wiki)<br />
<br />
<ul style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 19.950000762939453px; list-style-image: none; list-style-type: none; margin: 0px 0px 0px 2em; padding: 0px;">
<li class="toclevel-2" style="margin-bottom: 0.1em;"><span class="toctext" style="background-color: white; background-image: none; text-decoration: none;">=> Android 1.0 (API level 1)</span></li>
<li class="toclevel-2" style="margin-bottom: 0.1em;"><span class="toctext" style="background-color: white; background-image: none; text-decoration: none;">=> Android 1.1 (API level 2)</span></li>
<li class="toclevel-2" style="color: #252525; margin-bottom: 0.1em;"><span class="toctext" style="background-color: white;"><span style="color: black;">=> </span>Android 1.5 Cupcake (API level 3)</span></li>
<li class="toclevel-2" style="color: #252525; margin-bottom: 0.1em;"><span class="toctext" style="background-color: white;"><span style="color: black;">=> </span>Android 1.6 Donut (API level 4)</span></li>
<li class="toclevel-2" style="color: #252525; margin-bottom: 0.1em;"><span class="toctext" style="background-color: white;"><span style="color: black;">=> </span>Android 2.0 Eclair (API level 5)</span></li>
<li class="toclevel-2" style="color: #252525; margin-bottom: 0.1em;"><span class="toctext" style="background-color: white;"><span style="color: black;">=> </span>Android 2.0.1 Eclair (API level 6)</span></li>
<li class="toclevel-2" style="color: #252525; margin-bottom: 0.1em;"><span class="toctext" style="background-color: white;"><span style="color: black;">=> </span>Android 2.1 Eclair (API level 7)</span></li>
<li class="toclevel-2" style="color: #252525; margin-bottom: 0.1em;"><span class="toctext" style="background-color: white;"><span style="color: black;">=> </span>Android 2.2–2.2.3 Froyo (API level 8)</span></li>
<li class="toclevel-2" style="color: #252525; margin-bottom: 0.1em;"><span class="toctext" style="background-color: white;"><span style="color: black;">=> </span>Android 2.3–2.3.2 Gingerbread (API level 9)</span></li>
<li class="toclevel-2" style="color: #252525; margin-bottom: 0.1em;"><span class="toctext" style="background-color: white;"><span style="color: black;">=> </span>Android 2.3.3–2.3.7 Gingerbread (API level 10)</span></li>
<li class="toclevel-2" style="color: #252525; margin-bottom: 0.1em;"><span class="toctext" style="background-color: white;"><span style="color: black;">=> </span>Android 3.0 Honeycomb (API level 11)</span></li>
<li class="toclevel-2" style="color: #252525; margin-bottom: 0.1em;"><span class="toctext" style="background-color: white;"><span style="color: black;">=> </span>Android 3.1 Honeycomb (API level 12)</span></li>
<li class="toclevel-2" style="color: #252525; margin-bottom: 0.1em;"><span class="toctext" style="background-color: white;"><span style="color: black;">=> </span>Android 3.2 Honeycomb (API level 13)</span></li>
<li class="toclevel-2" style="color: #252525; margin-bottom: 0.1em;"><span class="toctext" style="background-color: white;"><span style="color: black;">=> </span>Android 4.0–4.0.2 Ice Cream Sandwich (API level 14)</span></li>
<li class="toclevel-2" style="color: #252525; margin-bottom: 0.1em;"><span class="toctext" style="background-color: white;"><span style="color: black;">=> </span>Android 4.0.3–4.0.4 Ice Cream Sandwich (API level 15)</span></li>
<li class="toclevel-2" style="color: #252525; margin-bottom: 0.1em;"><span class="toctext" style="background-color: white;"><span style="color: black;">=> </span>Android 4.1 Jelly Bean (API level 16)</span></li>
<li class="toclevel-2" style="color: #252525; margin-bottom: 0.1em;"><span class="toctext" style="background-color: white;"><span style="color: black;">=> </span>Android 4.2 Jelly Bean (API level 17)</span></li>
<li class="toclevel-2" style="color: #252525; margin-bottom: 0.1em;"><span class="toctext" style="background-color: white;"><span style="color: black;">=> </span>Android 4.3 Jelly Bean (API level 18)</span></li>
<li class="toclevel-2" style="margin-bottom: 0.1em;"><span class="toctext" style="background-color: white; background-image: none; text-decoration: none;">=> Android 4.4 KitKat (API level 19)</span></li>
</ul>
<div>
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="line-height: 19.950000762939453px;"><br /></span></span></div>
<div>
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="line-height: 19.950000762939453px;">මුල් කාලෙ Android Apps සදහා Eclipse භාවිතා කරත් දැන් දැන් Android Studio වලින් තමා Android Apps හදන්න ගොඩක් අය පෙලෙඔන්නෙ. මේ Tutuorial සදහා use කරනු ලබන්නේ Android Studio with Gradle.</span></span></div>
<div>
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="line-height: 19.950000762939453px;"><br /></span></span></div>
<div>
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="line-height: 19.950000762939453px;">Gradle කියන්නෙ Android Studio සදහා use කරන build tool එකක්</span></span></div>
<div>
<br /></div>
<div>
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="line-height: 19.950000762939453px;"><br /></span></span></div>
<div>
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="line-height: 19.950000762939453px;">Android Stuio Download - <a href="http://developer.android.com/sdk/installing/win-studio">http://developer.android.com/sdk/installing/win-studio</a></span></span></div>
<div>
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="line-height: 19.950000762939453px;">Android SDK with Eclipse - <a href="http://developer.android.com/sdk/index.html#win-bundle">http://developer.android.com/sdk/index.html#win-bundle</a></span></span></div>
<div>
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;">Gradle Download - <a href="https://services.gradle.org/distributions/gradle-1.11-all.zip">https://services.gradle.org/distributions/gradle-1.11-all.zip</a></span></div>
<div>
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="line-height: 19.950000762939453px;"><br /></span></span></div>
<div>
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"><span style="line-height: 19.950000762939453px;">Download කරන් කට්ටිය ready වෙන්න :)........</span></span></div>
Lahiru Dhananjayahttp://www.blogger.com/profile/04904665996384999048noreply@blogger.com6tag:blogger.com,1999:blog-4880340238784455124.post-21925983557732034822014-03-22T20:25:00.001-07:002014-03-22T20:25:33.397-07:00Android WearHere we go after a long time I couldn't write any post .Today I'm trying to present you about <br />
<h2>
Android Wear </h2>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/0xQ3y902DEQ?feature=player_embedded' frameborder='0'></iframe></div>
<h2>
<br /></h2>
In this werable device we can sear google , check weather , voice replies ant more .The Platform is already build and we can try building apps for this wearable device.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg06BfPzCDZIshB8ZPz3IhbIWzhJfOSiW40ebw1PoblJ8YrveCRk8ofqD78taxhNS2ArjY_vioOFe4o6sokL6XMkc_TDi6nX5BMteyVcEEs-eCc2q6Dv54tvOqTYZFtUTV4HH1tjbwwMFnc/s1600/images.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg06BfPzCDZIshB8ZPz3IhbIWzhJfOSiW40ebw1PoblJ8YrveCRk8ofqD78taxhNS2ArjY_vioOFe4o6sokL6XMkc_TDi6nX5BMteyVcEEs-eCc2q6Dv54tvOqTYZFtUTV4HH1tjbwwMFnc/s1600/images.jpg" height="212" width="320" /></a></div>
<br />
Here is the steps to begin developing sample application for Android Ware...<br />
<br />
It s for AndroidWear[Preview]<br />
You Should follow Instructions<br />
1. Install Android-SDKs<br />
2. Install AndroidWearPreview<br />
<br />
Emulator /Eclipse<br />
<a href="http://developer.android.com/wear/preview/start.html" rel="nofollow" target="_blank">Source</a><br />
1. Window > Android Virtual Device Manager > New <br />
2. Set Name >> Choose AndroidWear Round/Square >> Android
4.4.2 /API 19 >> select CPU >> OK >> Launch<br />
3. After Connecting your Android Device AndroidWear Emulator won't recognize ur device<br />
4. <a href="http://forum.xda-developers.com/attachment.php?attachmentid=2639535&d=1395267654" rel="nofollow" target="_blank">Install apk below </a>** & Run it<br />
5. on Path of ur android-sdks type this into terminal;<br />
|| cd C:\Users\username\android-sdks\platform-tools\ (cmd below)<br />
<span style="font-size: medium;"></span><br />
<div style="margin-top: 5px; margin: 20px;">
<span style="font-size: medium;">
<div class="smallfont" style="margin-bottom: 2px;">
HTML Code:</div>
<pre class="alt2" dir="ltr" style="border: 1px inset; height: 34px; margin: 0px; overflow: auto; padding: 6px; text-align: left; width: 640px;">adb -d forward tcp:5601 tcp:5601</pre>
</span></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXg0lIYAwIcya8rOmSQOsPm5fGwsV8dHIC-uDyGt-0M6lQwO8AVx3X3t502WoWKVXJMB3NnlFIdx0Mf-RpnOw0flkACKNCvi0neCvsAlhpkJ4l1PG_3fbQvnE4xC5VFVqa1tFqANYqi9ND/s1600/android-wear-gui.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXg0lIYAwIcya8rOmSQOsPm5fGwsV8dHIC-uDyGt-0M6lQwO8AVx3X3t502WoWKVXJMB3NnlFIdx0Mf-RpnOw0flkACKNCvi0neCvsAlhpkJ4l1PG_3fbQvnE4xC5VFVqa1tFqANYqi9ND/s1600/android-wear-gui.jpg" height="170" width="320" /></a></div>
Device is coming with several architectures<br />
Try out this concept to your life<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjONyy2KkbHK220hK3BpwvHy8SotwWXQfZ91qAmkOrvWolfFJsWGSOPN48s8aEJgfq1gkoOdIVQTrN_V-feBQ2-NRkEjZQ86XWtKu_zKQ3Rt1pKO09LPP9-XNnfqADukR2ENWgzvD1rPLDu/s1600/Android-Wear-SDK-coming-soon.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjONyy2KkbHK220hK3BpwvHy8SotwWXQfZ91qAmkOrvWolfFJsWGSOPN48s8aEJgfq1gkoOdIVQTrN_V-feBQ2-NRkEjZQ86XWtKu_zKQ3Rt1pKO09LPP9-XNnfqADukR2ENWgzvD1rPLDu/s1600/Android-Wear-SDK-coming-soon.png" height="177" width="320" /></a></div>
<br />
<br />
<br />
Also you can download sample apps and try it out<br />
<i><i><br />
</i></i><a href="http://forum.xda-developers.com/attachment.php?attachmentid=2643723&d=1395485659" rel="nofollow" target="_blank">AndroidWearPreview -LatestUpdate.APK</a><a href="http://forum.xda-developers.com/attachment.php?attachmentid=2642040&d=1395402412" rel="nofollow" target="_blank"><br />
ElizaChat4Wear.ZIP (Source Codes)</a><br />
<br />
<a href="http://forum.xda-developers.com/attachment.php?attachmentid=2642043&d=1395403119" rel="nofollow" target="_blank">NotificationWear.ZIP (SourceCodes)</a><br />
<a href="http://forum.xda-developers.com/attachment.php?attachmentid=2642044&d=1395403181" rel="nofollow" target="_blank">NotificationWear.APK</a><i><i><br />
<br />
<a href="http://forum.xda-developers.com/attachment.php?attachmentid=2643708&d=1395484979" rel="nofollow" target="_blank">CameraWear.ZIP</a><br />
<a href="http://forum.xda-developers.com/attachment.php?attachmentid=2643707&d=1395484979" rel="nofollow" target="_blank">CameraWear.APK</a></i></i><br />
<br />
<br />
You can watch a demo of Android wearable device from below video ................More details will publish later... Trying to do a app tutorial for this .... Keep in touch with Explorer..<br />
<br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/QrqZl2QIz0c?feature=player_embedded' frameborder='0'></iframe></div>
Lahiru Dhananjayahttp://www.blogger.com/profile/04904665996384999048noreply@blogger.com0tag:blogger.com,1999:blog-4880340238784455124.post-77020492563847162912013-10-20T05:34:00.000-07:002013-10-20T05:34:38.126-07:00ලේසර් වැඩ අරඔයි<!--[if gte mso 9]><xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
</o:OfficeDocumentSettings>
</xml><![endif]--><br />
<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-GB</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>SI-LK</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
<w:DontFlipMirrorIndents/>
<w:OverrideTableStyleHps/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="false"
DefSemiHidden="false" DefQFormat="false" DefPriority="99"
LatentStyleCount="371">
<w:LsdException Locked="false" Priority="0" QFormat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 1"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="true"
UnhideWhenUsed="true" QFormat="true" Name="heading 2"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="true"
UnhideWhenUsed="true" QFormat="true" Name="heading 3"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="true"
UnhideWhenUsed="true" QFormat="true" Name="heading 4"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="true"
UnhideWhenUsed="true" QFormat="true" Name="heading 5"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="true"
UnhideWhenUsed="true" QFormat="true" Name="heading 6"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="true"
UnhideWhenUsed="true" QFormat="true" Name="heading 7"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="true"
UnhideWhenUsed="true" QFormat="true" Name="heading 8"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="true"
UnhideWhenUsed="true" QFormat="true" Name="heading 9"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="index 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="index 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="index 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="index 4"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="index 5"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="index 6"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="index 7"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="index 8"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="index 9"/>
<w:LsdException Locked="false" Priority="39" SemiHidden="true"
UnhideWhenUsed="true" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" SemiHidden="true"
UnhideWhenUsed="true" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" SemiHidden="true"
UnhideWhenUsed="true" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" SemiHidden="true"
UnhideWhenUsed="true" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" SemiHidden="true"
UnhideWhenUsed="true" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" SemiHidden="true"
UnhideWhenUsed="true" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" SemiHidden="true"
UnhideWhenUsed="true" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" SemiHidden="true"
UnhideWhenUsed="true" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" SemiHidden="true"
UnhideWhenUsed="true" Name="toc 9"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Normal Indent"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="footnote text"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="annotation text"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="header"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="footer"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="index heading"/>
<w:LsdException Locked="false" Priority="35" SemiHidden="true"
UnhideWhenUsed="true" QFormat="true" Name="caption"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="table of figures"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="envelope address"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="envelope return"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="footnote reference"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="annotation reference"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="line number"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="page number"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="endnote reference"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="endnote text"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="table of authorities"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="macro"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="toa heading"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Bullet"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Number"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List 4"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List 5"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Bullet 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Bullet 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Bullet 4"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Bullet 5"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Number 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Number 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Number 4"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Number 5"/>
<w:LsdException Locked="false" Priority="10" QFormat="true" Name="Title"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Closing"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Signature"/>
<w:LsdException Locked="false" Priority="1" SemiHidden="true"
UnhideWhenUsed="true" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Body Text"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Body Text Indent"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Continue"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Continue 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Continue 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Continue 4"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Continue 5"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Message Header"/>
<w:LsdException Locked="false" Priority="11" QFormat="true" Name="Subtitle"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Salutation"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Date"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Body Text First Indent"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Body Text First Indent 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Note Heading"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Body Text 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Body Text 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Body Text Indent 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Body Text Indent 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Block Text"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Hyperlink"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="FollowedHyperlink"/>
<w:LsdException Locked="false" Priority="22" QFormat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" QFormat="true" Name="Emphasis"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Document Map"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Plain Text"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="E-mail Signature"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Top of Form"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Bottom of Form"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Normal (Web)"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Acronym"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Address"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Cite"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Code"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Definition"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Keyboard"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Preformatted"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Sample"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Typewriter"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Variable"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Normal Table"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="annotation subject"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="No List"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Outline List 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Outline List 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Outline List 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Simple 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Simple 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Simple 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Classic 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Classic 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Classic 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Classic 4"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Colorful 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Colorful 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Colorful 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Columns 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Columns 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Columns 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Columns 4"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Columns 5"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Grid 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Grid 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Grid 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Grid 4"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Grid 5"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Grid 6"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Grid 7"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Grid 8"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table List 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table List 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table List 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table List 4"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table List 5"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table List 6"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table List 7"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table List 8"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table 3D effects 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table 3D effects 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table 3D effects 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Contemporary"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Elegant"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Professional"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Subtle 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Subtle 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Web 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Web 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Web 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Balloon Text"/>
<w:LsdException Locked="false" Priority="39" Name="Table Grid"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Theme"/>
<w:LsdException Locked="false" SemiHidden="true" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" QFormat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" SemiHidden="true" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" QFormat="true"
Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" QFormat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" QFormat="true"
Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" QFormat="true"
Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" QFormat="true"
Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" QFormat="true"
Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" QFormat="true"
Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" QFormat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" SemiHidden="true"
UnhideWhenUsed="true" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" SemiHidden="true"
UnhideWhenUsed="true" QFormat="true" Name="TOC Heading"/>
<w:LsdException Locked="false" Priority="41" Name="Plain Table 1"/>
<w:LsdException Locked="false" Priority="42" Name="Plain Table 2"/>
<w:LsdException Locked="false" Priority="43" Name="Plain Table 3"/>
<w:LsdException Locked="false" Priority="44" Name="Plain Table 4"/>
<w:LsdException Locked="false" Priority="45" Name="Plain Table 5"/>
<w:LsdException Locked="false" Priority="40" Name="Grid Table Light"/>
<w:LsdException Locked="false" Priority="46" Name="Grid Table 1 Light"/>
<w:LsdException Locked="false" Priority="47" Name="Grid Table 2"/>
<w:LsdException Locked="false" Priority="48" Name="Grid Table 3"/>
<w:LsdException Locked="false" Priority="49" Name="Grid Table 4"/>
<w:LsdException Locked="false" Priority="50" Name="Grid Table 5 Dark"/>
<w:LsdException Locked="false" Priority="51" Name="Grid Table 6 Colorful"/>
<w:LsdException Locked="false" Priority="52" Name="Grid Table 7 Colorful"/>
<w:LsdException Locked="false" Priority="46"
Name="Grid Table 1 Light Accent 1"/>
<w:LsdException Locked="false" Priority="47" Name="Grid Table 2 Accent 1"/>
<w:LsdException Locked="false" Priority="48" Name="Grid Table 3 Accent 1"/>
<w:LsdException Locked="false" Priority="49" Name="Grid Table 4 Accent 1"/>
<w:LsdException Locked="false" Priority="50" Name="Grid Table 5 Dark Accent 1"/>
<w:LsdException Locked="false" Priority="51"
Name="Grid Table 6 Colorful Accent 1"/>
<w:LsdException Locked="false" Priority="52"
Name="Grid Table 7 Colorful Accent 1"/>
<w:LsdException Locked="false" Priority="46"
Name="Grid Table 1 Light Accent 2"/>
<w:LsdException Locked="false" Priority="47" Name="Grid Table 2 Accent 2"/>
<w:LsdException Locked="false" Priority="48" Name="Grid Table 3 Accent 2"/>
<w:LsdException Locked="false" Priority="49" Name="Grid Table 4 Accent 2"/>
<w:LsdException Locked="false" Priority="50" Name="Grid Table 5 Dark Accent 2"/>
<w:LsdException Locked="false" Priority="51"
Name="Grid Table 6 Colorful Accent 2"/>
<w:LsdException Locked="false" Priority="52"
Name="Grid Table 7 Colorful Accent 2"/>
<w:LsdException Locked="false" Priority="46"
Name="Grid Table 1 Light Accent 3"/>
<w:LsdException Locked="false" Priority="47" Name="Grid Table 2 Accent 3"/>
<w:LsdException Locked="false" Priority="48" Name="Grid Table 3 Accent 3"/>
<w:LsdException Locked="false" Priority="49" Name="Grid Table 4 Accent 3"/>
<w:LsdException Locked="false" Priority="50" Name="Grid Table 5 Dark Accent 3"/>
<w:LsdException Locked="false" Priority="51"
Name="Grid Table 6 Colorful Accent 3"/>
<w:LsdException Locked="false" Priority="52"
Name="Grid Table 7 Colorful Accent 3"/>
<w:LsdException Locked="false" Priority="46"
Name="Grid Table 1 Light Accent 4"/>
<w:LsdException Locked="false" Priority="47" Name="Grid Table 2 Accent 4"/>
<w:LsdException Locked="false" Priority="48" Name="Grid Table 3 Accent 4"/>
<w:LsdException Locked="false" Priority="49" Name="Grid Table 4 Accent 4"/>
<w:LsdException Locked="false" Priority="50" Name="Grid Table 5 Dark Accent 4"/>
<w:LsdException Locked="false" Priority="51"
Name="Grid Table 6 Colorful Accent 4"/>
<w:LsdException Locked="false" Priority="52"
Name="Grid Table 7 Colorful Accent 4"/>
<w:LsdException Locked="false" Priority="46"
Name="Grid Table 1 Light Accent 5"/>
<w:LsdException Locked="false" Priority="47" Name="Grid Table 2 Accent 5"/>
<w:LsdException Locked="false" Priority="48" Name="Grid Table 3 Accent 5"/>
<w:LsdException Locked="false" Priority="49" Name="Grid Table 4 Accent 5"/>
<w:LsdException Locked="false" Priority="50" Name="Grid Table 5 Dark Accent 5"/>
<w:LsdException Locked="false" Priority="51"
Name="Grid Table 6 Colorful Accent 5"/>
<w:LsdException Locked="false" Priority="52"
Name="Grid Table 7 Colorful Accent 5"/>
<w:LsdException Locked="false" Priority="46"
Name="Grid Table 1 Light Accent 6"/>
<w:LsdException Locked="false" Priority="47" Name="Grid Table 2 Accent 6"/>
<w:LsdException Locked="false" Priority="48" Name="Grid Table 3 Accent 6"/>
<w:LsdException Locked="false" Priority="49" Name="Grid Table 4 Accent 6"/>
<w:LsdException Locked="false" Priority="50" Name="Grid Table 5 Dark Accent 6"/>
<w:LsdException Locked="false" Priority="51"
Name="Grid Table 6 Colorful Accent 6"/>
<w:LsdException Locked="false" Priority="52"
Name="Grid Table 7 Colorful Accent 6"/>
<w:LsdException Locked="false" Priority="46" Name="List Table 1 Light"/>
<w:LsdException Locked="false" Priority="47" Name="List Table 2"/>
<w:LsdException Locked="false" Priority="48" Name="List Table 3"/>
<w:LsdException Locked="false" Priority="49" Name="List Table 4"/>
<w:LsdException Locked="false" Priority="50" Name="List Table 5 Dark"/>
<w:LsdException Locked="false" Priority="51" Name="List Table 6 Colorful"/>
<w:LsdException Locked="false" Priority="52" Name="List Table 7 Colorful"/>
<w:LsdException Locked="false" Priority="46"
Name="List Table 1 Light Accent 1"/>
<w:LsdException Locked="false" Priority="47" Name="List Table 2 Accent 1"/>
<w:LsdException Locked="false" Priority="48" Name="List Table 3 Accent 1"/>
<w:LsdException Locked="false" Priority="49" Name="List Table 4 Accent 1"/>
<w:LsdException Locked="false" Priority="50" Name="List Table 5 Dark Accent 1"/>
<w:LsdException Locked="false" Priority="51"
Name="List Table 6 Colorful Accent 1"/>
<w:LsdException Locked="false" Priority="52"
Name="List Table 7 Colorful Accent 1"/>
<w:LsdException Locked="false" Priority="46"
Name="List Table 1 Light Accent 2"/>
<w:LsdException Locked="false" Priority="47" Name="List Table 2 Accent 2"/>
<w:LsdException Locked="false" Priority="48" Name="List Table 3 Accent 2"/>
<w:LsdException Locked="false" Priority="49" Name="List Table 4 Accent 2"/>
<w:LsdException Locked="false" Priority="50" Name="List Table 5 Dark Accent 2"/>
<w:LsdException Locked="false" Priority="51"
Name="List Table 6 Colorful Accent 2"/>
<w:LsdException Locked="false" Priority="52"
Name="List Table 7 Colorful Accent 2"/>
<w:LsdException Locked="false" Priority="46"
Name="List Table 1 Light Accent 3"/>
<w:LsdException Locked="false" Priority="47" Name="List Table 2 Accent 3"/>
<w:LsdException Locked="false" Priority="48" Name="List Table 3 Accent 3"/>
<w:LsdException Locked="false" Priority="49" Name="List Table 4 Accent 3"/>
<w:LsdException Locked="false" Priority="50" Name="List Table 5 Dark Accent 3"/>
<w:LsdException Locked="false" Priority="51"
Name="List Table 6 Colorful Accent 3"/>
<w:LsdException Locked="false" Priority="52"
Name="List Table 7 Colorful Accent 3"/>
<w:LsdException Locked="false" Priority="46"
Name="List Table 1 Light Accent 4"/>
<w:LsdException Locked="false" Priority="47" Name="List Table 2 Accent 4"/>
<w:LsdException Locked="false" Priority="48" Name="List Table 3 Accent 4"/>
<w:LsdException Locked="false" Priority="49" Name="List Table 4 Accent 4"/>
<w:LsdException Locked="false" Priority="50" Name="List Table 5 Dark Accent 4"/>
<w:LsdException Locked="false" Priority="51"
Name="List Table 6 Colorful Accent 4"/>
<w:LsdException Locked="false" Priority="52"
Name="List Table 7 Colorful Accent 4"/>
<w:LsdException Locked="false" Priority="46"
Name="List Table 1 Light Accent 5"/>
<w:LsdException Locked="false" Priority="47" Name="List Table 2 Accent 5"/>
<w:LsdException Locked="false" Priority="48" Name="List Table 3 Accent 5"/>
<w:LsdException Locked="false" Priority="49" Name="List Table 4 Accent 5"/>
<w:LsdException Locked="false" Priority="50" Name="List Table 5 Dark Accent 5"/>
<w:LsdException Locked="false" Priority="51"
Name="List Table 6 Colorful Accent 5"/>
<w:LsdException Locked="false" Priority="52"
Name="List Table 7 Colorful Accent 5"/>
<w:LsdException Locked="false" Priority="46"
Name="List Table 1 Light Accent 6"/>
<w:LsdException Locked="false" Priority="47" Name="List Table 2 Accent 6"/>
<w:LsdException Locked="false" Priority="48" Name="List Table 3 Accent 6"/>
<w:LsdException Locked="false" Priority="49" Name="List Table 4 Accent 6"/>
<w:LsdException Locked="false" Priority="50" Name="List Table 5 Dark Accent 6"/>
<w:LsdException Locked="false" Priority="51"
Name="List Table 6 Colorful Accent 6"/>
<w:LsdException Locked="false" Priority="52"
Name="List Table 7 Colorful Accent 6"/>
</w:LatentStyles>
</xml><![endif]--><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin-top:0cm;
mso-para-margin-right:0cm;
mso-para-margin-bottom:8.0pt;
mso-para-margin-left:0cm;
line-height:107%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:"Iskoola Pota";
mso-bidi-theme-font:minor-bidi;
mso-fareast-language:EN-US;}
</style>
<![endif]-->
<br />
<div class="MsoNormal">
<span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">මේක නාසා වලින් කරපු </span>project <span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">එකක්. අපි සාමාන්යයෙන් දැනට සන්නිවේදනය සදහා</span><span lang="SI-LK"> </span><span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">යොදා ගන්නෙ </span>radio waves <span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">තමයි වැඩි පුරම.තාක්ෂණයේ දියුණුවත් සමග
සන්නිවේදනය සදහා යොදා ගන්නා මාධ්යයන් වෙනස් වුණා. ඇත්තටම කිව්වොත් මිනිසාගේ
දියුණුවත් සමගම ඒ ඒ අව්යතාවයන් වැඩි වුනා.</span></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSvYduagvBwHRbGXk2dWOgEJlCr8gbYehhL3ebkv8GDsU8tNrHcFLgD_oNaMwX-VDM5-FwMtSx6Hlo3SUGlStisneGbm4FXIVKMLHjHjyoX9tts_mv0xz-KNjFNVCa9kVd0qzMyDFVQN4o/s1600/22d.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSvYduagvBwHRbGXk2dWOgEJlCr8gbYehhL3ebkv8GDsU8tNrHcFLgD_oNaMwX-VDM5-FwMtSx6Hlo3SUGlStisneGbm4FXIVKMLHjHjyoX9tts_mv0xz-KNjFNVCa9kVd0qzMyDFVQN4o/s1600/22d.jpg" height="222" width="400" /></a></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">දැන් </span><span lang="EN-US" style="mso-ansi-language: EN-US; mso-bidi-font-family: "Iskoola Pota";">use </span><span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; mso-ansi-language: EN-US; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">කරන්න හදන </span><span lang="EN-US" style="mso-ansi-language: EN-US; mso-bidi-font-family: "Iskoola Pota";">laser
technology </span><span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; mso-ansi-language: EN-US; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">ගැන අපි
පොඩ්ඩක් කතා කරමු.</span><span lang="EN-US" style="mso-ansi-language: EN-US; mso-bidi-font-family: "Iskoola Pota";"></span></div>
<div class="MsoNormal">
<span style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 107%; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">Lunar Laser Communications Demonstration (LLCD)</span><span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; font-size: 12.0pt; line-height: 107%; mso-ascii-font-family: "Times New Roman"; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: "Times New Roman";"> කියන්නෙ </span><span lang="EN-US" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">NASA </span><span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-ascii-font-family: "Times New Roman"; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: "Times New Roman";">එකෙන් හදයි පෘථිවියයි අතර ලේසර් තාක්ෂණය මගින්
සන්නිවේදනය සදහා අලුතින්ම දියත් කරපු මෙහෙයුමයි.</span><span lang="EN-US" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"></span></div>
<div class="MsoNormal">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKGSENLgz4DJSDzu6QZwby2oZLLQK9yvhfQ0DeW9QoCp5n9nq-jT9Tot-UuMN5Kk7Q88qZzMRKp25km5lUFCH4M6gllNCKvkJ6YwvKXAbk0EGWqBkupbRbCx_x1y1ioWNtDAb9VkQ5FWff/s1600/nasa-llcd-laser-link-diagram.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKGSENLgz4DJSDzu6QZwby2oZLLQK9yvhfQ0DeW9QoCp5n9nq-jT9Tot-UuMN5Kk7Q88qZzMRKp25km5lUFCH4M6gllNCKvkJ6YwvKXAbk0EGWqBkupbRbCx_x1y1ioWNtDAb9VkQ5FWff/s1600/nasa-llcd-laser-link-diagram.jpg" height="119" width="320" /></a><span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-ascii-font-family: "Times New Roman"; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: "Times New Roman";">මේගොල්ලො මේක </span><span lang="EN-US" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">use </span><span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-ascii-font-family: "Times New Roman"; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: "Times New Roman";">කරන්නෙ </span><span lang="EN-US" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">radio waves </span><span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-ascii-font-family: "Times New Roman"; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: "Times New Roman";">වෙනුවට මේ තාක්ෂණය අභ්යාවකාෂ යානා අතරත් </span><span lang="EN-US" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">satalite </span><span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-ascii-font-family: "Times New Roman"; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: "Times New Roman";">අතරත්</span><span lang="SI-LK" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"> </span><span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-ascii-font-family: "Times New Roman"; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: "Times New Roman";">600</span><span lang="EN-US" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">Mbps </span><span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-ascii-font-family: "Times New Roman"; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: "Times New Roman";">වේගයක් සහිතව</span><span lang="SI-LK" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"> </span><span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-ascii-font-family: "Times New Roman"; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: "Times New Roman";">අඩු බලයකින් සහ පොඩි
ඇන්ටනාවකින් </span><span lang="EN-US" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">use </span><span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-ascii-font-family: "Times New Roman"; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: "Times New Roman";">කරන්න පුලුවන්වෙන්න යි.</span><span lang="EN-US" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-ascii-font-family: "Times New Roman"; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: "Times New Roman";">මේ මගින් එයාලා බලාපොරොත්තු වෙන්නෙ වැඩි </span><span lang="EN-US" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">data amount </span><span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-ascii-font-family: "Times New Roman"; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: "Times New Roman";"><span style="mso-spacerun: yes;"> </span>එකක් </span><span lang="EN-US" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">use </span><span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-ascii-font-family: "Times New Roman"; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: "Times New Roman";">කරන්නයි</span><span lang="EN-US" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">,</span><span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-ascii-font-family: "Times New Roman"; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: "Times New Roman";">අභ්යාවකාෂයට </span><span lang="EN-US" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">sensor </span><span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-ascii-font-family: "Times New Roman"; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: "Times New Roman";">සහිත </span><span lang="EN-US" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">cameras </span><span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-ascii-font-family: "Times New Roman"; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: "Times New Roman";">යවන්නයි.</span><span lang="EN-US" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-ascii-font-family: "Times New Roman"; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: "Times New Roman";">මේකෙ</span><span lang="EN-US" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"> speed </span><span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-ascii-font-family: "Times New Roman"; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: "Times New Roman";">එකේ තරම මනිනට වෙන්නේ <span style="mso-spacerun: yes;"> </span></span><span lang="EN-US" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">TeraHertz </span><span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-ascii-font-family: "Times New Roman"; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: "Times New Roman";">වලින්.</span><span lang="EN-US" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;"></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGgFsY-hXUiSvd6Yr8Hrd80a3j0aphVaQWdVkpcfJP4pS1cTEl9I83_skWmVBXQss3iMaZGQ7l5y2bQUDz0TzRVdc62l_snoy2NZlmGPMtIbD8jx_lxW5vMlZi9_8KiL7FdCagRzKuUmSr/s1600/Untitle556666d.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGgFsY-hXUiSvd6Yr8Hrd80a3j0aphVaQWdVkpcfJP4pS1cTEl9I83_skWmVBXQss3iMaZGQ7l5y2bQUDz0TzRVdc62l_snoy2NZlmGPMtIbD8jx_lxW5vMlZi9_8KiL7FdCagRzKuUmSr/s1600/Untitle556666d.jpg" height="237" width="320" /></a></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-ascii-font-family: "Times New Roman"; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: "Times New Roman";">මේක තාම අත්හදා බැලීම් මට්ටමේ තමා තියෙන්නෙ.
මොකද </span><span lang="EN-US" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">laser beem use </span><span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-ascii-font-family: "Times New Roman"; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: "Times New Roman";">කරන කොට ඒ කිරන වලින් ශක්තියක් පිටවන නිසා. </span><span lang="EN-US" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">laser beem</span><span lang="EN-US" style="font-family: "Iskoola Pota","sans-serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-ascii-font-family: "Times New Roman"; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: "Times New Roman";"> </span><span lang="SI-LK" style="font-family: "Iskoola Pota","sans-serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-ascii-font-family: "Times New Roman"; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB; mso-hansi-font-family: "Times New Roman";">එකක් කඩදාසියකට ඇල්ලුවොත් ඒක
පිච්චෙන තරම් දරුනුයි</span><span lang="EN-US" style="font-family: "Times New Roman","serif"; font-size: 12.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-bidi-font-family: "Iskoola Pota"; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-GB;">.</span></div>
. <br />Lahiru Dhananjayahttp://www.blogger.com/profile/04904665996384999048noreply@blogger.com0tag:blogger.com,1999:blog-4880340238784455124.post-56504666292969020322013-10-15T00:09:00.002-07:002013-10-15T00:18:42.892-07:00Google Spreadsheet එකෙන් වැඩ ගන්නෙ මෙහෙමයි-IIකලින් පාඩමෙන් අපි Data Input කරන විදිය දැන ගත්තනෙ දැන් තියෙන්නෙ මේකෙ වැඩ අවසන් කරන්නයි.<br />
<br />
දැන් කලින් හදාගත්ත code එකට තව ටිකක් add කරන්නයි තියෙන්නෙ. මේ code එක paste කරගන්න.<br />
<br />
<span style="font-size: x-small;">//Inserting Data to the form<br />function showDialog() {<br /> var app=UiApp.createApplication();//cretae Ui Application<br /> app.setTitle("My Application");<br /> var panel=app.createVerticalPanel();//create Panel<br /> var textBox=app.createTextBox();//create textbox<br /> textBox.setName('myTextBox').setId('myTextBox');<br /> var button=app.createButton('Submit');//create submit button<br /> panel.add(textBox);//add widget to the panel<br /> panel.add(button);//add widget to the panel<br /> var clickHandler=app.createServerClickHandler("respondToSubmit");<br /> button.addClickHandler(clickHandler);<br /> clickHandler.addCallbackElement(panel);<br /> app.add(panel);//add panel to the application<br /> var doc=SpreadsheetApp.getActive();<br /> doc.show(app);<br />}<br />//Retriving Data which we inserted to the form<br />function respondToSubmit(e){ //e is callback object- use to get the user submited value<br />var app=UiApp.getActiveApplication();<br />var textBoxValue=e.parameter.myTextBox;<br />var sheet=SpreadsheetApp.getActiveSheet();//Active Spreadsheet<br />var lastRow=sheet.getLastRow()+1;//Selecting row to put value<br />var lastCell=sheet.getRange("A"+lastRow);<br />lastCell.setValue(textBoxValue);<br />return app.close();<br />}</span><br />
<br />
මේකෙ අලුතෙන් add කරේ<span style="font-size: x-small;"><span style="font-size: small;"> Retriving Data which we inserted to the form ටිකයි <span style="font-size: small;">ම<span style="font-size: small;">ේ ටි<span style="font-size: small;">කයි</span></span></span></span></span><br />
<span style="font-size: x-small;"><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: x-small;"> var clickHandler=app.createServerClickHandler("respondToSubmit");<br /> button.addClickHandler(clickHandler);<br /> clickHandler.addCallbackElement(panel);</span></span></span></span></span></span><br />
<br />
<span style="font-size: small;">දැන් Tools->Script Manager Click කරලා show dialog function එක run කරන්න.</span><br />
<br />
<span style="font-size: small;"><span style="font-size: small;">දැන් <span style="font-size: small;">ඕන text එක <span style="font-size: small;">type <span style="font-size: small;">කරලා submit <span style="font-size: small;">කරන්න</span></span></span></span> </span></span><br />
<span style="font-size: small;"><span style="font-size: small;"> </span> </span><br />
<span style="font-size: x-small;"><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;"> </span></span></span></span></span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<span style="font-size: x-small;"><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-2IUd_hr5tDvE4UEpokJp3s8zrmIobZmAqTt06uO9jW1e4ob63l49ZH2eve467zeFGhUpa-rBGIO6AcixKeUYHmBZk4Vgi0qb4iCFXp588klRJSYlR-Ej5LhmpyfP3iAosyULdFtf26wi/s1600/222.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-2IUd_hr5tDvE4UEpokJp3s8zrmIobZmAqTt06uO9jW1e4ob63l49ZH2eve467zeFGhUpa-rBGIO6AcixKeUYHmBZk4Vgi0qb4iCFXp588klRJSYlR-Ej5LhmpyfP3iAosyULdFtf26wi/s1600/222.jpg" height="168" width="320" /></a></span></span></span></span></div>
<span style="font-size: x-small;"><span style="font-size: small;"><span style="font-size: small;"> <span style="font-size: small;">ඔන්න ඔය විදියට තමා <span style="font-size: small;">ම<span style="font-size: small;">ේ<span style="font-size: small;">ක <span style="font-size: small;">වෙන්<span style="font-size: small;">නෙ... Values 2<span style="font-size: small;"> ක් </span>3 add <span style="font-size: small;">කරලා බ<span style="font-size: small;">ල<span style="font-size: small;">න්න</span></span></span></span></span></span></span></span></span></span></span></span>.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-psJooRjCVJx53_rFPWePKUaYMcz5VJstXGISPxdgaDII4Cs61klJKpUhZC-hPEdJaCpgzZm3wC3ai-2SavPoK-aEsMgyaWJOzjmJAscz6KTH6G-v5B0iAu-HRQDcEd4kroRV1ftiyWcz/s1600/33.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-psJooRjCVJx53_rFPWePKUaYMcz5VJstXGISPxdgaDII4Cs61klJKpUhZC-hPEdJaCpgzZm3wC3ai-2SavPoK-aEsMgyaWJOzjmJAscz6KTH6G-v5B0iAu-HRQDcEd4kroRV1ftiyWcz/s1600/33.jpg" height="253" width="320" /> </a></div>
<div class="separator" style="clear: both; text-align: left;">
දැන් ඉතින් ඔයාලා concept එක දන්නවනේ මං හිතනවා useful දේවල් කරගන්න පුලුවන් වෙයි කියලා. එහෙනම් ආයෙ හමුවෙමු . </div>
<span style="font-size: x-small;"><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;"><span style="font-size: small;"><br /></span></span></span></span></span>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />Lahiru Dhananjayahttp://www.blogger.com/profile/04904665996384999048noreply@blogger.com0