천현우

Merge branch 'main' of http://khuhub.khu.ac.kr/2019102168/Voicoding into main

......@@ -2,6 +2,8 @@
--text-color:#fffde7;
--background-color:#ff94c2;
--accent-color:#ba2d65;
--output-color:#ff7043;
--output-accent-color:#c63f17;
}
body{
......@@ -13,7 +15,7 @@ a{
color:var(--text-color);
}
.menu{
.voi_menu{
display:flex;
justify-content:space-between;
align-items:center;
......@@ -23,10 +25,12 @@ a{
.menu_bar_content li:hover{
background-color:var(--accent-color);
border-radius: 4px;
color:var(--text-color);
}
.menu_bar_icons li:hover{
background-color:var(--accent-color);
border-radius: 4px;
color:var(--text-color);
}
.menu_bar_logo{
font-size: 20px;
......@@ -35,6 +39,9 @@ a{
.menu_bar_logo i{
color:var(--accent-color);
}
.basic:hover{
color:var(--text-color);
}
.menu_bar_content{
display:flex;
list-style: none;
......@@ -52,13 +59,17 @@ a{
padding: 8px 12px;
}
.menu_toggle{
color:var(--text-color);
display: none;
position: absolute;
right:32px;
font-size: 24px;
}
.menu_toggle:hover{
color:var(--text-color);
}
@media screen and (max-width: 500px) {
.menu{
.voi_menu{
flex-direction: column;
align-items: flex-start;
padding: 8px 24px;
......@@ -80,6 +91,7 @@ a{
}
.menu_toggle{
display: block;
color:var(--text-color);
}
.menu_bar_content.active,
.menu_bar_icons.active{
......@@ -87,25 +99,55 @@ a{
}
}
button{
background-color:#60ad5e;
background-color:var(--output-color);
border:none;
color:var(--text-color);
font-size:50px;
padding:12px 24px 24px 24px;
padding: 24px;
border-radius: 4px;
}
button:hover{
background-color:#005005;
background-color:var(--output-accent-color);
border-radius: 4px;
}
.controls{
padding:12px 24px;
height:70px;
font-size:100px;
display:flex;
justify-content:space-around;
border-radius:4px;
margin: 23px;
}
#output{
margin:20px;
display:flex;
align-items:center;
height:700px;
background-color:rgba(0,0,0,.87);
color:var(--text-color);
}
#recordButton{
line-height: 22px;
font-size:50px;
}
#transcribeButton{
line-height: 22px;
font-size:50px;
}
.output_bar{
display:flex;
justify-content:center;
color:black;
margin: 20px;
font-size:100px;
}
.basic{
color:var(--text-color);
font-size:20px;
}
.fas.fa-arrow-circle-down{
color:var(--background-color);
font-size:70px;
display:block;
text-align:center;
}
\ No newline at end of file
......
......@@ -6,25 +6,82 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Voicoding</title>
<script src="https://kit.fontawesome.com/a5f26fa106.js" crossorigin="anonymous"></script>
<script src="menu.js" defer></script>
<script defer src="https://kit.fontawesome.com/a5f26fa106.js" crossorigin="anonymous"></script>
<script defer src="menu.js"></script>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@300&display=swap" rel="stylesheet">
<script defer src="https://cdn.rawgit.com/mattdiamond/Recorderjs/08e7abd9/dist/recorder.js"></script>
<script defer src="client.js"></script>
<meta name="description" content="Free and open-source online code editor that allows you to write and execute code from a rich set of languages.">
<meta name="keywords" content="online editor, online code editor, online ide, online compiler, online interpreter, run code online, learn programming online,
online debugger, programming in browser, online code runner, online code execution, debug online, debug C code online, debug C++ code online,
programming online, snippet, snippets, code snippet, code snippets, pastebin, execute code, programming in browser, run c online, run C++ online,
run java online, run python online, run ruby online, run c# online, run rust online, run pascal online, run basic online">
<meta name="author" content="Herman Zvonimir Došilović">
<meta property="og:title" content="Judge0 IDE - Free and open-source online code editor">
<meta property="og:description" content="Free and open-source online code editor that allows you to write and execute code from a rich set of languages.">
<meta property="og:image" content="https://raw.githubusercontent.com/judge0/ide/master/.github/wallpaper.png">
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/golden-layout/1.5.9/goldenlayout.min.js" integrity="sha256-NhJAZDfGgv4PiB+GVlSrPdh3uc75XXYSM4su8hgTchI=" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/golden-layout/1.5.9/css/goldenlayout-base.css" integrity="sha256-oIDR18yKFZtfjCJfDsJYpTBv1S9QmxYopeqw2dO96xM=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/golden-layout/1.5.9/css/goldenlayout-dark-theme.css" integrity="sha256-ygw8PvSDJJUGLf6Q9KIQsYR3mOmiQNlDaxMLDOx9xL0=" crossorigin="anonymous" />
<script>
var require = {
paths: {
"vs": "https://unpkg.com/monaco-editor/min/vs",
"monaco-vim": "https://unpkg.com/monaco-vim/dist/monaco-vim",
"monaco-emacs": "https://unpkg.com/monaco-emacs/dist/monaco-emacs"
}
};
</script>
<script defer src="https://unpkg.com/monaco-editor/min/vs/loader.js"></script>
<script defer src="https://unpkg.com/monaco-editor@0.23.0/min/vs/editor/editor.main.nls.js"></script>
<script defer src="https://unpkg.com/monaco-editor@0.23.0/min/vs/editor/editor.main.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.css" integrity="sha256-9mbkOfVho3ZPXfM7W8sV2SndrGDuh7wuyLjtsWeTI1Q=" crossorigin="anonymous" />
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.js" integrity="sha256-t8GepnyPmw9t+foMh3mKNvcorqNHamSKtKRxxpUEgFI=" crossorigin="anonymous"></script>
<link href="https://fonts.googleapis.com/css?family=Exo+2" rel="stylesheet">
<script type="text/javascript" defer src="third_party/download.js"></script>
<script type="text/javascript" defer src="js/ide.js"></script>
<link type="text/css" rel="stylesheet" href="css/ide.css">
<title>Judge0 IDE - Free and open-source online code editor</title>
<link rel="shortcut icon" href="./favicon.ico" type="image/x-icon">
<link rel="icon" href="./favicon.ico" type="image/x-icon">
<script async defer src="https://www.googletagmanager.com/gtag/js?id=G-RHNJ50BJ2F"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-RHNJ50BJ2F');
</script>
<script defer type="text/javascript">window.$crisp=[];window.CRISP_WEBSITE_ID="ee4621ff-c682-44ac-8cfa-1835beddb98a";(function(){d=document;s=d.createElement("script"); src="https://client.crisp.chat/l.js";s.async=1;d.getElementsByTagName("head")[0].appendChild(s);})();</script>
</head>
<body>
<nav class="menu">
<nav class="voi_menu">
<div class="menu_bar_logo">
<i class="fas fa-microphone-alt"></i>
<a href="Voico_Home.html">Voicoding</a>
<a class = "basic" href="Voico_Menu.html">Voicoding</a>
</div>
<ul class="menu_bar_content">
<a href="Voico_Home.html"><li>Home</li></a>
<a href="\Manual.txt"><li>Manual</li></a>
<a href="Voico_Info.html"><li>info</li></a>
<a class = "basic" href="Voico_Home.html"><li>Home</li></a>
<a class = "basic" href="\Manual.txt"><li>Manual</li></a>
<a class = "basic" href="Voico_Info.html"><li>Info</li></a>
</ul>
<ul class="menu_bar_icons">
<li><a = href="https://www.instagram.com/waterinbottle48/"><i class="fab fa-instagram"></i></a></li>
<li><a = href="http://khuhub.khu.ac.kr/2019102168/Voicoding"><i class="fab fa-github"></i></a></li>
<li><a class = "basic" href="https://www.instagram.com/waterinbottle48/"><i class="fab fa-instagram"></i></a></li>
<li><a class = "basic" href="http://khuhub.khu.ac.kr/2019102168/Voicoding"><i class="fab fa-github"></i></a></li>
</ul>
<a href="#" class="menu_toggle"><i class="fas fa-bars"></i></a>
</nav>
......@@ -32,8 +89,107 @@
<button id="recordButton">Speech</button>
<button id="transcribeButton" disabled>To text</button>
</div>
<div class="output_bar">
<h2>Transcription Raw Data</h2>
</div>
<div id="output"></div>
<script src="https://cdn.rawgit.com/mattdiamond/Recorderjs/08e7abd9/dist/recorder.js"></script>
<script src="\client.js"></script>
<i class="fas fa-arrow-circle-down"></i>
<div class="output_bar">
<h2>TTP</h2>
</div>
<div id="site-navigation" class="ui small inverted menu" style="margin:20px 20px 0px 20px;">
<div id="site-header" class="header item">
</div>
<div class="left menu" >
<div class="ui dropdown item site-links on-hover">
File <i class="dropdown icon"></i>
<div class="menu">
<a class="item" target="_blank" href="/"><i class="file code icon"></i> New File</a>
<div class="item" onclick="downloadSource()"><i class="download icon"></i> Download</div>
<div id="insert-template-btn" class="item"><i class="file code outline icon"></i> Insert template
for current language</div>
</div>
</div>
<div class="item borderless">
</div>
<div class="item fitted borderless wide screen only">
<div class="ui input">
<p id="compiler-options" type="text" placeholder="Compiler options"></p>
</div>
</div>
<div class="item borderless wide screen only">
<div class="ui input">
<p id="command-line-arguments" type="text" placeholder="Command line arguments"></p>
</div>
</div>
<div class="item no-left-padding borderless">
<button id="run-btn" class="ui primary labeled icon button"><i class="play icon"></i>Run (F9)</button>
</div>
</div>
</div>
<div id="site-content"style="margin:0px 20px 20px 20px;"></div>
<div id="site-modal" class="ui modal">
<div class="header">
<i class="close icon"></i>
<span id="title"></span>
</div>
<div class="scrolling content"></div>
<div class="actions">
<div class="ui small labeled icon cancel button">
<i class="remove icon"></i>
Close (ESC)
</div>
</div>
</div>
<div id="site-settings" class="ui modal">
<i class="close icon"></i>
<div class="header">
<i class="cog icon"></i>
Settings
</div>
<div class="content">
<div class="ui form">
<div class="inline fields">
<label>Editor Mode</label>
<div class="field">
<div class="ui radio checkbox">
<input type="radio" name="editor-mode" value="normal" checked="checked">
<label>Normal</label>
</div>
</div>
<div class="field">
<div class="ui radio checkbox">
<input type="radio" name="editor-mode" value="vim">
<label>Vim</label>
</div>
</div>
<div class="field">
<div class="ui radio checkbox">
<input type="radio" name="editor-mode" value="emacs">
<label>Emacs</label>
</div>
</div>
</div>
<div class="inline field">
<div class="ui checkbox">
<input type="checkbox" name="redirect-output">
<label>Redirect stderr to stdout</label>
</div>
</div>
</div>
</div>
</div>
<div id="editor-status-line"></div>
</body>
</html>
\ No newline at end of file
......
......@@ -13,7 +13,7 @@ a{
color:var(--text-color);
}
.menu{
.voi_menu{
display:flex;
justify-content:space-between;
align-items:center;
......
......@@ -12,7 +12,7 @@
<link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@300&display=swap" rel="stylesheet">
</head>
<body>
<nav class="menu">
<nav class="voi_menu">
<div class="menu_bar_logo">
<i class="fas fa-microphone-alt"></i>
<a href="Voico_Home.html">Voicoding</a>
......
......@@ -13,7 +13,7 @@ a{
color:var(--text-color);
}
.menu{
.voi_menu{
display:flex;
justify-content:space-between;
align-items:center;
......
......@@ -12,7 +12,7 @@
<link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@300&display=swap" rel="stylesheet">
</head>
<body>
<nav class="menu">
<nav class="voi_menu">
<div class="menu_bar_logo">
<i class="fas fa-microphone-alt"></i>
<a href="Voico_Home.html">Voicoding</a>
......
......@@ -4,6 +4,7 @@ const recordButton = document.getElementById("recordButton");
const transcribeButton = document.getElementById("transcribeButton");
recordButton.addEventListener("click", startRecording);
transcribeButton.addEventListener("click", transcribeText);
let cnt = 0;
function startRecording() {
let constraints = { audio: true, video:false }
recordButton.disabled = true;
......@@ -32,7 +33,7 @@ function uploadSoundData(blob) {
let formData = new FormData();
xhr.onload = function(e) {
if(this.readyState === 4) {
document.getElementById("output").innerHTML += '<br><br><strong>Result: </strong>' + JSON.parse(e.target.responseText);
document.getElementById("output").innerHTML += `${cnt++}: ${JSON.parse(e.target.responseText)}<br>`;
}
};
formData.append("audio_data", blob, filename);
......
body {
background: url(/images/judge0_background.png) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
.ui[class*="left action"].input>.dropdown {
border-radius: 0 .28571429rem .28571429rem 0;
}
.ui.selection.dropdown {
width: 205px;
}
.lm_header .lm_tab {
padding-bottom: 3px;
height: 16px;
font-family: "Droid Sans Mono", monospace, monospace, "Droid Sans Fallback";
font-size: 14px;
}
.lm_header .lm_tab.lm_active {
box-shadow: none;
padding-bottom: 3px;
}
#site-navigation {
border-radius: 0;
margin: 0;
background: #1e1e1e;
border-bottom: 1px solid rgba(255, 255, 255, 0.08);
height: 45px;
}
#navigation-message {
font-size: 1.2em;
white-space: nowrap;
overflow: hidden;
}
@keyframes slide {
0% { transform: translateX(570px); }
100% { transform: translateX(-100%); }
}
@-webkit-keyframes slide {
0% { transform: translateX(570px); }
100% { transform: translateX(-100%); }
}
.navigation-message-text {
white-space: nowrap;
-moz-animation: slide 60s linear infinite;
-webkit-animation: slide 60s linear infinite;
animation: slide 60s linear infinite;
}
.navigation-message-text:hover {
-moz-animation-play-state: paused;
-webkit-animation-play-state: paused;
animation-play-state: paused;
}
#navigation-message a {
color: #41a5f1;
font-weight: bold;
}
#site-icon {
width: 30px;
height: 30px;
vertical-align: middle;
}
#site-header {
padding-left: 0;
padding-top: 0;
padding-bottom: 0;
}
#site-header h2 {
display: inline;
vertical-align: middle;
font-family: 'Exo 2', sans-serif;
}
#site-content {
display:flex;
height: calc(100% - 45px - 19px);
}
#site-modal .header {
color: #db2828;
}
#site-footer, #status-line, #donate-line {
background-color: #0E6EB8;
bottom: 0;
font-family: "Droid Sans Mono", monospace, monospace, "Droid Sans Fallback";
font-size: 13px;
height: 19px;
padding-left: 16px;
padding-right: 16px;
position: fixed;
}
#site-footer {
color: #41a5f1;
left: 0;
text-align: center;
width: 100%;
}
#site-footer a {
color: #41a5f1;
font-weight: bold;
}
#site-footer a:hover {
color: #a0d2f8;
}
#donate-line {
float: left;
left: 0;
text-align: left;
width: fit-content;
}
#status-line {
color: #fff;
float: right;
right: 0;
text-align: right;
width: fit-content;
}
#editor-status-line {
background: transparent;
color: #fff;
font-family: monospace;
height: 19px;
padding: 0px 16px;
width: inherit;
}
#editor-status-line input[type=text] {
background: transparent;
border: none;
color: #fff;
font-family: monospace;
outline: none;
}
#editor-status-line input[type=text]::selection {
background-color: #cce2ff;
color: #fff;
}
.blink {
animation: blinker 1s linear infinite;
}
@keyframes blinker {
50% {
background: #FFD700;
}
}
.dot {
background: #0E6EB8;
position: absolute;
border-radius: 50px;
width: 5px;
height: 5px;
right: 7.5px;
top: 7.5px;
}
.no-left-padding {
padding-left: 0 !important;
}
input[type="text"] {
width: 205px !important;
}
\ No newline at end of file
var defaultUrl = localStorageGetItem("api-url") || "https://ce.judge0.com";
var apiUrl = defaultUrl;
var wait = localStorageGetItem("wait") || false;
var check_timeout = 300;
var blinkStatusLine = ((localStorageGetItem("blink") || "true") === "true");
var editorMode = localStorageGetItem("editorMode") || "normal";
var redirectStderrToStdout = ((localStorageGetItem("redirectStderrToStdout") || "false") === "true");
var editorModeObject = null;
var fontSize = 14;
var MonacoVim;
var MonacoEmacs;
var layout;
var sourceEditor;
var stdinEditor;
var stdoutEditor;
var stderrEditor;
var compileOutputEditor;
var sandboxMessageEditor;
var isEditorDirty = false;
var currentLanguageId;
var $selectLanguage;
var $compilerOptions;
var $commandLineArguments;
var $insertTemplateBtn;
var $runBtn;
var $navigationMessage;
var $updates;
var $statusLine;
var timeStart;
var timeEnd;
var messagesData;
var layoutConfig = {
settings: {
showPopoutIcon: false,
reorderEnabled: true
},
dimensions: {
borderWidth: 3,
headerHeight: 22
},
content: [{
type: "row",
content: [{
type: "component",
componentName: "source",
title: "SOURCE",
isClosable: false,
componentState: {
readOnly: false
},
width: 60
}, {
type: "column",
content: [{
type: "stack",
content: [{
type: "component",
componentName: "stdin",
title: "STDIN",
isClosable: false,
componentState: {
readOnly: false
}
}]
}, {
type: "stack",
content: [{
type: "component",
componentName: "stdout",
title: "STDOUT",
isClosable: false,
componentState: {
readOnly: true
}
}, {
type: "component",
componentName: "stderr",
title: "STDERR",
isClosable: false,
componentState: {
readOnly: true
}
}, {
type: "component",
componentName: "compile output",
title: "COMPILE OUTPUT",
isClosable: false,
componentState: {
readOnly: true
}
}, {
type: "component",
componentName: "sandbox message",
title: "SANDBOX MESSAGE",
isClosable: false,
componentState: {
readOnly: true
}
}]
}]
}]
}]
};
function encode(str) {
return btoa(unescape(encodeURIComponent(str || "")));
}
function decode(bytes) {
var escaped = escape(atob(bytes || ""));
try {
return decodeURIComponent(escaped);
} catch {
return unescape(escaped);
}
}
function localStorageSetItem(key, value) {
try {
localStorage.setItem(key, value);
} catch (ignorable) {
}
}
function localStorageGetItem(key) {
try {
return localStorage.getItem(key);
} catch (ignorable) {
return null;
}
}
function showMessages() {
var width = 100//$updates.offset().left - parseFloat($updates.css("padding-left")) -
//$navigationMessage.parent().offset().left - parseFloat($navigationMessage.parent().css("padding-left")) - 5;
if (width < 200 || messagesData === undefined) {
return;
}
var messages = messagesData["messages"];
$navigationMessage.css("animation-duration", messagesData["duration"]);
$navigationMessage.parent().width(width - 5);
var combinedMessage = "";
for (var i = 0; i < messages.length; ++i) {
combinedMessage += `${messages[i]}`;
if (i != messages.length - 1) {
combinedMessage += "&nbsp".repeat(Math.min(200, messages[i].length));
}
}
$navigationMessage.html(combinedMessage);
}
function loadMessages() {
$.ajax({
url: `https://minio.judge0.com/public/ide/messages.json?${Date.now()}`,
type: "GET",
headers: {
"Accept": "application/json"
},
success: function (data, textStatus, jqXHR) {
messagesData = data;
showMessages();
}
});
}
function showError(title, content) {
$("#site-modal #title").html(title);
$("#site-modal .content").html(content);
$("#site-modal").modal("show");
}
function handleError(jqXHR, textStatus, errorThrown) {
showError(`${jqXHR.statusText} (${jqXHR.status})`, `<pre>${JSON.stringify(jqXHR, null, 4)}</pre>`);
}
function handleRunError(jqXHR, textStatus, errorThrown) {
handleError(jqXHR, textStatus, errorThrown);
$runBtn.removeClass("loading");
}
function handleResult(data) {
timeEnd = performance.now();
console.log("It took " + (timeEnd - timeStart) + " ms to get submission result.");
var status = data.status;
var stdout = decode(data.stdout);
var stderr = decode(data.stderr);
var compile_output = decode(data.compile_output);
var sandbox_message = decode(data.message);
var time = (data.time === null ? "-" : data.time + "s");
var memory = (data.memory === null ? "-" : data.memory + "KB");
$statusLine.html(`${status.description}, ${time}, ${memory}`);
if (blinkStatusLine) {
$statusLine.addClass("blink");
setTimeout(function() {
blinkStatusLine = false;
localStorageSetItem("blink", "false");
$statusLine.removeClass("blink");
}, 3000);
}
stdoutEditor.setValue(stdout);
stderrEditor.setValue(stderr);
compileOutputEditor.setValue(compile_output);
sandboxMessageEditor.setValue(sandbox_message);
if (stdout !== "") {
var dot = document.getElementById("stdout-dot");
if (!dot.parentElement.classList.contains("lm_active")) {
dot.hidden = false;
}
}
if (stderr !== "") {
var dot = document.getElementById("stderr-dot");
if (!dot.parentElement.classList.contains("lm_active")) {
dot.hidden = false;
}
}
if (compile_output !== "") {
var dot = document.getElementById("compile-output-dot");
if (!dot.parentElement.classList.contains("lm_active")) {
dot.hidden = false;
}
}
if (sandbox_message !== "") {
var dot = document.getElementById("sandbox-message-dot");
if (!dot.parentElement.classList.contains("lm_active")) {
dot.hidden = false;
}
}
$runBtn.removeClass("loading");
}
function getIdFromURI() {
var uri = location.search.substr(1).trim();
return uri.split("&")[0];
}
function downloadSource() {
var value = parseInt(71);
download(sourceEditor.getValue(), fileNames[value], "text/plain");
}
function loadSavedSource() {
snippet_id = getIdFromURI();
if (snippet_id.length == 36) {
$.ajax({
url: apiUrl + "/submissions/" + snippet_id + "?fields=source_code,language_id,stdin,stdout,stderr,compile_output,message,time,memory,status,compiler_options,command_line_arguments&base64_encoded=true",
type: "GET",
success: function(data, textStatus, jqXHR) {
sourceEditor.setValue(decode(data["source_code"]));
$selectLanguage.dropdown("set selected", data["language_id"]);
$compilerOptions.val(data["compiler_options"]);
$commandLineArguments.val(data["command_line_arguments"]);
stdinEditor.setValue(decode(data["stdin"]));
stdoutEditor.setValue(decode(data["stdout"]));
stderrEditor.setValue(decode(data["stderr"]));
compileOutputEditor.setValue(decode(data["compile_output"]));
sandboxMessageEditor.setValue(decode(data["message"]));
var time = (data.time === null ? "-" : data.time + "s");
var memory = (data.memory === null ? "-" : data.memory + "KB");
$statusLine.html(`${data.status.description}, ${time}, ${memory}`);
changeEditorLanguage();
},
error: handleRunError
});
} else {
loadRandomLanguage();
}
}
function run() {
if (sourceEditor.getValue().trim() === "") {
showError("Error", "Source code can't be empty!");
return;
} else {
$runBtn.addClass("loading");
}
document.getElementById("stdout-dot").hidden = true;
document.getElementById("stderr-dot").hidden = true;
document.getElementById("compile-output-dot").hidden = true;
document.getElementById("sandbox-message-dot").hidden = true;
stdoutEditor.setValue("");
stderrEditor.setValue("");
compileOutputEditor.setValue("");
sandboxMessageEditor.setValue("");
var sourceValue = encode(sourceEditor.getValue());
var stdinValue = encode(stdinEditor.getValue());
var languageId = resolveLanguageId(71);
var compilerOptions = $compilerOptions.val();
var commandLineArguments = $commandLineArguments.val();
if (parseInt(languageId) === 44) {
sourceValue = sourceEditor.getValue();
}
var data = {
source_code: sourceValue,
language_id: languageId,
stdin: stdinValue,
compiler_options: compilerOptions,
command_line_arguments: commandLineArguments,
redirect_stderr_to_stdout: redirectStderrToStdout
};
var sendRequest = function(data) {
timeStart = performance.now();
$.ajax({
url: apiUrl + `/submissions?base64_encoded=true&wait=${wait}`,
type: "POST",
async: true,
contentType: "application/json",
data: JSON.stringify(data),
xhrFields: {
withCredentials: apiUrl.indexOf("/secure") != -1 ? true : false
},
success: function (data, textStatus, jqXHR) {
console.log(`Your submission token is: ${data.token}`);
if (wait == true) {
handleResult(data);
} else {
setTimeout(fetchSubmission.bind(null, data.token), check_timeout);
}
},
error: handleRunError
});
}
var fetchAdditionalFiles = false;
if (parseInt(languageId) === 82) {
if (sqliteAdditionalFiles === "") {
fetchAdditionalFiles = true;
$.ajax({
url: `https://minio.judge0.com/public/ide/sqliteAdditionalFiles.base64.txt?${Date.now()}`,
type: "GET",
async: true,
contentType: "text/plain",
success: function (responseData, textStatus, jqXHR) {
sqliteAdditionalFiles = responseData;
data["additional_files"] = sqliteAdditionalFiles;
sendRequest(data);
},
error: handleRunError
});
}
else {
data["additional_files"] = sqliteAdditionalFiles;
}
}
if (!fetchAdditionalFiles) {
sendRequest(data);
}
}
function fetchSubmission(submission_token) {
$.ajax({
url: apiUrl + "/submissions/" + submission_token + "?base64_encoded=true",
type: "GET",
async: true,
success: function (data, textStatus, jqXHR) {
if (data.status.id <= 2) { // In Queue or Processing
setTimeout(fetchSubmission.bind(null, submission_token), check_timeout);
return;
}
handleResult(data);
},
error: handleRunError
});
}
function changeEditorLanguage() {
monaco.editor.setModelLanguage(sourceEditor.getModel(), $selectLanguage.find(":selected").attr("mode"));
currentLanguageId = parseInt(71);
$(".lm_title")[0].innerText = fileNames[currentLanguageId];
apiUrl = resolveApiUrl(71);
}
function insertTemplate() {
currentLanguageId = parseInt(71);
sourceEditor.setValue(sources[currentLanguageId]);
changeEditorLanguage();
}
function loadRandomLanguage() {
// $selectLanguage.dropdown("set selected", values[Math.floor(Math.random() * $selectLanguage[0].length)]);
//$selectLanguage.dropdown("set selected", 71);
apiUrl = resolveApiUrl(71);
insertTemplate();
}
function resizeEditor(layoutInfo) {
if (editorMode != "normal") {
var statusLineHeight = $("#editor-status-line").height();
layoutInfo.height -= statusLineHeight;
layoutInfo.contentHeight -= statusLineHeight;
}
}
function disposeEditorModeObject() {
try {
editorModeObject.dispose();
editorModeObject = null;
} catch(ignorable) {
}
}
function changeEditorMode() {
disposeEditorModeObject();
if (editorMode == "vim") {
editorModeObject = MonacoVim.initVimMode(sourceEditor, $("#editor-status-line")[0]);
} else if (editorMode == "emacs") {
var statusNode = $("#editor-status-line")[0];
editorModeObject = new MonacoEmacs.EmacsExtension(sourceEditor);
editorModeObject.onDidMarkChange(function(e) {
statusNode.textContent = e ? "Mark Set!" : "Mark Unset";
});
editorModeObject.onDidChangeKey(function(str) {
statusNode.textContent = str;
});
editorModeObject.start();
}
}
function resolveLanguageId(id) {
id = parseInt(id);
return languageIdTable[id] || id;
}
function resolveApiUrl(id) {
id = parseInt(id);
return languageApiUrlTable[id] || defaultUrl;
}
function editorsUpdateFontSize(fontSize) {
sourceEditor.updateOptions({fontSize: fontSize});
stdinEditor.updateOptions({fontSize: fontSize});
stdoutEditor.updateOptions({fontSize: fontSize});
stderrEditor.updateOptions({fontSize: fontSize});
compileOutputEditor.updateOptions({fontSize: fontSize});
sandboxMessageEditor.updateOptions({fontSize: fontSize});
}
function updateScreenElements() {
var display = window.innerWidth <= 1200 ? "none" : "";
$(".wide.screen.only").each(function(index) {
$(this).css("display", display);
});
}
$(window).resize(function() {
layout.updateSize();
updateScreenElements();
showMessages();
});
$(document).ready(function () {
updateScreenElements();
console.log("Hey, Judge0 IDE is open-sourced: https://github.com/judge0/ide. Have fun!");
$selectLanguage = $("#select-language");
$selectLanguage.change(function (e) {
if (!isEditorDirty) {
insertTemplate();
} else {
changeEditorLanguage();
}
});
$compilerOptions = $("#compiler-options");
$commandLineArguments = $("#command-line-arguments");
$commandLineArguments.attr("size", $commandLineArguments.attr("placeholder").length);
$insertTemplateBtn = $("#insert-template-btn");
$insertTemplateBtn.click(function (e) {
if (isEditorDirty && confirm("Are you sure? Your current changes will be lost.")) {
insertTemplate();
}
});
$runBtn = $("#run-btn");
$runBtn.click(function (e) {
run();
});
$navigationMessage = $("#navigation-message span");
$updates = $("#judge0-more");
$(`input[name="editor-mode"][value="${editorMode}"]`).prop("checked", true);
$("input[name=\"editor-mode\"]").on("change", function(e) {
editorMode = e.target.value;
localStorageSetItem("editorMode", editorMode);
resizeEditor(sourceEditor.getLayoutInfo());
changeEditorMode();
sourceEditor.focus();
});
$("input[name=\"redirect-output\"]").prop("checked", redirectStderrToStdout)
$("input[name=\"redirect-output\"]").on("change", function(e) {
redirectStderrToStdout = e.target.checked;
localStorageSetItem("redirectStderrToStdout", redirectStderrToStdout);
});
$statusLine = $("#status-line");
$("body").keydown(function (e) {
var keyCode = e.keyCode || e.which;
if (keyCode == 120) { // F9
e.preventDefault();
run();
} else if (keyCode == 119) { // F8
e.preventDefault();
var url = prompt("Enter URL of Judge0 API:", apiUrl);
if (url != null) {
url = url.trim();
}
if (url != null && url != "") {
apiUrl = url;
localStorageSetItem("api-url", apiUrl);
}
} else if (keyCode == 118) { // F7
e.preventDefault();
wait = !wait;
localStorageSetItem("wait", wait);
alert(`Submission wait is ${wait ? "ON. Enjoy" : "OFF"}.`);
} else if (event.ctrlKey && keyCode == 107) { // Ctrl++
e.preventDefault();
fontSize += 1;
editorsUpdateFontSize(fontSize);
} else if (event.ctrlKey && keyCode == 109) { // Ctrl+-
e.preventDefault();
fontSize -= 1;
editorsUpdateFontSize(fontSize);
}
});
$("select.dropdown").dropdown();
$(".ui.dropdown").dropdown();
$(".ui.dropdown.site-links").dropdown({action: "hide", on: "hover"});
$(".ui.checkbox").checkbox();
$(".message .close").on("click", function () {
$(this).closest(".message").transition("fade");
});
loadMessages();
require(["vs/editor/editor.main", "monaco-vim", "monaco-emacs"], function (ignorable, MVim, MEmacs) {
layout = new GoldenLayout(layoutConfig, $("#site-content"));
MonacoVim = MVim;
MonacoEmacs = MEmacs;
layout.registerComponent("source", function (container, state) {
sourceEditor = monaco.editor.create(container.getElement()[0], {
automaticLayout: true,
theme: "vs-dark",
scrollBeyondLastLine: true,
readOnly: state.readOnly,
language: "python",
minimap: {
enabled: false
}
});
changeEditorMode();
sourceEditor.getModel().onDidChangeContent(function (e) {
currentLanguageId = parseInt(71);
isEditorDirty = sourceEditor.getValue() != sources[currentLanguageId];
});
sourceEditor.onDidLayoutChange(resizeEditor);
});
layout.registerComponent("stdin", function (container, state) {
stdinEditor = monaco.editor.create(container.getElement()[0], {
automaticLayout: true,
theme: "vs-dark",
scrollBeyondLastLine: false,
readOnly: state.readOnly,
language: "plaintext",
minimap: {
enabled: false
}
});
});
layout.registerComponent("stdout", function (container, state) {
stdoutEditor = monaco.editor.create(container.getElement()[0], {
automaticLayout: true,
theme: "vs-dark",
scrollBeyondLastLine: false,
readOnly: state.readOnly,
language: "plaintext",
minimap: {
enabled: false
}
});
container.on("tab", function(tab) {
tab.element.append("<span id=\"stdout-dot\" class=\"dot\" hidden></span>");
tab.element.on("mousedown", function(e) {
e.target.closest(".lm_tab").children[3].hidden = true;
});
});
});
layout.registerComponent("stderr", function (container, state) {
stderrEditor = monaco.editor.create(container.getElement()[0], {
automaticLayout: true,
theme: "vs-dark",
scrollBeyondLastLine: false,
readOnly: state.readOnly,
language: "plaintext",
minimap: {
enabled: false
}
});
container.on("tab", function(tab) {
tab.element.append("<span id=\"stderr-dot\" class=\"dot\" hidden></span>");
tab.element.on("mousedown", function(e) {
e.target.closest(".lm_tab").children[3].hidden = true;
});
});
});
layout.registerComponent("compile output", function (container, state) {
compileOutputEditor = monaco.editor.create(container.getElement()[0], {
automaticLayout: true,
theme: "vs-dark",
scrollBeyondLastLine: false,
readOnly: state.readOnly,
language: "plaintext",
minimap: {
enabled: false
}
});
container.on("tab", function(tab) {
tab.element.append("<span id=\"compile-output-dot\" class=\"dot\" hidden></span>");
tab.element.on("mousedown", function(e) {
e.target.closest(".lm_tab").children[3].hidden = true;
});
});
});
layout.registerComponent("sandbox message", function (container, state) {
sandboxMessageEditor = monaco.editor.create(container.getElement()[0], {
automaticLayout: true,
theme: "vs-dark",
scrollBeyondLastLine: false,
readOnly: state.readOnly,
language: "plaintext",
minimap: {
enabled: false
}
});
container.on("tab", function(tab) {
tab.element.append("<span id=\"sandbox-message-dot\" class=\"dot\" hidden></span>");
tab.element.on("mousedown", function(e) {
e.target.closest(".lm_tab").children[3].hidden = true;
});
});
});
layout.on("initialised", function () {
$(".monaco-editor")[0].appendChild($("#editor-status-line")[0]);
if (getIdFromURI()) {
loadSavedSource();
} else {
loadRandomLanguage();
}
$("#site-navigation").css("border-bottom", "1px solid black");
sourceEditor.focus();
editorsUpdateFontSize(fontSize);
});
layout.init();
});
});
// Template Sources
var assemblySource = "\
section .text\n\
global _start\n\
\n\
_start:\n\
\n\
xor eax, eax\n\
lea edx, [rax+len]\n\
mov al, 1\n\
mov esi, msg\n\
mov edi, eax\n\
syscall\n\
\n\
xor edi, edi\n\
lea eax, [rdi+60]\n\
syscall\n\
\n\
section .rodata\n\
\n\
msg db 'hello, world', 0xa\n\
len equ $ - msg\n\
";
var bashSource = "echo \"hello, world\"";
var basicSource = "PRINT \"hello, world\"";
var cSource = "\
// Powered by Judge0\n\
#include <stdio.h>\n\
\n\
int main(void) {\n\
printf(\"Hello Judge0!\\n\");\n\
return 0;\n\
}\n\
";
var csharpSource = "\
public class Hello {\n\
public static void Main() {\n\
System.Console.WriteLine(\"hello, world\");\n\
}\n\
}\n\
";
var cppSource = "\
#include <iostream>\n\
\n\
int main() {\n\
std::cout << \"hello, world\" << std::endl;\n\
return 0;\n\
}\n\
";
var clojureSource = "(println \"hello, world\")\n";
var cobolSource = "\
IDENTIFICATION DIVISION.\n\
PROGRAM-ID. MAIN.\n\
PROCEDURE DIVISION.\n\
DISPLAY \"hello, world\".\n\
STOP RUN.\n\
";
var lispSource = "(write-line \"hello, world\")";
var dSource = "\
import std.stdio;\n\
\n\
void main()\n\
{\n\
writeln(\"hello, world\");\n\
}\n\
";
var elixirSource = "IO.puts \"hello, world\"";
var erlangSource = "\
main(_) ->\n\
io:fwrite(\"hello, world\\n\").\n\
";
var executableSource = "\
Judge0 IDE assumes that content of executable is Base64 encoded.\n\
\n\
This means that you should Base64 encode content of your binary,\n\
paste it here and click \"Run\".\n\
\n\
Here is an example of compiled \"hello, world\" NASM program.\n\
Content of compiled binary is Base64 encoded and used as source code.\n\
\n\
https://ide.judge0.com/?kS_f\n\
";
var fsharpSource = "printfn \"hello, world\"\n";
var fortranSource = "\
program main\n\
print *, \"hello, world\"\n\
end\n\
";
var goSource = "\
package main\n\
\n\
import \"fmt\"\n\
\n\
func main() {\n\
fmt.Println(\"hello, world\")\n\
}\n\
";
var groovySource = "println \"hello, world\"\n";
var haskellSource = "main = putStrLn \"hello, world\"";
var javaSource = "\
public class Main {\n\
public static void main(String[] args) {\n\
System.out.println(\"hello, world\");\n\
}\n\
}\n\
";
var javaScriptSource = "console.log(\"hello, world\");";
var kotlinSource = "\
fun main() {\n\
println(\"hello, world\")\n\
}\n\
";
var luaSource = "print(\"hello, world\")";
var objectiveCSource = "\
#import <Foundation/Foundation.h>\n\
\n\
int main() {\n\
@autoreleasepool {\n\
char name[10];\n\
scanf(\"%s\", name);\n\
NSString *message = [NSString stringWithFormat:@\"hello, %s\\n\", name];\n\
printf(\"%s\", message.UTF8String);\n\
}\n\
return 0;\n\
}\n\
";
var ocamlSource = "print_endline \"hello, world\"";
var octaveSource = "printf(\"hello, world\\n\");";
var pascalSource = "\
program Hello;\n\
begin\n\
writeln ('hello, world')\n\
end.\n\
";
var perlSource = "\
my $name = <STDIN>;\n\
print \"hello, $name\";\n\
";
var phpSource = "\
<?php\n\
print(\"hello, world\\n\");\n\
?>\n\
";
var plainTextSource = "hello, world\n";
var prologSource = "\
:- initialization(main).\n\
main :- write('hello, world\\n').\n\
";
var pythonSource = "print(\"hello, world\")";
var rSource = "cat(\"hello, world\\n\")";
var rubySource = "puts \"hello, world\"";
var rustSource = "\
fn main() {\n\
println!(\"hello, world\");\n\
}\n\
";
var scalaSource = "\
object Main {\n\
def main(args: Array[String]) = {\n\
val name = scala.io.StdIn.readLine()\n\
println(\"hello, \"+ name)\n\
}\n\
}\n\
";
var sqliteSource = "\
-- On Judge0 IDE your SQL script is run on chinook database (https://www.sqlitetutorial.net/sqlite-sample-database).\n\
-- For more information about how to use SQL with Judge0 API please\n\
-- watch this asciicast: https://asciinema.org/a/326975.\n\
SELECT\n\
Name, COUNT(*) AS num_albums\n\
FROM artists JOIN albums\n\
ON albums.ArtistID = artists.ArtistID\n\
GROUP BY Name\n\
ORDER BY num_albums DESC\n\
LIMIT 4;\n\
";
var sqliteAdditionalFiles = "";
var swiftSource = "\
import Foundation\n\
let name = readLine()\n\
print(\"hello, \\(name!)\")\n\
";
var typescriptSource = "console.log(\"hello, world\");";
var vbSource = "\
Public Module Program\n\
Public Sub Main()\n\
Console.WriteLine(\"hello, world\")\n\
End Sub\n\
End Module\n\
";
var c3Source = "\
// On the Judge0 IDE, C3 is automatically\n\
// updated every hour to the latest commit on master branch.\n\
module main;\n\
\n\
extern func void printf(char *str, ...);\n\
\n\
func int main()\n\
{\n\
printf(\"hello, world\\n\");\n\
return 0;\n\
}\n\
";
var javaTestSource = "\
import static org.junit.jupiter.api.Assertions.assertEquals;\n\
\n\
import org.junit.jupiter.api.Test;\n\
\n\
class MainTest {\n\
static class Calculator {\n\
public int add(int x, int y) {\n\
return x + y;\n\
}\n\
}\n\
\n\
private final Calculator calculator = new Calculator();\n\
\n\
@Test\n\
void addition() {\n\
assertEquals(2, calculator.add(1, 1));\n\
}\n\
}\n\
";
var mpiccSource = "\
// Try adding \"-n 5\" (without quotes) into command line arguments. \n\
#include <mpi.h>\n\
\n\
#include <stdio.h>\n\
\n\
int main()\n\
{\n\
MPI_Init(NULL, NULL);\n\
\n\
int world_size;\n\
MPI_Comm_size(MPI_COMM_WORLD, &world_size);\n\
\n\
int world_rank;\n\
MPI_Comm_rank(MPI_COMM_WORLD, &world_rank);\n\
\n\
printf(\"Hello from processor with rank %d out of %d processors.\\n\", world_rank, world_size);\n\
\n\
MPI_Finalize();\n\
\n\
return 0;\n\
}\n\
";
var mpicxxSource = "\
// Try adding \"-n 5\" (without quotes) into command line arguments. \n\
#include <mpi.h>\n\
\n\
#include <iostream>\n\
\n\
int main()\n\
{\n\
MPI_Init(NULL, NULL);\n\
\n\
int world_size;\n\
MPI_Comm_size(MPI_COMM_WORLD, &world_size);\n\
\n\
int world_rank;\n\
MPI_Comm_rank(MPI_COMM_WORLD, &world_rank);\n\
\n\
std::cout << \"Hello from processor with rank \"\n\
<< world_rank << \" out of \" << world_size << \" processors.\\n\";\n\
\n\
MPI_Finalize();\n\
\n\
return 0;\n\
}\n\
";
var mpipySource = "\
# Try adding \"-n 5\" (without quotes) into command line arguments. \n\
from mpi4py import MPI\n\
\n\
comm = MPI.COMM_WORLD\n\
world_size = comm.Get_size()\n\
world_rank = comm.Get_rank()\n\
\n\
print(f\"Hello from processor with rank {world_rank} out of {world_size} processors\")\n\
";
var nimSource = "\
# On the Judge0 IDE, Nim is automatically\n\
# updated every day to the latest stable version.\n\
echo \"hello, world\"\n\
";
var pythonForMlSource = "\
import mlxtend\n\
import numpy\n\
import pandas\n\
import scipy\n\
import sklearn\n\
\n\
print(\"hello, world\")\n\
";
var bosqueSource = "\
// On the Judge0 IDE, Bosque (https://github.com/microsoft/BosqueLanguage)\n\
// is automatically updated every hour to the latest commit on master branch.\n\
\n\
namespace NSMain;\n\
\n\
concept WithName {\n\
invariant $name != \"\";\n\
\n\
field name: String;\n\
}\n\
\n\
concept Greeting {\n\
abstract method sayHello(): String;\n\
\n\
virtual method sayGoodbye(): String {\n\
return \"goodbye\";\n\
}\n\
}\n\
\n\
entity GenericGreeting provides Greeting {\n\
const instance: GenericGreeting = GenericGreeting@{};\n\
\n\
override method sayHello(): String {\n\
return \"hello world\";\n\
}\n\
}\n\
\n\
entity NamedGreeting provides WithName, Greeting {\n\
override method sayHello(): String {\n\
return String::concat(\"hello\", \" \", this.name);\n\
}\n\
}\n\
\n\
entrypoint function main(arg?: String): String {\n\
var val = arg ?| \"\";\n\
if (val == \"1\") {\n\
return GenericGreeting@{}.sayHello();\n\
}\n\
elif (val == \"2\") {\n\
return GenericGreeting::instance.sayHello();\n\
}\n\
else {\n\
return NamedGreeting@{name=\"bob\"}.sayHello();\n\
}\n\
}\n\
";
var cppTestSource = "\
#include <gtest/gtest.h>\n\
\n\
int add(int x, int y) {\n\
return x + y;\n\
}\n\
\n\
TEST(AdditionTest, NeutralElement) {\n\
EXPECT_EQ(1, add(1, 0));\n\
EXPECT_EQ(1, add(0, 1));\n\
EXPECT_EQ(0, add(0, 0));\n\
}\n\
\n\
TEST(AdditionTest, CommutativeProperty) {\n\
EXPECT_EQ(add(2, 3), add(3, 2));\n\
}\n\
\n\
int main(int argc, char **argv) {\n\
::testing::InitGoogleTest(&argc, argv);\n\
return RUN_ALL_TESTS();\n\
}\n\
";
var csharpTestSource ="\
using NUnit.Framework;\n\
\n\
public class Calculator\n\
{\n\
public int add(int a, int b)\n\
{\n\
return a + b;\n\
}\n\
}\n\
\n\
[TestFixture]\n\
public class Tests\n\
{\n\
private Calculator calculator;\n\
\n\
[SetUp]\n\
protected void SetUp()\n\
{\n\
calculator = new Calculator();\n\
}\n\
\n\
[Test]\n\
public void NeutralElement()\n\
{\n\
Assert.AreEqual(1, calculator.add(1, 0));\n\
Assert.AreEqual(1, calculator.add(0, 1));\n\
Assert.AreEqual(0, calculator.add(0, 0));\n\
}\n\
\n\
[Test]\n\
public void CommutativeProperty()\n\
{\n\
Assert.AreEqual(calculator.add(2, 3), calculator.add(3, 2));\n\
}\n\
}\n\
";
var sources = {
45: assemblySource,
46: bashSource,
47: basicSource,
48: cSource,
49: cSource,
50: cSource,
51: csharpSource,
52: cppSource,
53: cppSource,
54: cppSource,
55: lispSource,
56: dSource,
57: elixirSource,
58: erlangSource,
44: executableSource,
59: fortranSource,
60: goSource,
61: haskellSource,
62: javaSource,
63: javaScriptSource,
64: luaSource,
65: ocamlSource,
66: octaveSource,
67: pascalSource,
68: phpSource,
43: plainTextSource,
69: prologSource,
70: pythonSource,
71: pythonSource,
72: rubySource,
73: rustSource,
74: typescriptSource,
75: cSource,
76: cppSource,
77: cobolSource,
78: kotlinSource,
79: objectiveCSource,
80: rSource,
81: scalaSource,
82: sqliteSource,
83: swiftSource,
84: vbSource,
85: perlSource,
86: clojureSource,
87: fsharpSource,
88: groovySource,
1001: cSource,
1002: cppSource,
1003: c3Source,
1004: javaSource,
1005: javaTestSource,
1006: mpiccSource,
1007: mpicxxSource,
1008: mpipySource,
1009: nimSource,
1010: pythonForMlSource,
1011: bosqueSource,
1012: cppTestSource,
1013: cSource,
1014: cppSource,
1015: cppTestSource,
1021: csharpSource,
1022: csharpSource,
1023: csharpTestSource,
1024: fsharpSource
};
var fileNames = {
45: "main.asm",
46: "script.sh",
47: "main.bas",
48: "main.c",
49: "main.c",
50: "main.c",
51: "Main.cs",
52: "main.cpp",
53: "main.cpp",
54: "main.cpp",
55: "script.lisp",
56: "main.d",
57: "script.exs",
58: "main.erl",
44: "a.out",
59: "main.f90",
60: "main.go",
61: "main.hs",
62: "Main.java",
63: "script.js",
64: "script.lua",
65: "main.ml",
66: "script.m",
67: "main.pas",
68: "script.php",
43: "text.txt",
69: "main.pro",
70: "script.py",
71: "script.py",
72: "script.rb",
73: "main.rs",
74: "script.ts",
75: "main.c",
76: "main.cpp",
77: "main.cob",
78: "Main.kt",
79: "main.m",
80: "script.r",
81: "Main.scala",
82: "script.sql",
83: "Main.swift",
84: "Main.vb",
85: "script.pl",
86: "main.clj",
87: "script.fsx",
88: "script.groovy",
1001: "main.c",
1002: "main.cpp",
1003: "main.c3",
1004: "Main.java",
1005: "MainTest.java",
1006: "main.c",
1007: "main.cpp",
1008: "script.py",
1009: "main.nim",
1010: "script.py",
1011: "main.bsq",
1012: "main.cpp",
1013: "main.c",
1014: "main.cpp",
1015: "main.cpp",
1021: "Main.cs",
1022: "Main.cs",
1023: "Test.cs",
1024: "script.fsx"
};
var languageIdTable = {
1001: 1,
1002: 2,
1003: 3,
1004: 4,
1005: 5,
1006: 6,
1007: 7,
1008: 8,
1009: 9,
1010: 10,
1011: 11,
1012: 12,
1013: 13,
1014: 14,
1015: 15,
1021: 21,
1022: 22,
1023: 23,
1024: 24
}
var extraApiUrl = "https://extra-ce.judge0.com";
var languageApiUrlTable = {
1001: extraApiUrl,
1002: extraApiUrl,
1003: extraApiUrl,
1004: extraApiUrl,
1005: extraApiUrl,
1006: extraApiUrl,
1007: extraApiUrl,
1008: extraApiUrl,
1009: extraApiUrl,
1010: extraApiUrl,
1011: extraApiUrl,
1012: extraApiUrl,
1013: extraApiUrl,
1014: extraApiUrl,
1015: extraApiUrl,
1021: extraApiUrl,
1022: extraApiUrl,
1023: extraApiUrl,
1024: extraApiUrl
}
{
"lockfileVersion": 1
}
File mode changed
......@@ -3,7 +3,7 @@ const multer = require('multer');
const fs = require('fs');
const upload = multer();
const app = express();
const port = 5501;
const port = 5500;
app.use(express.static('Voicoding_web'));
app.use(express.static('./'));
async function testGoogleTextToSpeech(audioBuffer) {
......