env=baseenv() in R

I’ve been playing around with the Life Analytics trading with R tutorial (http://lifeanalytics.blogspot.com/2011/01/forex-trading-with-r-part-1.html) and keep getting stuck on a problem related to building the data model. So I start with a bunch of functions: Then try to build a model passing the data to the functions: And keep getting the following error: Error in formula.default(object, … Read more

Categories r Tags

Joda DateTime to Timestamp conversion

It is a common misconception that time (a measurable 4th dimension) is different over the world. Timestamp as a moment in time is unique. Date however is influenced how we “see” time but actually it is “time of day”. An example: two people look at the clock at the same moment. The timestamp is the same, … Read more

What are mock objects in Java?

A Mock object is something used for unit testing. If you have an object whose methods you want to test, and those methods depend on some other object, you create a mock of the dependency rather than an actual instance of that dependency. This allows you to test your object in isolation. Common Java frameworks … Read more

How does str(list) work?

Well you have a total of 4 questions, let us go one by one. 1. Why does str(list) returns how we see list on the console? How does str(list) work? What is str() and __str__()? The str() callable is to return a printable form of the object only! From the docs str(object) does not always attempt to return a string that is acceptable to eval(); its goal is to return a … Read more

Getting “Skipping JaCoCo execution due to missing execution data file” upon executing JaCoCo

jacoco-maven-plugin:0.7.10-SNAPSHOT From jacoco:prepare-agent that says: One of the ways to do this in case of maven-surefire-plugin – is to use syntax for late property evaluation: Note the @{argLine} that’s added to -your -extra -arguments. Thanks Slava Semushin for noticing the change and reporting in the comment. jacoco-maven-plugin:0.7.2-SNAPSHOT Following jacoco:prepare-agent that says: [org.jacoco:jacoco-maven-plugin:0.7.2-SNAPSHOT:prepare-agent] Prepares a property pointing to the JaCoCo runtime agent that can be passed as … Read more

How do I reset a sequence in Oracle?

Here is a good procedure for resetting any sequence to 0 from Oracle guru Tom Kyte. Great discussion on the pros and cons in the links below too. From this page: Dynamic SQL to reset sequence valueAnother good discussion is also here: How to reset sequences?