This file contains hidden or 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
function getFuelPrices() { | |
var tableBody = document.querySelectorAll('body table table table table')[1].childNodes[1]; | |
var data = []; | |
for (var i = 1; i <= 5; i = i + 2) { | |
var row = { | |
label: tableBody.childNodes[i].childNodes[1].childNodes[0].data, | |
price: tableBody.childNodes[i].childNodes[3].childNodes[0].data | |
}; | |
data.push(row); | |
} |
This file contains hidden or 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
import com.fasterxml.jackson.core.JsonParser; | |
import com.fasterxml.jackson.databind.DeserializationContext; | |
import com.fasterxml.jackson.databind.JsonNode; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import com.fasterxml.jackson.databind.deser.std.StdDeserializer; | |
import com.fasterxml.jackson.databind.module.SimpleModule; | |
import java.io.IOException; | |
import java.util.HashMap; | |
import java.util.Map; |
This file contains hidden or 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
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.Random; | |
/* | |
output: | |
** cones before ** | |
label: bar | |
height: 13.37 |
This file contains hidden or 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 request object | |
var xhttp = new XMLHttpRequest(); | |
// set params | |
var method = 'GET' || 'DELETE' || 'POST' || 'PUT' || 'PATCH'; | |
var url = 'controller/action'; | |
var asynchronous = true; | |
// open request | |
xhttp.open(method, url, asynchronous); | |
// set ajax headers | |
xhttp.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); |