J Hill

All generations.

generate functionTue, 22 Nov 2022

Create a responsive, landing page with logo at top and include <iframe id="JotFormIFrame-223186333960053" title="NotaryROAD" onload="window.parent.scrollTo(0,0)" allowtransparency="true" allowfullscreen="true" allow="geolocation; microphone; camera" src="https://form.jotform.com/223186333960053" frameborder="0" style=" min-width: 100%; height:539px; border:none;" scrolling="no" > </iframe> <script type="text/javascript"> var ifr = document.getElementById("JotFormIFrame-223186333960053"); if (ifr) { var src = ifr.src; var iframeParams = []; if (window.location.href && window.location.href.indexOf("?") > -1) { iframeParams = iframeParams.concat(window.location.href.substr(window.location.href.indexOf("?") + 1).split('&')); } if (src && src.indexOf("?") > -1) { iframeParams = iframeParams.concat(src.substr(src.indexOf("?") + 1).split("&")); src = src.substr(0, src.indexOf("?")) } iframeParams.push("isIframeEmbed=1"); ifr.src = src + "?" + iframeParams.join('&'); } window.handleIFrameMessage = function(e) { if (typeof e.data === 'object') { return; } var args = e.data.split(":"); if (args.length > 2) { iframe = document.getElementById("JotFormIFrame-" + args[(args.length - 1)]); } else { iframe = document.getElementById("JotFormIFrame"); } if (!iframe) { return; } switch (args[0]) { case "scrollIntoView": iframe.scrollIntoView(); break; case "setHeight": iframe.style.height = args[1] + "px"; break; case "collapseErrorPage": if (iframe.clientHeight > window.innerHeight) { iframe.style.height = window.innerHeight + "px"; } break; case "reloadPage": window.location.reload(); break; case "loadScript": if( !window.isPermitted(e.origin, ['jotform.com', 'jotform.pro']) ) { break; } var src = args[1]; if (args.length > 3) { src = args[1] + ':' + args[2]; } var script = document.createElement('script'); script.src = src; script.type = 'text/javascript'; document.body.appendChild(script); break; case "exitFullscreen": if (window.document.exitFullscreen) window.document.exitFullscreen(); else if (window.document.mozCancelFullScreen) window.document.mozCancelFullScreen(); else if (window.document.mozCancelFullscreen) window.document.mozCancelFullScreen(); else if (window.document.webkitExitFullscreen) window.document.webkitExitFullscreen(); else if (window.document.msExitFullscreen) window.document.msExitFullscreen(); break; } var isJotForm = (e.origin.indexOf("jotform") > -1) ? true : false; if(isJotForm && "contentWindow" in iframe && "postMessage" in iframe.contentWindow) { var urls = {"docurl":encodeURIComponent(document.URL),"referrer":encodeURIComponent(document.referrer)}; iframe.contentWindow.postMessage(JSON.stringify({"type":"urls","value":urls}), "*"); } }; window.isPermitted = function(originUrl, whitelisted_domains) { var url = document.createElement('a'); url.href = originUrl; var hostname = url.hostname; var result = false; if( typeof hostname !== 'undefined' ) { whitelisted_domains.forEach(function(element) { if( hostname.slice((-1 * element.length - 1)) === '.'.concat(element) || hostname === element ) { result = true; } }); return result; } }; if (window.addEventListener) { window.addEventListener("message", handleIFrameMessage, false); } else if (window.attachEvent) { window.attachEvent("onmessage", handleIFrameMessage); } </script>

<script type="text/javascript"> var windowHeight = window.innerHeight; document.getElementById("JotFormIFrame-223186333960053").style.height = (windowHeight - 30) + "px"; </script>

Javascript
View
generate functionTue, 22 Nov 2022

Create a responsive, landing page with logo at top and include <iframe id="JotFormIFrame-223186333960053" title="NotaryROAD" onload="window.parent.scrollTo(0,0)" allowtransparency="true" allowfullscreen="true" allow="geolocation; microphone; camera" src="https://form.jotform.com/223186333960053" frameborder="0" style=" min-width: 100%; height:539px; border:none;" scrolling="no" > </iframe> <script type="text/javascript"> var ifr = document.getElementById("JotFormIFrame-223186333960053"); if (ifr) { var src = ifr.src; var iframeParams = []; if (window.location.href && window.location.href.indexOf("?") > -1) { iframeParams = iframeParams.concat(window.location.href.substr(window.location.href.indexOf("?") + 1).split('&')); } if (src && src.indexOf("?") > -1) { iframeParams = iframeParams.concat(src.substr(src.indexOf("?") + 1).split("&")); src = src.substr(0, src.indexOf("?")) } iframeParams.push("isIframeEmbed=1"); ifr.src = src + "?" + iframeParams.join('&'); } window.handleIFrameMessage = function(e) { if (typeof e.data === 'object') { return; } var args = e.data.split(":"); if (args.length > 2) { iframe = document.getElementById("JotFormIFrame-" + args[(args.length - 1)]); } else { iframe = document.getElementById("JotFormIFrame"); } if (!iframe) { return; } switch (args[0]) { case "scrollIntoView": iframe.scrollIntoView(); break; case "setHeight": iframe.style.height = args[1] + "px"; break; case "collapseErrorPage": if (iframe.clientHeight > window.innerHeight) { iframe.style.height = window.innerHeight + "px"; } break; case "reloadPage": window.location.reload(); break; case "loadScript": if( !window.isPermitted(e.origin, ['jotform.com', 'jotform.pro']) ) { break; } var src = args[1]; if (args.length > 3) { src = args[1] + ':' + args[2]; } var script = document.createElement('script'); script.src = src; script.type = 'text/javascript'; document.body.appendChild(script); break; case "exitFullscreen": if (window.document.exitFullscreen) window.document.exitFullscreen(); else if (window.document.mozCancelFullScreen) window.document.mozCancelFullScreen(); else if (window.document.mozCancelFullscreen) window.document.mozCancelFullScreen(); else if (window.document.webkitExitFullscreen) window.document.webkitExitFullscreen(); else if (window.document.msExitFullscreen) window.document.msExitFullscreen(); break; } var isJotForm = (e.origin.indexOf("jotform") > -1) ? true : false; if(isJotForm && "contentWindow" in iframe && "postMessage" in iframe.contentWindow) { var urls = {"docurl":encodeURIComponent(document.URL),"referrer":encodeURIComponent(document.referrer)}; iframe.contentWindow.postMessage(JSON.stringify({"type":"urls","value":urls}), "*"); } }; window.isPermitted = function(originUrl, whitelisted_domains) { var url = document.createElement('a'); url.href = originUrl; var hostname = url.hostname; var result = false; if( typeof hostname !== 'undefined' ) { whitelisted_domains.forEach(function(element) { if( hostname.slice((-1 * element.length - 1)) === '.'.concat(element) || hostname === element ) { result = true; } }); return result; } }; if (window.addEventListener) { window.addEventListener("message", handleIFrameMessage, false); } else if (window.attachEvent) { window.attachEvent("onmessage", handleIFrameMessage); } </script>

function that:

Javascript
View
generate functionThu, 01 Dec 2022

Create code in solidity that uploads data files, create smart contract for the files and uploads them to storj

function makeFile(filename, file, filechecksum) public returns (string memory, uint id, string memory checksum) { require(msg.value == 0); uint time = now; uint id = fileId; fileId++; string memory checksum = filechecksum; string memory filename = filename; string memory file = file; userFiles[msg.sender][id] = File(filename, file, checksum, time); emit LogNewContractCreated(id, filename, checksum, msg.sender); return (filename, id, checksum); }

Javascript
View
generate functionThu, 01 Dec 2022

Create code to create a landing page that downloads data files to be stored on the blockchain using solidity

function createLandingPage(dataFiles,contractAddress) { var html = ""; html = html + '<html><head><title>Data Files</title></head><body>'; html = html + '<h1>Data Files</h1>'; html = html + '<ul>'; for (var i = 0; i < dataFiles.length; i++) { html = html + '<li><a href="' + dataFiles[i] + '">File' + (i+1) + '</a></li>'; } html = html + '</ul>'; html = html + '<h2>Send Files to Blockchain Contract</h2>'; html = html + '<ul>'; for (var i = 0; i < dataFiles.length; i++) { html = html + '<li>' + '<button onclick="sendFileToBlockchain(\'' + dataFiles[i] + '\', \'' + contractAddress + '\')">Send File' + (

Javascript
View
generate functionThu, 01 Dec 2022

Create code using solidity to download .pdf files and compile the files into a smart contract

pragma solidity >=0.4.22 <0.7.0; contract PdfDownloader { // address of the contract address payable _owner = msg.sender; // pdf file to be downloaded string pdf = "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"; // how much to pay for the file uint256 _price = msg.value; struct User { address addr; uint256 balance; } mapping(address => User) public users; // get the pdf file and pay the price function getFile() payable public { require(msg.value == _price); users[msg.sender].balance = msg.value; } // refund the user if they download the file again function refund() public { require(msg.value == _price); users[msg.sender].balance = msg.value;

Javascript
View
generate functionThu, 01 Dec 2022

Create code to download .pdf files and compile the files into a smart contract

const fs = require('fs'); const axios = require('axios'); const downloadFile = async (url, path) => { const writer = fs.createWriteStream(path); const response = await axios({ url, method: 'GET', responseType: 'stream', }); response.data.pipe(writer); return new Promise((resolve, reject) => { writer.on('finish', resolve); writer.on('error', reject); }); }; const urls = [ 'https://media.consensys.net/2017/06/21/Smart-Contract-Security-Best-Practices.pdf', 'https://blog.zeppelin.solutions/smart-contract-security-using-zeppelin-os-f8d17b9e5b5e', 'https://media.consensys.net/the-hitchhikers-guide-to-smart-contracts-in-ethereum-848f08001f05', 'https://

Javascript
View
generate functionThu, 01 Dec 2022

Create code to download .pdf files to be stored on the cloud

// Download a pdf file db.getAttachment("tutorial", "tutorial.pdf").then(function(blob) { var url = URL.createObjectURL(blob); var a = document.createElement("a"); a.style = "display: none"; a.href = url; a.download = "tutorial.pdf"; document.body.appendChild(a); a.click(); setTimeout(function() { document.body.removeChild(a); window.URL.revokeObjectURL(url); }, 100); }).catch(function(error) { console.log(error); });

Javascript
View
generate functionThu, 01 Dec 2022

Create code in solidity that uploads data files, create smart contract for the files and uploads them to storj

contract storage { uint constant price = 1; mapping (address => uint) public balance; address public owner; function storage() public { owner = msg.sender; balance[msg.sender] = 1000000000000000000; } function upload() public payable { // if(msg.value < price) // revert(); if(msg.value < 0.01 ether) revert(); balance[msg.sender] -= msg.value; } }

Javascript
View
generate functionThu, 01 Dec 2022

Create code in solidity that uploads data files, then create smart contract for the files

pragma solidity ^0.4.17; contract Ownable { address public owner; function Ownable() public { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner); _; } function transferOwnership(address newOwner) onlyOwner public { owner = newOwner; } } contract FileUpload is Ownable { string public fileName; string public fileData; //string public fileSize; function FileUpload(string _fileName, string _fileData) public { fileName = _fileName; fileData = _fileData; //fileSize = _fileSize; } function changeFileName(string _fileName) public { fileName = _fileName; } function changeFileData(string _fileData) public { fileData = _fileData; } function changeFileSize(string _fileSize) public { fileSize

Javascript
View

Questions about programming?Chat with your personal AI assistant