I'm seeing a message in RIDE "Interpreter exited with code 134" and then it becomes unresponsive with the window changing colour -- what does that mean?
I have some VB code that I want to convert into APL. Doing it as a tradfn is not going to be difficult, but what are some of the things I should watch for in converting to "play for efficiency"?
@JeffZeitlin If you're able / willing to share I'd be very interested to take a look at your before / after (and maybe have a go at translating myself). You'll get a surprising amount of milage by considering what you're trying to do and coming up with the APL solution independent of your VBA code. Replacing conditional statements (if/else) with boolean logic is a pretty standard APLey thing.
@RichardPark - I can give you a description of what I'm trying to accomplish; the actual code is on another box and not yet transferable (email, not file, yet).
Consider a grid of close-packed hexagons, stacked in columns rather than rows, with alternating columns offset by half-a-hex.
@RichardPark - I'm doing this for a column in my magazine, so I don't need the code to be golfed into incomprehensibility :), but after I have a good, clear, working function, I'll certainly give some thought to offering it as a CGCC puzzle.
@RichardPark - On that grid, the topmost hex of each column is CC01, and it increases going down the grid.
@JeffZeitlin I was thinking if you could map to Euclidean space and do straight lines, but there are degenerate cases like 0102{}0302 - two paths of minimum length
@RichardPark - I'm not quite getting what you're asking. If the hexes are touching sides, you can move between them as one step. There are six possible moves from every hex.
Given a vector k and an int v, if I want to turn this into a matrix where the first row is k and the second row is v, repeated, how can I achieve that? If I do ↑k v it fills the row with zeros -- is there a way of specifying the "fill element"?
Funny you should ask. I was just thinking about how to best announce a schedule change. I have a holiday clashing. Oh, and we've not decided on a subject yet. Where are you holding with your self-studies. Need help?
@RGS If COVID-19 doesn't prevent it, RichardPark and I will certainly go (ass will most Dyalog employees), and with a high probability, PaulMansour too.
@RGS Look at the previous Phase I problems. They are meant to be simple and well geared for APL solutions.
@Adám of course, that is understandable. But I have 11 years worth of APL Competitions to train with. I browsed through some of the recent winners and I found a 3rd place that was definitely Portuguese (ok, maybe Brazilian) and a 2nd place by a 12yo!
The point with "but I have ... to train with" is that I have a lot to play around with. Do I have your permission to ping you?
@Adám really? Like who? I don't know many people here so I can't really map the nicknames here to the RL winners. In fact, I only (sort of) know you and Bubbler
@RGS Oh, it looks like past Phase I winners are not listed. Torsten Grust and Zachary Taylor were here, and Torsten still comes around. If I recall correctly, at least dzaima, Uriel, and Erik the Outgolfer have won Phase I prizes.
@RGS No. As far as I know, nobody from my family ever returned, even for a visit. My father's mother's mother was born Henriques.
Hm, typing ]box gives that "box is off" and I wanted to turn it on. There must be a command to works for similar settings like this, no?
Just nailed it! ]Box 'ON' did the trick
@Adám did your family leave when we started pursuing jewish people..? I'm fairly certain that at some point in our history we had that unfortunate moment...
@RGS Btw, there's a toolbar button you can click to toggle it on/off:
@RGS Yes, they had fled from Spain in 1492, then fled onwards to Holland in 1609 and arrived to the (then) Danish city of Altona around 1650. They were safe in Denmark until 1943…
I do not know if you know this, but there is an interesting traditional dish that was created during those times. If I recall correctly, and if my quick google search is correct, Jewish people cannot eat pork, right? At least during some periods of time every year?
Some Jews would do this ingenious thing: they would take a pig's intestine, clean it, and fill it with meat from birds. Then they would hang those things to let them dry
To make a type of meal that we call enchido in European Portuguese
Then, people who were looking for Jews would arrive at those homes, find the "enchido" (which is typically pork meat) and then leave... when in fact it was the said intestine filled with other meats.
I hope this doesn't offend you, I just remember learning this in History class and I found it fascinating at the time. And I still do, that is why I remember it after all this time!
No, not at all. I don't get offended when it comes to religion. And this tidbit of history is interesting too. In Denmark, the Jews left their mark on food culture in the form of poppy seeds being called by a Yiddish name.
That is funny! I am assuming the "birkes" were the small seeds on top of what looked like some sort of bread or pastry in the danish link you sent me : )
I'm a Danish citizen, born in Denmark. But by now, I'm pretty much an international person, having lived a total of about 13 years in Denmark, 6 years in each of USA and Sweden, 5 in Canada, and now 4 in the UK. :-)
@RGS You can see what the site looks like (and get instant feedback for your solutions to the Phase I problems) at dyalogaplcompetition.com
It was just to confirm that it made sense that you found Chunky Monkey, which was the first problem last year, very easy, as I think we roughly sorted the problems by ascending difficulty. However, it wasn't "scientifically" done, only estimated.
@RGS That's because ⍴ looks for the shape, which for a scalar is the empty vector. You could "ravel" the argument first to normalise it, or simply use ≢ instead of ⍴.
In any one project. But most APLers prefer one and stick with it, maybe only occasionally switching to the other (usually ⎕IO←1ers switching to ⎕IO←0) if very called for in a particular function.
Most dialects have ⎕IO←1 by default, while a few are ⎕IO←0 only.
It is actually one of the things I dislike Dyalog APL. I think there should be a function that dos exactly that, take indices and pick those values. I call it "Select" or "Sane indexing".
@RGS Yours is basically the same as my "chipmunk" ⊃¨⊂. An alternative ways to write it (but which requires the target array explicitly) is ⊃∘target¨indices.
@RGS Critics of my proposal say that you can "simply" use ⌷⍤0 99 but I think that's too obscure for such a fundamental operation.
@RGS The problem is that ⌷ in its pure form, can only handle a single index left argument and the data array on the right. So ⍤0 99 pairs each index on the left (subarrays of rank 0, i.e. scalars) up with the entire array on the right (subarrays of 99 or less).
In a sense, you are. The deal here is that ¨ applies APL's scalar extension rules also seen in things like 3 4 5+1. But this requires one argument to be a scalar. ⊂ makes that argument into a scalar.
@RGS It is actually (conceptually) the other way around. + expects a right hand vector to match the left hand vector, but it only finds a scalar, so it extends the scalar to match the shape of the vector.
a vector of vectors, or a matrix, right? But then the LHS is a vector, so isn't the ¨ taking the LHS vector and still trying to perform indices ⊃ data for each data on the RHS?
or does the ¨ go over both LHS and RHS vectors at the same time?
@Adám I'm just telling you what happened to me; the other day I was code-golfing with APL and needed to know how to convert letters into unicode codepoints. Clearly I didn't type in the correct things because I took an awful long time to find ⎕UCS
@Adám I can't reproduce exactly what I typed in, but now I was trying it again and I noticed ⎕UCS was there for everything I typed... I just didn't type enough OR I mistyped, because I thought the name was "codepoint" and not "code point"
@RGS You're not alone. Maybe because the format isn't so suitable for verbose (read: all currently popular) languages. I've made it MIT so others can use it freely. In fact, I know of one company that wanted to use it internally for their internal APIs. (Maybe they use it — I wouldn't know…)
True, but many of the tasks are not common in code golf, but are more real-world'y. Not many people use golfing langs for real world problems. Certainly not for code that others will ever see.
@Adám Other languages just aren't nearly as idiom-oriented - there either just isn't a "best" version of any code or the best an acceptable version is immediately obvious to any competent user
whereas in APL using an ¨ where you could get away with not can slow a program down many times
@RGS Because for other languages, we always have StackOverflow for How-To questions. And we don't even search on SO, we just google it, and google gives us a ton of SO answers.