Skip to content

Instantly share code, notes, and snippets.

View yask123's full-sized avatar
👨‍💻

Yask Srivastava yask123

👨‍💻
View GitHub Profile
public class test
{
public void run()
{
System.out.println("Hello World");
}
}
public class Palin
{
public static void main(String args[])
{
Palin ob = new Palin();
int max=0;int tmp=0;
for(int i=100;i<999;i++)
{
for(int j=100;j<999;j++)
<?php
include ‘connection.php’;
$query = “SELECT * FROM people”;
$result = mysql_query($query);
while($person = mysql_fetch_array($result))
{
echo “<h3>”.$person[‘Name’].”</h3>”;
}
echo “<h2>YIPEEE , I finally outputted data from mysql !!</h2>”;
echo “GREAT SUCCESS!!!!!!!!!”;
@yask123
yask123 / fibo.py
Created July 21, 2014 10:11
Generating Fibonacci Series
def gen_fibo(n):
a,b=0,1
while(a<n):
print(a,end=' ')
a,b=b,a+b
print()
gen_fibo(100)
class Student(list):
def __init__(self,a_name,a_age,a_branch,a_pointers):
list.__init__([])
self.name=a_name
self.age=a_age
self.branch=a_branch
self.append(a_pointers)
def top_pointer(self):
return(sorted(self)[0])
@yask123
yask123 / prime_factor.py
Last active August 29, 2015 14:04
Finding Prime Factors
import math
def isprime(n):
for num in range(2,math.floor(math.sqrt(n))+1):
if n%num==0:
return(False)
return(True)
def findfactors(n):
import collections
import e3#importing previous pyton file for findfactor() function , sorry for seperating !
a=e3.findfactors(100)#Called the opther function using namespace
print(a)
counter=collections.Counter(a)#Return a dictionary of frequency of elements in the prime list
pro=1#will store the product of (a+1)*(b+1).. explained in the blog
for each_key in counter:
pro*=(counter[each_key]+1)#Calculate (a+1)*(b+1)*...etc
@yask123
yask123 / Main.java
Created August 2, 2014 20:34
This is a test
package com.company;
public class Main {
public static void main(String[] args) {
// write your code here
System.out.println("Hello world");
int a []={1,2,3,4};
for(int i=0;i<a.length;i++)
{
@yask123
yask123 / designer.html
Created September 29, 2014 20:19
designer
<link href="../topeka-elements/category-images.html" rel="import">
<link href="../core-icon/core-icon.html" rel="import">
<link href="../core-icons/core-icons.html" rel="import">
<link href="../core-icons/av-icons.html" rel="import">
<link href="../paper-fab/paper-fab.html" rel="import">
<polymer-element name="my-element">
<template>
<style>
@yask123
yask123 / designer.html
Created October 2, 2014 18:42
designer
<link rel="import" href="../core-animated-pages/core-animated-pages.html">
<link rel="import" href="../core-animated-pages/transitions/hero-transition.html">
<link rel="import" href="../core-animated-pages/transitions/cross-fade.html">
<link rel="import" href="../core-animated-pages/transitions/slide-down.html">
<link rel="import" href="../core-animated-pages/transitions/slide-up.html">
<link rel="import" href="../core-animated-pages/transitions/tile-cascade.html">
<link rel="import" href="../core-input/core-input.html">
<polymer-element name="my-element">