This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Create your own S class, pass your results as object, use your own summary function | |
Summary_Printer <- function(obj1) UseMethod("Summary_Printer") | |
Summary_Printer.default <- function(regression,sandwich) | |
{ | |
printer <- NULL | |
printer$regression <- regression | |
printer$sandwich <- sandwich | |
class(printer) <- "Summary_Printer" | |
printer | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%let query=hello; | |
%let likequery=%sysfunc(cat(%str(%%),%str(&query),%str(%%))); | |
%put &query; *Will appear as hello in log; | |
%put &likequery; *Will appear as %hello% in log; | |
proc print data=test; | |
where x like "&likequery"; | |
run; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
APT_TimeStamp dateofbirth(in0.Dob,"%yyyy%mm%dd%hh%nn%ss%SSSSSS",true); // APT_Timestamp to convert char to timestamp (see the reference card for more info) | |
if ( !dateofbirth.isValid() ) { recOk = false; } else { out0.Dob = dateofbirth;} // check if the current record contains a valid timestamp | |
out0.Name = in0.Name; // assign the column from the 1st input port to the 1st output port which is the results port | |
out0.Country = in0.Country; | |
if ( lowercase == "yes" ) { out0.Country.toLower(); } // if the string property (as defined in the property tab) of lowercase is yes , output should be lowercase | |
out0.Region = in0.Region; | |
out0.Region.trimWhitespaceLeadingTrailing(); //this is actually a datastage macro, you can use setPadChar and trimPadding to trim (see reference card). To see how to conversion (using some C precompilers) is being applied you can take a look at the generated C++ code after generation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
http://benjithian.sg/2013/02/simple-convex-defect-opencv/ | |
Simple Convex hull with Convex Defect. Simple stuff. | |
*/ | |
#include <stdio.h> | |
#include <curl/curl.h> | |
#include <sstream> | |
#include <iostream> | |
#include <vector> | |
#include <opencv2/opencv.hpp> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
http://benjithian.sg/2012/12/simple-convex-hull-opencv/ | |
Simple Convex hull. Simple stuff. | |
*/ | |
#include <stdio.h> | |
#include <curl/curl.h> | |
#include <sstream> | |
#include <iostream> | |
#include <vector> | |
#include <opencv2/opencv.hpp> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Inspired by Rick Wicklin's <a href="http://blogs.sas.com/content/iml/2012/12/14/a-fractal-christmas-tree/">SAS Christmas Tree</a>, i decided to create my own tree using Base SAS to generate the data and then using JMP to visualize the data in bubbleplot. | |
http://benjithian.sg/2012/12/sas-jmp-christmas-tree/ | |
*/ | |
/* Snow generator */ | |
%macro snow_generator(density,filename); | |
data snow; | |
drop i; | |
do i = 1 to &density; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
http://benjithian.sg/2012/12/simple-background-subtraction/ | |
Simple Background Subtraction. Simple stuff. | |
*/ | |
#include <stdio.h> | |
#include <curl/curl.h> | |
#include <sstream> | |
#include <iostream> | |
#include <vector> | |
#include <opencv2/opencv.hpp> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: Open the folder that contains the sas files | |
cd "C:\Users\Benji_Thian\Desktop\SAS_and_OTHERS\Scheduling" | |
:: Use Base SAS to call the javasas.sas program in batch mode with any specificed settings u want | |
"C:\Program Files\SASHome\SASFoundation\9.3\sas.exe" -BATCH -NOTERMINAL -CONFIG "C:\Program Files\SASHome\SASFoundation\9.3\nls\en\sasv9.cfg" -set classpath "C:\Users\Benji_Thian\workspace\test\bin" -SYSIN "javasas.sas" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Use SAS to call Java Object * | |
* http://benjithian.sg/2012/12/sas-with-java/ */ | |
/* Sample Data from Google Chart API*/ | |
data Work.test; | |
infile datalines missover; | |
input Topping $ Slices $; | |
datalines; | |
Mushroom 3 | |
Onions 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* A Simple Java class just to write a google chart html when called by BASE SAS*/ | |
import java.io.*; | |
import java.util.HashMap; | |
import java.util.Iterator; | |
import java.util.Map; | |
public class Chart { | |
HashMap<String,Integer> map = new HashMap<String,Integer>(); | |
public Chart() |
NewerOlder