Tuesday, 19 July 2011

Conclusion

Looking at the title of this blog it shows the ending of a journey. A journey that began some months ago where I knew a tiny little bit about HTML and CSS and know I learned so much. Below I shall be highlighting some of my experiences. 

At first bloging each week I taught it is going to be a boring task but to my surprise I enjoyed bloging and to be honest I learned much more this way. Explaining your own material and small project is really helpful and putting up a blog had to make me fully understand what I was doing as if I didn't understand what was happening and doing I couldn't have bloged. 

This course helped me in every kind of way. We spoke about things related to web which are mostly in use now a days. We tackled HTML, CSS, PHP, Javascript, XML which I am sure that I will be needing them very shortly even for my final project of this year. At first I started a bit on a slow gear but then as time went on I started getting the grip on things better. 

When it came to second live it was fun and even in class we had a laugh however in my opinion I would have prefered spending those 4 weeks doing more PHP and javascript in more detail and taking things a bit slower as I think they are two really important languages that can develop something extraordinary with them. Probably I didn't find SL that interesting because I don't really see the use in it for know but if in the future it gets to people I will be one  of those that have some knowledge and knows what's happening. 

Our lecturer always made his utmost so that he doesn't deliver the material in a boring way and keep us very much interested with the lesson. Discussions where held during class where everyone had the opportunity to point out his point of views and everything was discussed.

That is it for me for now! 
Happpyyy Blogging everyone! =) 

Week 18 - Cloud Computing

Introduction
Cloud-Computing... A very interesting subject. Probably one that you are making use of without knowing! Cloud-Computing is making use of multiple servers on a digital network. The term cloud is used because the the cloud image represents the Internet or a kind of network environment. Instead of having messy data pipes, routers and servers there are now services. Google-Docs and Gmail is driven on cloud-computing. Also a good example of this is dropbox.The term private cloud-computing refers to having data at the tip of your fingertips and ready for use, having data which is transferable and can be instantly accessible. Cloud-computing can be based on mobile phones

Irrespective of what type of cloud it is either a private or a public it should have the following characteristics: 
  • Quickly to allocate and relieve resources when it is required by clients
  • A real-time backup should be offered to clients for maximum up time
  • Should satisfy users requests without involving clients with the management of the service

There are three types of cloud-computing Saas (Software as a Service), Paas (Platform as a Service) and Iaas (Infrastructure as a Service)
  • Saas - Having the software built by the service provider and configured by the end users depending on their needs.
  • Paas - This is a platform used for different purposes
  • Iaas - Infrastructure is offered on demand. Any required thing like spaces, expenses and personnel can be saved


Advantages of cloud computing
Pros can be divided into six main categories being:
  • Reduced Cost - Paid incrementally therefore saves organizations money
  • Increased Storage - Can store more data than on a private computer system
  • Highly Automated- IT people won't need to worry about keeping software up to date.
  • Flexibility - Offers much more flexibility
  • More Mobility - Information can be accessed from everywhere rather than from your own desk
  • Allows IT to shift focus - No need for server updates and other computing issues
Personally I think that you are not limited to one desk is the biggest advantage. Accessing your data from everywhere is a thumbs up. You would work comfortable if a good internet connection is provided however I doubt if bad connections still exist, if they do I don't think they will remain for long as connectivity is improving really fast and as it improves so does cloud computing. As mentioned in the introduction cloud computing can be done with mobile phones. You can have all your data in sync all day long. 

Security is another advantage. Cloud-computing are pretty much secure also real-time backup is offered which means less data loss. Cloud systems aren't as prone to hacks or DDoS attacks as other systems this is because people don't know about where the data is exactly. 

Using cloud computing won't require you to buy additional servers or any other peripherals so it will reduce hardware costs. 

Servers running inside a virtual machine can be stored in one image file containing the entire system configuration and settings. In case a server crashes, you don’t have to start from scratch to perform  re installation and reconfiguration. Simply take a copy of the saved image, restore data from last backup and the server will  be back up and running again.  In this manner time, effort and resources are saved.

Electricity Bills will be reduced as there will be no need to maintain a temperature room to cool down the server.

Replacing or upgrading a server specification can be easier to execute using cloud computing. If the parent server is overloaded and specifications are not sufficient anymore, we can easily upgrade the specification or move a virtual machine to another, more powerful server

Disadvantages of cloud computing
After mentioning the advantages some disadvantages are to be mentioned as most of the time where there are some advantages there is a disadvantage. 

The main disadvantage of cloud computing is that if the data centre crashes all the virtual machines will be affected. 
Backing up your data will obviously help in prevention of any data loss is that it requires a good and stabilized internet connection, if you don't have a good connection you can't expect it to give you good functionality
Another disadvantage is if having intruders targeting the parent server and hacking it. 

Conclusion
Cloud-computing should really keep advancing I think that it is great and the better internet connectivity gets the better it will be.  Probably people won't like the idea of having data accessible from anywhere as they might get the wrong ideas. Trusting your data might be a big issue but finding a good provider will do. 

Saturday, 16 July 2011

week 17 - Social Networking

Introduction
Social Networking is something big, huge, that made a big impact on our daily lives and makes a huge part of our daily routine. It is a place where you interact and meet people over the web. Social Networking  has the ability of interacting with people not only your friends but also people you don't know on-line, sharing with other people your details, date of birth, name, surname, age. This is a structure made of nodes tied together by interdependency like friendship, relationships, common interests, beliefs and more. 

Social Networking History
This goes way back in time round 1978 were BBS standing for Bulletin Board Systems were being used. These use to exchange data over phone line. Later in 1994 Geocities was founded, Geocities was the first social network sites to be created. 3 years later there was sixdegrees another type of social network that allows people to create their own profile and have friends just listed. In the 20th century different types of social networks were created.  Friendster which was created in 2002 was another social network which allow people to contact other members. It was also used for dating, discovering new events, bands and hobbies. This was mostly popular in South-east Asia. A year later there was Myspace and hi5 and the biggest change was in 2004 where Facebook was created. Originally Facebook was created by Harvard students, they used it so that Harvard college students could connect with each other. However this was expanded into other colleges in Boston area, Ivy League and Stanford University and added support for student to other universities and later to anyone who's age was above 13. Although as seen on several reports that are around 7.5 million who violated this term and accessed Facebook under the age of 13. In January 2009 this was ranked as the most used social network service. In the mean time twitter was launched and now that we are in 2011 Google+ will soon be open for public as it is still undergoing some tests.

I remember using IRC years ago. This was based on internet text messaging known as chatting designed for group communications each group was called a channel and if for example you wanted to join a chat with Maltese people you type #Malta. That was a different type of social network type. Modern social networks offer sharing of  pictures, videos, tagging other people and more. Nowadays I remember a few months ago there was a tremor in Malta I confirmed it by seeing people posting on Facebook. Things spread faster on Facebook then on local news.

Facebook 
As I said before Facebook was launched in 2004. As seen by latest statistics by 2011 around 750 million users are active on Facebook. Users first register an account. Users have to declare themselves as being older than 12 years old. Then they can set their personal account having a profile and add friends, exchange messages, tagging and much much more. Workplaces and collages can be organized and one can join that group.  Mark Zucherberg founded facebook together with his room-mates and some other computer students. Facebook recently also introduced video chat which is based on Skype technology. Video chat is only limited to a number of users but in the future it will be open for everyone.

In my opinion Facebook was what made an explosion to social networking.Seven years ago I use to make use of Hi5 but when I migrated my stuff Facebook around 4 years ago it was a huge impact and big difference. I remember there where days when I had to log on Facebook every single day. I also think that Facebook made a big hit because people are very nosey sometimes and want to know what's happening in everyday's people lives and with Facebook one can get to know what's happening as if someone went in a relationship people change their statues if they broke up its another statues change, if they are having a massive party they post it on their wall every single thing that they do, people post it on their wall. Nowadays companies, businesses and organization no matter the size are using Facebook as publicity and advertisement about their company.

Google +
A few months ago Google+ emerged. This is another social network that is already evolving amongst people. Till know already around 10Million users are G+ users. Google+ didn't automatically let anyone join in, people needed an invite to be able to join Google+ and it wasn't open for people all the time.  So each time Google+  opens a number of people join in.  Google+ is known for hangouts, sparks and Circles.
  1. Circles - These are like groups which allow you to group people according to your preferences. Like you can have a circle or friends, a circle of enemies, a circle or work mates and another one of families. Circles allow you to post things which can either be viewed by everyone or else you can specify the circle you want to share it with. A good example of this would be you are want to ask someone about a client at work and you share your question with only the work mates circle.
  2. Hangouts - This allows you to start a web-cam session with a particular circle. 10 persons at a time can join a hangout and when a particular person is talking that person will appear with a big camera.  You will need a Plug-in in before you start using hangouts. 
  3. Sparks - With sparks you can search about any interest that you like and share it with others. 
Conclusion
Social Networks evolved in an extreme way and they keep improving. I enjoy spending time on Google+ and Facebook however sometimes I do stop and think about certain issues like privacy. There are certain privacy settings that one can set. In my opinion people who exaggerate with postings and pictures are videos. Certain privacy is reduced as you never know in which hands your information will end. What if people want to use your picture for bad use or need your address for something? Therefore although social networking is fun it has the negative side of it. To contradict this issue however who doesn't want to risk privacy can opt to not have a profile. 

Sunday, 26 June 2011

Week 16 - Mobile Phones

Introduction 
This week's lesson was about mobile phone web development.In my opinion the word mobile phone has lost its original meaning as "mobile phone" is suppose to be gadget which allows a person to communicate with another person even being miles away and in different countries by the click of a button. Nowadays when people hear the word mobile phone what they mean is having in their hands the smallest gadget available, having internet connection, with a lot of applications, e-mails, facebook, games messaging, gps and any other possible feature. When mobile phones where introduced these were bigger in dimensions, probably having one in this century everyone would laugh. However people having those types of mobile phones in the past years where considered to be well off people or people having high positions at their work place.  Nowadays nearly everybody owns a mobile phone, some people even own more then on phone for instance they have two one which is for personal use and an other one for work. Also since they always want to improve quality and technology now there are dual-sim phones (phones having two sim cards)

Technology is making a point that everything will advance and be of better usage. Mobile phones now incorporated web development, making phones able to have different applications. To make good usage of websites on phones you need to have a website that is supported on phones and is easy to use without letting the user scroll to much. Applications are being made with java, javascript and also C. There are different types of mobile phones each having different brands and running different systems. Several types of phones are Apple, Nokia, Samsung, Sony Ericson, BlackBerry, Motorola, LG, HTC and many more. Also there are different type of browsers like focus, cursor, touch and multitouch browsers.

Below are certain platforms that smartphones can run on.

Microsoft - Certain phones that used this platform are Nokia, Motorola, Samsung and LG. People can now also have windows on their phone not only on their PC.

Apple - Used buy Iphones, which now a days is pretty much popular.

Android - HTC, Samsung, Sony Ericsson. Android is competing with Apple. Personally I used both Iphones and Android and for my tastes androids are on a higher scale at the moment. Android are open source.

The above platforms all use different browsers like Opera, Firefox, Android, Mozilla Firefox and others.

Coursework
This week's coursework is about an application that had to be created on a smartphone which is the geographic location. I will be doing this test on an android system.  The geolocation is a web application that one can access from his phone in order to determine his or her geographical location using longitude and latitude . Using this application will help you out where ever you are in the word. Getting lost when you are abroad is no longer an option! Below is the code that was used for the geolocation.

For starters i downloaded a mobile emulator from http://www.opera.com/developer/tools/mobile/ which allows you to test and preview web sites from your computer as if you are viewing them from your smartphone. When this application opens up, you have some settings which you can set according to your likings. You can set the profile to what phone you want and if the phone you will be using is not in the list you can edit using the custom button.



Below is the code used for the geolocation. 

1.  <html>
2.  <head>
3.    <title>Geolocation</title>
4.  </head>
5.  <body>
6.  <script type="text/javascript">
7.  navigator.geolocation.getCurrentPosition(userLocated, 8. locationError)
9.  function userLocated(position){
10.
11.    var lat = position.coords.latitude;
12.    var long = position.coords.longitude;
13.    var timeOfLocation = position.timestamp;
14.    document.write(lat + "<br/>");      
15.    document.write(long + "<br/>");
16.    document.write(timeOfLocation);
17.  
18.  }
19.  function locationError(error){
20.    alert(error.code);
21.  }
22.  </script>
23.  </body>
24.  </html>



Two important functions are seen here shown on line7:

userLocated() function - This function is used so that the current position of where the person currently is can be achieved.
locationError() function - This function is only used when there is an error. There will be an alert that there is an error
Then on lines 11 to 13 the variables are being declared for longitude, latitude and timestamp while lines 14 - 16 are being displayed.

At first when trying to make this attempt it failed. As on my phone I wasn't seeing anything but then I realized it was only because I didnt have any thing being displayed. Then I used the document.write and the longitude and latitude were displayed as shown below.


Conclusion
Mobile development is a huge improvement seeing a huge amount of people that cannot live without their mobile phone is a huge impact. When a few years back this never crossed peoples mind or people taught that most things we have today are impossible. I do sometimes think how would my life be without all this technology  and gadgets and did gadgets affect my life and others around me? The most obvious answer is yes it did. And another question that we would all have to wait for an answer is, How is the future of mobile technology going to evolve.

Monday, 20 June 2011

Week 15 - HTML5, CSS3, Advanced Javascript

Overall Introduction
From this week onwards lessons will be held on any technology of our choice as long as it is useful to us students and that we can gain from. Since technology is evolving and changing by the days it is very important to keep up with them, if you want to always keep up with new technology. 
Introduction of HTML5
The word HTML as we have seen in previous blogs stands for Hyper Text Markup Language, which is a programming language used for developing websites. HTML4, the one we are most familiar with was standardized in 1997. Since technology is improving everyday now we have HTML5 which is a new generation, a more enhanced, a fifth generation of the original language which was introduced in 1990.  HTML has been going on for a long time however HTML4 was now lacking on certain things as it struggled when it came to keep up with certain add-ons like Microsoft Silverlight and Adobe Flash therefore it needed room for improvement and that's  where HTML5 came in handy.  HTML5 started out the when Hypertext Application Technology Working Group and the W3C decided to move forward together to boost up technology as in fact happened. Browsers have to be update to adopt these new enhancements.For users to get these improvments one has to be updated with new releases to adopt these new standards although by updating browsers is not enough as users using old versions of browsers have to be willing to upgrade newer versions of browsers. 

Interesting sites
Two very interesting and useful sites are the following: http://html5test.com/ - From this site one can check how well HTML5 is supported on the browser you are using. For example Google Chrome scored 291 points and you can see which specifications scored least and most. Internet Explorer on the other hand scored only 32 points out of 400 which is really bad. Another useful  site is http://www.findmebyip.com/litmus/ this is a browser compatibility guide.


New Elements
As improvement HTML5 introduced several new elements which will help and will make life easier for developers when coding. These are some of the new elements which are added more elements can be found on http://www.w3schools.com/html5/html5_new_elements.asp





For starters the new doctype for HTML5 is <!DOCTYPE html> you will need this if you want to make use of HTML5, with this snippet of code one will be able to make use of XHTML or HTML in strict mode. Going down to the head section, this has been simplified for instance the <meta> tag has been improved.  Following is the body section this is where most changes have been made. The best thing is that one won't need to nest several div tags to create a good website layout. HTML5 came along with better elements like the <header> and the <nav> element. On the left is an image which will be an output of how HTML use to be used while below is an image of what one would get as a result when using HTML5. Personally I think that the HTML5 makes work more organised and easier to understand. As when I use to code using HTML4 it use to be time consuming till I got the hang of which tag is which. At least know you have the <nav> which can be used for menus the header for banners and titles and the <footer> for footer and copyrights. 
Drawing with HTML5
One can create different things with the draw feature like animations, charts and graphs, simple diagrams and more.To draw with HTML5 you need to use a canvas.  One can use rectangles and arcs as well as paths and line drawing and quadratic curves also you can give shapes certain effects like; fillings and strokes, applying shadows, gradients and transparency. You can also rotate the image and scale it. To do these things you need what's called a canvas and to use a canvas you need two specific things,  the most important is the <canvas> tag, in which you will be placing drawings within them and also javascript to do the drawing. Below is an example of how one can create a smiley face.


1.<script type="text/javascript"
2.   window.onload = function() {
3. var drawingCanvas = 4.document.getElementById('myDrawing');
5.    if(drawingCanvas && drawingCanvas.getContext){
6.    var context = drawingCanvas.getContext('2d');

7.  context.strokeStyle = "#FFFFFF";
8.  context.fillStyle = "#800040";
9.  context.arc(100,100,50,0,Math.PI*2,true);
10. context.closePath();
11. context.stroke();
12. context.fill();

   

Above is part of the javascript which creates the smiley face this section create a big outline circle. The rest of the code to create the complete smiley face is pretty much similar. Then in the body section goes the canvas tag as following:

<body>
<canvas id="myDrawing" width="200" height="200">
<p>Your browser doesn't support canvas.</p>
</canvas>
<h1>This is a canvas test</h1>
</body>
</html>


Forms
In forms some new tags where added which some of them can be seen above like the speech tag and the telephone together with the date tags. The first after the name and surname tag is the  telephon. The type for telephone is tel. The date tag can have a minimum date and a maximum date and the user can select by clicking on the up and down arrows any date he wants. The best improvement for forms in my opinion is the speech recognition function. The x-webkit-speech can be used with text, numbers tel and search but cannot be used on textarea fields. Below is an example of a form I did using a few of the new elements.


1. <label>Telephone</label>
2.    <input class="mystyle" name="telephone" type="tel" 3.    size="20">
4.  
5.    <label>Date</label>
7.    <input type="date" min="1990-12-12" max="2011-12- 8.    12" value="2011-06-16"/>
9.    
10.    <label>Speak</label>
12.    <input type="text" x-webkit-speech />




CSS3
The major difference with CSS3 from CSS2 is the CSS3 introduced modules, modules allow specifications to be completed and approved faster as they are completed in chunks. Selectors are a new functionality in CSS3. Examples of new selectors:
  • Matching on attributes and attribute values, including partial matches
  • Structrual pseudo-classes like nth class
  • A target pseudo-class to style only elements that are targeted in the URL
Selectors are already known and supported by a lot of browsers therefore one can already start using them.
Another improvement can be seen in text effects and layouts where one can make changes to justification of text in documents and whitespace. Also CSS can handle more media like running headers and footers which will also include advanced properties for printing generated content like footnote and cross-reference properties. Designers can also make multiple use of columns by using column-gap, column-count and column-width.

CSS Borders 
Borders included a new feature being the border-radius property, this allows to make use of round corners easily without needed corner images or multiple div tags. To make a rounded corner there are two ways either. First one is using four individual properties border-bottom-left-radius, border-top left-radius, border-bottom-right-radius and border-top-left-radius, this will accept either one value or else two values. When two values are used the first value defines horizontally and the second vertically . Else you can use one command, border-radius. This is a screen shot of some of the corners that I tried doing.




#newStyle{
height: 65px;
width:160px;
-moz-border-radius-bottomright: 50px;
border-bottom-right-radius: 50px;
background:#82C0FF;
margin-bottom: 10px;
}
#newStyle2{
height: 7em;
width: 15em;
-moz-border-radius: 2em 5em 2em 5em;
border-radius: 2em 5em 2em 5em;
background:#82C0FF;
margin-bottom: 10px;
}
#newStyle3{
height: 70px;
width: 70px;
-moz-border-radius: 35px;
border-radius: 35px;
background-color:#990033;
margin-bottom: 10px;
}


Resizing a box
Another new feature is the box resize. This will allow users to re-size a box. To be able to do it you need to user the resize and overflow properties.


div id="size"
{
border:5px solid;
border-color:#990033;
padding:10px 40px; 
width:100px;
resize:both;
overflow:auto;
}

Both these image are the same box simply it was just resized. On one of the corners there is an icon you simply click and drag and the box will be resized.

 




Other new things in CSS3 are text effects, like shadowing and keyframes. Keyframes are animations example having a box which changes colours.  Shadowing is done using the text-shadow: 3px 1px 1px #990033; This will cause a text-shadowing effect which will have a pinkish colour. Another new feature is the word-wrap this allows long words to be broken and wrap onto the next line. This takes two values; normal or break-word
Keyframes in my opinion are very interesting. For this I created two boxes with CSS and then one box which will be moving. As HTML I used 2 divs. <div class="box1"> <p>This is box 1</p></div><div class="box2"><p>This is box 2</p></div>. Then created the CSS


1.  .box1{
2.  width:100px;
3.  height:100px;
4.  background-color:#004080;
5.  position:absolute;
6.  top:100px;
7.  left:50%;
8.  margin-left:-100px;
9.  }
10.
11  .box2{
12.  width:100px;
13.  height:100px;
14.  background-color:#800040;
15.  position:absolute;
16.  top:100px;
17.  left:90%;
18.  margin-left:-100px;
19.  }
20.  @-webkit-keyframes BoxMotion{
21.  0%{left:90%;}
22.  50%{left:10%;}
23.  100%{left:90%;}
24.  }
25. .box2{
26.  -webkit-animation:BoxMotion 10s infinite;
27.  }
From line 1-9 the first box is being created giving it the dimensions, selecting a colour and specifying the position. From line 11-19 is the other box being created having the same features and properties as the previous box. Line 20-24 is setting up the keyframes. BoxMotion is the name of the animation. From lines 25-27 is where the fun part is. This is making one box move. 10s is the speed you want to apply to the moving box, if for instance you set it to 5s it will go faster. Infinite is there so that the animation will keep going on and won't stop.


Two boxes pink box is moving to the right

Two boxes moving pink box went on purple box
JavaScript
Like HTML5 and CSS3, Javascript also added some new features some of them are Web storage, Web SQL storage, offline application cache, web workers and web sockets.
Web SQL storage
This is also known as DOM storage and offers improvement in cookies. This offers great storage capacity of 5MB. Data stored in a data stored does not expire and can span across several windows. There are two types of data storages session sessionStorage and local storage localStorage. Both are used for different purposes sessionStorage is used when you want data to be stored only for one particular session while localStorage is used to store data for more than one single session, when the browser is closed and is re-opened the sessions will remain there. Both of these implement the storage interface.
Methods and properties:
  • length - Gets the number of key/value pairs in the list
  • key (index) - Returns the key at the given index
  • getItem(key)- Returns the key associated with the given key
  • remomeItem(key) - Removes the item
  • clear()- removes all keys
Web SQL storage
This is used for accessing databases directly from javascript. One can now create a table, create a new record update and delete the record and also deleting tables. Below are some examples of how can this be done. Client-side database storage can be used.

Conclusion
With all these improvements and new features one can immediately notice a sign of relief as things have been simplified in the terms that now developers are more flexible with what can be done and achieved. Even thoughHTML5 is not fully released yet one can already notice the difference and once it is released there will be a big difference. CSS really made things easier. I remember doing the keyframes using flash and then loading up the flash animation into the website. With keyframes the size of the file will also help in having smaller sized website.


References: 

Thursday, 16 June 2011

Week 14 - More Second Life

Introduction
As we went further in with LSL, one can see that practically you can script anything, any prime in Second Life. This week we went into some more interesting worlds two of which were really amazing when you see how far Second Life can go.

Worlds
The first world was lost in bass, in this world as you enter you can tell your avatar to dance. There is a screen saying "touch to dance" and you avatar will start dancing. This was really an interesting place and also an interesting thing. In that world you don't need to worry that you don't know how to dance as everyone can dance! 
The other world we teleported into had really amazing light effects, like having a window and using a texture they made it look like sunraise are coming in. Also there was a really nice fireplace with fire. 
Objects
Last week I build an object that when you touch it, it sends a mail to specified address. This week I build a simple object where when it is touched you are directed to a specified site. To do so I had to use a new function called llLoadURL as shown in the below example.

 llLoadURL(llDetectedKey(0), "Let's Go!", "http://http://www.cynthiaduca.blogspot.com/");

This will prompt the user and offer him to visit the specified website. The specified URL must contain a protocol. Only two protocols can be used either HTTP:// or HTTPS:// other protocols like FTL and telnet won't work. This will only work if the object is not on mute if it is on mute the offer won't to visit the site won't be received. 

Offering the user to visit my blog.
default
{
    touch_start(integer total_number)
    {
        llLoadURL(llDetectedKey(0), "Let's Go!", "http://http://www.cynthiaduca.blogspot.com/");
   
   }
}

Notecards
Notecards can contain anything within them like text or else can have embedded objects like snapshots, textures and also other notecards. Any items in which you are going to embed in the notecard you need to edit their permissions and edit copy, modify and transfer. Notecards are found in the notecard folder. A notecard can have a default value of 65,536 bytes.

Functions of notecard
  • llGetNotecardLine - Pull out information from a notecard
  • llGetNumberOfNotecardLines - Returns number of lines in the notecard name 
  • llGiveInventory - Notecard contents are displayed and allows the user to keep or discard the notecard
Creating a new notecard
To create a new notecard right click on any folder in the inventory, preferably the notecard folder and select new notecard. Enter the text you want in the notecard and save it. To access the notecard you have to look for it in the inventory.  To put an image or a landmark on the notecard simply go to where the image or landmark are found in the inventory and drag it into the open notecard. Anything you want to put in the notecard simply is to drag it onto it. 
Creating a new notecard


Above are the screen shots of the steps taken to create the notecard and then the notecard was saved as schoolExercise.


Conclusion
From next week we will be discussing new topics which are more in use nowadays. We all agreed to start with some HTML5 and more javascript. After these few lessons on Second Life, I personally think that it was good learning some Linden Script because if second life can continue to evolve more one day we will be in need of LSL, but for now I don't think that second life made a huge impact. Although when you go in certain worlds one can immediately notice the amount of dedication needed by these people to put up together with certain ideas and work. In the future I think that LSL will be use and if improved further it will be of a success. Some improvements which I think are in need are that objects are too difficult, fussy and too much time consuming to build them and also requirements for internet speeds and connections really make a difference.

References:

Wednesday, 15 June 2011

Week 13 - More Linden Scripting Language

Introduction
Last week we started going into some Linden Scripting by doing some basic scripts this week we went in more detail and tried some more complex scripts.
First of I tried experimenting with a script that is found in the course material, where by clicking a prime your avatar can teleport.
To start with I started getting familiar with some different commands that are more complex and will be needed for this exercise.
Functions
Some of these functions where used to make the teleport successful. Vector DEST = <x,y,z>; was also used to select the coordinates to where  I wanted to teleport the avatar to. I tried changing a bit these coordinates to see where my avatar will end. I also came along another new function begin changed_link this occurs when duplicating a linked object or when a prime in an object chages its types of shape. The event doesn’t happen when the object is attached or detached.
Strings
I started going into a lot of different worlds where I saw that they had some sort of writings on them showing. Therefore I tried doing it and I managed. First I declared a variable of type string and also what colour I was going to use. Deceleration was done as following: string message = "This is Cynthia's Prim";
Once those where declared I used llSetText(message, color, alpha);. This was quite an easy job.  After this I passed to something more complex. You can display different text you can also display the description of the text by using  llSetText(llGetObjectDesc(),<1,0,1>,1);   or else displaying the object name using llSetText(llGetObjectName(),<1,1,0>,1);   llGetObjectDesc and llGetObjectName will automatically get this information from the general section in the build panel.
Another testing prime
E-mail
Next I built an object and made this object send e-mails. llEmail is a function used to send an e-mail you can attach the address, a subject and a message by first declaring them as: email (String time,string address,string subject,string message, integer num_left). This is triggered when a request by llGetNextEmail() is answered. Email’s time, sender’s address, subject, the message and number of emails queued are returned. Time is a Unix timestamp. The message can have a maximum of 1000 characters. 
Message format

You can also remove the  headers which are attached to the beginning of the message by making use of this line:

message = llDeleteSubString (message, 0, llSubStringindex(message,"\n\n")+1);


The object I created was a wall. I used different things things time instead of giving the object a colour I used textures and gave it a brick texture to make it seem like a real wall. Also I used the hallow which makes a kind of "whole" in the middle of the wall. Like this it makes it look like a wall with a window.

  
Next what I did was that when the avatar clicks on the object and touches it a mail will be sent. First I started with an easy example as shown below:

0. string email_address = "";
1.
2.  default
3.  {
4.     state_entry()
5.     {
6.         llSay(0, "Hello, Avatar!");
7.     }
8.
9.     touch_start(integer total_number)
10.    {
11.        llSay(0, "I sent an Email");
12.        llEmail( email_address, "Look it's an email 13.subject line!", "Testing 1 2 3" );
14.    }
15. }


Above is the default code where I simply added the email_address variable on top and added the llEmail function. Which the subject is "Look it's an email subject line" and the message is "Testing 1,2,3". Below is a more complex example.
1. string email_address = "myemail@xyz.com";
2.
3. default
4. {
5.     state_entry() {
6.
7.      
8.        llEmail( email_address, "Look it's an email 9.subject line!", "Testing 1 2 3" );
10.    }
11.
12.    touch_start( integer num_detected )
13.    {
14.         integer i = 0;
15.         do
16.            llEmail( email_address, "No touching!", 17. "My owner is: " + llDetectedName(i) + "\nKey: " +  18. (string) llDetectedKey(i) );
19.        while(++i < num_detected);
20.   }
21.  }


Above is the code. First you start off by declaring a variable as a string which contains the e-mail address to which the e-mail is going to be sent, for the object while testing I used my personal e-mail address. In the state_entry, anything under the state_entry will be done every time the script starts running once unless you reset the script. Then it goes down and finds the first function in which this case is the llEmail. When it reads the function it reads the sting. In the touch_state, an e-mail will be sent showing by whom the object was touched. In the e-mail there will be details. llDetectedName will show  by whom the object is created, while llDetectedKey gives you the key. Below are some screenshots of the received e-mail and also the message it contained. 
E-mail received
This shows that the e-mail has arrived and is found in my inbox, junk section. Although at first I taught that it wasn't working properly since no e-mails where arriving in my inbox but then I found all the e-mails in the junk section. 
Above is the e-mail message showing the details. The object name is defined by the creator who created the object inn the build section and can be anything.  The region is where the object is found at the moment when the prim was touched to send the e-mail while the local position is the coordinates of where the object is found. 

Conclusion
This week was another improvement towards Second Life, while working with prims and other building objects I continued touring around different worlds and continued getting more astonished as how many things can be done. Like waterfalls can be scripted and scripting the effect of a waterfall by setting a texture and rotating it will make it seem like water is flowing. Also at different worlds that there are. At first I can say that I really taught that SL wasn't that useful but getting to know it better I think it can be quite a success, being on your computer and chatting while sending gestures and doing as many things as possible can be quite a socializing event.


References:
http://lslwiki.net/lslwiki/wakka.php?wakka=llemail