Talent without working hard is nothing.

Hi, the example for today is how to use JSOUP library with Web Crawler.

the next java code use thread pool to generate thread to search for keywords you have been provided on the selected website.

JSOUP will do the connection to the website, download the page content (HTML), search for keywords and at the same time will save copy form all the links have been found in the current page.

ThreadPool will generate thread to make the search faster.

Snapshot Form Final Result :



Source code:



Read more..

Today, I going to explain about Twitter4J.

Twitter4J is an unofficial Java library for the Twitter API.
With Twitter4J, you can easily integrate your Java application with the Twitter service. Twitter4J is an unofficial library.

Twitter4J is featuring: 
✔ 100% Pure Java - works on any Java Platform version 5 or later
✔ Android platform and Google App Engine ready
✔ Zero dependencies: No additional jars required
✔ Built-in OAuth support
✔ Out-of-the-box gzip support
✔ 100% Twitter API 1.1 compatible

I will explain using the following code:

Java Application uses Twitter4J to work with Twitter API.

the Result of the application: just after you enter the Twitter @UseName, you want to know about it. The following...

1-Number Followed. 2-Number Of Tweets Received. 3-Number Of Retweets. 4-Most Active Followed.

There are too many methods you can call to analysis Twitter Account.


  • Do not forget the add your twitter app key.
  • Import Twitter4J API to your project (Included in Lib Folder).



  import java.util.ArrayList;
  import java.util.Date;
  import java.util.HashMap;
  import java.util.LinkedList;
  import java.util.List;
  import java.util.Map;
  import java.util.Map.Entry;
  import java.util.Scanner;
  import twitter4j.PagableResponseList;
  import twitter4j.Paging;
  import twitter4j.Status;
  import twitter4j.TwitterException;
  import twitter4j.TwitterFactory;
  import twitter4j.User;
  import twitter4j.conf.ConfigurationBuilder;
  public class Main {
  static ConfigurationBuilder _ConfigurationBuilder;// Config builder to build the connection for twitter api
  static TwitterFactory _TwitterFactory;//Building the factory
  static twitter4j.Twitter twitter;// Twitter4j lib to get the data from twitter
  static long coursor = -1;//used to read multi page
  static PagableResponseList<User> _User;// number of follower of the number of friends of account
  static HashMap<String, Integer> ListofFollower;//List of follower to save all the follower to using them in comparing
  static HashMap<String, Integer> userstweets;
  static List<Long> datestatus;// to save number of retweets during date
  static String UserName;// the username, we got it from the soa servies link
  static int NumberOfReTweets;
  static int TotalNumberOfRetweet;
  static int TotalNumberOfFollwed;
  static String MostActiveFollowed;
  static int TotalNumberOfTweetsReceived;
  public static void main(String[] args) {
  // TODO Auto-generated method stub
  // Initional Twitter API
  Init();// Use Your Key
  public static void GetUserName() {
  Scanner scanner = new Scanner(System.in);
  System.out.print("Enter a Twitter UserName:");
  UserName= scanner.nextLine();
  public static void print(String arg1,String arg2,String arg3) {
  System.out.println(arg1+ " "+arg2+" "+arg3);
  //Main method will be called many time to execute all the following methods
  public static void TweetAnalysis() {
  // To Get the UserName from Restful Link and save it on name.
  // If UserName gives twitter name/@aladinhamod.....etc../.
  if (!UserName.isEmpty()) {
  // This Method Will give Number Of Followed And Most Active Followed And NumOfTweetsReceived
  //Number Of Retweets During Jan 2018
  // NumberFollowed
  print("NumberFollowed", UserName, String.valueOf(TotalNumberOfFollwed));
  // MostActiveFollowed
  print("MostActiveFollowed", UserName, MostActiveFollowed);
  // NumberOfRetweets
  print("NumberOfRetweets", UserName, String.valueOf(NumberOfReTweets));
  // NumberOfTweetsReceived
  print("NumberOfTweetsReceived", UserName, String.valueOf(TotalNumberOfTweetsReceived));
  } else {
  System.out.println("Please Check Your Internet Connection");
  // Twitter API Will Return Number of NumOfFollowedMostActiveFollowedAndNumOfTweetsReceived
  public static void GetNumOfFollowedMostActiveFollowedAndNumOfTweetsReceived(String _UserName) {
  //HashMap to Save Number of Users
  ListofFollower = new HashMap<String, Integer>();
  do {
  try {
  //To get the number of followed
  _User = twitter.getFriendsList(_UserName, coursor);
  } catch (TwitterException e) {
  // TODO Auto-generated catch block
  //Loop to Read the data from followed list
  //to get Name of Best user
  for (User floower : _User) {
  String username = floower.getScreenName();// Friend Name ,, follower name
  int flooercout = floower.getStatusesCount(); /// Follower status count
  //Save the date to Hashmap
  ListofFollower.put(username, flooercout);
  //Get the TotalNumberOfTweetsReceived is total of user status
  TotalNumberOfTweetsReceived += flooercout;
  //Contionus to finish data (maybe save in more that page)
  } while ((coursor = _User.getNextCursor()) != 0);
  //To get the active user from the followed list
  Map.Entry<String, Integer> maxEntry = null;
  TotalNumberOfFollwed = ListofFollower.size();
  System.out.println("Tolal Number of Followed : " + TotalNumberOfFollwed);// Question 1
  //Comparing the tweets for the users to get the active follwer.
  for (Entry<String, Integer> entry : ListofFollower.entrySet()) {
  if (maxEntry == null || entry.getValue().compareTo(maxEntry.getValue()) > 0) {
  maxEntry = entry;
  //Getting the date from the comparing
  MostActiveFollowed = maxEntry.getKey();
  int NumberofTweet = maxEntry.getValue();
  System.out.println("Most Active Followed : " + MostActiveFollowed + " By Tweets number : " + NumberofTweet); // Question 4
  System.out.println("Total Number Of Tweets Received : " + TotalNumberOfTweetsReceived);//Qestion 2
  //Get the number of retweet by jan 2018
  public static void GetNumberOfReTweet(String _UserName) {
  //the first page
  int pageno = 1;
  String user = _UserName;
  //Save the list of tweets by date
  datestatus = new LinkedList<>();
  //Date format to get he month MM and the Year YYYY
  SimpleDateFormat sdf = new SimpleDateFormat("MM/YYYY");
  //TO save the status of user
  List<Status> statuses = new ArrayList<Status>();
  //Loop to read maybe more than 1 page
  while (true) {
  try {
  int size = statuses.size();
  Paging page = new Paging(pageno++, 200);
  //get all the user time line and save it ti statues
  statuses.addAll(twitter.getUserTimeline(user, page));
  //read the status one by one and get the retweets filterd by date
  for (Status s : statuses) {
  Date date = s.getCreatedAt();
  String dt = sdf.format(date);
  boolean is = s.isRetweet();
  Long id = s.getId();
  String str = "01/2018";
  if (!datestatus.contains(id)) {
  if ((dt.equals(str)) && (is)) {
  if (statuses.size() == size)
  } catch (TwitterException e) {
  //Numebr of retweets by date
  NumberOfReTweets = datestatus.size();// Question .3
  System.out.println("Total Tweets Number Of ReTweets during Jan 2018 : " + NumberOfReTweets);
  //This method to preper my twitter api and build the connection with twitter using twitter4j
  public static void Init() {
  _ConfigurationBuilder = new ConfigurationBuilder();
  _ConfigurationBuilder.setDebugEnabled(true).setOAuthConsumerKey("Use Your Key")
  .setOAuthConsumerSecret("Use Your Key")
  .setOAuthAccessToken("Use Your Key")
  .setOAuthAccessTokenSecret("Use Your Key");
  _TwitterFactory = new TwitterFactory(_ConfigurationBuilder.build());
  twitter = _TwitterFactory.getInstance();



Source: Twitter4J



Read more..

“Overseas students’ opinions on their interaction with native students”


The percentage of international students is increasing every day. Arkoudis(2013) claims that there are several benefits for interaction between overseas students and domestic students to improve their learning and develop students' cognitive skills. Both the international students and native students can learn about each other’s culture. It seems that interaction among international students and native students is one the most important problem face both of them. The aim of this report is to investigate the international students using the survey to identify their opinion about interaction with native students.


The main reason for this report was to study the overseas student's opinion about their interaction with domestic students. The data collected from the study depended on 13 international students survey from four different countries. The student age was range between 20s-50s.

   The survey was divided into five questions:

  • The first question consisted of a range of ages.
  • The second question was to know the country of the participants.
  • The third question was to know the number of international students who have native friends.
  • The fourth question was to know the student’s opinion if they prefer to spend time with people from the same country.
  • The fifth question consisted the group of agree/disagree questions.


According to the data collected from the international student’s questionnaire. It was found that, the total number of international students who have participated in the survey 13 students from the following countries as shown in Table (1):






Number of student





Table (1)

  • Table (2) shows the range of ages of the participants:







Table (2)

  • The percentage of international students who has native friends approximately 35%. Meanwhile, the percentage of the international students who do not have any native friend was 65%.
  • International students who prefer to spend all his time with people from his own country, or most of the time, or sometimes was 2,6 and 4 respectively.
  • The figure (1) shows the Agree/disagree answers presented in the next bar chart:
    1. There are many benefits to having English friends.
    2. It is easy to meet English people at the university.
    3. I am only here to study. I have no time to make friends.
    4. The University should provide social activities to help me meet native speakers.
    5. I am aware of what groups are organized by the student union.



The data analysis from the international students’ survey has found that most of the overseas students aware of the benefits of interaction with native students. Furthermore, many of the students commented on making friends with native students. At the same time, about half of the international students prefer to spend time with people from the same culture. Therefore, some of the international students care more about their culture and religion rather than socializing with native students. However, there are many opportunities to socialize separately from alcoholic activities, same as sport, films and too many other activities. In addition, some of the native students are fanatical about their cultures, that can stop international students from interacting with them.  Hence, a numerous number of the international students requested to interact with native students the main reason was to improve their language and to gain more knowledge about the culture of the host country. Arkoudis(2013) suggests that university staff can enhance the interaction between international students and domestic students by engaging them to work for group project such as Reading circle, same as these activities can break the wall between the students.





  • Arkoudis, S., Watty K., Baik, C., Yu, X., Borland, H., Chang, I., Lang J., Pearce, A., 2013, Finding common ground: enhancing interaction between domestic and international students in higher education, Teaching in Higher Education, 18(3), pp.222-235.
Read more..

Software Bugs

1. Introduction

Software bugs mean those mistakes made by a developer during the life cycle of developing software, as a result, to fix those bugs will be an effect on the developers’ time and on the cost of software. By reducing software bugs would give the developers to spend more time to add new features and enhance the software.

     The primary requirement for an end-user and software developer is software quality to be error-free. It seems that it is impossible to have software free bugs. However, this essay will examine the possibility of software free bugs and will compare the techniques methods used to help software be free bugs.


2. Bug life cycles

This section will demonstrate the benefit of studying the life cycle of bugs, and methods to help in decrease the cost of bugs.

2.1 History of software bugs

According to Davies (2014), software bugs as defined by The Institute of Electrical and Electronics Engineer (IEEE) is an issue in software are not fixed can cause in the incorrect outcome or fail in an application. Furthermore, the meaning of software bugs is still vague, there are many questions about the origin of a bug, how an end-user tread if he faces bugs in a software. However, the most important question is how to prevent or deal with them. There are many tools such as Bugzilla to help the developers to track the bugs in released software have been detected by end-user (Davies, 2014).


2.2 Bug tracking systems

The most effective role in bug life cycle is Bug Tracking Systems (BTSs), they are used to provide feedback on the system by developers and end-user, the feedback may be informed as an incorrect case or as a requirement to improve the system (Pinzger, M. et al.,2009).

     The feedback/bugs are recorded in a BTSs such as Bugzilla allow bug reporters (developers and end users) to report details of errors/bugs encountered while using an application (Davies, 2014). A real example of a bug shown in figure 1 from Mozilla the most common internet browser, the report includes a full explanation of a bug, specific information such as a piece of code and screenshots to guide the developer, all previous information is collected together in a bug report.

Figure 1

The benefit of the bug report is to guide the developer to fix the bugs using a useful information form the report. However, the information provided by bug report is not enough to fix the bug or determined the reason for the bug (Davies, 2014). As a result, the bug report is to help the developer to fix the bug and at the same time, can be stored as records to provide last update and the status of the bug to the reporter.

     According to Davies (2014) the bug report life cycle has a number of steps it depends on the BTS, figure 2 demonstrates the default stages of Bugzilla. The first step is an Unconfirmed status that created by a user during reporting about a bug, the decision back to the developer to decide to be Confirmed and send it to the next phase or the bug does exist, after the bug has been confirmed will be assigned to a specific developer to investigate and fix the bug and change the status to In Progress, if the developer has finished fixing the bug the status will be Resolved, the final stages is to check and test the bug by a quality engineer and confirm that the bug has been ixed correctly then the status will be changed to Verified.

Figure 2


The steps of the bug report life cycle provide more information about the bug and which techniques should be used to fix the bug by the developer.

There are two popular techniques in Software Development life cycle used to test the software by tester and developer. 

Sawant, el at. (2013, p.981) indicate that static testing or manual testing is a type of test which can be done by a set of tools or manually without executing the code to check the design and requirement documents to review it on the working document by the analyst and the testing team. When the system is inactive, the statics test executes security test to analyze the system without running the code. The static testing technique provides the developer the bug places in the application code on the early step of the life cycle. Static testing work with documents such as design, source code, and test plans documents. The static testing technique content many steps. First, inspection is one type of reviewing the code to find the defects using the checklist, code walkthroughs are managed by the moderator. Second, a walkthrough is meeting with the software users to describe the product, at the same time participants can ask questions as notes. Another step, technical reviews to check the code if is identical to the technical specifications and standards. The final step, informal reviews to review the documents and comments on it using informal methods.

Sawant, el at. (2013) indicate that dynamic testing or automated testing is executed while the software in active status or runtime. For example, the code executed same time of input the value, the output will be compared with the final result. The example shows the functional behavior of the application, during the runtime of the application it is possible to check the system performance and the quality of the application. There are two types of dynamic testing, functional testing, and nonfunctional testing. The dynamics techniques types are as the following. First, unit testing is the tool to test the code for individual modules. Second, integration testing is to test the join between the interfaces and the modules. Also, system testing is to test the whole application performance. The last one, acceptance testing is testing was done by the end-user.


 Nevertheless, both of the testing techniques dynamics and static are important for the Software Development life cycle. Sawant, et at., (2013) claims that both techniques have strong and weak points, which should be considered while executing these techniques on the application

Sawant, et at., (2013) demonstrate that the difference between both techniques that static technique is white box testing which is the first step on the software life cycle and it is effectively more than dynamic techniques, while the dynamic technique is the last step on the software life cycle. On the other hand, the static technique performs before execute the application whereas, the dynamic technique performed at the same time of the runtime. For example, online e-learning website with the static technique should go with the following steps: Review the documents, check the interfaces of the software and check the database tables.


This article has examined the history of software bugs and the methods of tracking bugs. At the same time, discuss the static and the dynamic techniques with comparing between both of the techniques. Also, discuss the possibility of having free bugs software. Unfortunately, it seems that impossible to have free bugs software. However, the strategies and techniques of testing software is a significant requirement to enhance the development life cycle (Thakare, S. el at.,2012, p.686).  Meanwhile, there are several methods to reduce software bugs, and many ways to solve it.



  • Davies, S., 2014, STUDYING THE LIVES OF SOFTWARE BUGS [Online] Glasgow, University of Strathclyde Glasgow. Available from: http://ethos.bl.uk/OrderDetails.do?uin=uk.bl.ethos.632701 [Accessed 15/11/2017].
  • Sawant, A. A. et at.,2012, Software Testing Techniques and Strategies [Online] Mumbai, University of Mumbai, INDIA. Available from: http://www.ijera.com/papers/Vol2_issue3/FQ23980986.pdf [Accessed 22/11/2017].
  • Pinzger, M. et al.,2009, "A Bug's Life" Visualizing a Bug Database [Online] Glasgow, University of Lugano, Switzerland and University of Zurich, Switzerland. Available from: https://serg.aau.at/pub/MartinPinzger/Publications/Dambros2007-bugslife.pdf [Accessed 15/11/2017].
  • Thakare, S. el at., 2012, International Journal of Emerging Technology and Advanced Engineering [Online] Mumbai, Computer Technology Department, India. Available from: http://citeseerx.ist.psu.edu/viewdoc/download?doi= [Accessed 15/11/2017].


Note: you may face some mistakes with sentence structures.


Read more..

To what extent are detection and prevention important considerations when dealing with plagiarism cases among international students?  Refer to the ideas and research conducted by Jocoy & DiBiase (2006) and Kier (2014).


A numerous number of countries around the world have lack of academic integrity resources, which make international students unaware of what plagiarism is. Many students believe that copying from books or internet is appropriate and no one is going to investigate even if a few words. Whilst, the violation of academic integrity is one type of plagiarism, "Plagiarism occurs when a writer deliberately uses someone else's language, ideas, or other original materials without acknowledging its source" (as cited in Jocoy and Dibiase et al., 2006, P.2). This essay will discuss detecting and preventing plagiarism between international student and increase student's awareness of plagiarism.  


Firstly, according to Jocoy and Dibiase (2006) states that significant increase in ability to detect plagiarism has improved in the last ten years, before using the technology widely, the manual detection was limited. For instance, two people’s manually matching papers that contained citations of the same source for literal copying lack paraphrasing (Karlins, 1988 cited in Jocoy and Dibiase et al., 2006)."The use of an automated plagiarism detection service noticeably improved our ability to find and document instances of copy-and-paste plagiarism. Manual decoction missed nearly 4 in 5 cases of plagiarism, such as a paragraph copied word-for-word. " (Jocoy and Dibiase et al.,2006, P.6) these days, technology makes it easier for both student and instructors, students easier to copy and paste from websites and for instructors simply to detect violations (Tenbusch,2002 cited in Jocoy and Dibiase et al.,2006). In addition, many online search engines such as Google allow the investigator to detect copied phrases. Whilst commercially services available, plagiarism detection software and online services (EVE, Turintin.com) matching each student paper to online documents or essay to find and give a decision of matching text (Jocoy and Dibiase, Dibiase). Ellery (2008, cited In Kier et al., 2014) plagiarism among Student working in a second language higher than domestic speakers. According to McCabe (2006, cited In Jocoy and Dibiase et al., 2006) state that, there are a number of reasons for this, including common awkwardness with the language and various cultural behavior's toward sharing and idiom of ideas. One more study found that, domestic English speakers involved in more plagiarism that international speakers, there is no reason why their consequence vary from other studies (McGee, 2004, cited In Jocoy and Dibiase et al., 2006). Nowadays, to improve our ability to match and detect online plagiarism within our international student's assignment using various ways. This allowed us to assess and compare the performance of automated and manual ways of plagiarism detection (Jocoy and Dibiase, 2006).   


Secondly, while recognizing the importance of plagiarism detection, educators have a liability to develop and ensure the level of academic integrity, which is a basic dogma of international students (Hersh, 1977, cited In Jocoy and Dibiase et al., 2006). There have been many types of research to prevent plagiarism, some of them were effective more than others. Some mention that students who received instruction about preventing plagiarism later plagiarized less than other students without instruction, but still stick to do plagiarized acts (Jocoy & Dibiase, 2006, cited In Kier et al., 2014). According to Landau (2002, cited In Kier et al., 2014) study, better than giving feedback to students should present them to "real-world" example of plagiarism to improve their ability to recognize the plagiarism and their paraphrasing. Barry (2006, cited In Kier et al., 2014) found that the students who exercise on paraphrasing have significant improvement in definitions of plagiarism and also were significantly better than students without such exercises. However, by engaging the class in four sessions, using six student-to-student paraphrasing practices was a success (Shirley, 2004, cited In Kier et al., 2014) some instructors found this method too time-consuming. Vardi (2012, cited In Kier et al., 2014) study, helping students to achieve "authorial identity" has resulted in a promising approach, these engaging students to foster their own voices. However, another approach comes from Kirsch (2012, cited In Kier et al., 2014) who make a seminar with interactive multimedia performances and information relating to plagiarism, paraphrasing, citation and more other activities. Theirs is a work in advance, but they were able to understand that students have most awkwardness in paraphrasing and widespread knowledge, even after taking the seminar. It seems that more survey is necessary to determine the situation in which practice is useful and probably the type of exercise that suit special international students.  


To conclude, understand Academic integrity is very important to prevent plagiarism and improve ways to detect plagiarism among international students. I think there are many methods to detect and prevent plagiarism, "To learning proper citation rules and how to avoid plagiarism, are essential skills for students in higher education" (Kier et al., 2014, P.6), focusing more on how to avoid plagiarism more than detect it will be the best method for international students.  



  • Jocoy & DiBiase (2006) Plagiarism by Adult Learners Online: A case study in detection and remediation* 
  • Kier (2014) How well do Canadian distance education student understand plagiarism? * 
  • Karlins, M., Michaels, C., and Podlogar, S., (1988) An empirical investigation of actual cheating in a large sample of undergraduates. Research in Higher Education 29(4), 359-364. 
  • Soto, J., Anand, S., and McGee, E. (2004, July/August). Plagiarism Avoidance: An empirical study examining teaching strategies. Journal of College Science Teaching 33(7), 42-48. Tenbusch, J. P. (2002). Keeping student honest in the electronic age. 
  • Ellery, K. (2008). Undergraduate plagiarism: A pedagogical perspective. Assessment & Evaluation in Higher Education, 33(5), 507–516. 
  • McCabe, D. L., and Pavela, G. (n.d.). Ten principles of academic integrity. College Administration Publications, Inc. Retrieved April 13, 2006 
  • Kohlberg. L., and Hersh, R. H. (1977). Moral Development: A review of the theory. Theory Into Practice, 16(2), 53 – 59. 
  • Barry, E. S. (2006). Can paraphrasing practice help students define plagiarism? College Student Journal, 40(2), 377-384. 
  • Shirley, S. (2004). The art of paraphrase. Teaching English in the Two Year College, 32(2), 186-188. 
  • Vardi, I. (2012): Developing students’ referencing skills: A matter of plagiarism, punishment, and morality or of learning to write critically? Higher Education Research & Development, 31(6), 921-930. 
  • Kirsch, B. A., & Bradley, L. (2012). Distance education and plagiarism prevention at the University Of South Carolina Upstate. Journal Of Library & Information Services in Distance Learning, 6(2), 79-99. 


Note: you may face some mistakes with sentence structures.


Read more..