tag:blogger.com,1999:blog-82560351291925588962024-03-17T22:03:26.313-07:00GCE Advanced Level ICTNiranjan Meegammanahttp://www.blogger.com/profile/03233425107844672492noreply@blogger.comBlogger117125tag:blogger.com,1999:blog-8256035129192558896.post-14167602836697669582021-02-06T23:28:00.002-08:002021-02-06T23:28:46.751-08:00Java Programming සංකල්ප
<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiX9wlhQEds042W-uiWcOogSZI-X9iRUcHipAQ4sJOMsu9WGp2FEcTU-Y3z2GBhpAlfNNyH5cTSfzYiF7-_NU8jqLTy66QH1VGAZUfM630oSnnZCMfaxrF8Owj2wMexedY66gk0PND-oMBM/s1280/maxresdefault_20210204152035265.jpg" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" width="320" data-original-height="720" data-original-width="1280" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiX9wlhQEds042W-uiWcOogSZI-X9iRUcHipAQ4sJOMsu9WGp2FEcTU-Y3z2GBhpAlfNNyH5cTSfzYiF7-_NU8jqLTy66QH1VGAZUfM630oSnnZCMfaxrF8Owj2wMexedY66gk0PND-oMBM/s320/maxresdefault_20210204152035265.jpg"/></a></div><br/>
Java, Spring Boot, Android Studio, Flutter ! මේ හතරම එකද? ඒ ගැනයි මේ ලිපිය .
කෙටියෙන් කියනවානම් Java කියන්නේ Object Oriented Programming Language එකක්.
අනිත් 3 ම විශේෂ අවශ්යතා සඳහා
Java
Javaුනa මත ගොඩ නැගුනු framework සහ development tools.
හුඟක් අය අමාරුවේ වැටෙන තැනක් තමයි framework එකෙන් වැඩ පටන් ගන්න එක.
සමාන ලක්ෂණ පෙනුනට Java Python වගේ නෙමෙයි. C වගේත් නෙමෙයි. Java language එක හුඟක් වෙනස්. Java වල අභියෝගය තියෙන්නේ OOP Approach එක හරියට අවබෝධ කරගන්න එක.
Python වල
print("Hello World")
කියලා ලියන එක Java වලින් මෙහෙම ලියන්නේ ඇයි ?
public class Main {
public static void main(String[] args) {
System.out.println("Hello World");
}
}
ඒක හරියට ඔලුව වටේ අත දාලා නහය අල්ලනවා වගේ කියලා හිතෙනවා නේද?
public, class, Main, static, void, main, String, args Statem.out , {} වචන වලින් වෙන්නේ මොකක්ද?
ඒවා නැතුව
println("Hello World");
විතරක් ලියන්න බැරි ඇයි?
ඒ මදිවට compile කරලා ආයේ වෙනම run කරන්න ඕනේ ඇයි ?
කෙටිම පිළිතුර Object Oriented Programming එහෙම තමා කියන එක. ඒත් ඒක පැහැදිලි පිලිතුරක් නං නෙමේ.
OOP සංකල්ප අවබෝධ කරගන්න අපට තවත් ගැඹුරට Java හදාරන්න වෙනවා.
මුලින්ම අපි ඉගෙන ගන්නේ object එකක් කියන මුලික සංකල්පය. සරලව කීවොත් object දත්ත සහ හැසුරුම් කේත එය තුලම ඇතුළත් කර තිබෙනවා. ඒ නිසා එයට බාහිර කේත හා දත්ත නොමැතිව ස්වයංව ක්රියා කරන්නට පුළුවන්. ඒකට කියන්නේ Encapsulation කියලා.
Object එකක් නිර්මාණය කරන්නේ base class එකකින්. එකම base class එකකින් Object ගණනක් හදන්න පුළුවන්. ඒ object එකිනෙකට සමාන වගේම වෙනස් වෙන්නත් පුළුවන්. ඒ Object අතර සන්නිවේදනය කරන්නත් පුළුවන්.
මේ program එක Car කියන base class එක භාවිතා කරලා Car objects දෙකක් නිර්මාණය කරනවා. ඒවා කාර් වර්ග දෙකක්.
public final class Car {
private final String name;
public Car(String brand) {
this.name= brand;
}
public static void main(String[] args) {
Car car1 = new Car("Toyota");
Car car2 = new Car("Suzuki");
System.out.println(car1.name);
System.out.println(car2.name);
}
}
අපි මෙතනදී බාවිතා කලේ Car base class එකේ Constructor method එක. හැබැයි කාර් මෙහෙයවන්න අපට තවත් functions ඕනේ වෙනවා.
start, run, break, honk, stop වගේ methods අපට base class එකටම දාන්න පුළුවන්. එතකොට car1 සහ car2 කියලා අපි නිර්මාණය කරන object දෙකටම ඒ methods automatically ලැබෙනවා. එවිට ඒ කාර් අපට මෙහෙයවන්න පුළුවන්. කාර් object එක තුළම ඒවා හසුරුවන දත්ත සහ ක්රමවේද ඇතුලත්. ඒවා ස්වයංපෝෂිතයි. ඒ සංකල්පයට කියන්නේ Inheritance.
Java programming කරන්න මේ වගේ OOP සංකල්ප වලින්. Java වල structural programming වලට අමතරව Abstraction, Inheritance, Polymorphism, Encapsulation, Constructor වගේ ප්රධාන OOP සංකල්ප සමග overloading, overriding , Static and dynamic binding, Access specifiers techniques ප්රායෝගිකව භාවිතා කරන හැටි ඉගෙන ගත්තාම Android, Spring Boot , Flutter කරදරයක් නැතිව කරගන්නත් පුළුවන්. නැත්නං මග හිරවෙනවා.
ඒ නිසා ඔබ පළමුව කළ
කළ යුත්තේ හරියට Java OOP Programming ඉගෙන ගන්න එකයි. ඒ වෙනුවෙන්ම වූ විශේෂ පාඨමාලාවක් ශිල්ප සයුර nextgen ඔබට හඳුන්වා දෙනවා.
ලියාපදිංචිය මෙතනින්.
https://forms.gle/AjFzTQ7EU1RcJNeK9
වැඩි විස්තර සඳහා 0777573857 අංකයට
පණිවිඩයක් එවන්න
නැතිනම් අමතන්න.
#shilpasayura #nextgen
Niranjan Meegammanahttp://www.blogger.com/profile/03233425107844672492noreply@blogger.com0tag:blogger.com,1999:blog-8256035129192558896.post-59372355425425628512019-07-13T20:42:00.000-07:002019-07-13T20:54:58.788-07:00Omega CTF on 27 July at SLIIT : Hacking competition<h2 class="text--sectionTitle text--bold padding--bottom" style="background-color: #f6f7f8; color: #212121; fill: rgb(46, 62, 72); font-family: "Graphik Meetup", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif; font-size: var(--font-size-section-title); font-weight: var(--font-weight-semi-bold); line-height: var(--font-line-height-section-title); margin: 0px; padding-bottom: var(--responsive-space); padding-left: 0px; padding-right: 0px; padding-top: 0px; stroke: transparent;">
</h2>
<div class="event-description runningText" style="background-color: #f6f7f8; color: #212121; font-family: "Graphik Meetup", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif; font-size: 16px; line-height: var(--font-line-height-normal); overflow: hidden; transition: height 0.5s cubic-bezier(0.215, 0.61, 0.355, 1) 0s;">
<div style="max-width: 40em; overflow-wrap: break-word; padding: 0px; word-break: break-word;">
This is a full-day event combined with 2 sessions as follows.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdEbqoxY4VwHQzgpuP8GB9qvKj0YYp2eN12meb2A8mfBVW-FBJKZOIN6f0vd-yZwIzzknz0o88nRZ99U8_gjmD1OFwrjdmTZP8Aw_Ew4luUtYKqW-mw9MtcpfTEv5sNxaPkj8I3AXmtaV8/s1600/%255Bwww.meetup.com%255D%255B405%255D600483080636.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="338" data-original-width="600" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdEbqoxY4VwHQzgpuP8GB9qvKj0YYp2eN12meb2A8mfBVW-FBJKZOIN6f0vd-yZwIzzknz0o88nRZ99U8_gjmD1OFwrjdmTZP8Aw_Ew4luUtYKqW-mw9MtcpfTEv5sNxaPkj8I3AXmtaV8/s640/%255Bwww.meetup.com%255D%255B405%255D600483080636.jpeg" width="640" /></a></div>
<br />
<b>Session 1: </b><br />
The Omega CTF - Capture The Flag Competition<br />
<br />
Time: 08.00AM - 04.00PM<br />
Venue: Main Auditorium Lobby - SLIIT Malabe.</div>
<div style="max-width: 40em; overflow-wrap: break-word; padding: 0px; word-break: break-word;">
<br />
Provided by Osanda Malith Jayathissa (IT Security Consultant/Security Researcher - UK)<br />
<br />
“Omega CTF” Capture the Flag tournament is a distributed, wide-area security exercise, whose goal is to understand how to approach real-world web application and find vulnerabilities effectively.<br />
This competition provides different types of offensive security problems for the participants to solve within a 6-7 hour time period.<br />
<br />
There can be a maximum of THREE members in a team.<br />
Winners are selected based on the activities and levels they have completed and predominantly the way they used.<br />
<br />
To Register for the CTF competition (Session 1), please fill the below form on or before July 21, 2019. (Only the team leader)</div>
<div style="max-width: 40em; overflow-wrap: break-word; padding: 0px; word-break: break-word;">
<br />
<a class="link" href="https://forms.gle/YgS2e1m7FZTwq1wc6" style="cursor: pointer; display: inline; fill: rgb(0, 162, 199); stroke: transparent; text-decoration-line: none;" target="__blank" title="https://forms.gle/YgS2e1m7FZTwq1wc6">https://forms.gle/YgS2e1m7FZTwq1wc6</a><br />
<br />
<b>Session 2: </b>S<br />
Based Hacking - Approaching a Real-World Web App<br />
Time: 04.30PM - 06.30PM<br />
Venue: Main Auditorium Lobby - SLIIT Malabe.<br />
Speaker: Osanda Malith Jayathissa (IT Security Consultant/Security Researcher - UK)<br />
To Register for the Scenario Based Hacking session (Session 2), please RSVP through meetup app or meetup.com<br />
<br />
Osanda Malith Jayathissa has over 10 years of experience as an independent security researcher. Osanda is a security researcher who is passionate about application security since he was a kid. He is interested in reverse engineering, exploit development and penetration testing. He started his hacking life with a single quote (SQL injection) at the age of 12. He has provided manual penetration testing for clients across many sectors, including Banking, Insurance, Media, Entertainment, Healthcare and Financial in UK. He currently works as an IT Security Consultant for a reputed company in UK.<br />
He got acknowledged by many organizations including Microsoft, Facebook, Apple, AT&T, Oracle, Adobe, Nokia, Twitter, Sony, Ebay, SoundCloud, RedHat, Github, Huawei, Dell, Samsung, Intel, etc.<br />
He currently holds OSCP,OSCE,OSWP,eCPPTX,eWPTX,eCRE,CREST CRT Pen.</div>
</div>
Niranjan Meegammanahttp://www.blogger.com/profile/03233425107844672492noreply@blogger.com1tag:blogger.com,1999:blog-8256035129192558896.post-75801750160865195552019-07-07T19:05:00.002-07:002019-07-07T19:05:19.901-07:00ශිල්පසේනා 2019 : BMICH July 18 -21Invitation :<br />
<br />
ශිල්පසේනා 2019 : July 18-21 BMICH<br />
Sri Lanka's Largest Tech exhibition.<br />
<a href="https://www.blogger.com/goog_1744293694"><br /></a>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyBcU_gnEFjK_tnhdmx5h_7l1t00bxkbt36aSFg-1f4xg6mA91W02rbajVP6UKkhn7H0-tQ8n78Z5VCHcOk89LzLL0Lgspv5yJdzwwJ7IQPzrhQ2tyHs7LNte3pEePPOqMMM4HTGUThu_J/s1600/sbm-header-bg+%25281%2529.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="477" data-original-width="1299" height="234" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyBcU_gnEFjK_tnhdmx5h_7l1t00bxkbt36aSFg-1f4xg6mA91W02rbajVP6UKkhn7H0-tQ8n78Z5VCHcOk89LzLL0Lgspv5yJdzwwJ7IQPzrhQ2tyHs7LNte3pEePPOqMMM4HTGUThu_J/s640/sbm-header-bg+%25281%2529.jpg" width="640" /></a></div>
<a href="https://www.blogger.com/goog_1744293694"><br /></a>
<a href="https://m.facebook.com/events/605486606645729">https://m.facebook.com/events/605486606645729</a><br />
<br />
#shilpasena #srilanka<br />
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3ruqj8y0_nJvJXYQ5Ey9rpuISTAm4roItlWwH8nEGn-7sb9L2xTqYa8V67iXahHjh-z3r6iqUhRmJnFNnf6ofH3UZNJc5vPT1DfM8Z03PsKuHVHlG60emaHfLCqtARUD4x0GF58_4siFS/s1600/Shilpasenagreenweb.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1018" data-original-width="720" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3ruqj8y0_nJvJXYQ5Ey9rpuISTAm4roItlWwH8nEGn-7sb9L2xTqYa8V67iXahHjh-z3r6iqUhRmJnFNnf6ofH3UZNJc5vPT1DfM8Z03PsKuHVHlG60emaHfLCqtARUD4x0GF58_4siFS/s640/Shilpasenagreenweb.jpg" width="452" /></a></div>
<div>
<br /></div>
Niranjan Meegammanahttp://www.blogger.com/profile/03233425107844672492noreply@blogger.com0tag:blogger.com,1999:blog-8256035129192558896.post-41646383765053511172018-08-22T08:42:00.000-07:002018-08-22T08:48:09.170-07:00A/L Python in one hour - Learn by example<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgweSalUX-r4bPhXrOKy5id6Pe_QAc8dTazMc2FjOyYjFJsf4ZJ4H21-n1anLXowjg3bfQAbfOyHNcwVHC0vWIx-tUCJqq9S5pwksvpntBJkWhXOcw9lytLr9vb7HFPEIpPk4W5Sila29iS/s1600/python4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-width="500" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgweSalUX-r4bPhXrOKy5id6Pe_QAc8dTazMc2FjOyYjFJsf4ZJ4H21-n1anLXowjg3bfQAbfOyHNcwVHC0vWIx-tUCJqq9S5pwksvpntBJkWhXOcw9lytLr9vb7HFPEIpPk4W5Sila29iS/s640/python4.png" width="500" /></a></div>
<b><br /><br />Variables</b><br />
x=3<br />
y="Nimal"<br />
z=True<br />
r=3<br />
2x=5<br />
_r=45<br />
a$5=3<br />
<br />
<b>Operators</b><br />
= + - / *<br />
% //<br />
**<br />
5 + 3 * 2<br />
5 + 3 * 2 / 2<br />
<br />
#single line comment<br />
<br />
"""<br />
multi line<br />
comment<br />
"""<br />
<br />
'''<br />
multi<br />
line<br />
comment<br />
'''<br />
<br />
<b>Input</b><br />
name = input("Enter Your Name ")<br />
print (name)<br />
<br />
<b>Data Types</b> : number, string, boolean, list, dict<br />
x+y<br />
r+x<br />
<br />
Data Type Conversion<br />
<br />
nt=input("n tofees ")<br />
p=input("person ")<br />
s=p + " got " + nt + " tofees"<br />
print(s)<br />
<br />
<br />
x=input()<br />
x=int(input())<br />
<br />
nt=int(input("n tofees"))<br />
pt=int(input("pr toffes"))<br />
tc=nt * pt<br />
print (tc)<br />
<br />
nt=input("n tofees")<br />
pt=input("pr toffes")<br />
tc=int(nt) * int(pt)<br />
print(tc)<br />
<br />
nt=7<br />
p=input("person ")<br />
s=p + " got " + str(nt) + " tofees"<br />
print(s)<br />
<br />
<br />
<b>Comparison</b><br />
==<br />
!=<br />
===<br />
>=<br />
<=<br />
<br />
<b>IF</b><br />
x=11<br />
if x < 10:<br />
print("low")<br />
elif x == 10:<br />
print ("equal")<br />
else:<br />
print("high")<br />
<br />
<b>While</b><br />
x = 1<br />
while x < 5: # condition for loop<br />
print (x)<br />
x = x + 1<br />
print ('I love python')<br />
<br />
print ('done')<br />
<br />
<b>For</b><br />
#0 to 9<br />
for i in range (10): <br />
print (i)<br />
<br />
<br />
<b>#range</b> (5,10) is 5 through 9<br />
for c in range (5,10):<br />
print (c)<br />
<br />
for c in range (1,6):<br />
if c == 3:<br />
break<br />
print (c)<br />
<br />
print ("out")<br />
<br />
<br />
for letter in 'Python': <br />
if letter == 'h':<br />
continue<br />
print ('Current Letter :', letter)<br />
<br />
for i in range(4): #to iterate between 10 to 20<br />
for j in range(4):<br />
print (i, j, i * j)<br />
<br />
<br />
<b>Functions</b><br />
<br />
def greeting(name):<br />
print ("Hello " + name)<br />
<br />
greeting("A")<br />
greeting("B")<br />
greeting("C")<br />
<br />
def add(a,b ):<br />
c=a+b<br />
return c # return value<br />
<br />
d=add(1,3)<span style="white-space: pre;"> </span><br />
print (d)<br />
e=add(d,3)<span style="white-space: pre;"> </span><br />
print(e)<br />
f= add(d,e)<br />
print(f)<br />
<br />
<b>Formatting</b><br />
# %d means integer %s is string<br />
x = 2<br />
y = 7<br />
print ("-old-")<br />
print ('The sum of %d and %d is %d' % (x, y, x + y))<br />
print ('The sum of %d and %d is %d is %s' % (x, y, x + y, "OK"))<br />
<br />
print ("-New-")<br />
print ('The sum of {} and {} is {}'.format (x, y, x + y))<br />
print ('The multi of [{}] and *{}* is {}'.format (x, y, x * y))<br />
<br />
<b>List</b><br />
list=[1,2,3,4,5,6]<br />
<br />
for x in list:<br />
print (x)<br />
<br />
list=[]<br />
print (list)<br />
for i in range(5):<br />
list.append(i)<br />
<br />
print (list)<br />
<br />
stack= []<br />
stack.append(1)<br />
stack.append("Sri Lanka")<br />
stack.append( 4)<br />
stack.append( True)<br />
print(stack)<br />
<br />
print(len(stack))<br />
<br />
a=stack.pop()<br />
print(a)<br />
print(stack)<br />
stack.pop()<br />
print(stack)<br />
<br />
<b>Array & List</b><br />
Array=(3,2,1)<br />
List=[3,2,1]<br />
<br />
print(List, Array)<br />
print(Array[0],List[0])<br />
<br />
List[2]=4<br />
print(List)<br />
<br />
# Array[2]=4 # error<br />
<br />
dict = {'Name': 'Ganesh', 'Age': 17, 'Class': 12}<br />
print(dict)<br />
print (dict['Name'])<br />
print (dict['Age'])<br />
<br />
<br />
dict['Age'] = 18<br />
dict['Class'] = 13<br />
dict['School'] = "RRCK"<br />
<br />
print(dict)<br />
<br />
<b>Files</b><br />
f = open("myfile.txt", "w") #write only<br />
f.write( "Python is cool\n")<br />
f.write( "iPython is very cool")<br />
f.close() #Close file<br />
<br />
<br />
f = open("myfile.txt", "r")<br />
s = f.read()<br />
print(s)<br />
f.close()<br />
<br />
input()<br />
<br />
f = open("myfile.txt", "r")<br />
line = f.readline()<br />
print(line)<br />
f.close()<br />
<br />
input()<br />
<br />
f = open("myfile.txt", "r")<br />
lines = f.readlines()<br />
print(lines)<br />
f.close()<br />
<br />
<b>List Addressing</b><br />
L=[0,1,2,3,4,5,6]<br />
print(L)<br />
print("L[0]" , L[0])<br />
print("L[2:]", L[2:])<br />
print("L[:3]", L[:3])<br />
print("L[2:3]", L[2:3])<br />
print("L[:]", L[:])<br />
print("L[:0]",L[:-1])<br />
print("L[:-2]", L[:-2])<br />
<br />
<br />
1. Study and Run Codes<br />
2. Explore what happens - do some tinkering<br />
3. Draw Flow Charts<br />
<br />
Solve this problem<br />
<div dir="ltr" style="background-color: white; line-height: 1.2; margin-bottom: 0pt; margin-top: 0.2pt;">
<br /></div>
<ol style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; margin-left: -15.85pt; text-decoration: none; vertical-align: baseline; white-space: pre;"><div dir="ltr" style="background-color: white; line-height: 1.365; margin-bottom: 0pt; margin-right: 16.95pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">Once upon a time, there were three little crows - ages</span><span style="background-color: transparent; color: black; font-family: "times new roman"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"> </span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">2, 4, and 6.
What is the total of their ages?</span></div>
</li>
</ol>
<div dir="ltr" style="background-color: white; line-height: 1.2; margin-bottom: 0pt; margin-top: 0.25pt;">
<br /></div>
<ol start="2" style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; margin-left: -15.85pt; text-decoration: none; vertical-align: baseline; white-space: pre;"><div dir="ltr" style="background-color: white; line-height: 1.3800000000000001; margin-bottom: 0pt; margin-right: 24pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">Each little Crow wanted to build a house. Crow #1</span><span style="background-color: transparent; color: black; font-family: "times new roman"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;"> </span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;">wanted to build a house of straw.
</span><span style="background-color: transparent; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">Straw costs Rs.4 a</span><span style="background-color: transparent; font-family: "times new roman"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;"> </span><span style="background-color: transparent; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">bundle. He needs 9 bundles. How much will he spend?
</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; margin-left: -15.85pt; text-decoration: none; vertical-align: baseline; white-space: pre;"><div dir="ltr" style="background-color: white; line-height: 1.3800000000000001; margin-bottom: 0pt; margin-right: 24pt; margin-top: 0pt;">
<span style="background-color: transparent; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Once upon a time, there were three little crows. They</span><span style="background-color: transparent; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">were Lady Crow, Lord Crow, and Sister Crow. Lady</span><span style="background-color: transparent; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Crow was 5 years old. Lord Crow was 4 years old and</span><span style="background-color: transparent; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Sister Crow was 3 years old. What was their total age?
</span></div>
</li>
</ol>
<div>
<span style="font-family: "arial";"><span style="font-size: 14.6667px; white-space: pre-wrap;">4. Master Crow bought 4 milk toffees at 3 Rupees. Next he bought 3 chocs, each cost 10 Rupees.
How much balance he would get when he give 100 Rupee note.</span></span></div>
<div>
<span style="font-family: "arial";"><span style="font-size: 14.6667px; white-space: pre-wrap;"><br /></span></span></div>
<div>
<span style="font-family: "arial";"><span style="font-size: 14.6667px; white-space: pre-wrap;">
5. </span></span><span style="font-family: "arial"; font-size: 12pt; white-space: pre-wrap;">Your Grandpa likes you talking with him. If you type in normal case, he responds with "HUH?! SPEAK LOUD KID!" . </span><span style="font-family: "arial"; font-size: 12pt; white-space: pre-wrap;">If you type in capital, he responds with "NO, NOT SINCE 1945!". Every time he responds he forget the year and tell a random year between 1945 to 1960. </span></div>
<span id="docs-internal-guid-32bbe1c5-7fff-06ce-1b07-db65763f346b"></span><br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span id="docs-internal-guid-32bbe1c5-7fff-06ce-1b07-db65763f346b"><span style="font-family: "arial"; font-size: 12pt; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="font-family: "arial"; font-size: 12pt; vertical-align: baseline; white-space: pre-wrap;">When you say "BYE" he says "STAY!". But when you say "BYE" 3 times you can leave.</span></span></div>
<span id="docs-internal-guid-32bbe1c5-7fff-06ce-1b07-db65763f346b">
</span>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span id="docs-internal-guid-32bbe1c5-7fff-06ce-1b07-db65763f346b"><span style="font-family: "arial"; font-size: 12pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">
More
<a href="http://pythonqueen.blogspot.com/">http://pythonqueen.blogspot.com/</a>
</span></span></div>
<span id="docs-internal-guid-32bbe1c5-7fff-06ce-1b07-db65763f346b">
</span>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span id="docs-internal-guid-32bbe1c5-7fff-06ce-1b07-db65763f346b"><span style="font-family: "arial"; font-size: 12pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br /></span></span></div>
<span id="docs-internal-guid-32bbe1c5-7fff-06ce-1b07-db65763f346b">
</span>Niranjan Meegammanahttp://www.blogger.com/profile/03233425107844672492noreply@blogger.com2tag:blogger.com,1999:blog-8256035129192558896.post-91870500833926503572018-06-07T18:16:00.001-07:002018-06-07T18:38:44.140-07:00Play this Binary Game<div id="binary-game" style="font-size:1.4em;font-face:Arial"></div>
<script>
var title = document.createElement("div");
title.innerHTML ="8 Bit Binary Game";
document.getElementById('binary-game').appendChild( title);
for (var i = 0; i < 8; i++ )
{
var cont = document.createElement("div");
cont.style.float = "left";
cont.style.background="#e5eceb";
cont.padding="5px";
cont.style.textAlign = "center";
cont.style.margin = "10px";
var twos = document.createElement('div');
twos.innerHTML = Math.pow(2,7-i);
twos.style.color = 'black';
var div = document.createElement('div');
div.innerHTML = "0";
div.style.color = 'blue';
div.setAttribute('class', 'order');
div.setAttribute('id', i);
div.onclick = function() {
this.innerHTML ^= 1; //Bitwise XOR a ^ b Returns a 1 in each bit position, either but not both operands are 1's.
this.style.color = this.innerHTML == 0 ? 'blue' : 'orange';
var orders = document.getElementsByClassName("order");
var number = Array.prototype.slice.call(orders).reduce(function(a,b){
return a + b.innerHTML;
},"");
if (parseInt(number,2) == parseInt(document.getElementById("number").innerHTML))
{
document.getElementById('number').innerHTML = Math.floor(Math.random() * 256) + " ?";;
document.getElementById('score').innerHTML++;
}
};
cont.appendChild(twos);
cont.appendChild(div);
document.getElementById('binary-game').appendChild(cont);
}
var number = document.createElement("div");
number.innerHTML = Math.floor((Math.random() * 10) + 1) + " ?";
number.setAttribute('id', 'number');
number.style.color = 'red';
document.getElementById('binary-game').appendChild(number);
var scoreLabel = document.createElement("score-l");
scoreLabel.innerHTML = 'score';
document.getElementById('binary-game').appendChild(scoreLabel);
var score = document.createElement("div");
score.innerHTML = 0;
score.setAttribute('id', 'score');
document.getElementById('binary-game').appendChild(score);
</script>Niranjan Meegammanahttp://www.blogger.com/profile/03233425107844672492noreply@blogger.com1tag:blogger.com,1999:blog-8256035129192558896.post-62838269954146735392018-05-18T15:56:00.001-07:002018-05-18T16:01:26.351-07:00How to prevent a ransomware attack!<div>
<br /></div>
<div>
<div>
How does a ransomware infection occur?</div>
<div>
<br /></div>
<div>
<ul>
<li>Email messages that carry downloader trojans, which attempt to install ransomware<br /></li>
<li>Websites hosting exploit kits that attempt use vulnerabilities in web browsers and other software to install ransomware</li>
</ul>
</div>
<div>
<br /></div>
<div>
More recent ransomware have worm-like capabilities that enable them to spread to other computers in the network. For instance, Spora drops ransomware copies in network shares. </div>
</div>
<ol>
<li>Keep clear inventories of all of your digital assets and their locations, so cyber criminals do not attack a system you are unaware of.</li>
<li>Keep all software up to date, including operating systems and applications.</li>
<li>Back up all information every day, including information on employee devices, so you can restore encrypted data if attacked.</li>
<li>Back up all information to a secure, offsite location.</li>
<li>Segment your network: Don't place all data on one file share accessed by everyone in the company.</li>
<li>Train staff on cyber security practices, emphasizing not opening attachments or links from unknown sources.</li>
<li>Develop a communication strategy to inform employees if a virus reaches the company network.</li>
<li>Before an attack happens, work with your board to determine if your company will plan to pay a ransom or launch an investigation.</li>
<li>Perform a threat analysis in communication with vendors to go over the cyber security throughout the lifecycle of a particular device or application.</li>
<li>Instruct information security teams to perform penetration testing to find any vulnerabilities.</li>
</ol>
<h2 style="background-color: white; color: #333333; font-family: "Proxima Nova", sans-serif; font-size: 23px; letter-spacing: -0.02em; line-height: 1.4; margin: 20px 0px 10px; text-rendering: optimizeLegibility;">
</h2>
Niranjan Meegammanahttp://www.blogger.com/profile/03233425107844672492noreply@blogger.com0tag:blogger.com,1999:blog-8256035129192558896.post-89168328799090462642018-03-02T23:45:00.001-08:002018-03-02T23:57:42.861-08:00Patterns are heart of algorithmic programming. Code 100 problems in python.<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLbkWx49vh2mn_09Nb0cV4GnwEE_dBHWQRATv3HJ2b1nMDU8T6ifJ9A6UHBXKyoZ56e1507tWJOluxD56EU4Ab7-jZRixVZeeLzhwtFYDglWaJFHl1Tz0HJ7ioP3y-JFCbCsEwK64gW3cQ/s1600/PythagorasTree_825.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="256" data-original-width="524" height="312" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLbkWx49vh2mn_09Nb0cV4GnwEE_dBHWQRATv3HJ2b1nMDU8T6ifJ9A6UHBXKyoZ56e1507tWJOluxD56EU4Ab7-jZRixVZeeLzhwtFYDglWaJFHl1Tz0HJ7ioP3y-JFCbCsEwK64gW3cQ/s640/PythagorasTree_825.gif" width="640" /></a></div>
Patterns are heart of programming algorithms. They are not difficult program. All you have to do is study relationships and occurrences.
Write a programs to produce given outputs using python.
<br />
<br />
<br />
<pre>Q.1 structure:
$$$$$
$$$$$
$$$$$
$$$$$
$$$$$
Q.2 #'s triangle:
# # # # #
# # # #
# # #
# #
#
Q.3 $'s triangle:
$ $ $ $ $
$ $ $ $
$ $ $
$ $
$
Q.4 #'s triangle:-
#
##
###
####
#####
Q.5 $'s triangle:
$
$ $
$ $ $
$ $ $ $
$ $ $ $ $
Q.6 numbers structure:
12345
12345
12345
12345
12345
Q.7 numbers structure:
54321
54321
54321
54321
54321
Q.8 numbers structure:
55555
44444
33333
22222
11111
Q.9 numbers structure:
11111
22222
33333
44444
55555
Q.10 numbers structure:
1
12
123
1234
12345
Q.11 numbers structure:
12345
1234
123
12
1
Q.12 numbers structure:
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
Q.13 numbers structure:
54321
4321
321
21
1
Q.14 numbers structure:
1
21
321
4321
54321
Q.15 numbers structure:
12345
1234
123
12
1
Q.16 numbers structure:
1 2 3 4 5
1 2 3 4
1 2 3
1 2
1
Q.17 numbers structure:
1
1 2 1
1 2 3 2 1
1 2 3 4 3 2 1
1 2 3 4 5 4 3 2 1
Q.18 numbers structure:
1 2 3 4 5 4 3 2 1
1 2 3 4 3 2 1
1 2 3 2 1
1 2 1
1
Q.19 triangle
*
* * *
* * * * *
* * * * * * *
* * * * * * * * *
* * * * * * * * * * *
Q.20 Floyd's triangle:
1
2 3
4 5 6
7 8 9 10
Q.21 Pascal triangle:
1
1 1
1 2 1
1 3 3 1
Q.22 character triangle:
A
B B
C C C
D D D D
Q.23 character triangle:
A
A B A
A B C B A
A B C D C B A
A B C D E D C B A
Q.24 character triangle:
A B C D E D C B A
B C D E D C B
C D E D C
D E D
E
Q.25 number structure:
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
4 4 4 4
3 3 3
2 2
1
Q.26 :
S
SR
SRI
SRIL
SRILA
SRILAN
SRILANK
SRILANKA
Q.27 character structure:
A
BB
CCC
DDDD
CCC
BB
A
Q.28 number triangle:
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
Q. 29 number structure:
123454321
2345432
34543
454
5
Q.30. number triangle structure:-
1
21
321
4321
54321
Q.31. number triangle structure:
54321
4321
321
21
1
Q.32 number pyramid:
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
6 6 6 6 6 6
Q.33 number structure:
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
1 2 3 4 5 6
Q. 34 rhombus symbol structure:
*
***
*****
*******
*****
***
*
Q. 35 number rhombus structure:
1
212
32123
4321234
32123
212
1
Q. 36 number rhombus structure:
1
121
12321
1234321
12321
121
1
Q.37 character rhombus structure:
A
ABA
ABCBA
ABCDCBA
ABCBA
ABA
A
Q.38 square character triangle:
A
ABA
ABCBA
ABCDCBA
Q.39 square character triangle:
ABCDCBA
ABCBA
ABA
A
Q.40 square character triangle:
A
AB
ABC
ABCD
ABCDE
ABCD
ABC
AB
A
Q.41 square character triangle:
A
BA
CBA
DCBA
EDCBA
DCBA
CBA
BA
A
Q.42 character triangle:
EDCBA
DCBA
CBA
BA
A
Q.43 number design/triangle:
9
0 1
2 3 4
5 6 7 8
9 0 1 2 3
Q. 44 number rectangle:
12344321
123__321
12____21
1______1
Q. 45 number pyramid or number structure:
1
1 2 3
1 2 3 4 5
1 2 3 4 5 6 7
1 2 3 4 5 6 7 8 9
Q. 46 number pyramid:
123456654321
1234554321
12344321
123321
1221
11
Q. 47 character pyramid:
ABCDEFFEDCBA
ABCDEEDCBA
ABCDDCBA
ABCCBA
ABBA
AA
Q. 48 number pyramid:
1
222
33333
4444444
555555555
Q. 49 number triangle:
9
898
78987
6789876
Q. 50 number triangle:
5
45
345
2345
12345
Q. 51 number triangle:
5
454
34543
2345432
123454321
Q. 52 star structure/fashion:
*********
*******
*****
***
*
***
*****
*******
*********
Q. 53 rectangle number pyramid:
33333
32223
32123
32223
33333
Q. 54 the star triangle frame pyramid like :
*
**
* *
* *
* *
* *
* *
* *
* *
**********
Q. 55 star pattern pyramid:
*
***
******
Q. 56 reverse star pyramid :
**********
**** ****
*** ***
** **
* *
Q. 57 odd number series pyramid :
1
3 5 7
9 11 13 15 17 19
Q.58 number pyramid/triangle:
54321
5432
543
54
5
Q.59 the number character pyramid :
1
AB
123
ABCD
12345
Q. 60 Floyd triangle :
1
2 3
4 5 6
7 8 9 10
Q.61 number pyramid:
1 2 3 4 5
2 3 4 5
3 4 5
4 5
5
Q.62 character pyramid:
A
BA
ABA
BABA
ABABA
Q.63 rows input pyramid :
*
**
***
****
***
**
*
Q.64 number pyramid:
1
232
34543
4567654
Q.65 number rectangle structure:
12321
12 21
1 1
12 21
12321
Q.66 character rectangle design:
ABCBA
AB BA
A A
AB BA
ABCBA
Q.67 star triangle structure:
*********
*******
*****
***
*
Q.68 number rectangle program:
1234
2341
3412
4123
Q.69 character rectangle program:
ABCD
BCDA
CDAB
DABC
Q.70 number pyramid program:
1234
341
12
3
Q.71 character pyramid program:
ABCD
CDA
AB
C
Q.72 number pyramid using function:
1
2 3
4 5 6
7 8 9 1
2 3 4 5 6
Q.73 number pyramid:
1
123
12345
1234567
Q.74 number pyramid:
1333
2222
3331
Q.75 number character pyramid :
1 a
21 ba
321 cba
4321 dcba
54321 edcba
Q.76 0 and 1 number triangle :
1
01
010
1010
10101
Q.77 1 and 0 pyramid :
1
01
101
0101
10101
Q.78 Square star pyramid :
*****
* *
* *
*****
Q.79 Rectangle star pyramid :
******
* *
* *
******
Q.80 Even-odd number star pyramid :
1
*2
1*3
*2*4
1*3*5
Q.81 character number pyramid :
1
A B
2 3 4
C D E F
5 6 7 8 9
Q.82 nested star pyramid :
* *** *** *
** ** ** **
*** * * ***
Q.83 random number pyramid :
4572
572
72
2
Q.84 number design:
1
23
4
56
7
89
10
Q.85 number pyramid:
1
121
1231
12341
123451
Q.86 continues number pyramid:
1
121
12321
1234321
123454321
Q.87 alternative number-star pyramid :
1
2*2
3*3*3
4*4*4*4
4*4*4*4
3*3*3
2*2
1
Q.88 diagonal star-zero pyramid :
*000000
0*00000
00*0000
000*000
0000*00
00000*0
000000*
Q.89 geometric sequence pyramid :
7
14 15
28 29 30 31
56 57 58 59 60 61 62 63
Q.90 nested pyramid :
#####*#####
####*#*####
###*###*###
##*#####*##
#*#######*#
*#########*
Q.91 half-square number triangle :
543212345
4321234
32123
212
1
Q.92 equilateral triangle number :
5
454
34543
2345432
123454321
Q.93 positive-negative number triangle :
9
8 6
7 5 3
4 2 0 -2
1 -1 -3 -5 -7
Q.94 Star-Zero nested pattern:
*000*000*
0*00*00*0
00*0*0*00
000***000
Q.95 continuous vertical number pyramid:
1
2 7
3 8 13
4 9 14 19
5 10 15 20 25
Q.96 Nested number character pyramid:
A
1
BB
22
CCC
333
Q.97 two symbol pyramid:
$
#
$$
##
$$$
###
Q.98 Square number pyramid :
1
1 4 9
1 4 9 16 25
1 4 9 16 25 36 49
1 4 9 16 25 36 49 64 81
Q.99 Arrow head pyramid :
1234
12345
123456
1234567
123456
12345
1234
Q.100 The hexagon pattern
____ ____ ____
/ \ / \ / \
/ \____/ \____/ \
\ / \ / \ /
\____/ \____/ \____/
/ \ / \ / \
/ \____/ \____/ \
\ / \ / \ /
\____/ \____/ \____/
/ \ / \ / \
/ \____/ \____/ \
\ / \ / \ /
\____/ \____/ \____/
</pre>
Source : cprogrammingcodes.blogspot.com
Niranjan Meegammanahttp://www.blogger.com/profile/03233425107844672492noreply@blogger.com0tag:blogger.com,1999:blog-8256035129192558896.post-33288267271530018372018-02-16T11:36:00.000-08:002018-02-16T11:37:25.298-08:00micro:bit ශූරතාවලිය - අවසාන ප්රතිඵල<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8jjodrqHS0SU2n0FtqLkHIWXwLK1Nl8vBQI8MdJUFOAyzop5oQ_fzR92yM1VU1i0YZghYq1q3v315aHMNEJqmPTxKDnybPjonxn_7zfDvEeK8PrMC1OICUp3CtZmOIKpL6hCOD5d04Yq5/s1600/final_resul2t.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="600" data-original-width="900" height="426" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8jjodrqHS0SU2n0FtqLkHIWXwLK1Nl8vBQI8MdJUFOAyzop5oQ_fzR92yM1VU1i0YZghYq1q3v315aHMNEJqmPTxKDnybPjonxn_7zfDvEeK8PrMC1OICUp3CtZmOIKpL6hCOD5d04Yq5/s640/final_resul2t.jpg" width="640" /></a></div>
<div style="background-color: white; color: #666666; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 1em;">
මයික්රෝබිට් මිතුරනි,<br />
ශ්රී ලංකා ජාතික ගීය, මයික්රෝ මරියෝ, ෆ්ලැපි කුරුල්ලා, පොර පොල්, මයික්රෝ නැටුම වැනි අගනා micro:bit නිර්මාණ 400 කට වඩා ඉදිරිපත්වූ පළමු micro:bit ශූරතාවලිය අනාගත බලාපොරොත්තු රැසක් සමග සාර්ථකව සිදුඋනා. අප ලද වඩාත් අගනා ප්රතිඵලය IoT හා robotics සඳහා පරිගණක විද්යාව, කේතනය හා ඇලොගරිතම ඉගනීමට දැනුම සම්භාරයක් ප්රජාව මුල්කරගන <a data-ft="{"tn":"-U"}" data-lynx-mode="async" href="https://l.facebook.com/l.php?u=http%3A%2F%2Fmicrobit.info.lk%2F&h=ATOr86fL5zGFIc9RCSCXlnIUvynDpAzUcA9I9H4wwRTyjz8sQIHEGqHO1sC2BsegFtAKPoU0xTR5jVlggInZZtNSvaEFHtqM_vw_exiG2g49DkYT7ZZMXI-Bv4MYcI1wUORpO7ZtBgVLYpT6yNayVB31KHA_VcUxkMqOINahCn996qM95WzHhRbo2dfU6w_S8oBmR__ng-570RlvmpQPGIg1aRbcL1BKSmH9l5g856qn_HJnq4lZwQ" rel="noopener nofollow" style="color: #365899; cursor: pointer; font-family: inherit; text-decoration-line: none;" target="_blank">http://microbit.info.lk</a> හි නිර්මාණය වීමයි. දැන් ICT සිසුනට හා ගුරුවරුන්ට ඒවා භාවිතා කර micro:bit කේතනය ඉගනීමට හැකි වේවි. ලොව පුරා සිසුන්, ගුරුවරුන් හා තාක්ෂණඥයින්ගේ micro:bit ප්රජාවක්ද microbit club වටා ගොඩනැගීමද, ඔවුනොවුන් හඳුනා ගැනීමටද අපට සැමට අවස්ථාව ලැබුණා. අප දැන් 1300 කට වඩා සමූහයක්. ශූරතාවය තුලින්<br />
අප සැම ගොඩක් දේ ඉගෙන ගත්තා. එයට ඔබ සැමට ස්තූතියි.<br />
<br /></div>
<div style="background-color: white; color: #666666; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 1em;">
micro:bit ශූරතාවලියේ ප්රතිඵල!<br />
14 න් පහළ micro:bit ශූරයා චමිත් ඉඳුවර (නිර්මාණ 21, මනාප 457)<br />
19 න් පහළ micro:bit ශූරයා හිමාෂ් තිලකරත්න (නිර්මාණ 21 මනාප 250)<br />
විශ්ව විද්යාල micro:bit ශූරයා කසුන් දිසානායක (නිර්මාණ 23 මනාප 612)<br />
ගුරුවරුන්ගේ micro:bit ශූරයා උමාර රත්නායක (නිර්මාණ 5 මනාප 65)<br />
විවෘත micro:bit ශූරයා ඉවාන් බොස්නික් (නිර්මාණ 27 මනාප 117)</div>
<div style="background-color: white; color: #666666; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 1em;">
විශේෂ සඳහන් කිරීම්!<br />
14 න් පහළ - සිතුම් දුලේන් ප්රනාන්දු, හබීබා ඈන්ස්, අසීම් ෆයිසාල්, ඉනුකි වික්රමතිලක<br />
19 න් පහල - හන්සල සෙනවිරත්න, නදූෂන් , ටී මුරලි<br />
විශ්ව විද්යාල - ක්රිස්ටීන් ප්රනාන්දු<br />
ගුරුවරු - ජිනානි වලිසුන්දර<br />
විවෘත - ඇලෙක්ස් ෆ්ලෝරිජාන්, සිමුන් බිලාස්, නිකෝලා පෙට්රොවික්, එන් වීරකුමාර , විශ්ව කුමාර</div>
<div style="background-color: white; color: #666666; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 1em;">
micro:bit ශූරතාවලියේ ජයග්රාහකයන්ටත්, සහභාගී වූ සැමටත්, එය නැරඹා නිර්මාණ අගය කල ඔබ සැමටත් microbit club, shilpa64 හා algohack ප්රණාමය.</div>
<div style="background-color: white; color: #666666; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 1em;">
ඊළඟට micro:bit ලෝක ශූරතාවලය ගණිතය ගැන.<br />
විස්තර ලගඳීම. නැවතත් ස්තූතියි. මෙය Share කරන්න.<br />
micro:bit තාක්ෂණ අධ්යාපනයට වැදගත්ම උපකරණයක්.<br />
විස්තර සඳහා බලන්න. <a data-ft="{"tn":"-U"}" data-lynx-mode="async" href="https://l.facebook.com/l.php?u=http%3A%2F%2Fmicrobit.info.lk%2F&h=ATP1nKNHHgMbqLjvImTSICBwenywpAbnNWbhO1L7ryB73Hz_7GxpNzD0AJMUcsPWutdq8IU0Iz8mjPCkaoZIgRHBdxjVZnLRUceqPyPN_xRvNktrenSl6YNXNUI7uGRLn4eEwf6lM2OlyJZAGeIQpuwyojH0G2IG5UwqUjBi3LoVDaiZh1OqfJKCppFjiExcuwoKGKYTMYDMzq5mJQeoPqGEFdf-VbQcArd2Chw7NHJPHMW0AkYCPQ" rel="noopener nofollow" style="color: #365899; cursor: pointer; font-family: inherit; text-decoration-line: none;" target="_blank">http://microbit.info.lk</a></div>
<div style="background-color: white; color: #666666; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 1em;">
සංවිධානය හා තාක්ෂණය<br />
Poornima Heashadharani (microbit club)<br />
Sagara Ekanayake (Silicon Hills)<br />
Niranjan Meegammana (Shilpa Sayura Foundation)<br />
NP Vishva Kumara (info.lk)<br />
Yamuna Rathnayake (RRCK)</div>
<div style="background-color: white; color: #666666; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-top: 1em;">
තවත් විස්තර!<br />
ශූරතාවලිය :<a data-ft="{"tn":"-U"}" data-lynx-mode="async" data-lynx-uri="https://l.facebook.com/l.php?u=https%3A%2F%2Fgoo.gl%2FVRARSD&h=ATOqVBw6_3Sv03lYmdxI13AEQDRy-FqVXWYIIE3QayLLnexZeJJ32bbi7Mfbt1DfRIpUTPvD7EC0a8krQZQAgVISLR-yY2Afs5csFNhy2PUZdBLr-x30JhtQlfrDvN_B8rhfBxIRr99SajV8UaXuOSDhuqlIZevWayoN31DBok2yAInCrBjHkJ3hMJi7KkbM9e54fUCZZXXKBU9n-422mQH77b_y8rN7_53vGTMFzprrA9rFVNIA8w" href="https://goo.gl/VRARSD" rel="noopener nofollow" style="color: #365899; cursor: pointer; font-family: inherit; text-decoration-line: none;" target="_blank">https://goo.gl/VRARSD</a><br />
තරඟ ප්රශ්ණ : <a data-ft="{"tn":"-U"}" data-lynx-mode="async" href="https://l.facebook.com/l.php?u=https%3A%2F%2Fgoo.gl%2FupKGUf&h=ATNpdM25TChNsnYJXhYhE1S1jUnuXowhZC8YhrOr3Idlti7-m10aPDIN0SpepfdXX8BBxCPLltGVvs7J5GKK4t1gq5hBc1F9pBjHLA7-5tP3uy9S5AwkT7lXqLMpRoRmtkVn7Uq7-ly1G-53dXR5xbOndnYPxX7YsLdtZ-0h0qVsN-4r01oCZoR-0YEVtaUQPLav4Yz_8CgMGDNxWPL54F_qBSz9aDAHr9NhZcljQdTsLc3TmwrAiQ" rel="noopener nofollow" style="color: #365899; cursor: pointer; font-family: inherit; text-decoration-line: none;" target="_blank">https://goo.gl/upKGUf</a><br />
තරඟ නිර්මාණ <a data-ft="{"tn":"-U"}" data-lynx-mode="async" href="https://l.facebook.com/l.php?u=http%3A%2F%2Fmicrobit.info.lk%2F&h=ATOjE_uAkQW5eMYi5rxlZe15WRb08Oshi5pc1fbLaPNMIlz-N25Waj3rNietnSRrvkVpMzJTOl11ErHP5JCGLLalqMBRIo9G5NizydQuB6G6nGtRukhB5UxwpzlGgvlZvtLZ80dogCYTCwZ2-epAroStYSwKvUT4-uVbKE5CRneRem4W2FYGKs_Ii_JNqi3-nTBRFDko9MOahx781mshIWWsmJulOSkTEyZoL4fixHgv72wzvN3-vA" rel="noopener nofollow" style="color: #365899; cursor: pointer; font-family: inherit; text-decoration-line: none;" target="_blank">http://microbit.info.lk</a><br />
මයික්රෝබිට් පාඩම් : <a data-ft="{"tn":"-U"}" data-lynx-mode="async" href="https://l.facebook.com/l.php?u=https%3A%2F%2Fgoo.gl%2F31qKry&h=ATOu6e602U5cWRHfNf69UyMWAgqN_xDN6KOlEq5Rv5hWu7xEkdikm5Qa97QbGPLH0XYKRNhrpiuVvXNul7vMexRykMT7Kb0nsFdIq1MvUXl7nSkKdKxbEd7TIfxHV7pi_-BX29WNG2sJRX29Xd_1kkvt65naFXRt-BGj9SgWtGuxOBF6QLur0enXqdttj6kbhPeWdm5hFRzekjUzRPjQrRIYFHZubirzYLDvMc-ZAonCR067Xw5Glw" rel="noopener nofollow" style="color: #365899; cursor: pointer; font-family: inherit; text-decoration-line: none;" target="_blank">https://goo.gl/31qKry</a><br />
සංවිධානය : <a data-ft="{"tn":"-U"}" data-lynx-mode="async" href="https://l.facebook.com/l.php?u=http%3A%2F%2Fshilpasayura.org%2F&h=ATMe1p3869Zpas6szpKmoMu5tx481qcgKcWxcV0gDS7wiezNo-aOlxVuBzygQQc8wWp8LIySgnodJbLPerrd1vz35St0oyhxWFjKAfTyoJpJkS1reRpLXwqGSrhrSsDeuZI0lJjw4PnKuvxN367o7A2_QXv2JrRSFXaPdLqUEWOlDicj3l8KD3mU50nHirk_oLgeKq1jjZQnkEYWB2PVrXonYKsahwQndZf126dKYwLdTZ_csobGXw" rel="noopener nofollow" style="color: #365899; cursor: pointer; font-family: inherit; text-decoration-line: none;" target="_blank">http://shilpasayura.org</a> සහ ප්රජාව<br />
අනුග්රහය හා මයික්රෝබිට් ලබාදීම <a data-ft="{"tn":"-U"}" data-lynx-mode="async" href="https://l.facebook.com/l.php?u=http%3A%2F%2Fmicrobitclub.info.lk%2F&h=ATPZxnufhlxDPj04mb9gTV4Z8_irVhl9xur5KRdUE7ZywPZLNv4NpOBm1wv9jmKGuo3qrObpCiaxapNEtRcMdk0vpfeJolobBfp25U01ViorJDNmIC4wRj6Qdo9UKu13k0zgWpDKYn6vjzIu7iSnzCzSiGbISH7ucUr9rIthIdC2Ttg5Kk0l26Q5ynfl6ZGDsyc9fwByfrjUvqL21d7oWGtrHFk2svM6okz028os6d3wI_m2hIc26w" rel="noopener nofollow" style="color: #365899; cursor: pointer; font-family: inherit; text-decoration-line: none;" target="_blank">http://microbitclub.info.lk</a></div>
Niranjan Meegammanahttp://www.blogger.com/profile/03233425107844672492noreply@blogger.com0tag:blogger.com,1999:blog-8256035129192558896.post-14992722287657033592018-02-16T10:42:00.002-08:002018-02-16T10:42:45.998-08:00Intelligent Mario with gravity and thrust<iframe allowtransparency="true" frameborder="0" height="270" scrolling="no" src="https://www.facebook.com/plugins/post.php?href=https%3A%2F%2Fwww.facebook.com%2Fniranjan.meegammana%2Fposts%2F2058416464183458&width=500" style="border: none; overflow: hidden;" width="500"></iframe>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTcdvDsremzbMPFYWxMfwJAWrFRDXxCW3odiznqVbZjpyFK4MziGjDCA2CGnqa88zvsevWap9xlvVcu-MTk8whQDRHhQIUHCmsA9lNkrtnMfcgjIUQS0oUvQG85cyft7TztnSZvJf0A3KX/s1600/23669163_1929212710437168_4473147518641101904_o.jpg" imageanchor="1"><img border="0" data-original-height="545" data-original-width="970" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTcdvDsremzbMPFYWxMfwJAWrFRDXxCW3odiznqVbZjpyFK4MziGjDCA2CGnqa88zvsevWap9xlvVcu-MTk8whQDRHhQIUHCmsA9lNkrtnMfcgjIUQS0oUvQG85cyft7TztnSZvJf0A3KX/s640/23669163_1929212710437168_4473147518641101904_o.jpg" width="640" /></a>Niranjan Meegammanahttp://www.blogger.com/profile/03233425107844672492noreply@blogger.com0tag:blogger.com,1999:blog-8256035129192558896.post-81363598891056957472018-02-15T20:22:00.000-08:002018-02-15T20:29:20.583-08:00Model View Controller (MVC) Pattern with Java Script<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgGEnkBrk4OZAskOCuUp08lr8-51bnpY0hpkpYwdL3UeukLa9cjFbpSeTECfD1DQyIpd4uphsjWkiobD8bCEBjCP3kbjjKRN9DkWd0QVYcOnVFQhZGLa2ItrxTbxXDcvwgyPCVj42rR1hB/s1600/model-view-controller-mvc-explained.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="239" data-original-width="585" height="260" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgGEnkBrk4OZAskOCuUp08lr8-51bnpY0hpkpYwdL3UeukLa9cjFbpSeTECfD1DQyIpd4uphsjWkiobD8bCEBjCP3kbjjKRN9DkWd0QVYcOnVFQhZGLa2ItrxTbxXDcvwgyPCVj42rR1hB/s640/model-view-controller-mvc-explained.jpg" width="640" /></a></div>
<br /><br />The Controller (C) listens to event stream. Here we use click event<br />
<br />
Model (M) provide access to data source.<br />
<br />
View (V) knows how to render data from the Model.<br />
<br />
The Controller tells to View to do something with Model data.<br />
The View knows nothing about the Model apart from it's interface<br />
The Model knows nothing of the View and the Controller<br />
The Controller knows about both the Model and the View<br />
The Controller tells the View to do something with the data from the Model<br />
<br />
You need to add form input elements and a button to experiment this code.<br />
<br />
<br />
<pre>var M = {}, V = {}, C = {};
/* Controller Handles the Events */
/* Model Handles the Data */
/* View Handles the Display */
M = {
data: {
userName : "Ping Pong",
userID : "440"
},
setData : function(d){
this.data.userName = d.userName;
this.data.userID = d.userID;
},
getData : function(){
return data;
}
}
//elements who will receive data
V = {
userName : document.querySelector("#inputUserName"),
userID : document.querySelector("#inputUserID"),
update: function(M){
this.userName.value = M.data.userName;
this.userID.value = M.data.userID;
}
}
//Controller handles all
C = {
model: M,
view: V,
handler: function(){
this.view.update(this.model);
}
}
//event
document.querySelector("#submitBtn").addEventListener("click", function(){
C.handler.call(C);
});
</pre>
Niranjan Meegammanahttp://www.blogger.com/profile/03233425107844672492noreply@blogger.com0tag:blogger.com,1999:blog-8256035129192558896.post-23995307521668878702018-02-14T16:23:00.001-08:002018-02-14T16:23:13.435-08:00PHP MySQLi object oriented implementation<b>MySQLi</b> - i standing for 'improved'.<br />
<br />
<b>PDO</b><br />
PDO works with various different database systems<br />
MySQLi will only work with MySQL databases.<br />
Both are object oriented, but MySQLi allows procedural usage also.<br />
<b><br /></b>
<b>PHP MySQLi </b>object oriented implementation,<br />
<b><br /></b>
<b>Connecting</b><br />
Create a new instance of MySQLi on localhost database<br />
<br />
$db = new mysqli('localhost', 'mysql_database', 'pass', 'demo');<br />
<br />
if($db->connect_errno > 0){<br />
die('Unable to connect to database [' . $db->connect_error . ']');<br />
}<br />
<br />
<b>Querying</b><br />
<br />
$sql = SELECT * FROM `users` WHERE `live` = 1<br />
$result = $db->query($sql)<br />
<br />
if(!$result ){<br />
die('There was an error running the query [' . $db->error . ']');<br />
}<br />
<br />
<b>Output query results</b><br />
To loop through the results and output the username<br />
<br />
while($row = $result->fetch_assoc()){<br />
echo $row['username'] . '<br />';<br />
}<br />
<br />
<br />
<b>Number of returned rows</b><br />
<br />
<br />
<?php<br />
echo 'Total results: ' . $result->num_rows;<br />
?><br />
<b><br /></b>
<b>Number of affected rows</b><br />
<br />
<?php<br />
echo 'Total rows updated: ' . $db->affected_rows;<br />
?><br />
<br />
<b>Free result set</b><br />
It's advisable to free a result after use<br />
<br />
$result->free();<br />
<br />
This will free up some system resources, and is a good practice to get in the habit of doing.<br />
<br />
<b>Escaping characters</b><br />
<br />
$db->real_escape_string('This is an unescaped "string"');<br />
<br />
$db->escape_string('This is an unescape "string"');<br />
The string should now be safer to insert into your database through a query.<br />
<br />
close the connection:<br />
<br />
$db->close();<br />
<br />
<b>Define a statement</b><br />
<br />
$statment = $db->prepare("SELECT `name` FROM `users` WHERE `username` = ?");<br />
<br />
<b>Bind parameters</b><br />
$name = 'Bob';<br />
$statement->bind_param('s', $name);<br />
<b>Execute the statement</b><br />
$statement->execute();<br />
<b><br /></b>
<b>Iterating over results</b><br />
<br />
$statement->bind_result($returned_name);<br />
<br />
while($statement->fetch()){<br />
echo $returned_name . '<br />';<br />
}<br />
<br />
<b>Close statement</b><br />
<br />
$statement->free_result();<br />
<br />
<b>MySQLi Transactions</b><br />
<br />
<b>Disable auto commit</b><br />
You need to make it so that any query you submit doesn't automatically commit in the database.<br />
<br />
$db->autocommit(FALSE);<br />
<br />
<b>Commit the queries</b><br />
After a few queries that you've ran using $db->query()<br />
we can call a simple function to commit the transaction:<br />
<br />
$db->commit();<br />
<br />
<b>Rollback</b><br />
roll something back:<br />
<br />
$db->rollback();<br />
<div>
<br /></div>
Niranjan Meegammanahttp://www.blogger.com/profile/03233425107844672492noreply@blogger.com0tag:blogger.com,1999:blog-8256035129192558896.post-15127383732830476952018-02-09T10:59:00.000-08:002018-02-09T10:59:13.296-08:00IP & Subnet Calculator<style>
ul#input {
padding-top: 10px;
padding-bottom: 10px;
width: 22em;
border: 1px solid black;
margin-left: auto;
margin-right: auto;
list-style-type: none;
}
ul#input li {
width: 100%;
font-family: arial;
font-size:0.9em;
font-weight:bold;
overflow: auto;
}
select, input {
padding-bottom: 0;
float: right;
clear: both;
margin-right: 3em;
width: 10em;
}
#prevsubnet {
float: left;
clear: left;
width: 9em;
}
#nextsubnet {
float: right;
clear: right;
width: 9em;
}
table {
border-collapse: collapse;
margin: auto;
}
td, th {
font-size: .8em;
font-family: arial;
text-align: left;
border: 1px solid #55660D;
padding: 3px 7px 2px 7px;
}
td {
font-family: "Lucida Console";
}
tr.even td {
}
.hidden {
visibility: hidden;
border: none;
}
.dec, .hex {
width: 8em;
}
.bin {
width: 15em;
}
.netbits {
color: red;
}
.subnetbits {
color: blue;
}
.hostbits {
color: green;
}
</style>
<script>
Array.prototype.sum = function () {
var sum = 0;
for (var i = 0; i < this.length; i++) {
sum += parseInt(this[i]);
}
return sum;
}
String.prototype.repeat = function(count) {
var result = "";
for (var i = 0; i < count; i++) {
result += this;
}
return result;
}
function ipInfo() {
this.defaultMask = 0;
this.netClass = 0;
this.hosts = 0;
this.subnets = 0;
this.subnetId = 0;
this.networkId = 0;
this.validMasks = new Array();
this.validHosts = new Array();
this.validSubnets = new Array();
this.ipOctetArray = new Array();
this.ipString = "";
this.ip = 0;
this.maskOctetArray = new Array();
this.maskString = "";
this.mask = 0;
this.generateMasks = function () {
var masks = new Array();
var bitCount = this.defaultMask.toString(2).split("").sum();
// /32 leaves 0 bits for hosts, /31 leaves 1 bit for hosts, but that is reserved for broadcast, /30 is as high as we can go
for (var i = bitCount; i <= 30; i++) {
masks[i - bitCount] = parseInt("1".repeat(i) + "0".repeat(32 - i),2);
}
this.validMasks = masks;
}
this.generateHosts = function() {
var hosts = new Array();
// var bitArray = bitwiseXor(bitwiseNot(this.defaultMask),1).toString(2).split("");
var bitTotal = bitwiseNot(this.defaultMask).toString(2).split("").length;
for (var i = 1; i < bitTotal; i++) {
hosts[i - 1] = Math.pow(2, i + 1) - 2;
}
this.validHosts = hosts.reverse();
}
this.generateSubnets = function () {
var subnets = new Array();
var bitTotal = bitwiseNot(this.defaultMask).toString(2).split("").length;
// the last two non-mask bits cannot be used for subnets because they would leave 0, and 2 bits for hosts respectively, but two addresses in every subnet are for broadcast and network ID
for (var i = 0; i <= bitTotal -2; i++) {
subnets[i] = Math.pow(2, i);
}
this.validSubnets = subnets;
}
this.parseIp = function(ipString) {
this.ipString = ipString;
this.ipOctetArray = ipString.split(".");
this.ip = this.parseOctets(this.ipOctetArray);
if (!this.ip) {
return false;
}
switch (true) {
case (this.ipOctetArray[0] >= 1 && this.ipOctetArray[0] <= 126):
this.netClass = "A";
this.defaultMask = 0xFF000000; // 255.0.0.0
break;
case (this.ipOctetArray[0] >= 128 && this.ipOctetArray[0] <= 191):
this.netClass = "B";
this.defaultMask = 0xFFFF0000; // 255.255.0.0
break;
case (this.ipOctetArray[0] >= 192 && this.ipOctetArray[0] <= 223):
this.netClass = "C";
this.defaultMask = 0xFFFFFF00; // 255.255.255.0
break;
default:
this.netClass = false; // Invalid IP, Classes D and E don't really work with a subnet calculator.
this.defaultMask = false;
break;
}
if (this.mask) {
this.subnetId = bitwiseAnd(this.ip,this.mask);
}
this.networkId = bitwiseAnd(this.ip,this.defaultMask);
this.generateMasks();
this.generateHosts();
this.generateSubnets();
return true;
}
this.parseMask = function(maskString) {
if (maskString === "") {
maskString = toOctets(this.defaultMask);
}
this.maskString = maskString;
this.maskOctetArray = maskString.split(".");
this.mask = this.parseOctets(this.maskOctetArray);
if (!this.mask) {
return false;
}
this.hosts = bitwiseNot(this.mask) - 1;
if (this.defaultMask) {
this.subnets = Math.pow(2,bitwiseXor(this.mask,this.defaultMask).toString(2).split("").sum());
}
if (this.ip) {
this.subnetId = bitwiseAnd(this.ip,this.mask);
}
return true;
}
this.parseMaskByHosts = function (hosts) {
var bitCount = parseInt(hosts).toString(2).split("").length;
var maskString = toOctets(parseInt("1".repeat(32 - bitCount) + "0".repeat(bitCount),2));
return this.parseMask(maskString);
}
this.parseMaskBySubnets = function (subnets) {
var bitCount = this.defaultMask.toString(2).split("").sum() + Math.log(subnets)/Math.log(2);
var maskString = toOctets(parseInt("1".repeat(bitCount) + "0".repeat(32 - bitCount), 2))
return this.parseMask(maskString);
}
this.parseOctets = function(octetArray) {
var result = 0;
if (octetArray.length != 4) {
return false;
}
for (var i = 0; i < 4; i++) {
if (octetArray[i] > 255 || octetArray[i] < 0) {
return false;
}
result = bitwiseOr(bitwiseLShift(result,8), parseInt(octetArray[i]));
}
return result;
}
}
function ipFromClass(netClass) {
switch (netClass) {
case "A":
return "10.0.0.1";
case "B":
return "172.16.0.1";
case "C":
return "192.168.1.1";
default:
return false;
}
}
function fillSelect(selectObj, dataArray, withOctets) {
while (selectObj.length) {
selectObj.remove(0);
}
for (var i = 0; i < dataArray.length; i++) {
var tmpOpt = document.createElement('option');
if (withOctets) {
tmpOpt.text = toOctets(dataArray[i]);
tmpOpt.setAttribute('id', selectObj.id + toOctets(dataArray[i]));
}
else {
tmpOpt.text = dataArray[i];
tmpOpt.setAttribute('id', selectObj.id + dataArray[i]);
}
selectObj.add(tmpOpt,null);
}
}
function action(actionId) {
var fatalErr = "";
var ipObj = document.getElementById("ip");
var maskObj = document.getElementById("mask");
var classObj = document.getElementById("class");
var hostsObj = document.getElementById("hosts");
var subnetsObj = document.getElementById("subnets");
var tableObj = document.getElementById("infotable");
debugger;
var ip = new ipInfo;
if (actionId == "class" || actionId == "load") {
ipObj.value = ipFromClass(classObj.value);
}
// Determine which values were invalid and report an error
if(!ip.parseIp(ipObj.value) && ipObj.value) {
fatalErr = "Invalid IP\n";
}
if(!ip.parseMask(maskObj.value) && maskObj.value) {
fatalErr = "Invalid Mask\n";
}
if (fatalErr) {
alert(fatalErr);
return false;
}
// populate the drop downs and calculate mask information from default mask on load, if class drop down was used, or if ip has changed to a different class.
if (classObj.options[classObj.selectedIndex].value != ip.netClass || actionId == "class" || actionId == "load") {
fillSelect(maskObj, ip.validMasks, true);
fillSelect(hostsObj, ip.validHosts);
fillSelect(subnetsObj, ip.validSubnets);
ip.parseMask(toOctets(ip.defaultMask));
}
if (actionId == "prevsubnet") {
ip.parseIp(toOctets(ip.subnetId - 2)); // last host of previous subnet
ip.parseIp(toOctets(ip.subnetId + 1)); // first host of that same subnet
ipObj.value = ip.ipString;
}
if (actionId == "nextsubnet") {
ip.parseIp(toOctets(bitwiseOr(bitwiseNot(ip.mask), bitwiseAnd(ip.mask, ip.ip)) + 2));
ipObj.value = ip.ipString;
}
if (actionId == "hosts") {
ip.parseMaskByHosts(hostsObj.options[hostsObj.selectedIndex].value);
}
if (actionId == "subnets") {
ip.parseMaskBySubnets(subnetsObj.options[subnetsObj.selectedIndex].value);
}
// Fill the values into the page
document.getElementById(maskObj.id + ip.maskString).selected = true;
document.getElementById(hostsObj.id + ip.hosts).selected = true;
document.getElementById(subnetsObj.id + ip.subnets).selected = true;
document.getElementById(classObj.id + ip.netClass).selected = true;
//Network ID
tableObj.rows[1].cells[1].innerHTML = toOctets(ip.networkId);
//tableObj.rows[1].cells[2].innerHTML = toOctets(ip.networkId, 16);
tableObj.rows[1].cells[2].innerHTML = colorCodeBits(toOctets(ip.networkId, 2), ip.defaultMask, ip.mask);
//Subnet ID
tableObj.rows[2].cells[1].innerHTML = toOctets(ip.subnetId);
//tableObj.rows[2].cells[2].innerHTML = toOctets(ip.subnetId, 16);
tableObj.rows[2].cells[2].innerHTML = colorCodeBits(toOctets(ip.subnetId, 2), ip.defaultMask, ip.mask);
//First Host
tableObj.rows[3].cells[1].innerHTML = toOctets(ip.subnetId + 1);
//tableObj.rows[3].cells[2].innerHTML = toOctets(ip.subnetId + 1, 16);
tableObj.rows[3].cells[2].innerHTML = colorCodeBits(toOctets(ip.subnetId + 1, 2), ip.defaultMask, ip.mask);
//Last Host
tableObj.rows[4].cells[1].innerHTML = toOctets(bitwiseOr(bitwiseNot(ip.mask), bitwiseAnd(ip.mask, ip.ip)) - 1);
//tableObj.rows[4].cells[2].innerHTML = toOctets(bitwiseOr(bitwiseNot(ip.mask), bitwiseAnd(ip.mask, ip.ip)) - 1, 16);
tableObj.rows[4].cells[2].innerHTML = colorCodeBits(toOctets(bitwiseOr(bitwiseNot(ip.mask), bitwiseAnd(ip.mask, ip.ip)) - 1, 2), ip.defaultMask, ip.mask);
//Broadcast Address
tableObj.rows[5].cells[1].innerHTML = toOctets(bitwiseOr(bitwiseNot(ip.mask), bitwiseAnd(ip.mask, ip.ip)));
// tableObj.rows[5].cells[2].innerHTML = toOctets(bitwiseOr(bitwiseNot(ip.mask), bitwiseAnd(ip.mask, ip.ip)), 16);
tableObj.rows[5].cells[2].innerHTML = colorCodeBits(toOctets(bitwiseOr(bitwiseNot(ip.mask), bitwiseAnd(ip.mask, ip.ip)), 2), ip.defaultMask, ip.mask);
//Subnet Mask
tableObj.rows[6].cells[1].innerHTML = ip.maskString;
//tableObj.rows[6].cells[2].innerHTML = toOctets(ip.mask, 16);
tableObj.rows[6].cells[2].innerHTML = colorCodeBits(toOctets(ip.mask, 2), ip.defaultMask, ip.mask);
//Wildcard Mask
tableObj.rows[7].cells[1].innerHTML = toOctets(bitwiseNot(ip.mask));
//tableObj.rows[7].cells[2].innerHTML = toOctets(bitwiseNot(ip.mask), 16);
tableObj.rows[7].cells[2].innerHTML = colorCodeBits(toOctets(bitwiseNot(ip.mask), 2), ip.defaultMask, ip.mask);
return true;
}
// Convert a regular number into period delimited 8-bit pieces
function colorCodeBits (bitOctets, defaultMask, mask) {
var charArray = bitOctets.split("");
var defaultBitCount = defaultMask.toString(2).split("").sum();
var maskBitCount = mask.toString(2).split("").sum();
var result = '<span class="netbits">';
for (var i = 0; defaultBitCount > 0; i++) {
if (charArray[i] != ".") {
defaultBitCount--;
}
if (i > 50) {
return false;
}
}
result += charArray.slice(0,i).join("") + '</span><span class="subnetbits">';
for (var j = 0; maskBitCount > 0; j++) {
if (charArray[j] != ".") {
maskBitCount--;
}
if (j > 50) {
return false;
}
}
result += charArray.slice(i,j).join("") + '</span><span class="hostbits">' + charArray.slice(j,charArray.length).join("") + '</span>';
return result;
}
function toOctets(num, base) {
var bitString = num.toString(2);
var result = new Array();
var bitArray = new Array();
if (bitString.length > 32) {
return false;
}
if (bitString.length < 32) {
bitString = "0".repeat(32 - bitString.length) + bitString;
}
bitArray = bitString.split("");
if (bitArray.length > 32) {
return false;
}
if (bitArray.length < 32) {
bitArray = "0".repeat(32 - bitArray.length) + bitArray
}
for (var i = 0; i < bitArray.length; i += 8) {
result[i/8] = parseInt(bitArray.slice(i,i+8).join(""),2);
if (base) {
result[i/8] = result[i/8].toString(base).toUpperCase();
if (base == 2 && result[i/8].length < 8) {
result[i/8] = "0".repeat(8 - result[i/8].length) + result[i/8];
}
if (base == 16 && result[i/8].length < 2) {
result[i/8] = "0" + result[i/8];
}
}
}
if (result.length < 4) {
return "0.".repeat(4 - result.length) + result.join(".")
}
return result.join(".");
}
function showHideRow (rowNum, me) {
var meObj = document.getElementById(me);
var rowObj = document.getElementById("infotable").rows[rowNum];
if (rowObj.style.display == "none") {
rowObj.style.display = "";
meObj.style.listStyle = "";
}
else {
rowObj.style.display = "none";
meObj.style.listStyle = "none";
}
}
function showHideCol (colNum, me) {
var meObj = document.getElementById(me);
var rowObj = document.getElementById("infotable").rows;
for (var i = 0; i < rowObj.length; i++) {
var cell = rowObj[i].cells[colNum];
if (cell.style.display == "none") {
cell.style.display = "";
meObj.style.listStyle = "";
}
else {
cell.style.display = "none";
meObj.style.listStyle = "none";
}
}
return true;
}
/*function toOctets(num) {
var bitArray = num.toString(2).split("").reverse();
var result = parseInt(bitArray.slice(0,8).reverse().join(""),2);
for (var i = 8; i < bitArray.length; i += 8) {
result = parseInt(bitArray.slice(i,i+8).reverse().join(""),2) + "." + result;
}
return result;
}
*/
/*
JavaSctips's builtin bitwise operators can supposedly handle up to 32bit numbers,
but in looking around, and doing practical tests, it seems more like 31 bit is as
high as they go, IP addresses and subnet masks are 32 bit, so I made my own
versions that can handle larger numbers.
From my testing, it looks like parseInt can't correctly handle numbers larger than 53 bits in length, so that is also the limit of these functions.
Note: The bitwiseNot function only operates on bits within the actual number itself, it will not flip 0's to the left of the number to 1's.
Example:
bitwiseNot(0) = 1
bitwiseNot(1) = 0
bitwiseNot(5) = 4
*/
function bitwiseRShift(shiftNum, shiftDist) {
return shiftNum / Math.pow(2,shiftDist);
}
function bitwiseLShift(shiftNum, shiftDist) {
return shiftNum * Math.pow(2,shiftDist);
}
function bitwiseAnd(num1, num2) {
var resultArray = new Array();
// split expects a string, and therefore reads from left to right, if my bit strings have different lengths this will compare the wrong bits, reversing the array corrects this
var bitArray1 = num1.toString(2).split("").reverse();
var bitArray2 = num2.toString(2).split("").reverse();
for (var i = 0; i < Math.max(bitArray1.length, bitArray2.length); i++) {
if (bitArray1[i] == 1 && bitArray2[i] == 1) {
resultArray[i] = 1;
}
else {
resultArray[i] = 0;
}
}
return parseInt(resultArray.reverse().join(""),2);
}
function bitwiseOr(num1, num2) {
var resultArray = new Array();
// split expects a string, and therefore reads from left to right, if my bit strings have different lengths this will compare the wrong bits, reversing the array corrects this
var bitArray1 = num1.toString(2).split("").reverse();
var bitArray2 = num2.toString(2).split("").reverse();
for (var i = 0; i < Math.max(bitArray1.length, bitArray2.length); i++) {
if (bitArray1[i] == 1 || bitArray2[i] == 1) {
resultArray[i] = 1;
}
else {
resultArray[i] = 0;
}
}
return parseInt(resultArray.reverse().join(""),2);
}
function bitwiseXor(num1, num2) {
var resultArray = new Array();
// split expects a string, and therefore reads from left to right, if my bit strings have different lengths this will compare the wrong bits, reversing the array corrects this
var bitArray1 = num1.toString(2).split("").reverse();
var bitArray2 = num2.toString(2).split("").reverse();
for (var i = 0; i < Math.max(bitArray1.length, bitArray2.length); i++) {
if ((bitArray1[i] == 1 || bitArray2[i] == 1) && !(bitArray1[i] == 1 && bitArray2[i] == 1)) {
resultArray[i] = 1;
}
else {
resultArray[i] = 0;
}
}
return parseInt(resultArray.reverse().join(""),2);
}
function bitwiseNot(num) {
var bitArray = num.toString(2).split("");
for (var i = 0; i < bitArray.length; i++) {
if (bitArray[i] == 1) {
bitArray[i] = 0;
}
else {
bitArray[i] = 1;
}
}
return parseInt(bitArray.join(""),2);
}
window.addEventListener("load", function(event) {
console.log("All resources finished loading!");
debugger;
document.getElementById("class").selectedIndex = 2;
action("load");
});
</script>
<ul id="input">
<li>IP Address: <input type="text" id="ip" onchange="action(this.id)" /></li>
<li>Subnet Mask: <select id="mask" onchange="action(this.id)"></select></li>
<li>Subnets: <select id="subnets" onchange="action(this.id)"></select></li>
<li>Hosts: <select id="hosts" onchange="action(this.id)"></select></li>
<li>Class: <select id="class" onchange="action(this.id)"><option id="classA">A</option><option id="classB">B</option><option id="classC">C</option></select></li>
<li><input type="submit" id="prevsubnet" value="Previous Subnet" onclick="action(this.id);" /><input type="submit" id="nextsubnet" value="Next Subnet" onclick="action(this.id);" /></li>
</ul>
<table id="infotable">
<tr>
<th class="hidden"></th>
<th class="dec">Decimal</th>
<th class="bin">Binary</th>
</tr>
<tr class="even">
<th>Network ID</th>
<td></td>
<td></td>
</tr>
<tr>
<th>Subnet ID</th>
<td></td>
<td></td>
</tr>
<tr class="even">
<th>First Host</th>
<td></td>
<td></td>
</tr>
<tr>
<th>Last Host</th>
<td></td>
<td></td>
</tr>
<tr class="even">
<th>Broadcast Address</th>
<td></td>
<td></td>
</tr>
<tr>
<th>Subnet Mask</th>
<td></td>
<td></td>
</tr>
<tr class="even">
<th>Wildcard Mask</th>
<td></td>
<td></td>
</tr>
</table>Niranjan Meegammanahttp://www.blogger.com/profile/03233425107844672492noreply@blogger.com0tag:blogger.com,1999:blog-8256035129192558896.post-28057980187044630482018-02-03T15:35:00.001-08:002018-02-03T15:37:57.215-08:00What is a proxy Server ?<div style="background: rgb(255, 255, 255); border: 0px; line-height: 1.5em; margin-bottom: 1.5em; outline: 0px; padding: 0px; text-align: justify; vertical-align: baseline; word-wrap: break-word;">
<span style="color: #383838; font-family: "slabo" , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 17px; letter-spacing: 0.17px; word-spacing: 1.7px;"><br /></span></span>proxy server is a server that acts as an intermediary for requests from clients <br />and seeks resources from other servers <br /><br />A client connects to the proxy server, requesting some service, such as a file, connection, web page, or other resource available from a different server and the proxy server evaluates the request as a way to simplify and control its complexity.<br />
<img alt="Diagram of two computers connected only via a proxy server. The first computer says to the proxy server: "ask the second computer what the time is"." src="https://upload.wikimedia.org/wikipedia/commons/thumb/b/bb/Proxy_concept_en.svg/400px-Proxy_concept_en.svg.png" /><br />
<span style="color: #383838; font-family: "slabo" , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 17px; letter-spacing: 0.17px; word-spacing: 1.7px;">HTTP Proxy – The HTTP proxy works with web browsers (HTTP clients) and servers that support HTTP. The HTTP proxy caches pages, or store them, for faster retrieval and are used occasionally to increase metadata services available on the website.</span></span><br />
<span style="color: #383838; font-family: "slabo" , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 17px; letter-spacing: 0.17px; word-spacing: 1.7px;"><br /></span></span>
<span style="color: #383838; font-family: "slabo" , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 17px; letter-spacing: 0.17px; word-spacing: 1.7px;"><br /></span></span>
<span style="color: #383838; font-family: "slabo" , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 17px; letter-spacing: 0.17px; word-spacing: 1.7px;"><br /></span></span>
<span style="color: #383838; font-family: "slabo" , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 17px; letter-spacing: 0.17px; word-spacing: 1.7px;">Gateway Proxy – A proxy that allows requests and information to travel through without modification is called a gateway, or gateway proxy. T</span></span><br />
<span style="color: #383838; font-family: "slabo" , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 17px; letter-spacing: 0.17px; word-spacing: 1.7px;"><br /></span></span>
<span style="color: #383838; font-family: "slabo" , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 17px; letter-spacing: 0.17px; word-spacing: 1.7px;">Content Filter – The filter that might be blocking the sites you wish to access is likely a form of a proxy as well. These specialized proxies called content filters require all requests to pass through for review. The content filter proxy then blocks requests that match requests on a "black list" or based on certain security settings. Depending on the complexity of the content filter, network administrators can add to or remove items from the black list.</span></span><br />
<span style="color: #383838; font-family: "slabo" , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 17px; letter-spacing: 0.17px; word-spacing: 1.7px;"><br /></span></span>
<span style="color: #383838; font-family: "slabo" , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 17px; letter-spacing: 0.17px; word-spacing: 1.7px;">DNS Proxy - A DNS proxy server takes DNS queries from a ( Usually local ) networks and forwards them to an Internet Domain Name Server. It may also cache DNS records.</span></span><br />
<span style="color: #383838; font-family: "slabo" , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 17px; letter-spacing: 0.17px; word-spacing: 1.7px;"><br /></span></span>
<span style="color: #383838; font-family: "slabo" , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 17px; letter-spacing: 0.17px; word-spacing: 1.7px;">Anonymous HTTPS proxy - Users wanting to bypass web filtering, that want to prevent anyone from monitoring what they are doing, will typically search the internet for an open and anonymous HTTPS transparent proxy. T</span></span><br />
<span style="color: #383838; font-family: "slabo" , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 17px; letter-spacing: 0.17px; word-spacing: 1.7px;"><br /></span></span>
<span style="color: #383838; font-family: "slabo" , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 17px; letter-spacing: 0.17px; word-spacing: 1.7px;">Use of HTTPS proxies are detectable even without examining the encrypted data, based simply on firewall monitoring of addresses for frequency of use and bandwidth usage. </span></span><br />
<span style="color: #383838; font-family: "slabo" , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 17px; letter-spacing: 0.17px; word-spacing: 1.7px;"><br /></span></span>
<br />
<span style="color: #383838; font-family: "slabo" , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 17px; letter-spacing: 0.17px; word-spacing: 1.7px;">TOR Proxy - Tor ( The Onion Router) is a system intended to enable online anonymity. Tor client software routes Internet traffic through a worldwide volunteer network of servers in order to conceal a user's location or usage from someone conducting network surveillance or traffic analysis. Using Tor makes it more difficult to trace Internet activity, including "visits to Web sites, online posts,</span></span><br />
<span style="color: #383838; font-family: "slabo" , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 17px; letter-spacing: 0.17px; word-spacing: 1.7px;"><br /></span></span>
<span style="color: #383838; font-family: "slabo" , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 17px; letter-spacing: 0.17px; word-spacing: 1.7px;">I2P anonymous proxy - The I2P anonymous network ( I2P ) is a proxy network aiming at online anonymity. It implements garlic routing, which is an enhancement of Tor's onion routing. I2P is fully distributed and works by encrypting all communications in various layers and relaying them through a network of routers run by volunteers in various locations. By keeping the source of the information hidden, I2P offers censorship resistance. The goals of I2P are to protect users' personal freedom, privacy, and ability to conduct confidential business.</span></span><br />
<span style="color: #383838; font-family: "slabo" , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 17px; letter-spacing: 0.17px; word-spacing: 1.7px;"><br /></span></span>
<span style="color: #383838; font-family: "slabo" , "helvetica neue" , "helvetica" , "arial" , sans-serif;"><span style="font-size: 17px; letter-spacing: 0.17px; word-spacing: 1.7px;">Each user of I2P runs an I2P router on their computer (node). The I2P router takes care of finding other peers and building anonymizing tunnels through them. I2P provides proxies for all protocols (HTTP, IRC, SOCKS, ...).</span></span></div>
<div style="background: rgb(255, 255, 255); border: 0px; font-family: "Slabo 27px", "Helvetica Neue", Helvetica, Arial, sans-serif; font-feature-settings: 'kern' 1; font-kerning: normal; font-size: 17px; font-variant-ligatures: no-common-ligatures; letter-spacing: 0.17px; line-height: 1.5em; margin-bottom: 1.5em; outline: 0px; padding: 0px; text-align: justify; text-rendering: optimizeLegibility; vertical-align: baseline; word-spacing: 0.1em; word-wrap: break-word;">
<span style="background: transparent; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><b style="color: black;">USES OF PROXIES</b><b><br /></b></span></div>
<ol style="background: rgb(255, 255, 255); border: 0px; color: #383838; font-family: "Slabo 27px", "Helvetica Neue", Helvetica, Arial, sans-serif; font-feature-settings: 'kern' 1; font-kerning: normal; font-size: 17px; font-variant-ligatures: no-common-ligatures; letter-spacing: 0.17px; line-height: 1.5em; margin: 0px 0px 1.5em 25px; outline: 0px; padding: 0px; text-align: justify; text-rendering: optimizeLegibility; vertical-align: baseline; word-spacing: 0.1em; word-wrap: break-word;">
<li style="background: transparent; border: 0px; line-height: 1.5em; margin: 0px 0px 0px 0.5em; outline: 0px; padding: 0px; text-align: left; vertical-align: baseline;">Filtering of encrypted data</li>
<li style="background: transparent; border: 0px; line-height: 1.5em; margin: 0px 0px 0px 0.5em; outline: 0px; padding: 0px; text-align: left; vertical-align: baseline;">Bypassing filters and censorship</li>
<li style="background: transparent; border: 0px; line-height: 1.5em; margin: 0px 0px 0px 0.5em; outline: 0px; padding: 0px; text-align: left; vertical-align: baseline;">Logging and eavesdropping</li>
<li style="background: transparent; border: 0px; line-height: 1.5em; margin: 0px 0px 0px 0.5em; outline: 0px; padding: 0px; text-align: left; vertical-align: baseline;">Improving performance</li>
<li style="background: transparent; border: 0px; line-height: 1.5em; margin: 0px 0px 0px 0.5em; outline: 0px; padding: 0px; text-align: left; vertical-align: baseline;">Security</li>
<li style="background: transparent; border: 0px; line-height: 1.5em; margin: 0px 0px 0px 0.5em; outline: 0px; padding: 0px; text-align: left; vertical-align: baseline;">Cross-domain resources</li>
<li style="background: transparent; border: 0px; line-height: 1.5em; margin: 0px 0px 0px 0.5em; outline: 0px; padding: 0px; text-align: left; vertical-align: baseline;">Translation</li>
<li style="background: transparent; border: 0px; line-height: 1.5em; margin: 0px 0px 0px 0.5em; outline: 0px; padding: 0px; text-align: left; vertical-align: baseline;">Anonymousity</li>
</ol>
Niranjan Meegammanahttp://www.blogger.com/profile/03233425107844672492noreply@blogger.com0tag:blogger.com,1999:blog-8256035129192558896.post-83211591002669756272018-02-03T12:19:00.001-08:002018-02-03T12:19:19.562-08:00SECURE SOCKET LAYER<h1 dir="ltr" style="background-color: white; line-height: 1.54284; margin-bottom: 6pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #555555; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;"> </span>HTTPS protocol<br />SSL (Secure Sockets Layer) <br />is the most widely used.</h1>
<h1 dir="ltr" style="background-color: white; line-height: 1.2; margin-bottom: 30pt; margin-top: 30pt;">
<span style="background-color: transparent; color: #555555; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;">It is the standard security technology today.</span><span style="background-color: transparent; color: #555555; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;"><br class="kix-line-break" /></span><span style="background-color: transparent; color: #555555; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;">It establishes an encrypted link</span><span style="background-color: transparent; color: #555555; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;"><br class="kix-line-break" /></span><span style="background-color: transparent; color: #555555; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;">Between a web server and a browser.</span><span style="background-color: transparent; color: #555555; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;"><br class="kix-line-break" /></span><span style="background-color: transparent; color: #555555; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;"><br class="kix-line-break" /></span><span style="background-color: transparent; color: #555555; font-family: Arial; font-size: 13.999999999999998pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;">HTTP and HTTPS </span><span style="background-color: transparent; color: #555555; font-family: Arial; font-size: 13.999999999999998pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;"><br class="kix-line-break" /></span><span style="background-color: transparent; color: #555555; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;">HTTP link is not encrypted </span><span style="background-color: transparent; color: #555555; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;"><br class="kix-line-break" /></span><span style="background-color: transparent; color: #555555; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;">HTPS is encrypted and secure communication.</span><span style="background-color: transparent; color: #555555; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;"><br class="kix-line-break" /></span><span style="background-color: transparent; color: #555555; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;"><br class="kix-line-break" /></span><span style="background-color: transparent; color: #555555; font-family: Arial; font-size: 13.999999999999998pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;">How HTTP and HTTPS work?</span><span style="background-color: transparent; color: #555555; font-family: Arial; font-size: 13.999999999999998pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;"><br class="kix-line-break" /></span><span style="background-color: transparent; color: #555555; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;">A (client) and B (server) are two devices. </span><span style="background-color: transparent; color: #555555; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;"><br class="kix-line-break" /></span><span style="background-color: transparent; color: #555555; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;">A sends password to B</span><span style="background-color: transparent; color: #555555; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;"><br class="kix-line-break" /></span><span style="background-color: transparent; color: #555555; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;">B receive password.</span><span style="background-color: transparent; color: #555555; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;"><br class="kix-line-break" /></span><span style="background-color: transparent; color: #555555; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;">hacker access in between.</span></h1>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 17pt; margin-top: 17pt;">
<span style="background-color: transparent; color: #555555; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;"><img height="119" src="https://lh4.googleusercontent.com/WX-Qfvs30LrGHK6Eiit_Z1slWmF-C7-X8rDED9v1lLU9avC1NUvBkjqlYzvhSgR9EAEB-V1ZRVP4hBGFEzBOa5jTkpgb__xsx5WibGo6kRQl4d6yc9Z9mt9vt5T6FKb-6aXvMiap" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" title="http-without ssl" width="367" /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 17pt; margin-top: 17pt;">
<span style="background-color: transparent; color: #555555; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;">If A sends “badpass”, hacker gets “badpass”.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 17pt; margin-top: 17pt;">
<span style="background-color: transparent; color: #555555; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;">In HTTPS</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 17pt; margin-top: 17pt;">
<span style="background-color: transparent; color: #555555; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;"><img height="119" src="https://lh5.googleusercontent.com/8E64Eu2GRrSh48tKbw7YRAHe8B-1B-oDCbUr-6ldAvby4Dqv2muM_LKkSPmcllRmISUQBfYUUhszHleYucpERX-w-CXd9qQE443HrlfrYulCk6vu3xdYYG5JxXE0BQ8x2En6C9mp" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" title="https-with ssl" width="367" /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 17pt; margin-top: 17pt;">
<span style="background-color: transparent; color: #555555; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;">SSL communication used to encript messages.</span><span style="background-color: transparent; color: #555555; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;"><br class="kix-line-break" /></span><span style="background-color: transparent; color: #555555; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;">A sends message on the network.</span><span style="background-color: transparent; color: #555555; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;"><br class="kix-line-break" /></span><span style="background-color: transparent; color: #555555; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;">B receive themessage on the network. </span><span style="background-color: transparent; color: #555555; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;"><br class="kix-line-break" /></span><span style="background-color: transparent; color: #555555; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; white-space: pre;">Now hacker see password as “xYhVIO9l”</span></div>
<span id="docs-internal-guid-5c9ff11b-5d51-5142-2273-4f75b50da1ce"><span style="color: #555555; font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">How SSL works?</span><span style="color: #555555; font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="color: #555555; font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">A SSL Certificate issued to a websites by a certifying agency. A security certificate installed in web server with SSL capability..</span><span style="color: #555555; font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="color: #555555; font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="color: #555555; font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="color: #555555; font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">SSL system consists of a Public key and a Private key. Public key is used to encrypt the information</span><span style="color: #555555; font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="color: #555555; font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Private key is used to decrypt it. </span></span>Niranjan Meegammanahttp://www.blogger.com/profile/03233425107844672492noreply@blogger.com0tag:blogger.com,1999:blog-8256035129192558896.post-89772807356684058002018-01-29T18:11:00.002-08:002018-01-29T18:21:23.391-08:00Issues of IoT<img alt="Image result for IoT" height="420" src="https://www.sensorsexpo.com/sites/sensorsexpo/files/til_image/iotecosystem_icon_final_0.png" width="640" /><br />
<br />
• Cyber security<br />
• Privacy<br />
• Software licensing<br />
• Data use and ownership<br />
• Regulation<br />
<br />
<b><span style="font-size: large;">IoT cyber security</span></b> is a moving target. When a patch or fix is developed, it’s only a matter of time<br />
before hackers find ways around it. In situations where IoT security is breached, who is liable? Is the<br />
software maker liable if it doesn’t update its software? Who is liable if the software maker updates its software, but the user doesn’t<br />
download the update? What happens if the software maker updates the software, but the user doesn’t know there’s an update?<br />
<span style="font-size: large;"><br /></span>
<b><span style="font-size: large;">Privacy and Laws</span></b><br />
Privacy laws vary across countries. The Europeans are very protective<br />
of privacy, and the US is less protective. Video rental habits are protected by federal laws,<br />
not clear to of data generated by an implantable cardiac monitor is protected. Who owns datathat describes the quality and quantity of your heartbeats.<br />
<br />
<b><span style="font-size: large;">Governing the Internet of Things</span></b><br />
<br />
Software Licensing—It’s Complicated<br />
IoT requires software and hardware from multiple vendors.<br />
Maintaining the software, hardware stack can be expensive.<br />
In the IoT economy, there will be a handful of end-to-end solutions and a broad assortment of mash-ups.<br />
<br />
<b><span style="font-size: large;">Data Use and Ownership</span></b>—Who Controls What?<br />
who owns what data, where can it be sent, who is allowed to use it and how much if<br />
it can be stored across the IoT landscape.<br />
<br />
As the IoT becomes a more dominant force in our lives, the data it generates will become more valuable. Since the laws governing data ownership are ambiguous, rights associated with ownership are so unclear, look at who controls the use of data. It should be the consumer<br />
<br />
<span style="font-size: large;">Autonomous driving</span> raises questions about data ownership and usage.<br />
If a driverless car is involved in an accident, who is liable and who is allowed to review data relating to the accident? Will the manufacturer of the car want to see the data so it can lodge a suit against the developer who wrote the navigational software? Will network providers be required to share data with law enforcement agencies when autonomous vehicles collide?<br />
Many questions but few answers yet .<br />
<br />
<span style="font-size: large;"><b>Government regulation</b>—or the lack of it</span><br />
In the driverless car, precisely who is responsible in case of an accident—the owner of the car,<br />
the company that made the car, or the company that wrote the software<br />
guiding the car?<br />
<div>
<br /></div>
Niranjan Meegammanahttp://www.blogger.com/profile/03233425107844672492noreply@blogger.com0tag:blogger.com,1999:blog-8256035129192558896.post-53815330185149760762018-01-24T11:16:00.000-08:002018-01-24T11:16:01.849-08:00Subnetting in 5 minutes<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguX8qYBU7RDCC-rL0kd8HXPSDr70nNbhgR1_tEQyC31S7VQ2BakzzgRGbZQxRG11CpI7qUnGbpi_Tp45TvLAMznJ5V01a0AI2hBdWM4a9Zm7Rs_8lBKVMV_rbkn-BEidKh1N4_ml-sCQtm/s1600/subnetting_2.jpg" imageanchor="1"><img border="0" data-original-height="283" data-original-width="458" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguX8qYBU7RDCC-rL0kd8HXPSDr70nNbhgR1_tEQyC31S7VQ2BakzzgRGbZQxRG11CpI7qUnGbpi_Tp45TvLAMznJ5V01a0AI2hBdWM4a9Zm7Rs_8lBKVMV_rbkn-BEidKh1N4_ml-sCQtm/s1600/subnetting_2.jpg" /></a></div>
<br />
<br />
192.168.1.7 is an IP in IPV4 standard<br />
IPV4 networks have 32bits.<br />
Each 8bit is a Network ID.<br />
Each Network ID represent number between 0-255<br />
<br />
There are 4 basic classes A , B C, D<br />
The first ID or 8 bits is network class<br />
0-127 - Class A<br />
128 - 191 Class B<br />
192 - 223 Class C<br />
223 + Class D & E kept for research purpose<br />
<br />
Class<span style="white-space: pre;"> </span>First Network ID<span style="white-space: pre;"> </span>Last Network ID<br />
Class A<span style="white-space: pre;"> </span>1.0.0.0<span style="white-space: pre;"> </span>126.0.0.0<br />
Class B<span style="white-space: pre;"> </span>128.0.0.0<span style="white-space: pre;"> </span>191.255.0.0<br />
Class C<span style="white-space: pre;"> </span>192.0.0.0<span style="white-space: pre;"> </span>223.255.255.0<br />
<br />
If we have a class C network<br />
The first 3 numbers are network ID 192.168.1<br />
The last number is host ID<br />
First host id (0) is network id and last (255 broadcast id) not used<br />
So in the network we have host ids from<br />
192.168.1.1 - 192.168.1.254 we can have 254 hosts (computers or devices)<br />
We do sub netting to separate network traffic , like partitioning house.<br />
we can make 2 networks each having 254/2 - 1*2 hosts<br />
or make 4 networks having 254/4 - 1 *4<br />
<br />
Every time we break the network the first and last host IDs are used as subnets network ID and broadcast ID.<br />
<br />
Broadcast address used to send data to all hosts.<br />
So they cant be used as host IDs..<br />
A disadvantage of subnetting is reducing of usable IPs in a network.<br />
<br />
In order to tell the network how many computers we have in the subnet we use a subnet mask. Another number which tells how many subnet networks have been created.<br />
When we have 254 computers in a class C network we use<br />
255.255.255.0 as subnet mask so 192.168.1.1- 192.168.1.255 ips available to us.<br />
When we break the network into two subnets. We have to put a boundry between them by changing the subnet mask.<br />
<br />
Here subnet mask borrow one bit from host ID<br />
so subnet mask becomes 255.255.255.128<br />
The IP range of sub network A now is 192.168.1.1- 192.168.1.126<br />
The IP range of sub network B now is 192.168.1.129- 192.168.1.253<br />
The first and last IP of each subnet used for subnetworkid and broadcast address.<br />
<br />
Check here<br />
<a href="http://www.subnet-calculator.com/">http://www.subnet-calculator.com/</a><br />
<br />
In detail <a href="http://ict.shilpa64.lk/">http://ict.shilpa64.lk</a><br />
<br />Niranjan Meegammanahttp://www.blogger.com/profile/03233425107844672492noreply@blogger.com0tag:blogger.com,1999:blog-8256035129192558896.post-67154850066269671382018-01-21T10:51:00.000-08:002018-01-21T10:51:42.854-08:00උසස් පෙළ ICT ආදර්ශ ප්රශ්න පත්රයඅපොස උසස්පෙළ සඳහා ගුරුවරුන් රැසක් සම්පාදනය කළ ආදර්ශ ප්රශ්න. උත්සාහ කර බලන්න.<br /><br /><a href="https://www.slideshare.net/maheshkodit1/gce-al-model-papers" target="_blank">Download</a>Niranjan Meegammanahttp://www.blogger.com/profile/03233425107844672492noreply@blogger.com0tag:blogger.com,1999:blog-8256035129192558896.post-20101475968481215392018-01-21T10:48:00.000-08:002018-01-21T10:48:12.869-08:00O/L ICT, GIT, A/L ICT කෙටි ප්රශ්න 200 ක්අපොස සාමාන්ය පෙළ ICT සමත් නොවී උසස් පෙළ ICT කරන අයට හා GIT සඳහා වැදගත් O/L ICT කෙටි ප්රශ්න 200 ක් උත්සාහ කර බලන්න. ICT කරන සෑම අයෙකුටම සුදුසුයි.<br />
<br /><a href="https://www.yumpu.com/en/document/view/59784408/ict-ol-questions" target="_blank">Download</a>Niranjan Meegammanahttp://www.blogger.com/profile/03233425107844672492noreply@blogger.com0tag:blogger.com,1999:blog-8256035129192558896.post-47929008614654850152018-01-20T11:47:00.000-08:002018-01-20T11:47:09.878-08:00A/L ICT 2017 Sinhala Paper<a href="http://ict.shilpa64.lk/" target="_blank"><img border="0" data-original-height="300" data-original-width="246" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8pINei7cWt4fa4GSe-PHc_YdCG56iVTA6_6GQj5gYHr-M_NObEHb4DG5OHAxToTNT2581UA3iRo6vTyu_JNBwGJko8FP1Qe57HZO7aCOT8BOZ6j1ZBwjdLSVGnbsNr3szTHHrKFyqgGyB/s320/aL-ict_ad.jpg" width="262" /></a><br />
<br />
<br />
<a href="https://lookaside.fbsbx.com/file/2017%20AL%20ICT%20SINHALA%20MEDIUM%20PAPER.pdf?token=AWz4uFc7n_R3aKZwoSpaLLPT_cB-I7vQeJB2UFxEDYLQhs0iVrKNt_alPNnaBKaujxb_bP9JF_azJwjtoJheomzMMPHWMYkBok6TcQHgwgaGRH2cCfHlsw0IK7Ue8WcSDQHOO-PBgOmcC1OHp86GW8olWQ99dtbZol0DzvhHh_rYvvowhperNwgey1VI3JlKETrzSimYf8kU10VwbEjoPB1v">Download A/L ICT 2017 Sinhala Paper</a>Niranjan Meegammanahttp://www.blogger.com/profile/03233425107844672492noreply@blogger.com2tag:blogger.com,1999:blog-8256035129192558896.post-68218086141385055412018-01-20T11:44:00.001-08:002018-01-20T11:44:20.680-08:00Types of Data<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVP6qnl3SxlF9KsZV-q7K4eYmf9p5S9YdnLulxDD0sG-rw9439mjJl5zFMe-fZGudOkMEp5CXN3CpbxuEBK7xlq9zkl9arjYJ7gASsjZGhJz1F0qttzFRbILwMAtHz7dUbxwlunr53NWph/s1600/1200px-Data_types_-_en.svg.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1249" data-original-width="1200" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVP6qnl3SxlF9KsZV-q7K4eYmf9p5S9YdnLulxDD0sG-rw9439mjJl5zFMe-fZGudOkMEp5CXN3CpbxuEBK7xlq9zkl9arjYJ7gASsjZGhJz1F0qttzFRbILwMAtHz7dUbxwlunr53NWph/s640/1200px-Data_types_-_en.svg.png" width="614" /></a></div>
<br />Niranjan Meegammanahttp://www.blogger.com/profile/03233425107844672492noreply@blogger.com1tag:blogger.com,1999:blog-8256035129192558896.post-64280589652627120612017-11-08T03:10:00.003-08:002017-11-08T03:10:47.237-08:00IoT පද්ධතියක සංරචක<div style="background-color: white; color: #666666; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-top: 1em;">
2020 වසර වන විට ලෝකයේ බිලියන 26 ක් ජාලාංග අන්තර්ජාලයට සම්බන්ධ වන බව පර්යේෂකයෝ විස්වාස කරති. සමහරු එය බිලියන 100 ක් වේ යයි කියති. කෙසේ උවද දැ<span class="text_exposed_show" style="display: inline; font-family: inherit;">නුම් ආර්ථිකයක සිටින අපට ජාත්යන්තර IoT ක්ෂේත්රයේ රැකියා සහ සේවා අවස්ථා රැසක් ගලා එනු ඇත. IoT පර්යේෂණ සහ සංවර්ධනය, සේවා, නඩත්තුව, ආරක්ෂණය සහ IoT ව්යාපාර ඉන් සමහරක්. IoT විද්යාව, ගණිතය , තාක්ෂණය හා ඉංජිනේරු එකමුතුවක්. එහි මූලික වන්නේ භෞතික පරිගණනයයි. එනම් Physical Computing.</span></div>
<div class="text_exposed_show" style="background-color: white; color: #666666; display: inline; font-family: Helvetica, Arial, sans-serif;">
<div style="font-family: inherit; margin-bottom: 1em; margin-top: 1em;">
<span style="font-size: large;">මූලික IoT සංරචක</span></div>
<div class="separator" style="clear: both; font-size: 12px; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4jNrJh3ILTjL68F0FONn8PfPnHPaw8G9U1a2wg5cl-xE852uEUWx1xiZTzf2L-5-Ur4U2Wjee55d55Lz0731pgH7MVryllXhZA16tZtb5ECKWdn-KH7QOa1tJuuwH2XRRLeoohoxN8MyG/s1600/coponents.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="500" data-original-width="1206" height="264" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4jNrJh3ILTjL68F0FONn8PfPnHPaw8G9U1a2wg5cl-xE852uEUWx1xiZTzf2L-5-Ur4U2Wjee55d55Lz0731pgH7MVryllXhZA16tZtb5ECKWdn-KH7QOa1tJuuwH2XRRLeoohoxN8MyG/s640/coponents.jpg" width="640" /></a></div>
<div style="font-family: inherit; font-size: 12px; margin-bottom: 1em; margin-top: 1em;">
<br />1. Sensors - අප අවට පරිසරයෙන් විවිධ ආදාන ලබාගන්නා සංවේදක.<br />2 Algorithm - එම සංවේදක වලින් ලබාගන්නා දත්ත අනුව තීරණ ගන්නා අැලොගරිතම. මේවා Software හෝ Hardware විය හැක.<br />3. Control - අැලොගරිතම ගන්නා තීරණ අනුව පද්ධතියේ පාලනය සඳහා ක්රියාත්මක වල චාලක. (Actuators)<br />4. Internet - අන්තර්ජාලය සම්බන්ධ වී අනිකුත් ජාලාංග මගින් දත්ත විකාශණය හා ලබාගැනීමේ හැකියාව.<br />5. Power - IoT ක්රියාවලිය සඳහා විද්යුත් බලයක් අවශ්ය වේ. 3.3v - 5v දක්වා වෝල්ටීයතාවයකින් ඒවා වැඩ කරයි.<br />6. Security - IoT ආරක්ෂණය ඉතා වැදගත් අංශයක් වන්නේ එම පද්ධති අන්තර්ජාලයට සම්බන්ධවන නිසාය.<br />7. 5. Embeded Device - සංවේදක, චාලක, මුදුකාංග හා සන්නිවේදනය ලබාදෙන දෘඩාංගය. එය Arduino, microbit, Raspberry Pi වැනි පුවරුවකි. IoT පරිගණනයට අවශ්ය සියළු උපාංග එම පුවරුවට ඔබ්බා ඇත.</div>
<div style="font-family: inherit; font-size: 12px; margin-bottom: 1em; margin-top: 1em;">
උදාහරණයක් ලෙස IoT ශීතකරණයක barcode ස්කෑනරය මගින් එයට දමන සහ ගන්න ආහාර දත්ත මත කල් ඉකුත් වන දිනය,වට්ටෝරු, මිලදී ගැනුම් ලැයිස්තු හා නැවත ඇණවුම් කල හැකිවේ. මෙහිදී අාහාර ඇසුරුම් දත්ත, ස්කෑනරයෙන් සංවේදනය කර, නීති මත පදනම් වූ ඇලොගරිතමයකින් අදාල තීරණ ගනී. එය අන්තර්ජාලයේ කෑම වට්ටෝරු සොයා අමතරව අවශ්ය දේ ඔබට යෝජනා කරනු ඇත. ඔබගේ පවුලේ ආහාර පුරැදු අධ්යනය කර (machine learning) අනුව ආහාර සුරක්ෂිත භාවය වැඩිකරනු ඇත. නව්යකරණය තවත් දුරට යාහැක.</div>
<div style="font-family: inherit; font-size: 12px; margin-bottom: 1em; margin-top: 1em;">
සන්නිවේදනය සඳහා සෑම උපාංගටක්ම ඒකීය ලිපිනයක් භාවිතා කළ යුතුය. unique address. එය සොයාගන්නා අයෙකුට එය Hack කල හැක. බිලියන ගණනාවක් ජාලාංග අන්තර්ජාලයට සම්බන්ධවීම මත ගැන සිතන්න. IoT ආරක්ෂණය හා පුද්ගලිකත්වය ඉතා වැදගත් බව දැන් ඔබට වැටහේද?</div>
<div style="font-family: inherit; font-size: 12px; margin-bottom: 1em; margin-top: 1em;">
ඔබගේ නිවසේ රූපවාහිනියේ පාලනය අන්තර්ජාලයට සම්බන්ධ යයි සිතන්න. රූපවාහිනිය කියාත්මක වන්නේ ඔබ නිවසේ සිටන විටදී පමණය. ඔබ නිවසේ සිටින බව හෝ කිසිවෙකු නැති බව හොරෙකුට දැනගැනීමට අවශ්ය වේ. ඔහුට ඔබගේ නිවෙස් ජාලය විද්යුත්ව සිදුරු කර එම දත්තය ලබාගත හැක. එය ඔබ කලින් දැනසිටින්නේ නම් Polling, Proxy ආදී උපක්රම මගින් එය වලකා ගත හැක. නමුත් අන්තර්ජාලයට සම්බන්ධකිසිවක් 100% ආරක්ෂිත නොවන බව අප දනිමු.<br />Share with your friends. IoT is a great future to think.</div>
<div style="font-family: inherit; font-size: 12px; margin-top: 1em;">
<a class="_58cn" data-ft="{"tn":"*N","type":104}" href="https://www.facebook.com/hashtag/frontierinnovators?source=feed_text&story_id=1914592345232538" style="color: #365899; cursor: pointer; font-family: inherit; text-decoration-line: none;"><span class="_5afx" style="direction: ltr; font-family: inherit; unicode-bidi: isolate;"><span aria-label="hashtag" class="_58cl _5afz" style="color: #4267b2; font-family: inherit; unicode-bidi: isolate;">#</span><span class="_58cm" style="font-family: inherit;">FrontierInnovators</span></span></a> <a class="_58cn" data-ft="{"tn":"*N","type":104}" href="https://www.facebook.com/hashtag/shilpa64?source=feed_text&story_id=1914592345232538" style="color: #365899; cursor: pointer; font-family: inherit; text-decoration-line: none;"><span class="_5afx" style="direction: ltr; font-family: inherit; unicode-bidi: isolate;"><span aria-label="hashtag" class="_58cl _5afz" style="color: #4267b2; font-family: inherit; unicode-bidi: isolate;">#</span><span class="_58cm" style="font-family: inherit;">shilpa64</span></span></a> <a class="_58cn" data-ft="{"tn":"*N","type":104}" href="https://www.facebook.com/hashtag/iot?source=feed_text&story_id=1914592345232538" style="color: #365899; cursor: pointer; font-family: inherit; text-decoration-line: none;"><span class="_5afx" style="direction: ltr; font-family: inherit; unicode-bidi: isolate;"><span aria-label="hashtag" class="_58cl _5afz" style="color: #4267b2; font-family: inherit; unicode-bidi: isolate;">#</span><span class="_58cm" style="font-family: inherit;">IoT</span></span></a> <a class="_58cn" data-ft="{"tn":"*N","type":104}" href="https://www.facebook.com/hashtag/microbit?source=feed_text&story_id=1914592345232538" style="color: #365899; cursor: pointer; font-family: inherit; text-decoration-line: none;"><span class="_5afx" style="direction: ltr; font-family: inherit; unicode-bidi: isolate;"><span aria-label="hashtag" class="_58cl _5afz" style="color: #4267b2; font-family: inherit; unicode-bidi: isolate;">#</span><span class="_58cm" style="font-family: inherit;">microbit</span></span></a> <a class="_58cn" data-ft="{"tn":"*N","type":104}" href="https://www.facebook.com/hashtag/srilanka?source=feed_text&story_id=1914592345232538" style="color: #365899; cursor: pointer; font-family: inherit; text-decoration-line: none;"><span class="_5afx" style="direction: ltr; font-family: inherit; unicode-bidi: isolate;"><span aria-label="hashtag" class="_58cl _5afz" style="color: #4267b2; font-family: inherit; unicode-bidi: isolate;">#</span><span class="_58cm" style="font-family: inherit;">srilanka</span></span></a></div>
</div>
Niranjan Meegammanahttp://www.blogger.com/profile/03233425107844672492noreply@blogger.com0tag:blogger.com,1999:blog-8256035129192558896.post-21092253040002019762017-10-03T15:15:00.003-07:002017-10-03T15:15:35.459-07:00ශිල්ප සයුර AlgoHack + Google Cs-First සෑම පාසලකටම<iframe src="https://www.facebook.com/plugins/post.php?href=https%3A%2F%2Fwww.facebook.com%2Fniranjan.meegammana%2Fposts%2F1866477186710721&width=500" width="500" height="784" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true"></iframe>Niranjan Meegammanahttp://www.blogger.com/profile/03233425107844672492noreply@blogger.com0tag:blogger.com,1999:blog-8256035129192558896.post-21660971514500073892017-10-02T14:44:00.001-07:002017-10-02T14:44:53.517-07:00Internet of Things<iframe src="https://www.facebook.com/plugins/post.php?href=https%3A%2F%2Fwww.facebook.com%2Fniranjan.meegammana%2Fposts%2F1865550310136742&width=500" width="500" height="765" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true"></iframe>Niranjan Meegammanahttp://www.blogger.com/profile/03233425107844672492noreply@blogger.com0tag:blogger.com,1999:blog-8256035129192558896.post-71899031972693628282017-07-17T01:05:00.001-07:002017-07-17T01:05:22.815-07:00Micro:bit Game Programming<pre>Test it live online at makecode
<span id="docs-internal-guid-b1a60f3c-4f93-feda-c13d-a777052bad71"><a href="https://makecode.microbit.org/_Vcs0WxcD3Fyd" style="text-decoration-line: none;"><span style="color: #1155cc; font-family: Arial; font-size: 11pt; text-decoration-line: underline; vertical-align: baseline; white-space: pre-wrap;">https://makecode.microbit.org/_Vcs0WxcD3Fyd</span></a></span>
</pre>
<pre>//Niranjan Meegammana shilpasayura.org
let counter = 0
let x = 0
let y = 0
let pointsA = 0
let pointsB = 0
let playturn = 0
let mainplayer = 0
let Apos: number[] = []
let clrScreen = 0
let Bpos: number[] = []
let draws = 0
input.onButtonPressed(Button.A, () => {
if (clrScreen == 1) {
basic.clearScreen()
clrScreen = 0
}
drawApos()
})
input.onButtonPressed(Button.B, () => {
if (clrScreen == 1) {
basic.clearScreen()
clrScreen = 0
}
drawBpos()
})
draws = 0
mainplayer = Math.random(2)
playturn = mainplayer
pointsB = 0
pointsA = 0
y = 0
x = 0
counter = 0
Apos = [6]
Bpos = [6]
init()
playerSelect()
function playerSelect() {
basic.clearScreen()
clrScreen = 0
if (playturn == 0) {
leftArrow()
} else {
rightArrow()
}
clrScreen = 1
}
function init() {
counter = 0
pointsA = 0
pointsB = 0
draws = 0
clrScreen = 1
for (let i = 0; i < 3; i++) {
Apos[i] = 0
Apos[i + 3] = Math.random(4)
Bpos[i] = 4
Bpos[i + 3] = Math.random(4)
}
//basic.showNumber(Apos[4])
}
function eraseOld(ledPos: number[]) {
for (let k = 0; k < 3; k++) {
playTone()
x = ledPos[k] // old position
y = ledPos[k + 3]
led.unplot(x, y)
}
}
function drawCol(ledPos: number[]) {
// if ((mainplayer == 0) && (draws == 6)) {
// winner()
//}
//basic.showNumber(ledPos[4])
if (counter > 0) {
eraseOld(ledPos)
}
for (let k = 0; k < 3; k++) {
playTone()
if (playturn == 0) {
ledPos[k] = counter
}
else {
ledPos[k] = 4 - counter
}
ledPos[k + 3] = Math.random(4)
if (draws == 6) {
cut(ledPos[k], ledPos[k + 3])
}
else {
led.plot(ledPos[k], ledPos[k + 3])
}
}
return ledPos
}
function drawBpos() {
if (playturn == 0) {
return
}
draws++
Bpos = drawCol(Bpos)
playturn = 0
if (mainplayer == 0) {
counter++
}
if (draws == 6) {
winner()
}
}
function drawApos() {
if (playturn == 1) {
return
}
draws++
Apos = drawCol(Apos)
playturn = 1
if (mainplayer == 1) {
counter++
}
if (draws == 6) {
winner()
}
}
function cut(x: number, y: number) {
if (led.point(x, y)) {
playTone()
led.unplot(x, y)
if (playturn == 0) {
pointsA++
pointsB--
}
else {
pointsB++
pointsA--
}
}
else {
if (playturn == 0) {
pointsB++
pointsA--
}
else {
pointsA++
pointsB--
}
}
basic.pause(300)
led.plot(x, y)
playTone()
basic.pause(200)
}
function winner() {
counter = 0
basic.clearScreen()
if (pointsA > pointsB) {
basic.showString("A")
mainplayer = 1
}
else {
if (pointsA == pointsB) {
basic.showString("DRAW")
mainplayer = playturn
}
else {
basic.showString("B")
mainplayer = 0
}
}
playturn = mainplayer
pointsA = 0
pointsB = 0
counter = 0
draws = 0
basic.pause(1000)
playerSelect()
clrScreen = 1
}
function rightArrow() {
led.plot(4, 2)
led.plot(3, 1)
led.plot(3, 2)
led.plot(3, 3)
}
function leftArrow() {
led.plot(0, 2)
led.plot(1, 1)
led.plot(1, 2)
led.plot(1, 3)
}
function playTone() {
music.playTone(Math.random(1000), 30)
}
</pre>
Niranjan Meegammanahttp://www.blogger.com/profile/03233425107844672492noreply@blogger.com0tag:blogger.com,1999:blog-8256035129192558896.post-91621664012706893012016-12-03T02:07:00.000-08:002016-12-03T02:07:10.902-08:00A/L ICT e Learning Now Available<span style="background-color: white; color: #1d2129; font-family: Helvetica, Arial, sans-serif; white-space: pre-wrap;"><span style="font-size: x-large;">visit <a href="http://ict.shilpa64.lk/">http://ict.shilpa64.lk</a>
E Learning of ICT is easy.
</span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<span style="font-size: x-large;"><br /></span></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<span style="font-size: x-large;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0_1vw15w9FU4jVhOdrG92cQJGMXORGoSpx0hPbgkwJP2V0-rEWuBND7sgG_0BZr9inGqUERzic3WGew3g5kn4rm4n_5DoOGQIpuNzuqHmuBVxTUujltgy8YnXP7FklZ0zO4FdchBlmnnH/s1600/fb_ad.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="334" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0_1vw15w9FU4jVhOdrG92cQJGMXORGoSpx0hPbgkwJP2V0-rEWuBND7sgG_0BZr9inGqUERzic3WGew3g5kn4rm4n_5DoOGQIpuNzuqHmuBVxTUujltgy8YnXP7FklZ0zO4FdchBlmnnH/s640/fb_ad.jpg" width="640" /></a></span></div>
<span style="font-size: x-large;">
</span><br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyYqw-fgtH-QyGiIOIe0KjJIfVoGmhXHW0nAWnsf9SW_EuuMccfIlJ38yfegC4s875A9bjsNXbkU1t87qx-73A96w2FT7Pr7BNJJDshTbIY8QrA4cZbbY1UH0pIU1gvKLhpOODzgwl2yCj/s1600/fb_ad2.jpg" imageanchor="1" style="background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: xx-large; margin-left: 1em; margin-right: 1em; text-align: center; white-space: pre-wrap;"><img border="0" height="332" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyYqw-fgtH-QyGiIOIe0KjJIfVoGmhXHW0nAWnsf9SW_EuuMccfIlJ38yfegC4s875A9bjsNXbkU1t87qx-73A96w2FT7Pr7BNJJDshTbIY8QrA4cZbbY1UH0pIU1gvKLhpOODzgwl2yCj/s640/fb_ad2.jpg" width="640" /></a>Niranjan Meegammanahttp://www.blogger.com/profile/03233425107844672492noreply@blogger.com0