« first day (634 days earlier)      last day (2010 days later) » 

5:13 PM
@dzaima here's that horrible code now, together with the whole APL app
 
@dzaima Wait, are you using Python to create Java that can execute APL‽
 
@Adám yep, and to add to that - the python calls bash scripts :p
 
 
Python that calls bash to create java that can execute APL
-1 not enough jQuery
 
5:40 PM
Here's some Processing also
 
@dzaima Wait, your APL supports graphics?
 
@Quintec I've been working on that. It doesn't, but I'm writing Processing code that adds the P5 object to it when called from that
 
Also, is that Sublime Text?
 
@Quintec yep, with the JavaScript highlighting :p
 
Fun fact: my hobby is to go into random code I've written in Sublime Text and change the syntax highlighting to different languages just to see the pretty colors :D
 
6:05 PM
@dzaima +1000 I've always wanted an apl interface to processing
what's the difference between P5 and G?
are the :s your conditionals?
 
@Cowsquack P5 is the only given object by the library. P5.G is the main PGraphics object (the equivalent of the predefined variable g in Processing), on which you draw stuff (because I didn't want to bloat P5 with graphics things)
 
is p5 p5.js or normal processing?
 
@Cowsquack yeah. : itself is a conditional that keeps running the code and :← is "if return"
@Cowsquack the java version
 
@dzaima TIL there is a predefined PGraphics object
so g is implicitly displayed on the screen?
 
6:21 PM
@Cowsquack it is the screen
PApplet.fill(255)g.fill(255)
 
ooh
 
@dzaima well not completely, but close enough.
 
so it simply is a quirk of the java-processing
 
I'd personally call PApplet.fill a quirk, not g
 
6:59 PM
I'd be interested in the source of processing.apl
 
 
2 hours later…
@Quintec it'd probably be smarter to start with creating one side and then doing ⊢,'x',⌽ once
 
That is probably true
 
@Quintec Here is a template you can use to write your program once, execute it, and still get the counter right.
 
Oh, cool, thanks
 
I've got 40 bytes, one line, no variables
 
9:08 PM
I have 49 bytes, one line, no variables
 
40, one line, no vars here too.
⎕←(⌽,'X',⊢)'-'⍪⍨'-'⍪'-'@(2,¨1 2)⊢3 6⍴'  |'
 
@Adám
------X------
| | | X | | |
| | --X-- | |
| | | X | | |
------X------
 
@DyalogAPL not quite the correct output
 
@DyalogAPL Hey, you got that wrong, my friend!
Apparently, the bot removes duplicate spaces.
 
ah, that makes sense
 
9:11 PM
⎕←(⌽,'X',⊢)'-'⍪⍨'-'⍪'-'@(2,¨1 2)⊢3 6⍴'  |'
 
@Adám
------X------
|  |  X  |  |
|  |--X--|  |
|  |  X  |  |
------X------
 
@DyalogAPL Hooray for ⎕UCS 160
@dzaima WHat's yours?
 
Huh, forgot/didn't know
 
@Adám (⌽,'x',⊢)(⊢⍪'--| |'⍪⊖)(6/'-')⍪1 6⍴' |'
 
@dzaima (6/'-')'-' which makes it really nice.
You could change 1 6⍴ to ⍉⍪6⍴ for style, but it doesn't save anything.
 
9:16 PM
Which, actually, depressingly isn't really that much longer than my original
I bet if I did each line individually it actually would be shorter than my original
 
@Adám -7 bytes :p
at which point you might as well go with this
 
@dzaima Yes, I was about to post.
 
Yep, which all are depressingly shorter than my original 62 bytes. Ouch
 
A different approach:
⎕←{⎕←⍵,'X',⌽⍵}¨5⍴6⍴¨'-' '|  ' '|  |--' '|  '
 
9:23 PM
@Adám
------X------
| | | X | | |
| |--|X|--| |
| | | X | | |
------X------
┌─────────────┬─────────────┬─────────────┬─────────────┬─────────────┐
│------X------│| | | X | | |│| |--|X|--| |│| | | X | | |│------X------│
└─────────────┴─────────────┴─────────────┴─────────────┴─────────────┘
 
Huh what
 
⋄ {⎕←⍵,'X',⌽⍵}¨5⍴6⍴¨'-' '|  ' '|  |--' '|  '
 
@Adám
------X------
|  |  X  |  |
|  |--X--|  |
|  |  X  |  |
------X------
 
Ah
@Adám ?
 
9:26 PM
@Quintec Don't be sad. dzaima and I just have more experience. But look, dzaima is outgolfing me, and I have more than an order of magnitude more experience. You'll get there soon enough.
@Quintec Sure. I was just going for an iterative (!) solution.
 
9:39 PM
Got it
Tried to golf this in java... realized that straight out printing was shorter
 
10:15 PM
i'm going through the docs
the 2.2 example myapp isn't working for me
 
@nathanrogers Neither is it for me. I'll ask JD about it first thing tomorrow.
 
it could be outdated, let me find it again
the example in section 1 is working though
 
@nathanrogers newest version (notice that it isn't experimental any more)
 
10:33 PM
'HR' ⎕WC 'HTMLRenderer'
HR.HTML←'<canvas id="myCanvas" width="200" height="100" style="border:1px solid #000000;"></canvas>'
how do I get a handle to that canvas?
 
@nathanrogers If you're going to use JS to draw on it, then use its id.
 
i guess I don't know what the structure of an app using the htmlrenderer would look like. As in, how am I calling javascript on the canvas from APL? I don't really follow
am I writing javascript? or am I writing an API for APL that does the JS? or do I write the js and call js directly?
or am I writing <script tags using .HTML
 
@nathanrogers All of the methods you mentioned are feasible. Maybe the last is simplest.
 
I still don't understand how I'm going to interact. for example:
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
ctx.moveTo(0, 0);
ctx.lineTo(200, 100);
ctx.stroke();
 
@nathanrogers However, I have almost no experience with HTMLRenderer. I can ask Brian to give you some pointers.
 
10:41 PM
how does APL interact with a script that does that? am I setting some APL variable c←'<script>document.getElementByID('mycanvas')</script>'
please.I've done several canvas apps in plain js, and its pretty striaght forward, I just don't know how to do the apl interoperability
 
APL doesn't interact with the script... it's all in the CEF
 
CEF?
I'm new
 
Chromium Embedded Framework - the guts of Google's Chrome browser
 
so then how would I create a dynamic canvas application?
probably define a set of functions in javascript that are on the page, and then call those js functions one way?
and how do you do THAT part?
 
you create a char vector that contains the HTML/JS. then set HTMLRenderer's HTML property to it
 
10:47 PM
but then I need to interact with the canvas....am I just completely rerendering the page with every frame?
i'm trying to create an application that does drawing to the canvas
 
so, there are two options... 1) do it all in JavaScript, or 2) create event listeners that will make calls back to APL
 
so its more that I'm creating an API in APL that javascript will call, rather than an APL program that calls javascript
would it be possible to create a graphical drawing program using the .NET libraries?
 
for Windows only? probably... I'm sure there are .NET libraries to do that sort of thing, but I have no experience or knowledge of them
 
or oh I see. I could create event listeners such that when I want to draw, I publish a "draw" event which will call back to APL functions
 
for more on HTMLRenderer, here's a presentation from last year's Dyalog User Meeting (youtube.com/watch?v=c9CK0m_LuBk)... I'll be doing a new one as well in a week
 
10:52 PM
that's where I saw this the first time. I'll be glad to see an update :)
 
so, you can have listeners for mouse move/click/etc that callback to APL
 
nice to put a face with a name!
 
we should be streaming some of the presentations from the user meeting
 
link? or is there a notification service I can join?
 
but they'll how up on YouTube at some point
not sure about a specific link (I can ask)... but the live streaming will coincide with the user meeting agenda...dyalog.com/user-meetings/dyalog18/programme.htm
mind you the times are for Belfast UK
 
10:57 PM
is there a document listing all available event handlers?
and is the htmlrenderer able to publish any events?
 
the HTML attribute in HTMLRenderer is simple a character vector with the content for the page. so, a lot of the work I've been doing is to make it easy to generate that content from APL
I'll be introducing a framework we call DUI so you can do things like
mypage←⎕NEW Page
(mypage.Add _.h1 'Hello World').On 'click' 'mycallback'
which sets up an event handler on the <h1> element which will call back to an APL function named mycallback
the code is similar to that MiServer uses... if you look at miserver.dyalog.com, there are a number of examples. DUI is a framework that will include MiServer and HTMLRenderer so you can write the same code to run locally or over the net
I need to get back to prep for my presentations... I'll have more time after the user meeting to answer questions in greater depth.
 

« first day (634 days earlier)      last day (2010 days later) »