Posts

Showing posts from April, 2018

Upgrading to Ubuntu 18.04 (Bionic Beaver)

Image
Note: To upgrade your os to Bionic Beaver(18.04) you must have prior version of ubuntu 17.10 or the last long time support(LTS) version 16.04 . error "Target configured multiple times" fixed. scroll down to see the solution. UBUNTU 18.04 Bionic Beaver         To upgrade to the latest version you must have the root privileges or you can use sudo command with the administrator password. For ubuntu 18.04 LTS the support will be provided till  2023 . steps to upgrade to 18.04:-   $sudo apt update $sudo apt upgrade  Now that you are upgraded to 18.04 you should remove the duplicate packages using following command:   -$sudo apt dist-upgrade   dist-upgrade in addition to performing the function of upgrade, also intelligently handles changing dependencies with new versions of packages; apt-get has a "smart" conflict resolution system, and it will attempt to upgrade the most important packages at the expense of less important ones if n

Passing Data from Fragment to Activity

For passing the data from the fragment to the activity we can define "interface" in the fragment class which should be implemented it the activity class in which you want to transfer the data. for this, here is an small example which will show you how to pass the data the to the activity class. interface is the collection of abstract methods that are implemented by the class. A class that implements an interface must implement all of the non-default methods described in the interface , or be an abstract class. inside myfragment.java class:  //define the interface as shown below and call it in the fragment wher you want // to pass the data to the activity..in this case for example we will be passing //sample strings. public interface myInterface{  public void addData(ArrayList<String> lst) ; //here we can pass the data using Bundle also.  } inside myActivity.java class: //Activity in which you are recieving your data must look like the

Sending Mails using Intents

Using ACTION_SEND in intent for mail.. The code written below is using ACTION_SEND in the intent to generate mail which can be used to send the email to the single or multiple  person. firstly we will generate the intent with ACTION_SEND or ACTION_SENDTO. ACTION_SENDTO has one drawback that we can not add the attachment/files to the intent that we are sending. after setting the ACTION we will set up the intent with the type of the data that it is holding, for now we will use "message/rfc822", documentation on the type you can get here ( rfc822 ). Now we will move on to the setting the parameters that we are going to pass to our email using the function putExtras(). after setting up parameters for the mail we will create a chooser and launch our intent. NOTE: The Android device on which application is going to run must have already setup their mailing application. CODE:  Intent emailIntent=new Intent(Intent.ACTION_SEND);   //add the multiple or single reciev

Tips and Tweaks for Android and Windows (terminal,MAC Spoofing)

ANDROID TERMINAL AND MAC SPOOFING   1.Portable terminal (save 200mb space on your internal disk of android device to use 1st and 2nd script ) Root your android handset(for rooting go online with your device name to xda-developer) , patch the busy box or download it or askme ,now add any good terminal from android playstore and start using most of the featres of linux terminal. ....now dont bother bringing laptops for linux class . and the many thing you will be able do..for ex:spoofing mac address (just put the mac address of your registered college laptop and use it in phone also..) and more.. 2.This one to help you guys with the commands to spoof your MAC address on you android, and for general knowledge MAC address is a 12 character address given by the device manufacturers (though you all are genius i thought you might need it ).. $~>su ;dont bother about this ,it is just to enable the "superuser"..now next one $~>busybox iplink show eth0 ;this one wi

TOP COMPETITORS: HACKERRANK

Problem Statement:  Julia just finished conducting a coding contest, and she needs your help assembling the leaderboard! Write a query to print the respective hacker_id and name of hackers who achieved full scores for more than one challenge. Order your output in descending order by the total number of challenges in which the hacker earned a full score. If more than one hacker received full scores in same number of challenges, then sort them by ascending hacker_id . Tables: 1. Hackers: The hacker_id is the id of the hacker, and name is the name of the hacker.   2. Difficulty: The difficult_level is the level of difficulty of the challenge, and score is the score of the challenge for the difficulty level. 3. Challenges: The challenge_id is the id of the challenge, the hacker_id is the id of the hacker who created the challenge, and difficulty_level is the level of difficulty of the challenge. 4. Submissions: The submission_id is the id of the submission,