The winner of our last programming challenge is Jichun Wang. Jichun is a Sun Microsystems alumnus, now a senior software engineer at Synopsis. He uses perl to call a Google RESTful API and to parse the JSON outcome from google to get the result counting of google search. You can find his program here on my SAS_ACADEMY group.
Because the API he used is deprecated, you can find there is a significant difference in the counting using this API and that you get by googling directly in browser; however, he got the order correct!
|A-Hero||Cnt By API||Cnt By Browser|
|Iron Man||18,700,000||266 M|
I am no big Harry Potter fan so I can’t answer questions like when Ron felt in love with Hermione. But that doesn’t stop me from playing this game:
Find the motto of Hogwarts School of Witchcraft and Wizardry, “draco dormiens nunquam titillandus“, in English by using a program written in whatever programming language you feel comfortable.
Something may pop up onto your mind immediately:
- Q(uick) approach: Google translate API
- Q(uick)&D(irty) approach: web text/knowledge mining
- Diehard approach: write something equivalent to Google translate
- et cetera
For the first approach, unfortunately it’s actually a failed case for Google translate (titillandus is the gerundive of titillo, titillare). For the second, I like Q&D but it may not be scalable, i.e., you can’t apply the same method to get, say, the book of Genesis in Vulgate into English. For the third one, well, I don’t think so .
Send the source code to me by 30/9 to win a $25 gift card from Fry’s– Well, it’s actually negotiable if you prefer Macy’s.
BTW I used to think another topic:
Think a subset of sas programs that do not use macros. Write in any language you feel comfortable to get rid of comments.
Some contenders of our June challenge like Kalyani actually touched this topic. Then I chatted with Jiangtang–Both of us agreed it may be less interested in sas community. So I end up to leverage the Deathly Hallows. But if you want to try this code scanner topic, you are more than welcome!
A summary of our previous challenges and the winners:
March challenge: Web crawling (L0) (winner: Megha)
April challenge: Web crawling (L1) (winner: Megha)
May challenge: Eight Queens Puzzle (winner: Kalyani)
June challenge: Source line counting (winner: Megha)
July challenge: Infinitesimal in sas (winner: Jiangtang)
Our last programming challenge is Infinitesimal in the SAS universe of discourse. The following code and the like provide a predicate to approach that “infinitesimal”:
data _null_; x=1;
do until (0=x/2);x=x/2;c+1;end;
put c= x= binary64.;
The put statement writes in the log the output:
In another word, the sas infinitesimal is .
Some programmers provided the solution by using sas contant “SMALL”. On the surface level and surprisingly, it is not the smallest number in sas universe:
data _null_;x=constant('SMALL'); y=x/2; z=x>y; put x= binary64. y= binary64. z=;run;
The rationale behind the definition of “SMALL”, from my understanding, is “SMALL” is the smallest number that the implicit bit algorithm (see IEEE 754) to encode floating point numbers is applicable.
More code to play:
data _null_; x=log2(constant('SMALL')); put x=;run;
CDISC Express Mapping contest comes to an end today!
The challenge was to create a mapping file to map the source data set provided on this page to the SDTM DM domain using CDISC Express. Learn more about CDISC Express.
The winner is Jiangtang Hu! He is a reader and a blogger, lives in Beijing, China. He is a statistical SAS programmer at Sanofi Pasteur and a new member of the “Elite Fathers’ Club” by life. He wins an iPad2!
Jiangtang is one of the eraly testers and adopters of CDISC Express. He wrote a paper to help users like him ‘Dive into CDISC Express’. We posted the first part of this paper on our blog last week. There are 4 parts focused on guiding the user in the different features on the application. Next part will be published next week.
Thank you to all the participants and congratulations to Jiangtang
- Best Practices (3)
- Best-Practices (16)
- BioNews (3)
- Business Best Practices (5)
- Case studies (2)
- CDISC (11)
- Clinical Data Management (6)
- Clinical Stories (1)
- Code (13)
- EDC (7)
- Event (3)
- Events (7)
- Menu (3)
- Monthly Contest (12)
- New Technologies (15)
- OpenClinica (2)
- SAS Library (4)
- Scripting (2)
- Tips & Techniques (14)
- Trends (11)