Monday, January 27, 2020

Friend Recommendation System Software Design

Friend Recommendation System Software Design CHAPTER 4 SOFTWARE DESIGN DESCRIPTION 4.1Â  INTRODUCTION The Software Design Document provides transcript which will be used to aid in the software development phase of this project by providing the details for how the software should be built. Within the Software Design Document are narrative and graphical documentation of the software design for the project including use case models, sequence diagrams, object behaviour models, and other supporting requirement information. The requirements in SRS will be fully addressed in this software design document or alternative solution should be given. 4.2Â  DESIGN OVERVIEW The purpose of this software design document is to provide insight into the structure and design of each component in the Friend recommendation system. Topics covered include the following: Class hierarchies and interactions Data flow and design (DFD) User interface design Test cases and expected results In short, this document is meant to equip the reader with a solid understanding of the inner workings of the Friend recommendation system. The modules, as can be perceived from figure [ ], are as follows: Collect_Data_From_Sensors Data Collection Data preprocessing Activity Recognition Friend-matching graph construction Friend query and Feedback control These modules will be described in detail in the next section on System Design. 4.3Â  SYSTEM DESIGN This section provides a modular structure of the proposed system and explains each subsystem along with the relationships between the subsystems and the interfaces between the modules. Figure 4.1: The Architecture Diagram 4.4Â  DESIGN CONSTRAINTS: The server should be multithreaded. The Android application at the client side should have a retry mechanism to connect to server. Software System Attributes Usability : The software will be embedded in a website. It should be scalable designed to be easily adopted by a system. Reliability : The system should have accurate results and fast response to user’s changing habits. Security : The system uses GPS location information to find friends within some distance. In order to provide privacy, a region surrounding the accurate location will be uploaded to the system. 4.5Â  MODULE STRUCTURE The below is the structure of modules: Username/password User’s Credentials User Data User Data Query for Processed data Friends Send FeedbackFriend ListFriend List Figure 4.2 : The Module design 4.4.1 DESCRIPTION OF MODULES This section describes each of the above modules in brief. Module: LoginOrRegister This module contains login or registration in order to register the user with Friendbook application. If the user has already registered, then he/she can directly login and start using the application. If he/she is not registered then he/she has to register with friendbook application. Module: Authenticate Users This module compares the entered Username and Password with the respective records among the database entries. If a match is found, then redirects the user to his/her profile page. Else, an appropriate message is thrown and the user is redirected to the registration page. For registration, compares the Username entered with the ones in the database to check its availability. If unavailable, then asks for a different Username, else create a new record in the database and save the entered details. Redirects the user to his/her profile page on registration with appropriate message, if the Username is not already present. If the Username entered during registration is not unique, then an appropriate message is thrown. Name and Usernames should start with an alphabet and Password should contain at least one alphabet and one numeric character and one special character. Module: Collect_Data_From_Sensors Smartphone (e.g., iPhone or Android-based smartphones) are equipped with a rich set of embedded sensors, such as GPS, accelerometer, microphone, gyroscope, and camera. On the client side, each smartphone records data of its user from the sensors such as accelerometer, and GPS information. This collected data is further sent to the server for further processing. Module: Data Collection and Pre-processing This module collects the data sent from the client side. The raw data collected will be in format {time ,latitude ,longitude ,accx ,accy ,accz }. The collected raw data is further pre processed to remove outliers. Median filtering technique is used for outlier detection and removal. An unsupervised learning technique is applied on the preprocessed data to form clusters known as Kmeans clustering algorithm. The resulting clusters forms a list of activities carried out by a user, where each cluster representing an activity. Module: Activity Recognition Now that the k clusters are formed, each represents an activity, lifestyles are further extracted from these activities using LDA algorithm. A library called LAML is used*. It provides a convenient API to get topic structures for an array of input strings.The extracted lifestyles are used to find the similarities between the users. Once the similarity is calculated, the user who has highest similarity is suggested as a friend. Module: User Query and Feedback Control This module performs two tasks, it accepts and responds to user queries (eg, query for friend list) and collects feedback from users in order to improve the accuracy of the friend recommendation system. 4.6Â  INTERFACE DESCRIPTION: The following is the list of external interfaces: SOCIAL NETWORK PORTAL: A portal where the users can do registration by entering their details and also provide a feedback on the recommendations to improve the accuracy of the system. It is implemented using JSP and HTML. MOBILE INTERFACE: It continually sends the daily activities to the server via network using TCP connection. The daily activities are characterized by walking, sitting and GPS location. RECOMMENDATION SYSTEM : This is the interface in which the friend recommender algorithm works in the background. This interface will be used by the users. Customer cannot do many operations, but their feedbacks or ratings are very important to create a relevant recommendation. End users can only provide feedback and view recommendations. HARDWARE INTERFACES : The recommendation system can work on any smartphone device. These devices should have some limit requirements to make the application run effectively. The processor speed and internet speed are expected to be high. SOFTWARE INTERFACES: This system can work on any platform. Internet connection is a must to reach the system. Moreover, most of the application will be coded by Java. Java APIs of database management tools such as Netbeans, which is a standalone workbench application to interact with database management tools. 4.6.1 Use Case Diagrams And Key Features A use case diagram is a kind of behavioral design, which is constructed from an analysis. It presents a graphical synopsis of the capabilities provided by a system in terms of actors, aims and dependencies between use cases. Friend book user can perform following activities: Install the application in their mobiles Login/Register with the application View the list of most similar friends Upload feedback for improving accuracy of the system. The Use Case diagram in Figure 4.3, shows the different functionalities a friendbook user can perform. Figure 4.3 : Friendbook User Use Case The System can perform following activities: Collect raw data from users Pre-process the data Perform Activity Recognition and extract the lifestyles using LDA Find the list of friends based on similarity between users Handle Feedback Figure 4.4 : The Server Part Use Case 4.8Â  Class Diagram Top Level Client-Side Class Diagram: The client side class diagram, mainly consists of UI(user interface) required for a user to register with the application by providing user’s information, after which user will be able to login and start the service. Once the application starts, it continually records the values from sensors in the format: The above values are to the server at regular intervals (say 3secs). In order to send the values to server a TCP connection is setup. Once the connection is setup, the device will start sending the data. The users can also provide a feedback on the recommendation results given to them. Top Level Server-Side Class Diagram: The server-side class diagram, consists of classes that are executed in a sequential manner. Firstly, ActivityClustering class collects the data sent from the android device, and pre-processes it using median filtering technique. After the data is filtered, the processed data is then partitioned into k clusters using k-means algorithm. Next, a class known as ConvertToActivitySeq is invoked, which maps the activities to cluster they are close to and produces a list containing sequence of activities i.e,. the life document. This document is further given as an input to LifeStylemodelling class, which computes p(word/document) i.e, it calculates probability of word given the document matrix. This matrix is then decomposed to produce two matrices, called p(word/lifestyle) and p(lifestyle/document). Finally, p(lifestyle/document) matrix is used to calculate the similarities of the lifestyles between users. 4.8Â  DATA FLOW DIAGRAM The data flow diagrams are pictorial representation of data flowing in the system. DFD’s are used for the purpose of viewing the data processing in the system. In a data flow diagram, the data elements flow from external or an internal data source, through an internal process. Level 0 Data Flow Diagram A level 0 DFD or a context level design represents the intercommunication between the system and external sources, which act as data sinks. In Level 0 DFD, the interaction between the system and external entity are designed in terms of data flows across the system boundaries. This level diagram shows the complete system as a single procedure. In the DFD diagram shown in Fig*, the lifestyle information are the sensor values sent from the client i.e., android phone to the server. The data sent from client are processed to produce a list of potential friends. Figure 4.* : Level 0 DFD of Lifestyle based friend recommender Level 1 Data Flow Diagram The level 1 DFD, exhibits how the system is split into sub components, where each component represents one or more data flows to or from an external source. And when combined, it provides the complete functionality of the system as a whole. It represents the inter components data flows in a specific sequence and also the data flow between the components of the system. The proposed application consists of the components as shown in the figure 5.*. It first performs data collection, raw data pre-processing by noise removal, Activity recognition where each cluster represents an activity and finally calculates similaties between users to suggest a friend. Figure 5.* : Level 1 DFD of Lifestyle based friend recommender 4.9Â  OBJECTS AND ACTIONS (SEQUENCE DIAGRAM) The sequence diagrams shows below. Sequence for Setup Connection: This sequence is to set up FOR TCP connection between user and the server. Also monitors GPS and Accelerometer by collecting the data from them. Sequence for Monitor Result to the server: The raw data, that is sent from the client is collected by server. And the collected raw data is pre-processed for outlier removal. Sequence for Finding Friends: When the user queries for the friend list, the server accepts the request from the client and responds by sending the potential list of friends. Sequence for Data Collection: The data collection module collects life documents from users’ smartphones. The life document is collection of users activities. The life styles of users are extracted by the life style analysis module with the probabilistic topic model(by using a library for LDA ). Then the life style indexing module puts the life styles of users into the database in the format of (life- style, user) instead of (user, life-style). As the packet arrives , these packet will be store in files. Sequence for Preprocessing: The user sends data, and preprocesses to make the data consistent, by remove irrelevant data.The preprocessed data is converted into archive and upload to the database. Sequence for Database Connection: Data base connection is established when a friend request query is posed. A TCP connection will be established between user and server. Server will process this request and respond with the extracted information from the database i.e, the list of potential friends. 4.10Â  PSEUDO CODE MOBILE END: SERVER SIDE PSEUDO CODE:

Sunday, January 19, 2020

Hadyn Middletons The Lie of the Land - The Next Blockbuster Movie? :: Hadyn Middleton The Lie of the Land

Hadyn Middleton's The Lie of the Land - The Next Blockbuster Movie? The idea of turning Hadyn Middleton's The Lie of the Land into a film sounds quite exciting. I can just picture the television commercials airing clips from the movie after every sitcom and T.V. show, and posters and billboards mounted high atop tall buildings on Sunset Boulevard in Hollywood and even New York. Perhaps The Lie of the Land can be the next blockbuster movie! Just imagine, with an all star cast and a high budget set, this film can have great potential. Our leading man, David Nennius, can be played by none other than the handsome Keanu Reeves and his leading lady, Melissa, can be played by the beautiful half African American and half Caucasian, Halle Berry. The rest of the cast can include Elizabeth Hurley as David's pitiful mother, Mary, Cameron Diaz as Rachel, Robert Downey Jr. as her husband Matthew, Hugh Grant as Quinn, and special appearances by Richard Gere as William Meredith and Bruce Willis as Alasdair (Ally). Of course, we would need about ten to fifteen more extras to fill the roles of characters like Art, Grace, Emrys, David's anonymous father, and the man who gets brutally killed by David. This contemporary film of the nineties can be a thriller especially for young adult movie goers, but can be viewed by all 17 and over persons for it must be rated R due to some profanity and explicit sexual scenes in the film. Lots of loud pop/rap/alternative music and vibrant colors can add much flavor and pizazz to this flick. Action, drama, murder, mystery, sex, and much more can really jazz up this film. The setting would be in England of course and it would include buildings, city streets, cars, and the night life. Certainly, the costs of making this film would be expensive due to the all star cast and the location it will be filmed in. But wouldn't it be worth it if it becomes a big hit? Being directed by Quentin Terrintino and all? Furthermore, unlike the novel, the film will start with Elizabeth Hurley (i.e. Mary) getting seduced by this mysterious man and then giving birth to our main character, David. Then the film will progress as it does in the book, but the ending of the film will be the beginning of the novel. The movie would have not much differences from the novel, but I figure that a heated scene in the beginning of the movie will open many eyes immediately,and naturally viewers would be interested to keep their eyes open throughout the film to see what's next.

Saturday, January 11, 2020

Expectation as a Malaysia Living in a Multi-Cultured Society Essay

Malaysia with a population of 28.3 millions (Department of Statistics Malaysia, 2010) is pluralistic and multicultural. The three main ethnic groups constituting the Malays and Bumiputera (67.4%), Chinese (24.6%), Indians (7.3%) have their own unique culture and heritage, such as language, belief system, tradition and religion. The lifestyle patterns of the different groups have direct links to the differences in their values and expectations(Syed Serajul Islam, 2008). Since achieving independence fifty-five years ago, Malaysia has undergone economic transformation in terms of diversification of its agriculturein the 1960s to manufacturing in the 1970s-1980s, and then to technology-based development since the 1990s. These achievements came as a result of the ability of Malaysians, diverse in their culture, to tolerate, and to live and work together in realising the country’s overall goals of growth and prosperity. But then as pointed out by Musa Hitam (2007), nation-building is not just about providing highways, byways and hospitals. It is also about weaving together national values for the citizenry to live by and devising greater missions to galvanize their camaraderie and spirit. Such a vision of weaving together national values is still far from the set goal. For Malaysia up to the present day, except for the 1969 race riot between the Malays and the Chinese, and the 2001 clashes between the Malays and the Indians, race relations have been peaceful unlike what had been experienced in countries with mixed populations such as Nigeria, Rwanda, Bosnia, Thailand, Sudan, and India (Zaid, 2007).The basis for conflict between the ethnic groups stems from identity contestation in the form of language and culture (Shamsul, 2006). In the 1970s, the Malays advocated that the core of the national culture should be that of the Malay. This assimilative approach was unkindly viewed by the Chinese and the Indians. Relationships between the ethnic groups are rather complex, intricate and sensitive, especially when dealing with matters of religion, culture and language. These features are important in identity contestation, a phenomenon created by the British in the context of colonial knowledge and its investigative modalities (Shamsul, 2006). According to Shamsul, it is through the colonial practice of codifying, documenting and representing the social, cultural, economic  and political state in history that modern identities in Malaysia like Malay/Malayness, Chinese/Chineseness and Indian/Indianess have emerged, consolidated and fortified. Realizing the danger of creating distrust among the ethnic groups the government had rescinded the assimilation strategy and sought the policy based on the multicultural model. My expectation as a Malaysian living in the multi-cultured society is every Malaysia residents respect, unite and tolerance with each other although we are different ethnic and having a different cultural background. To push Malaysia and Malaysians to success, we must collaborate in every aspect like education, economic , politics and others. This can be a great advantage for development of Malaysia in global competition as we have different ethnic with different cultural background that we collaborate and creating a better way to work, hence improving our efficiency and productivity compared to other nation that only dominated by single race. In education, my expectation is to have Multicultural Education in every level of school, which mean we have Multicultural Education from kinder garden to university. The crux of having Multicultural Education is achieve its purposes for students, teachers, parents, and administrators of the school system : a) a learning environment that support positive interracial contact; b) a multicultural curriculum; c) positive teacher expectations; d) administrative support; and, e) teacher training workshops (Bennett, 1995). If one of the features is absent, frustration and heightened resentment may occur as backlash behaviors multiply. Besides that, a multicultural curriculum should be considered for several reasons: a) provides alternative points of view relative to information already taught in most educational systems; b) provides ethnic minorities with a sense of being inclusive in history, science etc.; and, c) decreases stereotypes, prejudice, bigotry, and racism in Malaysia and the wo rld. Educational institutions have been dictated too long by attitudes, values, beliefs, and value systems of one race and class of people. The future of our universe is demanding a positive change for all. In Politics, race plays a large role in Malaysian politics, and many Malaysian political parties are ethnically based. The Government’s New Economic Policy (NEP) and the National Development  Policy(NDP) which superseded it, were implemented to advance the standing of Bumiputera Malaysians. The policies provide preferential treatment to Malays over non-Malays in employment, education, scholarships, business, and access to cheaper housing and assisted savings. While improving in the economic position of Malays, it is a source of resentment amongst non-Malays. Prime Minister Dato Sri Mohd Najib Tun Razak has claimed to attempt to close racial divides through the 1Malaysia initiative. The origin of race based politics can be traced back to independence of Malaysia from United Kin gdom, who wanted all citizens of Malaysia to be equal upon independence, instead of dominance by Malays. This caused the political parties of the three major races at the time, the UMNO (representing Malays), the MCA (representing Chinese), and the MIC (representing Indians), to join and form the Alliance Party. My expectation for politics is that we should not dividing ourselves into parts based on our race. We should unite as one to make a better Malaysia and provide everyone a fair chance and right to fight for a higher achievement for our country without any discrimination or preferential treatment. For multi-cultured society in economic sector, the economic consequences of ethnic heterogeneity and ethnic diversity have been topics discussed world widely. The relationship between ethnicity and economic development seems to be one of the key topics to an ideal sustainable developing nation. According to Easterly and Levine (1997), high ethnic diversity has a direct negative effect on economic growth. Furthermore, increase of ethnic diversity associated with more corruption(Mauro, 1995), reduces contribution to local public goods(Alesina et al., 1999), diminishing participation in groups and association (Alesina and La Ferraa, 2000) and higher propensity to from jurisdictions to sort into homogenous groups (Alesina et al., 2004). Moreover, greater ethnic heterogeneity decreases both the probability and the amount an individual contributes to a charitable organization (Okten and Osili, 2005). Although these studies showed the bad effect of ethnic diversity in economic sectors, i still expecting for a successful achievement in Malaysia Economy by uniting the three major races, Malay, Chinese and Indian through collaboration, respecting each other and tolerance. Therefore, a leader and a good plan is necessary for us to unite as one to create a better multi-cultured Malaysia! Reference -Abu Bakar Nordin , Norlidah Alias & Saedah Sira (January 2013). The Malaysia Online Journal of Educational Science. National Integration in Multicultural School Setting In Malaysia, volume 1, issue 1. Retrieved April 20th 2013, from http://moj-es.net/volume01-i01.php -Politics of Malaysia. Participation. Retrieved 23rd April 2013, from http://en.wikipedia.org/wiki/Politics_of_Malaysia -Albert, C. (February 2011). The Impact of Ethnicity on the Regional Economic Development in Malaysia. Retrieved 23rd April 2013, from http://www.academia.edu/745998/The_Impact_of_Ethnicity_on_Regional_Economic_Development_in_Malaysia Photos that showing the results of multi-cultural society in Malaysia