×
Home
Jobs
Tools
Coding Ground
Current Affairs
UPSC Notes
Online Tutors
Whiteboard
Net Meeting
Tutorix
Login
Packages
Categories
Java
JSP
iOS
HTML
Android
Python
C Programming
C++ Programming
C#
PHP
CSS
Javascript
jQuery
SAP
SAP HANA
Data Structure
RDBMS
MySQL
Mathematics
8085 Microprocessor
Operating System
Digital Electronics
Analysis of Algorithms
Mobile Development
Front End
Web Development
Selenium
MongoDB
Computer Network
General Topics
Library
Videos
Q/A
eBooks
Login
Library
Videos
eBooks
Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Selected Reading
UPSC IAS Exams Notes
Developer's Best Practices
Questions and Answers
Effective Resume Writing
HR Interview Questions
Computer Glossary
Who is Who
Pythonista
has Published
72
Answers
Why we can't use arrow operator in gets and puts?
C++
Server Side Programming
Programming
Pythonista
Published on 08-May-2018 15:09:20
You can't read user input in an un-initialized pointer. Instead, have a variable of the struct data type and assign its address to pointer before accessing its inner elements by → operatorexample#include <stdio.h> struct example{ char name[20]; }; main(){ struct example *ptr; struct example e; puts("enter ...
Read More
Extract decimal numbers from a string in Python
Python
Server Side Programming
Programming
Pythonista
Published on 08-May-2018 14:50:30
Using RegEx module is the fastest way.>>> import reAssuming that the string contains integer and floating point numbers as well as below −>>> s='my age is 25. I have 55.50 percent marks and 9764135408 is my number'the findall() function returns a list of numbers matching given pattern which includes digit ...
Read More
How to convert a string to a integer in C
C
Server Side Programming
Programming
Pythonista
Published on 08-May-2018 14:28:46
First extract characters from left bracket '(' using strchr() function.char *name="The Matrix(1999)"; char *ps; ps=strchr(name, '(');Then add each character within brackets () to an char arraychar y[5]=""; int p; for (p=1;p<strlen(ps+1);p++) { y[p-1]=ps[p]; } y[4]='\0';Lastly convert resultant string to integer using atoi() functionyear=atoi(y); printf("year=%d", year);You can now apply required ...
Read More
C++ 'a.out' not recognised as a command
C++
Server Side Programming
Programming
Pythonista
Published on 08-May-2018 12:59:16
Having entered following command from linux terminal −$ g++ helloworld.cppThe a.out file should be created in the current working directory if the compilation is successful. Check if a.out is created.To execute enter following from command line −$ ./a.outIn most cases, output of your source program is displayed. However, as in ...
Read More
compareTo() definition mistake?
Java 8
Object Oriented Programming
Programming
Pythonista
Published on 01-May-2018 15:23:36
The example works correctly. The compareTo() method is called by a string object and takes another string object as argument. The return value is integer and is difference in Unicode values of characters of respective strings when they are not equal. The value can be -ve, 0 or +ve.
How to write string functions in Java?
Java 8
Object Oriented Programming
Programming
Pythonista
Published on 01-May-2018 15:10:00
1) take a string from the user and check contains atleast one digit or not:Extract character array from string using toCharArray() method. Run a for loop over each character in array and test if it is a digit by static method isDigit() of character classpublic static boolean chkdigit(String str) { ...
Read More
Java is also not pure object-oriented like c++
Java 8
Object Oriented Programming
Programming
C++
Pythonista
Published on 01-May-2018 14:33:39
the main() method in Java code is itself inside a class. The static keyword lets the main() method which is the entry point of execution without making an object but you need to write a class. In C++, main() is outside the class and writing class it self is not ...
Read More
Python - How to convert this while loop to for loop?
Python
Server Side Programming
Programming
Pythonista
Published on 01-May-2018 14:26:49
Usin count() function in itertools module gives an iterator of evenly spaced values. The function takes two parameters. start is by default 0 and step is by default 1. Using defaults will generate infinite iterator. Use break to terminate loop.import itertools percentNumbers = [ ] finish = "n" num = ...
Read More
How can I convert a Python Named tuple to a dictionary?
Python
Server Side Programming
Programming
Pythonista
Published on 03-Mar-2018 00:37:06
Namedtuple class is defined in the collections module. It returns a new tuple subclass. The new subclass is used to create tuple-like objects that have fields accessible by attribute lookup as well as being indexable and iterable. The constructor takes type name and field list as arguments. For example, a ...
Read More
How to split Python tuples into sub-tuples?
Python
Server Side Programming
Programming
Pythonista
Published on 03-Mar-2018 00:19:06
Here is a tuple with 12 integers. In order to split it in four sub-tuple of three elements each, slice a tuple of three successive elements from it and append the segment in a lis. The result will be a list of 4 tuples each with 3 numbers.>>> tup=(7, 6, ...
Read More
1
2
3
4
5
6
7
8
Next
Advertisements
Print
Add Notes
Bookmark this page
Report Error
Suggestions
Save
Close
Dashboard
Logout