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
PROBLEM: | |
The Product Importer has lots of crazy report formats that vary wildly from report to report. To reduce | |
the strain on requiring TWIKI to model these in JSON marshallers/unmarshallers, I have created a happy | |
path proxy scenario that just passes along the response of a request. | |
This is using the NEWMAN framework https://github.com/stackmob/newman.. The TwikiService | |
has an existing example of the use of Newman. | |
In a route, add something like: |
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
def happy(i: Long): Boolean = { | |
def lilHappy(ii: Long, count: Long = 0): Boolean = { | |
val num = ii.toString.map(_.asDigit).map(x => (x*x).toLong).sum | |
if(num == 1) true | |
else if( count == 30) false | |
else lilHappy(num, count + 1) | |
} | |
lilHappy(i) | |
} |
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
<html> | |
<body> | |
<form name="uploadForm"> | |
<input id="uploadFile" type="file" name="uploadFile" onchange="performFilePoop();" /> | |
</form> | |
<script> | |
function performFilePoop(){ | |
var files = document.getElementById("uploadFile").files |