OSN User Walls FullDoc
OSN User Walls FullDoc
Submitted to
BATCHELOR OF TECHNOLOGY
In
Submitted by
G.LIKHITA(17KN1A0546)
B.ROOPA SRI(17KN1A0513)
CH.TANMAI(17KN1A0530)
A.PHANI KUMAR(17KN1A0509)
Mrs.K.Udaya Sri
Associate Professor, CSE Department
2017-2021
NRI INSTITUTE OF TECHNOLOGY
(Approved by AICTE, Permanently Affiliated to JNTUK, Kakinada)
Certificate
This is to certify that the Project entitled “A SYSTEM TO FILTER UNWANTED
MESSAGES FROM OSN USERWALLS” is a bonified work carriedout by
G.LIKHITHA (17KN1A0546) B.ROOPA SRI (17KN1A0513) CH.TANMAYI (17KN1A0530) and
A.PHANI KUMAR (17KN1A0509) in partial fulfillment for the award of degree of Bachelor of
EXTERNAL EXAMINER
DECLARATION
We hereby declare that the project report titled “A System to Filter Unwanted
Messages from OSN Userwalls” is a bonafide work carried out in the Department of
We further declare that this dissertation has not been submitted elsewhere for any
Degree.
17KN1A0546
17KN1A0513
17KN1A0530
17KN1A0509
ACKNOWLEDGEMENT
We take this opportunity to thank all who have rendered their full support to our work. The pleasure, the
achievement, the glory, the satisfaction, the reward, the appreciation and the construction of my project
cannot be expressed with a few words for their valuable suggestions.
We are grateful to our Project Guide Mrs.K. Udaya Sri , Associate Professor
for rendering the valuable suggestions and extended his support to complete the project
successfully.
We are expressing our heartfelt thanks to Head of the Department, Dr. D. Suneetha
garu for her continuous guidance for completion of our Project work.
We are extending our sincere thanks to Dean of the Department, Dr. K. V. Sambasiva Rao garu
for his continuous guidance and support to complete our project successfully.
We are thankful to the Principal, Dr. C. Naga Bhaskar garu for his encouragement to complete
the Project work.
We are extending our sincere and honest thanks to the Chairman, Dr. R. Venkata Rao garu &
Secretary, Sri K. Sridhar garu for their continuous support in completing the Project work.
Finally, we thank the Administrative Officer, Staff Members, Faculty of Department of CSE, NRI Institute
of Technology and our friends, directly or indirectly helped us in the completion of this project.
17KN1A0546
17KN1A0513
17KN1A0530
17KN1A0509
ABSTRACT
One fundamental issue in today On-line Social Networks (OSNs) is to give users
the ability to control the messages posted on their own private space to avoid
that unwanted content is displayed. Up to now OSNs provide little support to
this requirement. To fill the gap, in this paper, we propose a system allowing
OSN users to have a direct control on the messages posted on their walls. This is
achieved through a flexible rule-based system, that allows users to customize
the filtering criteria to be applied to their walls, and a Machine Learning based
soft classifier automatically labeling messages in support of content-based
filtering. Index Terms—On-line Social Networks, Information Filtering, Short Text
Classification, Policy-based Personalization.
INDEX
CHAPTER NO CONTENT PAGE NO
I. List of Figures………………………………...8
II. List of Output screens......................................9
III. List of Symbols……………………………….10
IV. List of Abbreviations.......................................11
1 Introduction. ...................................................12-18
1.1 Introduction & Objective..................................12
1.1.1 What is Data Mining?.......................................12
1.1.2 How Data Mining Works? ............................... 12-14
1.1.3 Different levels of analysis............................... 14-15
1.1.4 Characteristics of Data Mining.........................15
1.1.5 Benefits of Data Mining.................................. .15-16
1.1.6 Advantages of Data Mining............................. .16-17
1.1.7 Objective...........................................................18
1.2 IAU System........................................................18
2 Scope................................................................ 18-24
2.1 Process Model...................................................19
2.1.1 Diagram of Spiral model....................................20
2.1.2 Advantages of Spiral model...............................20
2.1.3 Disadvantages of Spiral model.......................... 20
2.1.4 When to use Spiral model................................. 20-21
2.1.5 Spiral Approach Phases..................................... 21-22
2.1.6 Analysis phase.................................................. .22-24
3 Functional Requirement Specification..............25-36
3.1 Performance Requirements............................... 28-29
3.2 Hardware Requirements.................................... 29
3.3 Software Requirements......................................29-30
3.4 Introduction to java............................................30-36
4 Unified modeling language................................36-54
4.1.1 Use case diagram................................................36-39
4.1.2 Identified use cases.............................................39-40
4.2 Flow- oriented modelling.................................... 41
4.2.1 Activity diagram............................................. .... 41-45
4.3 State chart diagram.............................................45
4.4 Sequence diagram...............................................45-48
4.5 Class based modelling......................................... 49
4.5.1 Class diagram...................................................... 49-51
4.6 Collaboration diagram......................................... 51-52
4.7 Component level class design............................ ..52-55
4.7.1 What is a Component? ........................................ 53
4.7.2 An Object Oriented View..................................... .53-54
5 System design specification..................................55-72
5.1 System architecture............................................ ..55
5.2 Data flow diagram.............................................. …56-58
5.3 Navigation diagrams.......................................... ….58-59
5.4 Drafts of user interface...................................... ..59-60
5.5 Data dictionary................................................... ..60-63
5.6 Database tables.................................................. 64-72
6 Implementation phase....................................... 72
7 Testing phase..................................................... 72-75
7.1 Test cases........................................................... 73-74
7.1.1 Admin test cases................................................ 73
7.1.2 User test cases...................................................74
7.2 Unit testing........................................................ 74-75
7.2.1 Admin class........................................................ 74-75
7.3 Functional Test plan.......................................... 75
8 Demo: Output Screen Shots.............................. 75-84
9 Appendix.............................................................85-132
10 Conclusion..........................................................132-134
11 Issues to Future Studies..................................... 134
12 References........................................................134-140
LIST OF FIGURES
Symbols Meaning
Use-case
Actor
Transition
Object
Name
Activities
ABBREVIATIONS MEANING
RF Relative Frequency
VM Virtual Machine
IP Internet Protocol
1) Extract, transform, and load transaction data onto the data warehouse
system.
2) Store and manage the data in a multidimensional database system.
3) Provide data access to business analysts and information technology
professionals.
4) Analyze the data by application software.
5) Present the data in a useful format, such as a graph or table.
1) It’s one of the most effective services that are available today. With the help
of data mining, one can discover precious information about the customers
and their behavior for a specific set of products and evaluate and analyze,
store, mine and load data related to them
2) An analytical CRM model and strategic business related decisions can be
made with the help of data mining as it helps in providing a complete
synopsis of customers
3) An endless number of organizations have installed data mining projects and
it has helped them see their own companies make an unprecedented
improvement in their marketing strategies (Campaigns)
4) Data mining is generally used by organizations with a solid customer focus.
For its flexible nature as far as applicability is concerned is being used
vehemently in applications to foresee crucial data including industry analysis
and consumer buying behaviors
5) Fast paced and prompt access to data along with economic processing
techniques have made data mining one of the most suitable services that a
company seek
1. Marketing / Retail:
Data mining helps marketing companies build models based on historical data
to predict who will respond to the new marketing campaigns such as direct mail,
online marketing campaign…etc. Through the results, marketers will have
appropriate approach to sell profitable products to targeted customers.
Data mining brings a lot of benefits to retail companies in the same way as
marketing. Through market basket analysis, a store can have an appropriate
production arrangement in a way that customers can buy frequent buying products
together with pleasant. In addition, it also helps the retail companies offer certain
discounts for particular products that will attract more customers.
2. Finance / Banking
Data mining gives financial institutions information about loan information and
credit reporting. By building a model from historical customer’s data, the bank and
financial institution can determine good and bad loans. In addition, data mining
helps banks detect fraudulent credit card transactions to protect credit card’s
owner.
3. Manufacturing
4. Governments
5. Law enforcement:
Data mining can aid law enforcers in identifying criminal suspects as well as
apprehending these criminals by examining trends in location, crime type, habit,
and other patterns of behaviors.
6. Researchers:
Data mining can assist researchers by speeding up their data analyzing process;
thus, allowing those more time to work on other projects.
1.1.7 Objective:
1.To give users the ability to control the messages posted on their own private
space.
2.To avoid that unwanted content is displayed.
3. To improve the quality of classification.
1.2 IAU System
A system to automatically filter unwanted messages from user walls on the
basis of both message content and the message creator relationships and
characteristics.
The current paper substantially extends for what concerns both the rule layer
and the classification module.
Ability to control the messages posted on their own private space
2 scope:
1.To give users the ability to control the messages posted on their own private
space.
2.1 Process Model:
The spiral model is similar to the incremental model, with more emphasis placed
on risk analysis. The spiral model has four phases: Planning, Risk Analysis,
Engineering and Evaluation. A software project repeatedly passes through these
phases in iterations (called Spirals in this model). The baseline spiral, starting in
the planning phase, requirements are gathered and risk is assessed. Each
subsequent spirals builds on the baseline spiral.
Risk Analysis: In the risk analysis phase, a process is undertaken to identify risk
and alternate solutions. A prototype is produced at the end of the risk analysis
phase. If any risk is found during the risk analysis then alternate solutions are
suggested and implemented.
Engineering Phase: In this phase software is developed, along with testing at the
end of the phase. Hence in this phase the development and testing is done.
Evaluation phase: This phase allows the customer to evaluate the output of the
project to date before the project continues to the next spiral.
MODULES:
1. User module
2. Filtering process module
3. Online setup assistant module
4. Blacklisting process
5. Admin module
MODULES DESCRIPTION:
1. User Module:
In this module, users can create and manage their own “groups” (such like the new
Face book groups pages). Each group has a homepage that provides a place for
subscribers to post and share (by posting messages, images, etc.) and a block that
provides basic information about the group. Users can also enable additional
features in their owned page like view friends list and add friends by using friend’s
requests as well as share their images with selected group’s members. The status of
their friends requests are also updated in this module
In defining the language for FRs specification, we consider three main issues that,
in our opinion, should affect a message filtering decision. First of all, in OSNs like
in everyday life, the same message may have different meanings and relevance
based on who writes it. As a consequence, FRs should allow users to state
constraints on message creators. Creators on which a FR applies can be selected on
the basis of several different criteria; one of the most relevant is by imposing
conditions on their profile’s attributes. In such a way it is, for instance, possible to
define rules applying only to young creators or to creators with a given
religious/political view. Given the social network scenario, creators may also be
identified by exploiting information on their social graph. This implies to state
conditions on type, depth and trust values of the relationship(s) creators should be
involved in order to apply them the specified rules.
Similar to FRs, our BL rules make the wall owner able to identify users to be
blocked according to their profiles as well as their relationships in the OSN.
Therefore, by means of a BL rule, wall owners are for example able to ban from
their walls users they do not directly know (i.e., with which they have only indirect
relationships), or users that are friend of a given person as they may have a bad
opinion of this person. This banning can be adopted for an undetermined time
period or for a specific time window. Moreover, banning criteria may also take into
account users’ behavior in the OSN. More precisely, among possible information
denoting users’ bad behavior we have focused on two main measures. The first is
related to the principle that if within a given time interval a user has been inserted
into a BL for several times, say greater than a given threshold, he/she might
deserve to stay in the BL for another while, as his/her behavior is not improved.
This principle works for those users that have been already inserted in the
considered BL at least one time. In contrast, to catch new bad behaviors, we use
the Relative Frequency (RF) that let the system be able to detect those users whose
messages continue to fail the FRs. The two measures can be computed either
locally, that is, by considering only the messages and/or the BL of the user
specifying the BL rule or globally, that is, by considering all OSN users walls
and/or BLs.
5. Admin Module:
In this module, the admin manage all user’s information including posting
comments in the user status box. Each unwanted message has an alert from admin
that provides a place for post and share for the respective user walls. And admin
can see blocked message from the users and also that provides information about
the user who used the blocked message. Admin can also enable additional features
in their owned page like user list, adding unwanted message, update unwanted
messages, Blocked users list and finally filter performance graph. And also in this
module, we show the performance evaluation of the system in the graph.
Performance
The system must be interactive and the delays involved must be less .So in every
action-response of the system, there are no immediate delays. In case of opening
windows forms, of popping error messages and saving the settings or sessions
there is delay much below 2 seconds, In case of opening databases, sorting
questions and evaluation there are no delays and the operation is performed in less
than 2 seconds for opening ,sorting, computing, posting > 95% of the files. Also
when connecting to the server the delay is based editing on the distance of the 2
systems and the configuration between them so there is high probability that there
will be or not a successful connection in less than 20 seconds for sake of good
communication.
Safety
Reliability
As the system provide the right tools for discussion, problem solving it must be
made sure that the system is reliable in its operations and for securing the sensitive
details.
3.2HARDWARE REQUIREMENTS:
3.3SOFTWARE REQUIREMENTS:
Operating system : Windows XP/7.
Coding Language : ASP.net, C#.net
Tool : Visual Studio 2010
Database : SQL SERVER 2008
3.4 introduction to java:
Software Environment
Java Technology
Simple
Architecture neutral
Object oriented
Portable
Distributed
High performance
Interpreted
Multithreaded
Robust
Dynamic
Secure
You can think of Java byte codes as the machine code instructions for the
Java Virtual Machine (Java VM). Every Java interpreter, whether it’s a
development tool or a Web browser that can run applets, is an implementation of
the Java VM. Java byte codes help make “write once, run anywhere” possible. You
can compile your program into byte codes on any platform that has a Java
compiler. The byte codes can then be run on any implementation of the Java VM.
That means that as long as a computer has a Java VM, the same program written in
the Java programming language can run on Windows 2000, a Solaris workstation,
or on an iMac.
The Java Platform
A platform is the hardware or software environment in which a
program runs. We’ve already mentioned some of the most popular platforms
like Windows 2000, Linux, Solaris, and MacOS. Most platforms can be
described as a combination of the operating system and hardware. The Java
platform differs from most other platforms in that it’s a software-only
platform that runs on top of other hardware-based platforms.
Native code is code that after you compile it, the compiled code runs
on a specific hardware platform. As a platform-independent environment,
the Java platform can be a bit slower than native code. However, smart
compilers, well-tuned interpreters, and just-in-time byte code compilers can
bring performance close to that of native code without threatening
portability.
What Can Java Technology Do?
The most common types of programs written in the Java programming
language are applets and applications. If you’ve surfed the Web, you’re
probably already familiar with applets. An applet is a program that adheres
to certain conventions that allow it to run within a Java-enabled browser.
However, the Java programming language is not just for writing cute,
entertaining applets for the Web. The general-purpose, high-level Java
programming language is also a powerful software platform. Using the
generous API, you can write many types of programs.
An application is a standalone program that runs directly on the Java
platform. A special kind of application known as a server serves and
supports clients on a network. Examples of servers are Web servers, proxy
servers, mail servers, and print servers. Another specialized program is a
servlet. A servlet can almost be thought of as an applet that runs on the
server side. Java Servlets are a popular choice for building interactive web
applications, replacing the use of CGI scripts. Servlets are similar to applets
in that they are runtime extensions of applications. Instead of working in
browsers, though, servlets run within Java Web servers, configuring or
tailoring the server.
How does the API support all these kinds of programs? It does so with
packages of software components that provides a wide range of
functionality. Every full implementation of the Java platform gives you the
following features:
The essentials: Objects, strings, threads, numbers, input and output,
data structures, system properties, date and time, and so on.
Applets: The set of conventions used by applets.
Networking: URLs, TCP (Transmission Control Protocol), UDP
(User Data gram Protocol) sockets, and IP (Internet Protocol)
addresses.
Internationalization: Help for writing programs that can be localized
for users worldwide. Programs can automatically adapt to specific
locales and be displayed in the appropriate language.
Security: Both low level and high level, including electronic
signatures, public and private key management, access control, and
certificates.
Software components: Known as JavaBeansTM, can plug into
existing component architectures.
Object serialization: Allows lightweight persistence and
communication via Remote Method Invocation (RMI).
Java Database Connectivity (JDBCTM): Provides uniform access to
a wide range of relational databases.
The Java platform also has APIs for 2D and 3D graphics, accessibility,
servers, collaboration, telephony, speech, animation, and more. The
following figure depicts what is included in the Java 2 SDK.
Login
upload files
search by keyword
Admin
search by name
User
file rank
file download
enter user id
enter user
name
enter
password
enter address
enter email
5
login
.
3 sucess
A
d
view user view rank chart
view file details
m upload files details error
i
n
A
c
t
Fig:4.3 ivity Diagram
enter username
and password
verify
correct
enter field
enter file
keyword
enter capital
enter date
process
login update
status
enter user id
enter password
enter address
enter mail id
send details
send response
enter password
send details
send response
Database
: User
: Admin Registration
upload files
search keyword
search name
download files
rank results
file chart
Database
provideservice
storage()
7: send response
6: send details
database
4: send response
3: send details
Database
user
admin
file
upload
search by search
keyword file
by name download
file
details
4.17 Component Diagram
admin user
5.1
5.2 DATA FLOW DIAGRAM:
YE S NO
Ch ec k
S tatu s U p d ate
U n a u th o r iz ed U s er
Fi n d Fr ie n d s
S e n d in g R eq u es t
S h ar e I m a g e s
Al lo w P i v a c y S etti n g
V ie w F ri e n d Lis t
E n d P r o c es s
A d m i n L o g in
YE S NO
Ch ec k
B l o c k U n w a n te d M e s sa g e
U n a u th o r iz ed U s er
U se r L i st
U p d ate B lo c k in g W o rd s
B lo c k e d W o rd s U s e rs
P e rf o rm a n c e G ra p h
E n d P r o c es s
`image` longblob
)
5.6 Database Tables
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
Database changed
| Tables_in_socialnetwork |
+-------------------------+
| admin |
| buser |
| new_m |
| reg |
| request |
| update_ |
| view |
| view_pri |
+-------------------------+
+------------------+----------+
| cat | word |
+------------------+----------+
| ILLEGAL WORDS | |
| RESTRICTED WORDS | xx |
| BAD WORDS | |
| BAD WORDS | |
+------------------+----------+
+------------+--------------+------+-----+---------+-------+
+------------+--------------+------+-----+---------+-------+
| id | int(20) | NO | | NULL | |
| fname | varchar(255) | NO | | NULL | |
+------------+--------------+------+-----+---------+-------+
+--------------+--------------+------+-----+---------+-------+
+--------------+--------------+------+-----+---------+-------+
| id | int(255) | NO | | NULL | |
+--------------+--------------+------+-----+---------+-------+
+---------+-------------+------+-----+---------+-------+
+---------+-------------+------+-----+---------+-------+
+---------+-------------+------+-----+---------+-------+
+---------+-------------+------+-----+---------+-------+
+---------+-------------+------+-----+---------+-------+
| user | varchar(45) | NO | | | |
| statusa | varchar(45) | NO | | | |
+---------+-------------+------+-----+---------+-------+
+---------+-------------+------+-----+---------+-------+
+---------+-------------+------+-----+---------+-------+
| user | varchar(45) | NO | | | |
+---------+-------------+------+-----+---------+-------+
+--------------+--------------+------+-----+---------+-------+
| id | int(255) | NO | | NULL | |
+--------------+--------------+------+-----+---------+-------+
+---------+-------------+------+-----+---------+-------+
+---------+-------------+------+-----+---------+-------+
| user | varchar(45) | NO | | | |
| statusa | varchar(45) | NO | | | |
+---------+-------------+------+-----+---------+-------+
6. Implementation Phase:
7. Testing Phase .
7.1.1 Admin
5.share photo
7.2Unittesting
7.2.1 Admin class
10.
11.
12.Userslist:
13.
14.Filter wordslist:
15.
16.Blocked users list:
17.
18.
19.User registration:
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
9.Appendix:
Adminlogin.jp:
<html>
<head>
<script language="JavaScript">
function validation()
var a = document.form.userid.value;
var b = document.form.pass.value;
if(a=="")
return false;
if(b=="")
document.form.pass.focus();
return false;
</script>
</head>
<body>
<div id="header">
<div id="logo">
<h1 align="center"><font size="+3">A System to Filter Unwanted
Messages from OSN User Walls</font></h1>
</div>
</div>
<div id="page">
<div>
</div>
</div>
<fieldset>
<table height="160">
<tr>
<td height="37">Admin</td>
</tr>
<tr>
<td height="35">Password</td>
</tr>
<tr>
<td height="39"></td>
</td>
</tr>
</form>
</table>
</fieldset>
<br><br><br>
<p><img src="images/newUser.png"><font size="3"><a
href="newuser.jsp">New User Signup Here?</a></font></p>
</div>
<br><br>
<div class="post">
</div>
</div>
</div>
<div id="footer">
</div>
</body>
</html>
Adminuser.jsp:
<%--
Document : newjsp
Author : ibn
--%>
<!DOCTYPE html>
<html>
<head>
<script>
function check()
var a = document.f1.opn.value;
var b = document.f1.t.value;
if(a ==""){
return false;
if(b==""){
return false;
}
</script>
<title>admin Page</title>
</head>
<body bgcolor="#B3D1B3">
</font></h1>
<div id="menu">
<ul>
</ul>
</div>
<h2>Word Category</h2>:
</select>
<%
if (request.getParameter("msg") != null) {
out.println("<script>alert('Information
Saved..!')</script>");
if (request.getParameter("msgr") != null) {
out.println("<script>alert('fails')</script>");
%>
</form>
</div><BR>
<HR>
</body>
</html>
Userpage.jsp:
<%
try {
Connection con;
con = databasecon.getconnection();
Statement st = con.createStatement();
ResultSet rs = st.executeQuery(s);
if (rs.next()) {
id = rs.getString(1);
name = rs.getString(2);
userid = rs.getString(3);
session.setAttribute("id", id);
} else {
out.print("Please check your login credentials");
%>
<html>
<head>
</head>
<body>
<!-- start header -->
<div id="header">
<div id="logo">
</font></h1>
</div>
</div>
<div class='cssmenu'>
<ul>
</ul>
</div>
<div id="page">
<h2>Welcome!
</h2>
<%
} catch (Exception e) {
System.out.println(e);
%>
<li>
<ul>
<br><br>
</ul>
</li>
</ul>
</div>
</div>
<br><br>
<div id="content">
<!--fragment-2-->
<%
int fid = 0;
try {
Class.forName("com.mysql.jdbc.Driver");
con2 =
DriverManager.getConnection("jdbc:mysql://localhost:3306/socialnetwork
", "root", "root");;
st2 = con2.createStatement();
rs2 = st2.executeQuery(sql);
%>
Walls</font></font></div>
<fieldset>
<legend><font color="#FFFFFF"><strong><font size="4">Posted
Image</font></strong></font></legend>
<%while (rs2.next()) {
fid = rs2.getInt("fid");
fname = rs2.getString("fname");
try {
Class.forName("com.mysql.jdbc.Driver");
con3 =
DriverManager.getConnection("jdbc:mysql://localhost:3306/socialnetwork
", "root", "root");
st3 = con3.createStatement();
rs3 = st3.executeQuery(sql3);
while (rs3.next()) {
System.out.println("image id" +
rs3.getInt("id"));
%>
<tr><td>
</td>
<td><font color="#FFFFCC"><strong>Posted
By</strong></font>:
<%=rs3.getString("name")%>
</td>
</tr>
<%}
} catch (Exception e3) {
System.out.println(e3);
}%>
</table>
</fieldset>
</div>
<%
System.out.println(ex);
} finally {
con2.close();
st2.close();
%>
</div><!--end fragment-2-->
</div>
</div>
</div>
</body>
</html>
Viewrequest.jsp:
<%
Connection con;
con = databasecon.getconnection();
Statement st = con.createStatement();
//fname=(String)session.getAttribute("fname");
//sname=(String)session.getAttribute("sname");
ResultSet rs = st.executeQuery(s);
if (rs.next()) {
id = rs.getString(1);
name = rs.getString(2);
userid = rs.getString(3);
session.setAttribute("id", id);
} else {
%>
<html>
<head>
</head>
<body>
<div id="header">
<div id="logo">
</font></h1>
</div>
</div>
<div class='cssmenu'>
<ul>
<li><a href="index.html"><span>Logout</span></a></li>
</ul>
</div>
<div id="page">
<h2>Welcome!
</h2>
<%
} catch (Exception e) {
System.out.println(e);
}
%>
<ul>
<li>
<ul>
<br><br>
</ul>
</li>
</ul>
</div>
</div>
<br><br>
<div id="content">
<%
int fid = 0;
try {
Class.forName("com.mysql.jdbc.Driver");
con2 =
DriverManager.getConnection("jdbc:mysql://localhost:3306/socialnetwork
", "root", "root");;
st2 = con2.createStatement();
rs2 = st2.executeQuery(sql);
%>
<fieldset>
<%while (rs2.next()) {
fid = rs2.getInt("id");
fname = rs2.getString("name");
%>
<tr><td>Name: <%=rs2.getString("name")%></td>
</tr>
<tr><td><img src="viewimage.jsp?id=<%=fid%>" alt="" width="120"
height="99" /></td></tr>
<tr>
<td><a href="viewrequest1.jsp?id=<%=rid1%>"><font
color="#FFFFCC"><strong>Confirm</strong></font></a>
<a href="ignore.jsp?id=<%=rid2%>"><font
color="#FFFFCC"><strong>Ignore</strong></font></a></td>
</tr>
<%}%>
</table>
</fieldset>
</div>
</form>
<%
System.out.println(ex);
} finally {
con2.close();
st2.close();
}
%>
</div><!--end fragment-2-->
</div>
</div>
</div>
<br><br><br><br><br><br><br><br><br><br><br><br><br>
<div id="footer">
<p align="right"><font color="#FFFFFF" size="2"><strong>Online
Social
Network</strong></font> &n
bsp; <img
src="images/icon3.jpg"> <img
src="images/icon1.jpg"> <img
src="images/icon4.jpg"> <img
src="images/icon5.jpg"> <img
src="images/Icon7.png" width="30" height="30"></p>
</div>
</body>
</html>
Profileinsert.jsp:
<%@page
import="com.oreilly.servlet.*,java.sql.*,databaseconnection.*,java.util.*,ja
va.io.*,javax.servlet.*, javax.servlet.http.*"%>
<%@page import="javax.crypto.*"%>
<html>
<head>
</head>
<body>
<%
Thread.sleep(100);
String paramname=null;
int id=0;
String secondary=null,university=null,employee=null,image=null;
try {
while (params.hasMoreElements())
if(paramname.equalsIgnoreCase("secondary"))
secondary=multi.getParameter(paramname);
if(paramname.equalsIgnoreCase("university"))
university=multi.getParameter(paramname);
if(paramname.equalsIgnoreCase("employee"))
employee=multi.getParameter(paramname);
}
if(paramname.equalsIgnoreCase("image"))
image=multi.getParameter(paramname);
int f = 0;
while (files.hasMoreElements())
if(paramname.equals("d1"))
paramname = null;
if(paramname != null)
{
f = 1;
image = multi.getFilesystemName(paramname);
list.add(fs);
Connection con=databasecon.getconnection();
ps.setString(1,secondary);
ps.setString(2,university);
ps.setString(3,employee);
ps.setString(4,image);
if(f == 0)
ps.setObject(4,null);
else if(f == 1)
fs1 = (FileInputStream)list.get(0);
ps.setBinaryStream(4,fs1,fs1.available());
int x=ps.executeUpdate();
if(x!=0)
response.sendRedirect("userpage.jsp?message=success");
else
{
response.sendRedirect("userpage.jsp?message=fail");
catch (Exception e)
out.println(e.getMessage());
%>
</body>
</html>
Userinsert.jsp:
<%@page
import="com.oreilly.servlet.*,java.sql.*,java.lang.*,databaseconnection.*,j
ava.text.SimpleDateFormat,java.util.*,java.io.*,javax.servlet.*,
javax.servlet.http.*" errorPage="Error.jsp"%>
<html>
<head>
<body>
<%
try
String a=request.getParameter("fname");
String b=request.getParameter("sname");
String c=request.getParameter("userid");
String d=request.getParameter("remail");
String e=request.getParameter("pass");
String f=request.getParameter("gender");
String g=request.getParameter("date");
String h=request.getParameter("month");
String i=request.getParameter("year");
session.setAttribute("fname",a);
session.setAttribute("sname",b);
session.setAttribute("userid",c);
session.setAttribute("name",j);
Connection con=databasecon.getconnection();
Statement st=con.createStatement();
int x=st.executeUpdate(sql);
if(x!=0){
response.sendRedirect("owner.jsp?message=Successfully
Registered");
else{
response.sendRedirect("owner.jsp?message=fail");
con.close();
st.close();
catch(Exception e)
out.println(e);
%>
</center>
</td>
</tr>
</body>
</table>
Viewrequest.jsp:
<%@page
import="com.oreilly.servlet.*,java.sql.*,databaseconnection.*,java.util.*,ja
va.io.*,javax.servlet.*, javax.servlet.http.*"%>
<%@page import=" java.security.MessageDigest"%>
<%@page import="javax.crypto.*"%>
<html>
<head>
</head>
<body>
<%
String[] temp;
temp = str.split(delimiter,5);
int id=Integer.parseInt((temp[0]));
String name = temp[1];
int fid=Integer.parseInt((temp[2]));
session.setAttribute("fid",fid);
session.setAttribute("fname",fname);
try {
Connection con=databasecon.getconnection();
PreparedStatement ps=con.prepareStatement("update
request set status=? where id='"+fid+"' and fid='"+id+"'");
ps.setString(1,status);
/* if(f == 0)
ps.setObject(4,null);
else if(f == 1)
fs1 = (FileInputStream)list.get(0);
ps.setBinaryStream(4,fs1,fs1.available());
} */
int x=ps.executeUpdate();
if(x!=0)
response.sendRedirect("viewrequest3.jsp?message=success");
else
response.sendRedirect("viewrequest3.jsp?message=fail");
}
}
catch (Exception e)
out.println(e.getMessage());
%>
</body>
</html>
10. Conclusion
In this paper, we have presented a system to filter undesired messages from OSN
walls. The system exploits a ML soft classifier to enforce customizable content-
dependent FRs. Moreover, the flexibility of the system in terms of filtering options
is enhanced through the management of BLs. This work is the first step of a wider
project. The early encouraging results we have obtained on the classification
procedure prompt us to continue with other work that will aim to improve the
quality of classification. In particular, future plans contemplate a deeper
investigation on two interdependent tasks. The first concerns the extraction and/ or
selection of contextual features that have been shown to have a high discriminative
power. The second task involves the learning phase. Since the underlying domain
is dynamically changing, the collection of preclassified data may not be
representative in the longer term. The present batch learning strategy, based on the
preliminary collection of the entire set of labeled data from experts, allowed an
accurate experimental evaluation but needs to be evolved to include new
operational requirements. In future work, we plan to address this problem by
investigating the use of online learning paradigms able to include label feedbacks
from users. Additionally, we plan to enhance our system with a more sophisticated
approach to decide when a user should be inserted into a BL. The development of a
GUI and a set of related tools to make easier BL and FR specification is also a
direction we plan to investigate, since usability is a key requirement for such kind
of applications. In particular, we aim at investigating a tool able to automatically
recommend trust values for those contacts user does not personally known. We do
believe that such a tool should suggest trust value based on users actions,
behaviors, and reputation in OSN, which might imply to enhance OSN with audit
mechanisms. However, the design of these audit-based tools is complicated by
several issues, like the implications an audit system might have on users privacy
and/or the limitations on what it is possible to audit in current OSNs. A preliminary
work in this direction has been done in the context of trust values used for OSN
access control purposes [52]. However, we would like to remark that the system
proposed in this paper represents just the core set of functionalities needed to
provide a sophisticated tool for OSN message filtering. Even if we have
complemented our system with an online assistant to set FR thresholds, the
development of a complete system easily usable by average OSN users is a wide
topic which is out of the scope of the current paper. As such, the developed
Facebook application is to be meant as a proof-of-concepts of the system core
functionalities, rather than a fully developed system.
Moreover, we are aware that a usable GUI could not be enough, representing only
the first step. Indeed, the proposed system may suffer of problems similar to those
encountered in the specification of OSN privacy settings. In this context, many
empirical studies [53] have shown that average OSN users have difficulties in
understanding also the simple privacy settings provided by today OSNs. To
overcome this problem, a promising trend is to exploit data mining techniques to
infer the best privacy preferences to suggest to OSN users, on the basis of the
available social network data [54]. As future work, we intend to exploit similar
techniques to infer BL rules and FRs. Additionally, we plan to study strategies and
techniques limiting the inferences that a user can do on the enforced filtering rules
with the aim of bypassing the filtering system, such as for instance randomly
notifying a message that should instead be blocked, or detecting modifications to
profile attributes that have been made for the only purpose of defeating the filtering
system.
12.references
REFERENCES
[1] A. Adomavicius and G. Tuzhilin, “Toward the Next Generation of
Recommender Systems: A Survey of the State-of-the-Art and Possible
Extensions,” IEEE Trans. Knowledge and Data Eng., vol. 17, no. 6, pp. 734-749,
June 2005.
[2] M. Chau and H. Chen, “A Machine Learning Approach to Web Page Filtering
Using Content and Structure Analysis,” Decision Support Systems, vol. 44, no. 2,
pp. 482-494, 2008.
[6] N.J. Belkin and W.B. Croft, “Information Filtering and Information Retrieval:
Two Sides of the Same Coin?” Comm. ACM, vol. 35, no. 12, pp. 29-38, 1992.
[7] P.J. Denning, “Electronic Junk,” Comm. ACM, vol. 25, no. 3, pp. 163-165,
1982.
[8] P.W. Foltz and S.T. Dumais, “Personalized Information Delivery: An Analysis
of Information Filtering Methods,” Comm. ACM, vol. 35, no. 12, pp. 51-60, 1992.
[9] P.S. Jacobs and L.F. Rau, “Scisor: Extracting Information from On-Line
News,” Comm. ACM, vol. 33, no. 11, pp. 88-97, 1990.
[11] P.E. Baclace, “Competitive Agents for Information Filtering,” Comm. ACM,
vol. 35, no. 12, p. 50, 1992.
[12] P.J. Hayes, P.M. Andersen, I.B. Nirenburg, and L.M. Schmandt, “Tcs: A Shell
for Content-Based Text Categorization,” Proc. Sixth IEEE Conf. Artificial
Intelligence Applications (CAIA ’90), pp. 320-326, 1990.
[14] M.J. Pazzani and D. Billsus, “Learning and Revising User Profiles: The
Identification of Interesting Web Sites,” Machine Learning, vol. 27, no. 3, pp. 313-
331, 1997.
[19] R.E. Schapire and Y. Singer, “Boostexter: A Boosting-Based System for Text
Categorization,” Machine Learning, vol. 39, nos. 2/3, pp. 135-168, 2000.
[20] H. Schu¨ tze, D.A. Hull, and J.O. Pedersen, “A Comparison of Classifiers and
Document Representations for the Routing Problem,” Proc. 18th Ann.
ACM/SIGIR Conf. Research and Development in Information Retrieval , pp. 229-
237, 1995.
[21] E.D. Wiener, J.O. Pedersen, and A.S. Weigend, “A Neural Network Approach
to Topic Spotting,” Proc. Fourth Ann. Symp. Document Analysis and Information
Retrieval (SDAIR ’95), pp. 317-332, 1995.
[22] T. Joachims, “Text Categorization with Support Vector Machines: Learning
with Many Relevant Features,” Proc. European Conf. Machine Learning, pp. 137-
142, 1998.
[24] S.E. Robertson and K.S. Jones, “Relevance Weighting of Search Terms,” J.
Am. Soc. for Information Science, vol. 27, no. 3, pp. 129- 146, 1976.
[26] V. Bobicev and M. Sokolova, “An Effective and Robust Method for Short
Text Classification,” Proc. 23rd Nat’l Conf. Artificial Intelligence (AAAI), D. Fox
and C.P. Gomes, eds., pp. 1444-1445, 2008.
[34] D.D. Lewis, Y. Yang, T.G. Rose, and F. Li, “Rcv1: A New Benchmark
Collection for Text Categorization Research,” J. Machine Learning Research, vol.
5, pp. 361-397, 2004.