Home Technical

Latest Comments

Bookmark this!!!

Technical
Oracle functions PDF Print E-mail
Tweet me!
Technical - Oracle
Written by Karthikeyan NG Administrator   
Monday, 15 March 2010 16:50


From today onwards I am going to share something technical like "tip of the day" in a daily basis. i will try to make it daily.

 

select ascii('K') from dual

This ascii function returns ascii value for the given value.


select asciistr('Ä Ê Í Õ') from dual

This function converts a string in any character set to an ASCII string using the database character set. The output of this query will be "\00C4 \00CA \00CD \00D5"

select chr(100) from dual

This function returns the character for the given ascii value. it is just opposite to ascii function.


select compose('o' || unistr('\0308') ) from dual

This function returns the unicode value for the given character


select concat('karthi', 'keyan') from dual

select 'karthi'||'keyan' from dual

The above two functions are used for concatenation


select dump('NGK') from dual

This function returns data type, length and internal representation of it.


select initcap('i like the way i am') from dual

This capitalizes the initial character from each word in the sentence


select instr('karthi','a',1) from dual

This returns the position of the given substring from the input string. Here the argument 1 will try to match its first occurence.


select lpad('7',3,'0') from dual

This function returns '007'. It pads zero on the left side.


select ltrim(' karthi') from dual

This function trims spaces on the left side

 

 


 

 
Scheme Language - basic programs III PDF Print E-mail
Tweet me!
Technical - Technical
Written by Karthikeyan NG Administrator   
Tuesday, 13 October 2009 10:07

(define (checkperfect num)
  (define total 0)
  (let loop((count 1) (end(round(/ num 2))) (temp 0))
    (if(<= count end)
       (begin
       (if(= (modulo num count) 0)
          (begin
            (set! temp count)
            (set! total (+ total temp))
            (loop (+ count 1) end temp)
            )
          (loop (+ count 1) end temp)
          )
       )
       (begin
         (if(= total num)
            #t
            #f
            )  )   )  )  )
;(checkperfect 28)

(define (findperfects start end)
  (define result(list))
  (let loop((count start))
    (if(<= count end)
       (begin
         (if(checkperfect count)
            (begin
            (set! result (append result (list count)))
            (loop (+ count 1))
            )
            (loop (+ count 1))
            )    )
       result
       )   )  )
Input:
(findperfects 1 5000)
Output:
(6 28 496)
                  
                                 
         

 
Scheme language - basic programs II PDF Print E-mail
Tweet me!
Technical - Technical
Written by Karthikeyan NG Administrator   
Monday, 12 October 2009 16:50

; string reverse

(define (stringrev inputString)
  (define len (string-length inputString))
  (define result "")
  (let loop((count len)) 
    (if(> count 0)
       (begin
       (set! result (string-append result (make-string 1 (string-ref inputString (- count 1)))))
       (loop (- count 1))
       ))
    result
    ) 
 )
input:
;(stringrev "karthi")
output:
"ihtrak"

_____________________________________
; fibonacci series

(define (fibonacci num)
  (define num1 0)
  (define num2 1)
  (define result(list))
  (let loop((count 0) (temp 0))
    (if(< count num)
       (begin
         (set! result (append result (list num1)))
         (set! temp num2)
         (set! num2 (+ num1 num2))
         (set! num1 temp)
         (loop (+ count 1) temp)
         )
       result
       )
    )
  )
input:
(fibonacci 5)
output:
(0 1 1 2 3)

___________________________
;struct

(define-struct std(roll name))
(define (pro clist)
 
  (std-roll (list-ref clist 0))
  (set-std-roll! (list-ref clist 0) 2)
  (std-roll (list-ref clist 0))
 
  )
 
(pro (list (make-std 11 "gg") (make-std 12 "tt")))
2


______________________________
(define (checkprime num)
  (if(< num 2)
     #f
     (begin
       (let loop((count 2) (end (round(sqrt num))))
         (if(<= count end)
            (begin
              (if(= (modulo num count) 0)
                 #f
                 (loop (+ count 1) end)
                           
                 )
              )
            #t
            )
         )
       )
     )
  )
;(checkprime 8)
;(checkprime 9)
;(checkprime 1)
;(checkprime 2)


(define (prime num)
  (define result(list))
  (let looping((count 2) (end num))
    (if(<= count num)
       (begin
         (if(checkprime count)
            (begin
            (set! result (append result (list count)))
            (looping (+ count 1) end)
            )
                        (looping (+ count 1) end)
                        )
         )
       result
       )
    )
  )
input:
(prime 50)
output:
(2 3 5 7 11 13 17 19 23 29 31 37 41 43 47)

Last Updated on Tuesday, 13 October 2009 09:50
 
Scheme Language - basic programs PDF Print E-mail
Tweet me!
Technical - Technical
Written by Karthikeyan NG   
Monday, 12 October 2009 15:48

Here I have listed some basic programs in scheme language. Ask me if you have any doubts :).

_____________________


;;Bubble sort

(define (bubble inputList)
  (define (swap inputList index1 index2)
    (let ((item1 (list-ref inputList index1)) (item2 (list-ref inputList index2)))
      (set-car! (list-tail inputList index1) item2)
      (set-car! (list-tail inputList index2) item1)
      )
      )
    (let loop1((count1 0) (len1 (- (length inputList) 1)))
      (if(< count1 len1)
           (begin
      (let loop2((count2 (+ count1 1)) (len2 (length inputList)))
                  
             (if(< count2 len2)
                 (begin
                  (if(> (list-ref inputList count1) (list-ref inputList count2))
                     (begin
                  (swap inputList count1 count2)
                  (loop2 (+ count2 1) len2)
                  )
                (loop2 (+ count2 1) len2)
                )
                  ) (loop1 (+ count1 1) len1)
                 )
                    
             
             )
        )inputList
      )
    ))
sample input:
(bubble (list 5 2 6 1 3))
output:
(1 2 3 5 6)
            

Read more...
 
TCS days starts PDF Print E-mail
Tweet me!
Technical - TCS
Written by Karthikeyan NG   
Thursday, 01 October 2009 23:52

On 29.09.2009 our training starts in TCS, Trivandrum technopark campus. It is really cool here both infra structure and also our accommodation. Training ends on March 4th approximately.  They have conducted some induction program for two days. It was interesting. Today they have divided us into batches and starts their training program. They gave some programs to do. All are simple programs which we have done in our first year C programming lab :) . They have given some 25 programs to do like that. Three days leave now. Tomorrow all are going to kovalam beach, padmanabapuram temple, museum and zoo blah blah blah.. for roaming for the next three days :) . We are going to book tickets for deepavali trip.I will update everything often.

 

 
«StartPrev1234NextEnd»

Page 1 of 4

Copyright © 2010 Karthikeyan NG. All Rights Reserved.
 


I am Karthikeyan NG, working as a software programmer in Hyderabad,India. Exploring new technologies, Bike riding, PC Gaming, Reading Novels, Blogging, Writing thamizh poems are my hobbies.


Who's Online

We have 4 guests online

Follow @ Twitter

Twitter / intrepidkarthi

My Visitors

mod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_counter
mod_vvisit_counterToday6
mod_vvisit_counterAll days4332

We have: 2 guests, 2 bots online
Your IP: 38.107.191.89
 , 
Today: Mar 16, 2010