Monthly Archives: April 2016

Iterating through a dictionary-Python

dict1={‘name’:‘Ashish‘,‘age’:30} for key,value in dict1.iteritems():     print“Key is “,key ,“and value is”,value Advertisements

Posted in Uncategorized | Leave a comment

Getting Started with CSS

CSS mainly uses the model :Style separated by declaration. As an example everything like h1,p tags will be considered as style. Example of CSS: <!DOCTYPE html> <html> <head> <style type=”text/css”> h1{ color: red; font-weight: normal; letter-spacing: .4em; text-transform: lowercase; } … Continue reading

Posted in CSS | Tagged | Leave a comment

Method Reference -Java

import java.util.ArrayList; import java.util.List; /** * @author ashishsharda * */ public class LL9 { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub List names =new ArrayList(); names.add(“Arjun”); names.add(“Ashish”); names.forEach(System.out::println); } }

Posted in Java | Tagged | Leave a comment

Print Time in Python

#Print Time in Python import time print time.time() print ‘Now print localtime‘,time.localtime(time.time()) print “Ascii time “,time.asctime(time.localtime(time.time()))

Posted in Python | Tagged | Leave a comment

Using numpy Python

”’ Created on Apr 16, 2016 @author: ashishsharda ”’ import numpy as np #Print 15 numbers a=np.arange(15) print a #Reshape as 3×5 matrix array a=np.arange(15).reshape(3,5) print a #Print Numbers within a range.In this case this will print first row. print … Continue reading

Posted in Python, Uncategorized | Tagged | Leave a comment

Structures in C++

#include <iostream> using namespace std; struct Books{     char name[50];     int age; }; int main() {     Books b1;     strcpy(, “My Book”);     b1.age=50;     cout<<“\n”<<“Name of the book is “<<<<“\n Age … Continue reading

Posted in Uncategorized | Tagged , , | Leave a comment

Stack Push and Pop-Java

import java.util.Stack; public class String3 { public static void main(String[] args) { Stack st=new Stack(); st.push(10); st.push(20); System.out.println(“Size of stack is “+st.size()); System.out.println(“Let me display this “); System.out.println(“First element of stack is “+st.firstElement()); System.out.println(“Remove top object “+st.pop()); } }

Posted in Java, Uncategorized | Tagged , | Leave a comment