Karthikeya Boyini has Published 2383 Articles

ftp_nb_fput() function in PHP

karthikeya Boyini

karthikeya Boyini

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

30 Views

The ftp_nb_fput() function uploads from an open file and saves it to a file on the FTP server.Syntaxftp_nb_fput(con, remote_file, open_file, transfer_mode, beg_pos);Parameterscon − The FTP connectionremote_file − The file to upload toopen_file − The pointer to the open filetransfer_mode − This is the transfer mode. The following are the possible ... Read More

Java Program to remove file information from a filename returning only its path component

karthikeya Boyini

karthikeya Boyini

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

85 Views

The method pathCompinent() is used to remove the file information from a filename and return only its path component. This method requires a single parameter i.e. the file name and it returns the path component only of the file name.A program that demonstrates this is given as follows −Example Live Demoimport ... Read More

Display just hour and minute using Formatter in Java

karthikeya Boyini

karthikeya Boyini

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

164 Views

Firstly, create a Formatter and a Calendar object.Formatter f = new Formatter(); Calendar c = Calendar.getInstance();To display hour using Formatter class, use the ‘l’ conversion a character −f = new Formatter(); System.out.println(f.format("Hour: %tl", c));To display minute using Formatter class, use the ‘M’ conversion character −f = new Formatter(); System.out.println(f.format("Minute: %1$tM", ... Read More

ftp_nb_get() function in PHP

karthikeya Boyini

karthikeya Boyini

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

43 Views

The ftp_nb_get() function downloads a file from the FTP server.Syntaxftp_nb_get(con, local_file, server_file, transfer_mode, beg_pos);Parameterscon − The FTP connectionlocal_file − The local file pathserver_file − The server file to downloadtransfer_mode − This is the transfer mode. The following are the possible values −- FTP_ASCII, or- FTP_BINARYbeg_pos − The position to begin ... Read More

Java Program to display date and time information in lowercase

karthikeya Boyini

karthikeya Boyini

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

113 Views

Firstly, create a Formatter and a Calendar object.Formatter f = new Formatter(); Calendar c = Calendar.getInstance();To display complete date and time information use the ‘c’ conversion character. However, to display it in lowercase, use ‘tc’ −f = new Formatter(); System.out.println(f.format("Date and Time (lowercase): %tc", cal));The following is an example −Example Live ... Read More

Get SubList from LinkedList in Java

karthikeya Boyini

karthikeya Boyini

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

875 Views

The subList of a LinkedList can be obtained using the java.util.LinkedList.subList(). This method takes two parameters i.e. the start index for the sub-list(inclusive) and the end index for the sub-list(exclusive) from the required LinkedList. If the start index and the end index are the same, then an empty sub-list is ... Read More

ftp_pasv() function in PHP

karthikeya Boyini

karthikeya Boyini

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

76 Views

The ftp_pasv() function turns the passive mode on or off.Syntaxftp_pasv(con, pasv)Parameterscon − The FTP connectionpasv − Specifies the passive mode. The following are the possible values −TRUE (passive mode on)FALSE (passive mode off)ReturnThe ftp_pasv() function returns TRUE on success or FALSE on failureExampleThe following is an example −Read More

Java Program to strip a filename of its extension after the last dot

karthikeya Boyini

karthikeya Boyini

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

3K+ Views

The method removeExtension() is used to strip a filename of its extension after the last dot. This method requires a single parameter i.e. the file name and it returns the file name without its extension.A program that demonstrates this is given as follows −Example Live Demoimport java.io.File; public class Demo { ... Read More

Display today’s date in Java with SimpleDateFormat

karthikeya Boyini

karthikeya Boyini

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

178 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; ... Read More

Implement a stack from a LinkedList in Java

karthikeya Boyini

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 { ... Read More

Advertisements