Posts

Deep Neural Networks Tuning MindMap

I have invested some to learn and summarize Optimization strategies of Deep Neural Networks. I created a mind map to help me to remember/structure all possibilities.

Create your own formats and informats

create new formats and informats, and some typical examples Paper (PDF) Wiki Article

Browse through file system with SAS Base

It often happens that task comes to implement certain SAS program on a machine which internal file system is not available. These files can be useful to list files and folders, and read files, which have access granted to local user used to execute SAS programs (usually sassrv user) In order to browse through file system where SAS is running, the following two SAS programs can be very useful: Listing Files and Folders of the system hosting SAS Read Files and display it in SAS Output as text P.S. Second example is taken from SAS website, but always extremely hard to find.

SAS and Web/REST Service Calls

SAS offers a possibility to communicate with Web Services and REST services using a couple of tools. Most important products of SAS required to properly communicate with Web Services/REST Services are: PROC SOAP PROC HTTP XML Library Engine (xmlv2) The following examples show how are these coupled together: Calling and Parsing the Web Service using SAS Calling and Parsing the REST service using SAS

How to extract filename and extension from the absolute path in SAS

This is very simple problem in SAS, but somewhat nowhere on internet written. You can use scan function to catch last occurrence of string.

How to set special characters in SAS Base code

If you ever end up having a sas variable, which contains special characters in it, and you want to split them into each separate variable, you need to use a ascii number equivalent to required special character,and at x at the end of the string. For example, if the special character is tabulator: In ASCII table, '09'x is a ascii equivalent to tab character.

How to round the number up to 2 digits in Javascript

Sometimes you need to round up the number up to 2 digits. For example, you calculation has to show a result in currency. There are two solutions to use on internet: 1) Use Math.random function. var a=123.4567; Math.random(a*100)/100 However, this is not really good, as for example in case of var a=1.005; Math.random(a*100)/100 results into 1 instead of 1.01. 2) use toFixed(2) However, it is more secure option to use a.toFixed(2), which would return element as fixed 2 decimal value

How to download/upload a SAS dataset from server to your local machine

There is a neat way the EG offers you to download SAS datasets. Under a menu bar, there are a options "Tasks" - "Data" - "Upload Data Files to Server" and   "Tasks" - "Data" - "Download Data Files to PC"  In case of "Download Data Files to PC", you need to choose a dataset you want to transfer. My humble suggestion is to first subset the original dataset to a temporal dataset you exactly need, and download only the temporal dataset. Detailed screenshots will follow...

Changing system time on Virtual Box Virtual machines

Once upon a time I needed to change the system time of the virtual machine to test its behavior at specific date/time. To do that, you can use the following commands: VBoxManage setextradata "YOURVIRTUALMACHIENNAME" "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" 1 VBoxManage modifyvm "YOURVIRTUALMACHIENNAME" --biossystemtimeoffset -36288000000 This script above returns the time 420 days in the past. Note to myself: Change this post to add also other useful commands, including the one to switch existing virtual hard disk properties (static to dynamic, its size, etc)

Javascript - Take care of Regular Expressions

These text here is my summary of things I learned while reading the eloquentJS book. In order to understand the issues mentioned in a book better, I have created a different examples. Take care when using Regular expressions in Javascript. 1) lastIndex is not refreshed, when using global regular expressions for multiple exec calls.

SymbolHound

It often happens to me that I have a part of a code which I dont understand, neither know how to search for it. These cases are those when you look for some operator shortcuts in programming codes. For example, (+) sign in PL/SQL. How to find this? Through answers of good old StackOverflow community, I came up to symbolhound . Perfect search engine for exactly those cases!

Dynamically assign fileref to external file

Sometimes, you might want to assign fileref to external file which path you get to know during some complex data manipulations. In that case, filename statement is difficult to use as filepath you need to know in advance. Along with FILENAME statement, SAS offers also FILENAME function, which you can use within the DATA step. SAS Base SAS Data Integration Studio Let's assume that you already have SAS dataset created that contains path to csv file. Then you need to: add "User Written Code" transformation (under "Data->User Written Code"), connect SAS dataset (that contains path to csv file) to "User Written Code transformation". Go to "User Written Code" properties, tab "Code" (keep "Code generation mode: User Written Body"), and in the code body write the following text right above %rcSet(&syserr... (it is sometimes hard to see, but automatically generated code has a greyish background, and ...

Redirect libref to WORK library in SAS

Imagine you have a SAS Enterprise Guide Project, where you have been using a libref (let's name it "SAVE") very often. However, now you want to switch it in specific occassion turn to WORK library so that it does not require a specific folder for SAS datasets to be saved. Also, you would still like to have the LIBNAME statement for SAVE libref, so that you can switch easily from WORK libref to specific path. so, the following two solutions you can use: LIBNAME save %sysfunc(quote(%sysfunc(pathname(work)))) ; the second way to do it is the following: %let workLocation=%sysfunc(getoption(work)); libname SAVE "&workLocation.";

Read multiple external files into single dataset in SAS

Reading multiple external files in SAS. For further manipulation, it looks good if these data could all be gathered in the same dataset, from which then usual data manipulation queries could be performed on. Now, if you would like to conditionally to read multiple files that have different structure, you can conditionally change the input statement. Let's say that file has the different structure if its name ends with "d" character:

Error: Invalid business key defined

In SAS DI Studio, when you try to add the column as Business Key which is already selected as a Detect Changes, you will get the error: Error: Invalid business key defined In order to resolve that, you need to remove whatever business keys you want to define from " Detect Changes " tab, it error is gone.

Java Expert RE-Learning Javascript Part 2 - Operators

What do you thing, what does javascript do with the following ? "5" + 1 - result? "51" 5 + "1" - result? "51" "5" - 1 - result? 4 "5" == 5 - result? true null == undefined - result? true How did you do? I was bad at it, especially to realize that "5" + 1 and 5 + "1" would make the same result. Javascript tries always to do conversion whenever the types of operands dont match. Javascript is pretty easy-going language. It allows you to do many things, giving you a bit of additional freedom. BUT you have to be VERY careful, as you can imagine that in some cases, above mentioned freedom might cost you a lot of bugs :) So, summary of rules in Javascript about operators: If you give Javascript different types to operate with, it will start doing type conversion. The way it would do it is based on set of (often confusing) rules. It would check first the operator, and then try to convert opera...

Java Expert RE-Learning Javascript Part 1 - Intro

You know the time when you come across so many different programming languages, it happens that you come cross programming language you never really learn from scratch, but just "learn by doing". It has been like that all the way until I had "awakening" call, a job interview, where I got javascript questions which I did not know at all. The biggest issue was its similarity to Java/C programming languages, where many things I rather "assumed" it is the same, without ever really checking it out. After sobering up, I decided to RE-learn Javascript, and started reading book "Eloquent Javascript"  . after reading now already a quarter of a book, I am positively surprised how nice it was written. I strongly suggest to anyone, either a core beginner in programming (no pre-knowledge whatsoever is required to read it), or even a veteran programmer. This book has also very challenging exercises in the end which solutions (can be found on above link)...
Today I listened a really nice clean-code google talk about bad practice of using IFs, and how much polymorphism helps out there. It is amazing to see how nicer code becomes, and how easy it is for a programmers to go into routine of making if/switch statements for no reason. All methods mentioned there are not new at all, but having it here shown reminds you on what and how should you think when programming.

CodeAnywhere, (thumbsup)!

I started some mini javascript project of my own, so needed to create a relatively simplistic development environment. However, this environment has some constrains: - it should not require install (portable to many different devices), - it should connect to my Dropbox  account. For that purpose, I came across CodeAnywhere  website, where you can for free set up your account and connect your dropbox account and immediately start working. However, the internal browser that they have is running through their proxy, which causes a number of issues for my javascript development, so I am not using it.

What makes SAS Enterprise Guide not a mature application ...

Ok, before I start expressing my opinion about SAS Enterprise Guide and SAS Base Programming, I would like to make a quick introduction of my technical experience and expertise. Throughout 7-8 years of my professional life, I have been using in great extent software tools like MATLAB, and have been programming enterprise applications in Java/Spring. In last 6 months I am introducing myself to SAS World. Version I am working on is SAS Enterprise Guide 9.4. For a system that still uses programming model (SAS Base) of 80s, a graphical interface which visually shows how the process is being executed is a great refreshment. There are many options on dealing with data and doing analysis on it, making it very comfortable tool to easily build a large data manipulation process. Basic Application use issues: "Object reference not set to an instance of an object". It relatively often happens (every 4 days of 8h daily use of SAS Enterprise Guide) that the file you think yo...