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)
|
|
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 |
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...
|
|
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.
|
Tweet me!
|
Technical -
Technical
|
|
Written by Karthikeyan NG
|
|
Sunday, 27 September 2009 19:47 |
|
Recently I got a project from one of my relative's organization. It deals about maintaining their customer's details along with their credit amount and it must generate reports based on their specification and exporting the report results into excel sheet.
Actually I thought it was an easy one to do with ASP.Net grid view controls. So I have started with that. In that application we must store the customers name in Tamil font. It was the main one. Every name will be a combination of tamil and english letters. For example, his/her initials will be in english and name will be in tamil.
To store these type of data into the database we can use the data field type "nVarChar" in SQL server.I am using SQL server 2005 express edition. It is mainly for storing UniCodes. While inserting the data into the database add a prefix "N". For example your insert query must be like insert into karthidb(N'unicodedata',30);
It must be like this. Really it was very much useful for me. I used Thagadoor font and also a java script for toggling from tamil font to english font and vice versa. For any doubts regarding this feel free to contact me.
|
|
|
|
|
|
|
Page 1 of 4 |
Vinnai thandi varuvaya review
VTV - I love this film a lot..U ve narrated the story ll..but its not sequential..think u ld ve slept while seein
Luv s a feel tat can come to anyone.U cant say tht only those who think tat they can liv together ld luv..Coz luv doesnt come after thinkin these n all..Even if they r not able to liv 2gether,the feel ll be thr always n tats luv..Thr ll be a feel between them til the end of lif even if they r apart..tats true luv..this s jus my own opinion..
உலக காதலர்களுக்கு
Kavithai romba nalla irundhuchu.. adhuvum ""காதலின் காதலனாக!!!"" konnuteenga..!! Nee nadadhu machi.. una adicchuka eyavanum kedayadhu..!!
My name is Khan movie-review
MNIK rockzz !!! - Dude...had seen d movie yesterday... All d credits goes to SRK who really made d movie lively...The nice thing about the story is huv the followin link happend Rizwan khan -> Bush -> Muslim -> 9/11 -> Obama
Beauty of d story
உலக காதலர்களுக்கு
kalakreenga rep!!! great going...............
உலக காதலர்களுக்கு
Indraya Kadhal - Ulaga kadhalarka ezhuthina indraya kadhal kavithai superb ...
My name is Khan movie-review
My comment - That's `asperger's syndrome' very much what Justin Hoffman played in `Rain Man'(a classic of all time). Hope they've got inspired from that role which won him an oscar. The movie is very much Indian-ish when it comes to the anti-climax and climax(media coverage and meeting Obama
) Anyways just printing my first test comment on your site
உலக காதலர்களுக்கு
Super kavidhai - It resembles my love boss. Nice one. Keep it up.
My name is Khan movie-review
MNIK is good -
I have seen the movie and it was really nice. I love sharukh.