Make Layout Scroll Vertically in Android

George John
Updated on 30-Jul-2019 22:30:24

8K+ Views

Before getting into example, we should know what is vertical Scroll View(Scroll View). Vertical Scroll view provide by android.widget.ScrollView class. It is used to scroll child views in a vertical direction.This example demonstrates how to use Vertical Scroll view.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.                                                     ... Read More

Reverse Direction of Marquee in TextView in Android

George John
Updated on 30-Jul-2019 22:30:24

642 Views

This example demonstrate about How to reverse the direction of marquee of a Text View.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.     In the above code, we have taken text view and ellipsize property as marquee as shown below -android:ellipsize = "marquee" android:layoutDirection = "rtl" android:textDirection = "rtl" android:fadingEdge = "horizontal" android:marqueeRepeatLimit = "marquee_forever" android:scrollHorizontally = "true" android:singleLine = "true"Step 3 − Add the following code to src/MainActivity.javapackage com.example.andy.myapplication; import android.os.Bundle; ... Read More

Create Directories Recursively in Java

Samual Sam
Updated on 30-Jul-2019 22:30:24

184 Views

The method java.io.File.mkdirs() is used to create the specified directories, including the necessary parent directories. This method requires no parameters and it returns true on the success of the directories creation or false otherwise.A program that demonstrates this is given as follows −Example Live Demoimport java.io.File; public class Demo {    public static void main(String[] args) {       String recursiveDirectories = "D:\a\b\c\d";       File file = new File(recursiveDirectories);       boolean flag = file.mkdirs();       System.out.println("The directories are created recursively? " + flag);    } }The output of the above program is as follows ... Read More

Display Today's Date in Java with SimpleDateFormat

karthikeya Boyini
Updated on 30-Jul-2019 22:30:24

283 Views

To work with SimpleDateFormat class in Java, import the following package.import java.text.SimpleDateFormat;To get the date, use the format() method as shown below. Firstly, set the date format −Calendar cal = Calendar.getInstance(); SimpleDateFormat simpleformat = new SimpleDateFormat("dd/MM/yyyy");Now, we will get the date −simpleformat.format(cal.getTime())The following is the complete example −Example Live Demoimport java.text.SimpleDateFormat; import java.util.Calendar; public class Demo { public static void main(String[] args) throws Exception { Calendar cal = Calendar.getInstance(); SimpleDateFormat simpleformat = new SimpleDateFormat("dd/MM/yyyy"); System.out.println("Today's date = "+simpleformat.format(cal.getTime())); ... Read More

Implement a Stack from a LinkedList in Java

karthikeya Boyini
Updated on 30-Jul-2019 22:30:24

3K+ Views

A stack can be implemented using a LinkedList by managing the LinkedList as a stack. This is done by using a class Stack which contains some of the Stack methods such as push(), top(), pop() etc.A program that demonstrates this is given as follows −Example Live Demoimport java.util.LinkedList; class Stack { private LinkedList l = new LinkedList(); public void push(Object obj) { l.addFirst(obj); } public Object top() { return l.getFirst(); } public ... Read More

Find HCF of Two Given Bytes in 8085

Vrundesha Joshi
Updated on 30-Jul-2019 22:30:24

3K+ Views

In this program we will see how to find the HCF or GCD of two numbers using 8085.Problem StatementWrite 8085 Assembly language program to find the HCF of two numbers stored at memory location 8000H and 8001H.DiscussionThis problem is solved by the Euclidean algorithm to find HCF. This algorithm is very simple.The algorithm steps are as follows −If first number and second number are same, thengo to step 3.Else if first number < second number, then exchange no1 andno2.first-number A, then exchange B and AF00D90SUB B   if B < A, subtract B from AF00EC3, 06, F0JMP LOOP  Jump to LOOPF01148EXGMOV ... Read More

FTP Put Function in PHP

Samual Sam
Updated on 30-Jul-2019 22:30:24

286 Views

The ftp_put() function uploads a file to the FTP server.Syntaxftp_put(con,remote_file,local_file,mode,beg_pos);Parameterscon − The FTP connectionremote_file − The file path to upload tolocal_fil − The path of the file to uploadmode − The transfer mode. The following are the possible value −FTP_ASCII, orFTP_BINARYbeg_pos − The position to start uploadingReturnThe ftp_put() function returns TRUE on success or FALSE on failure.ExampleThe following is an example that uploads a file to the server −

What is Ragging and Its Effects in Colleges

Rashmi Iyer
Updated on 30-Jul-2019 22:30:24

6K+ Views

Ragging is a practice in colleges, hostels and other educational institutes where the senior or an influential person tends to demoralize and defame the juniors through the means of verbal or physical abuse and harassment. The term ragging is more prominent in the countries of India, Pakistan, Sri Lanka, and Bangladesh. In other countries, the same practice has different terms associated with it.Different forms of ragging exist due to the following key reasons:Considered as a form of entertainmentThe senior who have stayed for a slightly longer time in the system of the college have an extraordinary sense of superiority. This ... Read More

Programming the 8257

Jennifer Nicholas
Updated on 30-Jul-2019 22:30:24

366 Views

We know from the study of the description of 8257 that it consists of 40 pins and the condition when it works in Slave Mode and Master mode. From the microprocessor point of view, the I/O port is a chip which is used exclusively for DMA control application and is not used for interfacing I/O devices for the purpose of data transfer with the processor. This chip is only used to control the DMA data transfer for four I/O ports. For every I/O port there exists a corresponding DMA channel. This chip provides all the features which are needed for ... Read More

8085 Program to Convert ASCII to Binary

Anvi Jain
Updated on 30-Jul-2019 22:30:24

5K+ Views

Now let us see a program of Intel 8085 Microprocessor. This program will convert ASCII to binary values.Problem StatementWrite 8085 Assembly language program to convert ASCII to binary or Hexadecimal character values. DiscussionWe know that the ASCII of number 00H is 30H (48D), and ASCII of 09H is39H (57D). So all other numbers are in the range 30H to 39H. The ASCII value of 0AH is 41H (65D) and ASCII of 0FH is 46H (70D), so all other alphabets (B, C, D, E, F) are in the range 41H to 46H.Here the logic is simple. We are checking whether the ASCII ... Read More

Advertisements