« first day (8 days earlier)      last day (115 days later) » 

00:01
Alright, I'm in
!eval japt "\"Hi!\"" " "
/home/ubuntu/workspace/INTERPRETERS/japt:1
(function (exports, require, module, __filename, __dirname) { require 'shoco';
^^^^^^^

SyntaxError: Unexpected string
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:414:25)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at Function.Module.runMain (module.js:467:10)
at startup (node.js:136:18)
at node.js:963:3
Sadly, I have no idea where to go from here...
!eval japt "0" " "
/home/ubuntu/workspace/INTERPRETERS/japt:1
(function (exports, require, module, __filename, __dirname) { require 'shoco';
^^^^^^^

SyntaxError: Unexpected string
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:414:25)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at Function.Module.runMain (module.js:467:10)
at startup (node.js:136:18)
at node.js:963:3
Here one second lemme get you syntax coloring
!stop
@quartata Bot terminating...
00:06
Start the bot by going into DEVELOP and doing `./bot.sh
Bot started.
!eval japt "2" " "
/home/ubuntu/workspace/INTERPRETERS/japt.js:1
(function (exports, require, module, __filename, __dirname) { require 'shoco';
^^^^^^^

SyntaxError: Unexpected string
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:414:25)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at Function.Module.runMain (module.js:467:10)
at startup (node.js:136:18)
at node.js:963:3
So it doesn't like the shoco line
How do I import shoco then?
BTW, you can change the interpreters at any time, even when Data's already running.
00:08
I had to change the path
require 'shoco'; is the proper syntax, right?
@ETHproductions I thought so ye
I know js, I just don't know node.js
My crazy last-resort method would be to load shoco.js from my repository with an XMLHttpRequest, then eval it
nah
here lemme try this
Ah I see now.
I have to "export" my functions
You guys do know that the group chat on the c9 server is there for a reason. ;P
00:12
Better solution: just copy paste the shoco code into the japt file
!eval japt "2" " "
/home/ubuntu/workspace/INTERPRETERS/japt.js:401
shoco.c = function (str) { return Array.prototype.map.call(shoco.compress(str), function (char) { return String.fromCharCode(char) }).join('') };
^

ReferenceError: shoco is not defined
at Object.<anonymous> (/home/ubuntu/workspace/INTERPRETERS/japt.js:401:1)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at Function.Module.runMain (module.js:467:10)
ctrl+f
Here, I'll fix it
Wait, I'm not sure how
How do you do "classes"
ctrl+f "shoco." replace ""
00:16
@VoteToClose then some variables will conflict
@quartata Rename the variables. :P
No I'm not going through all of this spaghetti JS
"undefined"!==typeof module?module.Wd=c:window.shoco=c
@ETHproductions How do can I put all this junk into a module
Maybe just replace shoco. with module.Wd.?
00:19
spaghetti.js
In the rest of the code, I mean
@ETHproductions I can't read any of this JS
I don't know what is going on
Lemme see
All I know is I copy-pasted shoco into japt
and it no workie because scope
63
Q: Load and execute external js file in node.js with access to local variables?

TravisIs it easy/possible to do a simple include('./path/to/file') type of command in node.js? All I want to do is have access to local variables and run a script. How do people typically organize node.js projects that are bigger than a simple hello world? (A fully functional dynamic website) Fo...

00:24
!eval japt "2"
/home/ubuntu/workspace/INTERPRETERS/japt.js:264
shoco.c = function (str) { return Array.prototype.map.call(shoco.compress(str), function (char) { return String.fromCharCode(char) }).join('') };
^

ReferenceError: shoco is not defined
at Object.<anonymous> (/home/ubuntu/workspace/INTERPRETERS/japt.js:264:1)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at Function.Module.runMain (module.js:467:10)
There is no way we're gonna be able to make this spaghetti shoco code work as a module
!eval japt "2"
/home/ubuntu/workspace/INTERPRETERS/japt.js:264
shoco.c = function (str) { return Array.prototype.map.call(shoco.compress(str), function (char) { return String.fromCharCode(char) }).join('') };
^

ReferenceError: shoco is not defined
at Object.<anonymous> (/home/ubuntu/workspace/INTERPRETERS/japt.js:264:1)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at Function.Module.runMain (module.js:467:10)
I'm going to check npm
It'll take us ages to nodify this code
I have an idea to use the spaghetti code
00:32
er why did npm get killed
#wasntme
O.O Look at the memory and CPU stats?
I wasn't even in the IDE in that short period
I'ma restart it as soon as you're done.
er what just happened
00:35
Workspace restarted.
I've probably already said this but fuck node js
!alive
Who is in control of the bot? Could I manually restart it now that I have access to the IDE?
Yeah, just ./bot.sh
and it isn't even in npm
> shoco.js should be usable as a node.js module.
rly
!eval japt "2"
Bot started.
00:40
Fail.
@quartata Something went wrong with your request, sorry! Are you sure that language is on Try It Online?
Bot restarted after crash.
/me headdesks.
@quartata Bot terminating...
@VoteToClose That's just me hitting Ctrl D
OK I FIGURED IT OUT
no stop
00:47
Bot started.
!eval japt "2"
@quartata Something went wrong with your request, sorry! Are you sure that language is on Try It Online?
Bot restarted after crash.
wrong version
!stop
@quartata Bot terminating...
Bot started.
!eval japt "2"
00:48
/home/ubuntu/workspace/INTERPRETERS/japt.js:3
execfile.execfile('./shoco.js','shoco.js');
^

ReferenceError: execfile is not defined
at Object.<anonymous> (/home/ubuntu/workspace/INTERPRETERS/japt.js:3:1)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at Function.Module.runMain (module.js:467:10)
at startup (node.js:136:18)
at node.js:963:3
!stop
@quartata Bot terminating...
Bot started.
!eval japt "2"
/home/ubuntu/workspace/INTERPRETERS/japt.js:3
execfile('./shoco.js','shoco.js');
^

ReferenceError: execfile is not defined
at Object.<anonymous> (/home/ubuntu/workspace/INTERPRETERS/japt.js:3:1)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at Function.Module.runMain (module.js:467:10)
at startup (node.js:136:18)
at node.js:963:3
Is it "./execfile.js" and not "execfile.js"?
00:50
!eval japt "2"
fs.js:549
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^

Error: ENOENT: no such file or directory, open './shoco.js'
at Error (native)
at Object.fs.openSync (fs.js:549:18)
at Object.fs.readFileSync (fs.js:397:15)
at Object.<anonymous> (/home/ubuntu/workspace/INTERPRETERS/japt.js:4:15)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at Function.Module.runMain (module.js:467:10)
This is so stupid
!eval japt "2"
fs.js:549
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^

Error: ENOENT: no such file or directory, open '/home/ubuntu/INTERPRETERS/shoco.js'
at Error (native)
at Object.fs.openSync (fs.js:549:18)
at Object.fs.readFileSync (fs.js:397:15)
at Object.<anonymous> (/home/ubuntu/workspace/INTERPRETERS/japt.js:4:15)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
Uhh, I don't think that's your fault.
00:52
What's fs.js?
!eval japt "2"
@VoteToClose Bot terminating...
@VoteToClose it is typo
@VoteToClose why
Anonymous
Wouldn't it just be easier to use the c-to-JS compiler on shoco?
00:53
no
Ooohhhh.
I'm an idiot.
I mean yes.
Sorry. xD
That's what we're doing
Bot started.
00:53
here can you just give me a second
!eval japt "2"
/home/ubuntu/workspace/INTERPRETERS/shoco.js:9
print),"undefined"!=typeof printErr&&(p.printErr=printErr),p.read="undefined"!=typeof read?read:function(){e("no read() available (jsc?)")},p.readBinary=function(a){return read(a,"binary")},"undefined"!=typeof scriptArgs?p.arguments=scriptArgs:"undefined"!=typeof arguments&&(p.arguments=arguments),this.Module=p,eval("if (typeof gc === 'function' && gc.toString().indexOf('[native code]') > 0) var gc = undefined")):ca||da?(p.read=function(a){var b=new XMLHttpRequest;b.open("GET","http://crossorigin.me"+a,m);b.send(l);return b.responseText},
Yeah, the directory is /home/ubuntu/workspace/INTERPRETERS
print is not defined what is that mean
great there's a bug in shoco to top it off
Anonymous
Also I'm almost done with the local version of DataBot so we can use the bot as a programming language
This should work it's loading the file and executing it as plain javascript using vm
but apparently shoco has problems
00:54
wtf is print) doing at the beginning of a line
Anonymous
Can Node do dynload? It would probably be a million times easier to compile shoco into a so
@Mego any time you think something might be "easy" in node js it isn't
I give up I'll try to work on this later
This should work
Anonymous
Well if it can dynamically load shared objects, then it's a piece of cake to compile shoco into one.
Anonymous
71
Q: How can I use a C++ library from node.js?

ViclibThis is the question. How can I use a C++ library from node.js?

Anonymous
@quartata there is your solution ^
00:58
I can just disable shoco in Japt for now
If that would be the best solution
Why do you need shoco?
Oh, string compressor.
I'll add a shoco dummy object whose functions return the original text
Bot started.
!eval japt "2"
@ETHproductions Something went wrong with your request, sorry! Are you sure that language is on Try It Online?
/home/ubuntu/workspace/INTERPRETERS/shoco.js:9
print),"undefined"!=typeof printErr&&(p.printErr=printErr),p.read="undefined"!=typeof read?read:function(){e("no read() available (jsc?)")},p.readBinary=function(a){return read(a,"binary")},"undefined"!=typeof scriptArgs?p.arguments=scriptArgs:"undefined"!=typeof arguments&&(p.arguments=arguments),this.Module=p,eval("if (typeof gc === 'function' && gc.toString().indexOf('[native code]') > 0) var gc = undefined")):ca||da?(p.read=function(a){var b=new XMLHttpRequest;b.open("GET","http://crossorigin.me"+a,m);b.send(l);return b.responseText},
01:03
!stop
@ETHproductions You don't have the privilege to execute this command.
./bot.sh
@ETHproductions You don't have the privilege to execute this command.
wtf
Can someone please restart it
@VoteToClose Bot terminating...
Use the command line. :P
01:04
I did :P
@Mego Should I add him to the Config.py?
At least I think I did... I'm a noob at command line stuff
Oooh, wrong command line
Bot started.
!eval japt "2"
@ETHproductions Something went wrong with your request, sorry! Are you sure that language is on Try It Online?
01:05
Now what is your problem?
./bot.sh is not for DEVELOP.
cd into DEVELOP, then do ./bot.sh
!stop
@VoteToClose Bot terminating...
Bot started.
I did that in your terminal, for future reference.
!eval japt "2"
/home/ubuntu/workspace/INTERPRETERS/shoco.js:9
print),"undefined"!=typeof printErr&&(p.printErr=printErr),p.read="undefined"!=typeof read?read:function(){e("no read() available (jsc?)")},p.readBinary=function(a){return read(a,"binary")},"undefined"!=typeof scriptArgs?p.arguments=scriptArgs:"undefined"!=typeof arguments&&(p.arguments=arguments),this.Module=p,eval("if (typeof gc === 'function' && gc.toString().indexOf('[native code]') > 0) var gc = undefined")):ca||da?(p.read=function(a){var b=new XMLHttpRequest;b.open("GET","http://crossorigin.me"+a,m);b.send(l);return b.responseText},
Oh, thanks :)
01:07
Also, you don't need to restart the bot to update your interpreters. c:
Can I just delete all the code in shoco.js?
...why would you do that?
!eval japt "2"
Something's going wrong even though I commented out all the code. Unless it didn't update for some reason; I don't really know how this works...
fs.js:549
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^

Error: ENOENT: no such file or directory, open '/home/ubuntu/workspace/INTERPRETERS/shoco.js'
at Error (native)
at Object.fs.openSync (fs.js:549:18)
at Object.fs.readFileSync (fs.js:397:15)
at Object.<anonymous> (/home/ubuntu/workspace/INTERPRETERS/japt.js:4:15)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
:27396034 fs.js:549
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^

Error: ENOENT: no such file or directory, open '/home/ubuntu/workspace/INTERPRETERS/shoco.js'
at Error (native)
at Object.fs.openSync (fs.js:549:18)
at Object.fs.readFileSync (fs.js:397:15)
at Object.<anonymous> (/home/ubuntu/workspace/INTERPRETERS/japt.js:4:15)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
Why is fs.js being run now? I thought I commented out the code that called it from japt.js
01:11
!eval japt "2"
@VoteToClose <no output>
Ooh.
We're getting somewhere.
!eval_debug japt "2"
@VoteToClose Command not found.
:27396092 Command not found.
01:12
!listcommands
@VoteToClose Command not found.
Commands:
alive, ban, delete, disable, enable, eval, evaldebug, help, langs, listcommands, module, stop, unban, utc
!evaldebug japt "2" ""
@VoteToClose Argument parsing failed.
!evaldebug japt "2" ""
:27396112 Argument parsing failed.
@ETHproductions Argument parsing failed.
01:12
Nope.
Now what...
!evaldebug japt "2" "" ""
@VoteToClose Argument parsing failed.
!eval japt "Oo2"
@ETHproductions <no output>
01:14
!eval japt "[ABCDEFGHIJKLMNOPQRSTUVWXYZ]"
@ETHproductions <no output>
Does it output through alert?
It should output through a return.
Or console.log?
!eval japt "Oa[ABCDEFGHIJKLMNOPQRSTUVWXYZ]"
01:15
@ETHproductions <no output>
You need to set it up to output to STDOUT node.js style.
Oh, OK
Actually, it outputs through callback functions
You can modify around line 501 in japt.js to change it to something better
(I don't know JS, but I do know about STDOUT w/ node.js stuff)
Oooh, look at line 779
It only sends it to console.log
That should wrok that is stdout in node
also we should just use spidermonkey instead of node
im on mobile atm
01:20
I'm an idiot and quartatartots is right.
@ETHproductions You don't have the privilege to execute this command.
@Mego be aware that we cant use TIO languages in answers with Data
@VoteToClose Bot terminating...
01:21
Let's output errors to console.log as well, just to be sure
There
@quartata He's setting it up for git submodules to just download those interpreters.
did you disable shoco?
Yeah, I went through and commented out anything that involved shoco.
k. im thinking that thisll be ok for now but we should switch away from node as soon as possible
spidermonkey shoud work ok with shoco
!eval japt "2"
Oh, heh.
01:23
Bot started.
!eval japt "2"
@ETHproductions <no output>
What normally gets called to write to console.log?
oh you know what I think I know the issue
Good, cause I don't :P
01:24
check the stdin shit I probably did the event loop wrong
!eval japt "A"
@ETHproductions <no output>
also verify that the code is getting passed as an arg correctly
yeah its probably not doing the event loop and just exiting immediately
process.stdin.resume();
process.stdin.setEncoding('utf8');

process.stdin.on('data', function (chunk) {
  Japt.run(process.argv[2], chunk, true, null, function(x){console.log(x)}, function(x){console.log(x)});
});
Is that wrong?
01:28
you know what fuck stdin just pass the input as an arg
remove all that except the japt run change chunk to process argv 3
So remove all that and insert
Japt.run(process.argv[3], chunk, true, null, function(x){console.log(x)}, function(x){console.log(x)});
?
then go to run_japt
@Ethproductions no change the chunk var
process.stdin.resume();
process.stdin.setEncoding('utf8');

process.stdin.on('data', function (chunk) {
  Japt.run(process.argv[2], process.argv[3], true, null, function(x){console.log(x)}, function(x){console.log(x)});
});
Or just Japt.run(process.argv[2], process.argv[3], true, null, function(x){console.log(x)}, function(x){console.log(x)});
the latter
now go to evalmodule.py
01:32
find run_japt
0 matches
make sure you are in develop
Oh duh
found it
can copy paste the function so i can look at it
def run_japt(code, cinput):
    process = subprocess.Popen(["node", '/home/ubuntu/workspace/INTERPRETERS/japt.js', code], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True)
    try:
        result = process.communicate(input=cinput, timeout=60)[0]
    except subprocess.TimeoutExpired:
        process.kill()
        result = "Sorry, your code took too long to run!"
        partial_out = process.communicate()[0] # communicate returns a tuple first element is stdout second is stderr
01:35
thx
ok remove input=cinput, and add , cinput to the array on that process line at the beginning
def run_japt(code, cinput):
    process = subprocess.Popen(["node", '/home/ubuntu/workspace/INTERPRETERS/japt.js', code], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True, cinput)
    try:
        result = process.communicate(timeout=60)[0]
    except subprocess.TimeoutExpired:
        process.kill()
        result = "Sorry, your code took too long to run!"
        partial_out = process.communicate()[0] # communicate returns a tuple first element is stdout second is stderr
whoops, wrong
no add it to the [] bit
def run_japt(code, cinput):
    process = subprocess.Popen(["node", '/home/ubuntu/workspace/INTERPRETERS/japt.js', code, cinput], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True)
    try:
        result = process.communicate(timeout=60)[0]
    except subprocess.TimeoutExpired:
        process.kill()
        result = "Sorry, your code took too long to run!"
        partial_out = process.communicate()[0] # communicate returns a tuple first element is stdout second is stderr
ok good
Is that all?
01:39
should b ye
*be
kthx, I'll test it
Bot started.
!eval japt "2"
/home/ubuntu/workspace/INTERPRETERS/japt.js:364
try { Japt.stdout.value = ""; } catch (e) { alert ("Error: Japt.stdout must be sent to an HTMLElement"); }
^

ReferenceError: alert is not defined
at Object.Japt.clear_output (/home/ubuntu/workspace/INTERPRETERS/japt.js:364:46)
at Object.Japt.run (/home/ubuntu/workspace/INTERPRETERS/japt.js:454:10)
at Object.<anonymous> (/home/ubuntu/workspace/INTERPRETERS/japt.js:775:6)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
oh better get rid of that
01:40
yep
anyways that confirms that the event loopwas never cslling japt lmao
node js sucks
@ETHproductions Command not found.
01:41
!stop
@ETHproductions You don't have the privilege to execute this command.
/home/ubuntu/workspace/INTERPRETERS/japt.js:364
try { Japt.stdout.value = ""; } catch (e) { alert ("Error: Japt.stdout must be sent to an HTMLElement"); }
^

ReferenceError: alert is not defined
at Object.Japt.clear_output (/home/ubuntu/workspace/INTERPRETERS/japt.js:364:46)
at Object.Japt.run (/home/ubuntu/workspace/INTERPRETERS/japt.js:454:10)
at Object.<anonymous> (/home/ubuntu/workspace/INTERPRETERS/japt.js:775:6)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
@VoteToClose Command not found.
@ETHproductions Command not found.
Ugh, I always do that. xD
Bot started.
01:42
!eval japt "2"
@VoteToClose 2
:D
\o/
!eval japt "A*C"
@ETHproductions 120
!eval japt "U" "56"
01:43
@ETHproductions 0
Hurg, now we need to fix input...
I'm just gonna add you as a bot owner.
Thanks :)
whats up with input
01:45
@VoteToClose Bot terminating...
Bot started.
!eval japt "N" "[1 2 3] \"abc\" 123"
it should be getting passed to japt
@ETHproductions []
Huh
It doesn't seem to be
@ETHproductions Run !module help real quick?
!listcommands
01:47
Commands:
alive, ban, delete, disable, enable, eval, evaldebug, help, langs, listcommands, module, stop, unban, utc
!module help
Contains controls for modules.
`module enable <name>` - enables a module
`module disable <name>` - disables a module
Yeah, you're marked as owner. :D
It's sleepy time for me.
Night all.
01:48
g'night
@Ethproductions input is the second arg to japt .run right
what are all the args for japt.run again
@ETHproductions
Sorry, had to go away for a minute
@quartata Yes, it's (code, input, safemode, function to run before, function to run on success, function to run on error)
I'm gonna try something quick
i guess just add some kin of debug statement
@ETHproductions Bot terminating...
01:57
it should work
Bot started.
*kind
!eval japt "N" "123"
/home/ubuntu/workspace/INTERPRETERS/japt.js:478
U = N.length <= 0? 0 : N[0],
^

TypeError: Cannot read property 'length' of undefined
at Object.Japt.run (/home/ubuntu/workspace/INTERPRETERS/japt.js:478:7)
at Object.<anonymous> (/home/ubuntu/workspace/INTERPRETERS/japt.js:766:6)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at Function.Module.runMain (module.js:467:10)
at startup (node.js:136:18)
Uh
so input is undefined? that's weird
01:59
codez for the call to japt.run
i migght have gotten the args wrong
@quartata Japt.run(process.argv[2], process.argv[3], true, null, function(x){console.log(x)}, function(x){console.log(x)});

« first day (8 days earlier)      last day (115 days later) »