Adding external links in CodeIgniter

1. Go to application –> config –> autoload.php
2. $autoload[‘helper’] = array(‘url’, ‘file’);
3. Have to put the files on root folder.
4. For css <link rel=”stylesheet” type=”text/css” href =”css/style.css” />
5. For image <img src=”images/a.jpg” width=”400″ height=”400″ alt=”a”/>

Put the links in head tag

Celsius to Fahrenheit [Matlab]

Write this code in a .m file


function [ans] = convert (ti,tf)

j = 1;
for i=ti:1:tf
   tempF =  round((9 / 5 ) * i + 32);
   ans (j,1) = i;
   ans (j,2) = tempF;
j = j + 1;
end

And call this function by this line from the Command Window in your matlab


[ans] = convert (1,100)

That will convert Celsius to Fahrenheit

Pizza Cutting – UVA 10079

http://uva.onlinejudge.org/external/100/10079.html
import java.util.*;
public class kiholo {
    public static void main (String chayapoth[]){
        Scanner input = new Scanner(System.in);
        long sum=1;
        long incrementbyone=1;
        long ja;
        ja=input.nextLong();

        while(ja>=0){

            while(ja>0){ // when input zero then output one  bcause  then you will get the whole pizza !!!

                sum=sum+incrementbyone;
                incrementbyone++;
                ja--;
            }
            System.out.println(sum);
            ja=input.nextLong();
            sum=1;
            incrementbyone=1;
        }
    }
}

Back to High School Physics – UVA 10071

http://uva.onlinejudge.org/external/100/10071.html
import java.util.Scanner;
public class Main {

  public static void main (String args []) {

    Scanner input = new Scanner (System.in);

    while (input.hasNext()) {
      long v,t,s;
      v = input.nextLong();
      t = input.nextLong();
      s = 2*v*t;
      if (s < 0) {
        s = -s;
        System.out.println(s);
      } else  {
        System.out.println(s);
      }
    }
  }
}

Hashmat the brave warrior – UVA 10055

http://uva.onlinejudge.org/external/100/10055.html
import java.util.Scanner;
public class wish {

    public static void main (String args []) {

        Scanner input = new Scanner (System.in);

        while (input.hasNext()) {

            long a,b,c;
            a = input.nextLong();
            b = input.nextLong();

            if(b > a) {
                c = b - a;
                System.out.println(c);
            }

            else {
                c = a - b;
                System.out.println(c);
            }
        }
    }
}