Win a copy of Head First Android this week in the Android forum!

Ishan Shah

Ranch Hand
+ Follow
since Jan 04, 2020
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ishan Shah

fopen( ) function is used to create a new file or to open an existing file. This call will initialize an object of the type FILE, which contains all the information necessary to control the stream.

For example:

FILE * pFile;
 pFile = fopen ("filename.txt","modename");

Here, filename is a string literal, which you will use to name your file, and access mode can have one of the following values −r,r+,w,w+,a,a+.

I hope this will helps you.
8 months ago
What is the difference between Div Tag and Section Tag?
Install an Extension in chrome browser, go to “Chrome Web Store” -> search for “PDF Mage” in the search bar -> click on “Add to Chrome” -> after installation is complete, go to any webpage and click of “PDF Mage” Icon and the web page will be converted to PDF.
Install “Nitro PDF Reader”. Press “CTRL+P” -> look for heading “Destination” -> click on dropdown -> Select “Nitro PDF Creator” -> Click “Print” (Popup Window will appear) -> Select destination Folder & name for the file & finally click on “Save”
Press “CTRL+P” -> look for heading “Destination” -> click on dropdown -> Select “Save as PDF” -> Click “Save” (Popup Window will appear) -> Select destination Folder & name for the file & finally click on “Save”
Press “CTRL+P” -> look for heading “Destination” -> click on dropdown -> Select “Save to Google Drive (will be saved as PDF in Google Drive)” -> Click “Save” (will automatically be saved as pdf in Google Drive if Google account is be Signed In)
Hope this will be helpful.

I hope this will help you.
which method is easy for data transfer in MVC .net?
9 months ago

The mobile-friendly website is something that is designed especially for mobiles, while responsive sites are those which adjust layout according to the device.

A mobile-friendly Website is a website that is made for small screens such as Android phones, ios, or any smartphones so that visibility will have more transparency and the readability will be clearer.
A mobile-friendly website affects various things such as text. It will be large with respect to laptops and tablets. The size of the image will get reduced but will be more understandable. Overall user experience(UX) will be good.

I hope this will help you

What you should realize is that developing a website with Flask is essentially writing regular Python code with a little bit of ‘website-specific code. Flask is very lightweight; it gives you the essentials, but that’s it — apart from plugins.

To start, you don’t need to know much more than the following:

You create a Flask instance
from flask import Flask

app = Flask(__name__)  # don't worry about the __name__ bit for now
Each page is handled by a function, whose route is registered by a decorator
def index():
The app. route bit simply registers the function below to a specific path. It’s an alternative to app.add_url_rule('/', 'index', index). It’s just telling the app to refer to the index function whenever a user requests ‘/’.

Each of these functions can render a website using the data that you got using ‘regular Python’
import datetime  
from flask import render_template  
def index():
   current_dt =
You need a templates/index.html file which is written using Jinja2. This is regular HTML mixed with a specific syntax for logic and to use the data that ‘was sent to’ the template using the render_template function.

<title>My website
{{ current_dt.strftime("%H:%M" }}  # using a custom filter would be better, but is out of the scope of this answer
You run your development server
And that’s it. Your first Flask website shows the current time. Everything else just expands on this basis.

I hope this will help you
9 months ago

A simple question indeed; but of course, a conceptual one.

Well, a data type is a particular kind of data item, as defined by the values it can take, the programming language used, or the operations that can be performed on it. Example - integer, character, float, double, etc.

Now, in Java, the default values of float and double are as below.

Float - 0.0f
Double - 0.0d
You can verify the same by running the below program.

public class DefaultValue


static double d;

static float f;

public static void main(String[] args)


System.out.println("Double :" + d);

System.out.println("Float :" + f);




Hope by now, you are confident with the default values of float and double in Java.

A possible use case where a web app needs to access the file system is when you want to upload a file. You would let the user select a file from the local file system using the HTML input tag of type file, like this:

<!DOCTYPE html>
 <html lang="en">
   <title>Testing File Upload</title>
<script src="myscripts.js"></script>
<input id="file-upload" type="file"  

I hope this will help you
This HTML alone will let the user browse the file system and select a file. When the user selects the file, the following javascript code in myscripts.jar will convert the selected file into data URL. Data URL is a Base64 encoded version of the selected file.


window.addEventListener("load", function() {
 document.getElementById("file-upload").onchange = function(event) {
   var reader = new FileReader();
   var me = this;
   reader.onload = function () {
     var fileContent = reader.result;
You can store the value of file content in a database and then allow the user to download the file display the file on the browser if the file is an image or pdf.


Do you know it minimum and maximum?

Assume that the original array is a.

If not, find them with a single loop. Assume they are max and min.

Create a 1-d array (freq)with max-min+1 elements and initialize its elements to zeros.

Now take one element from the original array, a, and calculate k=element value - min. Increment freq[k] by one.

Like this freq array contains frequencies.

This is a linear order method.
using namespace std;
int frequency(int a[], int n, int x)
int count = 0;
for (int i=0; i < n; i++)
if (a[i] == x)  
return count;
// Driver program
int main() {
int a[] = {0, 5, 5, 5, 4};
int x = 5;
int n = sizeof(a)/sizeof(a[0]);
cout << frequency(a, n, x);
return 0;
I hope this will help  you

10 months ago
it strikes the right balance of flexibility, speed, and learning curve. I can’t think of any practical problem that can’t be coded in Python - and no one has to be the world's top coder to implement.

when I was in (chemical) engineering school, everyone solving machine learning or simulation type problems learned Matlab or Python, with more people gravitating towards Matlab. These days, it seems, more people gravitate to Python as the ultimate tool, with Matlab being more application-specific. And I think this is universally the case across the sciences. It’s what people know.

Python was quick to add specific packages for handling all sorts of domain specific analytics challenges.

it’s free and accepted among large companies.

there really aren’t any obvious capability benefits to using anything else, other than ease of use at a cost of flexibility.

I hope this will help
10 months ago
Read basic concepts in different java related books. Visit for basic concepts. On concepts cleared in very easy language. You can understand very well in few time periods.
Also, visit or, there are lots of warmup problems and classical problems are available.
Try to select different problems on such kind of websites. And try to solve such problems in java.

More Practices

I hope this will help you
10 months ago
Speechly has a great free tier. You should check out Speechly | Spoken language understanding API for developers

Speechly is actually more than speech recognition API: it returns with the actual transcript but also with the user intent and entities. This helps to build complex voice user interfaces, because, for any task, there’s an almost unlimited way of saying that in natural language; for example “switch off the kitchen light”, “turn off the kitchen light”, “make kitchen dark” all share the same intent (turn_off_lights) and the same entity (kitchen).

If you would only use speech recognition, you’d need to make some kind of grep for all those different utterances and copypaste it for every room. With Speechly, the API would return something like
INTENT: turn_off_lights
ENTITY: kitchen(room)

I hope this will help you
10 months ago

Serverless doesn't mean an absence of servers or no servers. So, is it one of the most popular tech-misnomers? Maybe.

Serverless completely abstracts the underlying details of cloud infrastructure. The servers are still there, however you no longer require to manage them. Does this sound like the Cloud PaaS (Platform as a Service)?

There’s a subtle difference between PaaS & Serverless (FaaS). In PaaS, you have to plan & define an Auto-Scaling strategy whereas in Serverless (FaaS) you just don't care about how/what's happening behind the scene - i.e. complete abstraction!

In Serverless, basically, a Function spins-up servers with an event/trigger and cleans it up (the resources, etc.) once the request/task is completed.
There is always one or more servers. It is serverless because the space you use in their server is in a container.

Monitoring containers help them monetize and handle what you’re doing there.

For you it is also beneficial, if the specs of your container matches what your application needs, you have less things to deal with and less responsabilities. Generally speaking, the cost of the service is quickly lower than the cost of the maintenance of doing it yourself.

I hope this will help you
11 months ago
It has no official standard since it is primarily an architectural style.
Can use several standards like HTTP, URL, JSON, and XML
It takes less bandwidth and resources since it deploys multiple standards.
It utilizes URL exposure such as @path to expose business logic
It uses services interfaces such as to expose business logic
Convenient with JavaScript and allows easy implementation.
Utilizes Web Application Description Language.

Based largely on HTTP and XML.
It only features SSL.
It uses service interfaces such as to expose business logic.
Based largely on HTTP and XML.
It is an official standard because it is a protocol.
Also convenient with JavaScript but is not supportive for greater implementation.
Uses Web Services Description language.

API is basically like a command for software, a command which one can execute by some defined protocols. HTTP is one such protocol.

Usually, APIs are created in applications and such applications are hosted on some server. Now to call those APIs one needs to use HTTP protocol over the network.

I hope this will help you
11 months ago