Coder Social home page Coder Social logo

decker's People

Contributors

1jss avatar danielpunkass avatar dijkstracula avatar duxovni avatar gingerbeardman avatar johnearnest avatar razetime avatar rmmh avatar srpatel avatar tekknolagi avatar treshenry avatar ynohtna avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

decker's Issues

[CDecker, CLil] build error: _POSIX_C_SOURCE: No such file or directory

Same error occurs on both decker and lilt:

razetime@razetime-Legion:~/Software$ cd Decker
razetime@razetime-Legion:~/Software/Decker$ make decker
gcc: error: _POSIX_C_SOURCE: No such file or directory
make: *** [Makefile:35: decker] Error 1
razetime@razetime-Legion:~/Software/Decker$ make lilt
gcc: error: _POSIX_C_SOURCE: No such file or directory
make: *** [Makefile:31: lilt] Error 1

OS: Ubuntu 20.04.5 LTS x86_64

Grids are blank after importing data from a CSV while a format is applied

So I set up a small application that returns random entries in a grid based on whether or not the user has checked a box next to each item in the grid and there are two things I've noticed that make working with grids a bit unfun.

The lists were long, so I used CSVs that I edited in Excel to populate the grids. That's not really a problem. I prefer that to building the list in the editor when one list is >100 items long.

The way I had it set up is that one column was a bool (technically 0 or 1) and the other was a string. I set the format to BL.

However, if I made changes to one of the CSVs and tried to reimport it, it would pull the column headers, but everything else would be blank.

I later discovered that I had to remove the format that I had set, reimport it, and then reapply the format to get the desired result.

I'm not sure if this applies to all formats or just the ones I chose, but it would definitely be nice to not have to mess with a grid's format just to reimport data.

Performance testing of Decker - Program degrades at around 5000 - 6000 cards and crashes at 10K cards

Test is mainly opening the deck and typing some characters in fields and saving.

At around 1000 cards, the system is responsive. I am using Windows 10, 32GB RAM. The binary distribution is as downloaded from itch.io.

(Step 1) The opening time increased with the number of cards (for 6000 cards it was very noticeable running to few seconds). Step 2 is to check all the cards are opened via File -> Cards and then scrolling to the bottom and see if all the cards are opened. In all cases Decker imported all the cards. Next (Step 3) involved doing some authoring by typing some characters into the fields and saving. Saving had a performance drop when the number of cards increased. When it had about 10,000 cards save didn't succeed. The program exited on save.

Decks were generated using the python script below. Script below for reference.

header = r'''{deck}
version:1
card:0
size:[512,342]
name:"perftest03.deck"'''

field_def = r'''{widgets}
field1:{"type":"field","size":[239,289],"pos":[37,35]}
field2:{"type":"field","size":[205,60],"pos":[298,34]}
field3:{"type":"field","size":[205,60],"pos":[298,107]}
field4:{"type":"field","size":[205,60],"pos":[298,185]}
field5:{"type":"field","size":[205,60],"pos":[296,262]}'''

def generate_deck_name(count):
    return "card"+str(count)

def generate_deck_header(count):
	card_first_line = "{card:"+generate_deck_name(count)+"}"
	return card_first_line
	
def generate_deck_body():
	global field_def
	return field_def

if __name__ == '__main__':
	deck_file = open("perftest03.deck",'w')
	deck_file.write(header)
	deck_file.write("\n")
	deck_file.write("\n")
	for i in range(1,6000):
		deck_name = generate_deck_name(i)
		deck_file.write(generate_deck_header(i))
		deck_file.write("\n")
		deck_file.write(generate_deck_body())
		deck_file.write("\n")
		deck_file.write("\n")
	deck_file.close()

The test was motivated by a video in which Bill Atkinson was talking about Hypercard being able to manage unlimited number of cards only limited by system constraints. The reasoning was that, Hypercard always read each card from disk and committed any unsaved things to the disk necessitating no explicit save. Decker deviates from this principle, though it is not bound to stick with original Hypercard ways. But, it is always good to have unlimited capacity esp a related system in the past had it as one of its main design consideration.

[Question] How to add new font ?

By default Decker comes with three fonts. It seems new fonts needs to be added from other decks containing (there is an example deck available in the distribution) using File -> Resources.

a. Is there a way to add system fonts easily inside Decker ? What is the preferred way ?
b. For every font size is it required to add a new font?

[Question] How to create links in rich text ?

The documentation says

"Rich text hyperlinks are only “clickable” when their field is locked. With scripting, a link can do anything a button can do when it’s clicked, but by default if you use the name of a card as the link value, clicking the link will navigate to that card. If you use a URL, clicking the link will have Decker prompt you to open the URL in a web browser."

I tried different means to create a hyperlink, none of them succeeded. Probably I misunderstood the docs. Can you clarify how to go about creating the things mentioned in the docs (doc:"Rich Text fields can contain multiple fonts, inline images, and clickable hyperlinks.").

Or is it that these can only created by scripting?

Should Lilt be optional in the installer?

The installer script halts if Lilt or Decker binaries are not found. Should Lilt be required or should the installer continue, just noting that the Lilt binary was missing?

Upscaled canvas is blurry in some situations

Problem

This is more noticeable on my MBP with retina screen, but is perhaps an issue a cross the board.

The canvas seems to be upscaled with bilinear(?) filtering on, even though the dimensions are kept to integer scale.

The results are a slightly blurry image, in shades of grey rather than pure black and white.

Where

  • web app
  • macOS app
    • windowed
    • fullscreen

Screen grabs

Here are some zoomed screen grabs.

What I see
decker-scaling

What I expect
decker-scaling-expect

Toggle fat bits mode

Currently fat bits mode can be entered using a modifier key plus click.

It would be very useful for the selection to be able to get out of fat bits mode with the same technique.

HyperCard achieved this by use of a modifier key when using the Pencil tool to toggle the mode on/off with repeated invocations.

From #3

Changes needed to Makefile and scripts for OpenBSD

  1. The scripts in scripts/*.sh: Change first line from "#!/bin/bash" to "#!/usr/bin/env bash".
  2. Add the following section to Makefile (e.g. after line 4):
ifeq ($(UNAME),OpenBSD)
	OPEN=xdg-open
	COMPILER=clang
	FLAGS=-Wall -Werror -Wextra -Wpedantic -O2
	# -Wno-misleading-indentation silences warnings which are entirely spurious.
	FLAGS:=$(FLAGS) -Wno-misleading-indentation -Wno-unknown-warning-option
	FLAGS:=$(FLAGS) -lm
	# FLAGS:=$(FLAGS) -fsanitize=undefined
	# FLAGS:=$(FLAGS) -fsanitize=address
endif

Packages needed:

  • gmake
  • sdl2
  • sdl2-image
  • vim (for xxd)

I only tried "native" decker.

Representation of big numbers in lil

Maybe I'm stretching too far the intended use of lil or it's just another windows-specific issue but in the native version (windows wsl):

r:1 each x in 1+range 10 r:r*r*x end r
returns

583617587388727090858100711201107859493172229546854534563669836 p ~      }K        Q      N      :~       N     ` |     r,      ` |     p ~       }        Q    ` |     p ~             R             "@        pE      ` |

In the web version within decker it returns the correct result in the format: 5.83..e+224

I don't know if the intended behavior is diplaying all digits or using scientific notation.

Either way, another related question is the definition of e as euler constant. It may trip people trying to input small or big numbers in scientific notation.

Example:
1e-3
returns
-0.281718

[Clil] segfault on (incorrect?) parse

"%2a" parse 97

results in segfault: fish: Job 1, 'decker' terminated by signal SIGSEGV (Address boundary error).

Decker v1.5, Void Linux 6.0.10_1 x86_64

Add markdown support

Decker is a great product. Really easy to use.
If you could marry markdown with this, it would be useful.

[Clil] Explain that native functions are not available in eval

Native functions are not available in eval, this tripped me up as I was trying to use print and show to get I/O helpers from an outside library earlier.

 eval["print"]
{"value":0,"vars":{},"error":""}
 print
on native x do ... end
 eval
on native x do ... end
 eval["print[\"fdssfd\"]"]
{"value":0,"vars":{},"error":""}

Font documentation inconsistency

The documentation of font records states:

Decker fonts define glyphs corresponding to printable ASCII excluding the space character (33–126; 95 glyphs total), an extra glyph representing an ellipsis (for truncating text on display), (...)

There is an error in this text alone, since there are 94 characters between 33 and 126, which make 95 characters when the ellipsis is included. However the actual font data present in the source code contains 96 glyphs, including the space glyph as the first one. This causes redundancy: there's the header byte defining the number of horizontal pixels to advance for a space character, and there's a glyph record for the space character with its own specified width.

I have not yet looked at how it's handled in code, but only one of those space width declarations should stay in the format, as it may lead to inconsistencies when they differ. My preference would be towards allowing full space glyph customization.

Visual effect dissolve?

I've decided to convert a famous 1992 Christmas animation from HyperCard to Decker. I think it would make a super 30th Anniversary surprise for the artist who is a friend of mine.

I'm happy to either keep everything to this one issue, or split it.

HyperCard to Decker

  • onmouseup = on click (like for like)
  • play built-in sound at with specific properties (workaround by importing recorded sounds)
  • visual effect dissolve (missing)

Currently the only real thing missing is visual effect dissolve.
And arguably the sound playback is simpler or less versatile depending on your point of view.


Details of the project...

Progress

  1. I've exported the images using HyperCardPreview and an old Mojave MacBook Pro.
  2. I can see the code by inspecting the original stack in HyperCard under emulation.

Specs

  • 503 cards
  • 1 image per card
  • 1 simple script to advance
  • one sound for the first frame
  • another sound for all subsequent frames
  • visual effect dissolve

To Do

  1. Import all images, one per card
    • initial attempt at this was quite confusing, I expect the image to remain resizable but it does not?
  2. Record original sounds
  3. Rewrite script

HyperTalk script

on mouseup
  global fg
  if fg is 1 then
    play flute tempo 120  d3e a3e
    visual effect dissolve slowly
    go next
    put 2 into fg
    exit mouseup
  end if
  
  if fg is 2 then
    play flute tempo 120  a3e d3e
    visual effect dissolve slowly
    go next
    put 1 into fg
    exit mouseup
  end if
  
end mouseup

Ability to make current selection "tight"

In Decker the lasso selection is as drawn.

It would be very useful for the selection to be only black pixels inside the drawn area.

HyperCard did this "tight" selection by default, and allowed "loose" selection (as drawn) by use of a modifier key when using the Select tool.

ideas

  1. default selection is tight, modifier to select as drawn (as HyperCard)
  2. default selection is as drawn, modifier to select tight (opposite of HyperCard)
  3. default selection is as drawn, modifier to make selection tight on move (hybrid)

From #3

HyperCard-like modifier keys

Request

HyperCard allowed using the modifier keys to trigger alternate drawing features and modes.

eg.

  • Cmd + Select = selection will be tight to any enclosed pixels
  • Cmd + Pencil = toggle flat bits mode
    • currently in Decker this sort-of works to enter fat bits mode, but not to exit it
  • etc

It would be cool to see them all in Decker.

Justification

The best HyperCard artists made extensive use of them. For example, I've heard this first hand from Thoru Yamamoto: https://archive.org/details/thoru-yamamoto-hypercard-stacks (viewable in browser)

HyperCard docs, see Chapter 8

Reference

image

Widget names with spaces make Lil references not work?

If I have a field named: wanda fish
and code in a button like so:

on click do
wanda fish.text:wanda fish.text*2
end

The code will not work. I've looked through the docs for any reference to this, and tried single and double quotes, square and curly braces, and parentheses, to no avail.

`x` in query expressions is bount to the table

Bug report

Query expressions exhibit undocumented behavior, binding the table being queried to the variable x which shadows

How to reproduce

Run the following code in the Listener:

test_table: insert a:"x","y" b:1,2 into 0
extract x from test_table

Expected result

The default value for unbound variables - 0.

Actual result

A table equivalent to test_table.

Store widget references in a variable?

If I do something like

on click do
x:"fish"
x.text:x.text*2
end

Nothing happens. It should be possible to store a widget name in a variable and then use that to reference the widget?

[Clil] 'table' segfaults when given a list of dictionaries with integers as column names

This is the error:

$ liltr
  d: (3,4,5) dict 4,5,6
{3:4,4:5,5:6}
  table list d
rlwrap: warning: lilt crashed, killed by SIGSEGV (core dumped).
rlwrap itself has not crashed, but for transparency,
it will now kill itself with the same signal


warnings can be silenced by the --no-warnings (-n) option
Segmentation fault (core dumped)

table 3 take list d also segfaults.

However, these cases are still fine:

$ liltr
  d: "abc" dict 4,5,6
{"a":4,"b":5,"c":6}
  table list d
+---+---+---+
| a | b | c |
+---+---+---+
| 4 | 5 | 6 |
+---+---+---+
  d: 1 dict 4
{1:4}
  table d
+---+
| 1 |
+---+
| 4 |
+---+
  table (3,4) dict 4
+---+---+
| 3 | 4 |
+---+---+
| 4 | 0 |
+---+---+

Installing on Linux

Huge thanks for this awesome project! Such a creative playground!

I just set it up on Debian and noticed that the install script (install.sh) installed lilt, but not decker as stated in the readme. No problems copying it by hand, though. I also crafted a tiny .desktop file for myself. Is that something you would like to include in the repo or do you rather keep the packaging outside of the repo?

Erase whilst drawing using modifier key

It would be useful to be able to quickly erase with the same drawing tool.

HyperCard achieved this by use of a modifier key when using the following tools:

  • Brush
  • Spray

But Decker combines Pencil and Brush so it would make sense to have this on the Pencil tool.

The goal here is to make for a more optimised, quicker, frictionless drawing experience.

From #3

Draw with pattern using modifier key

It would be useful to be able to draw with a pattern quickly without having to use the menu.

Using a modifier toggle would be quick and easy.

HyperCard achieved this by use of a modifier key when using the following tools:

  • Pencil
  • Line
  • Shapes

The goal here is to make for a more optimised, quicker, frictionless drawing experience.

From #3

Touch input not behaving as expected

Hi!

Firstly, this is amazing! Well done.

Problem
I've been trying the Tour on my iPhone and taps on elements like a checkbox or a button don't behave as expected.

Unfortunately this means I can get stuck and have to reload/refresh the page.

What I'm seeing

  • one tap turns checkbox both on and off

What I'm expecting

  • first tap to toggle on
  • second tap to toggle off

Screen recording

My setup

  • iPhone SE 2020
  • iOS 16.1
  • mobile Safari

JS vs C - Two Implementations

Is there any reason you have a C implementation and a JS implementation ? Won't this double the cost of long term maintenance and increase the burden of implementing new features?

You could in theory scrap the C version and use Node for desktop (Electron app etc). Or you could take the C SDL version and get it working with WebAssembly? There are lots of options out there to eliminate having two code bases.

Having a whole development environment within a single .html is absolutely amazing and so really the C version has less advantage long term. Everyone has a browser installed and so you already have a runtime environment for the .html vs C version which requires the Decker binary.

Just some thoughts.

Decker is the closest I have seen to HyperCard and would love to see it well supported and used going into the future.

Idea: numbers default to identity

I really like the idea of a nil-free dynamic type system, but numbers defaulting to zero didn't sit right with me.

It makes sense for: indexing, addition, subtraction. Concatenation shouldn't matter, because the void resolves to the empty string. But it isn't great for exponentiation, multiplication, and for division: terrible.

The solution being, for the last three contexts to resolve to 1. That would mean a missing number does nothing in the calculation, wherever found.

Just a thought! Look forward to seeing where this project goes.

Saving (locally?) is broken

When saving a deck as an HTML file via the web-decker system, it doesn't open properly again. The screen is left blank, and it appears to throw errors in the console as follows:

Uncaught TypeError: q(...) is null

Reproduction is relatively straight forward:

  1. Go to https://beyondloom.com/decker/tour.html
  2. Save deck as HTML
  3. Open locally saved HTML deck
  4. Save deck as HTML again
  5. Open newly saved HTML deck

I'm not certain why this happens, but it appears that it is NOT the intention for this to happen.

Immediate Image Export After Import Fails

If I import an image, then try to export an image of the selection, you just get an export of what was on the card before the import like the image isn't there. You have to drag select again to get an export that actually includes the imported image.

OS: Windows 10 64bit

Steps to recreate:

  • Import an image with File -> Import Image...
  • Leave area selected
  • Export an image with File -> Export Image...

Expected Result: An image with the selected part of the card including the imported image

Actual Result: An image of the selected part of the card before the image was imported

More than 50% CPU on Linux native

I'm in Ubuntu 22.04, tried compiling with the optimization you sugested on the itch.io forum and with the appimage.

Thanks for this amazing software and the time to read this. :)

Question on Grid

Again, it is a how-to question. Once the Grid widget is chosen, how to populate the grid with entries ? The document is not very clear on how to do it. It talks about format string, but don't say how to add rows and columns.

A workaround is to create a csv file and DnD into the card. But, it is not efficient when you have to modify it inside Decker. Any help in this regard will be appreciated.

"Text" menu not working

Decker Native-windows 1.16 / web 1.17

The "Text" menu never enables, making rich text entry difficult/impossible.

Steps to reproduce:

  1. Create a new Deck
  2. Create a new Field
  3. Double click it, ensure it is set to "Rich Text"
  4. Focus on the text field. The menu bar shows Text, but it is disabled
  5. Write text, select text, etc.; Text menu remains disabled
  6. ???

I'm not entirely unconvinced there's some other method you're supposed to use, but given that the menu appears but does not ever seem to activate...

chrome_20230420-185224

Duplicate selection

It would be useful to duplicate the current selection.

HyperCard achieved this by use of a modifier key when moving a selection.

The goal here is to make for a more optimised, quicker, frictionless drawing experience.

From #3

Sound recording - quality is poor

The default way to record new sound leads to poor quality.

a. Is there a way to improve the sound quality of spoken voice?
b. Is there a way to import wav files from the disk?

Select only black pixels

It would be useful to be able to select only black pixels, and not any white pixels in the selection.

This would enable easier use of selections.

HyperCard only selected black pixels.

The goal here is to make for a more optimised, quicker, frictionless drawing experience.

Related to #25

From #3

Guided tour has two fields that are too short, cutting off the bottom pixel

Basically what it says; the guided tour has a few fields that are a pixel too short, cutting off the descenders for letters like "g":

  • canvases: the lil logo loses a pixel of the "p"
  • contraption: top left "games" misses the bottom (looks like q)

edit: tested this in web decker and windows native, same result

image

Duplicate selection using drag + modifier key

It would be useful to be able to duplicate the selection.

HyperCard (and MacPaint, Photoshop, etc) achieved this by use of a modifier key when using certain tools (Select and Lasso for HyperCard).

The goal here is to make for a more optimised, quicker, frictionless drawing experience.

From #3

Segmentation fault on 'mag' AOC 2017 Day 7

EDIT minimal repro is mag 251-243. the problem was using mag on an atom. I read it could be used as absolute value, so i was using it here.

Implementation is C decker. JS decker works fine.

This is a WIP solution for day 7 part2 available here, the program is as follows, and the input is available at this link. The segfault seems to happen right after u is computed.

on uniq x do extract first value by value from x end

i:"%s (%i) -> %s" parse -1 drop "\n" split read["inp/07t"]
p:() dict ()
v:() dict ()
p2n:() dict ()
each x in i
  vk:x[0] vv:x[1]
  pv: if x[2] ", " split x[2] else () end
  v[vk]:vv
  each y in pv
    p[y]:vk
  end
  p2n[vk]:pv
end
p1:extract key where !p@key from v
show[p1]
show[p2n]
on p2 d do

  if (count p2n[d])>0
    vals:p2n[d]
    nxt:v@vals
    sums:each x in vals
      a:p2[x]
      show[x,a]
      a
    end
    # show[d,p2n[d]]
    # show["nxt",nxt]
    # show[sums]
    bal:sums

    u:extract list index by value from bal
    u:extract value orderby each x in u count x end asc from u
    show[u]
    if 2=count u
      sms:bal@each x in u first x end
      diff:mag sms[0]-sms[1]
      show[nxt[first first u]-diff]
    end    
    v[d]+sum bal 
  else
    v[d]
  end
end
 
p2[p1]

Selecting "Cancel" in Resources dialog triggers a Seg fault with no error (Mac)

I noticed that if I select File -> Resources, browse around for a folder without usable resources (e.g. no .html or .deck files or folders available, so the Open button is greyed out), if I click Cancel to exit the dialog, the program crashes with Segmentation Fault: 11. No error report is generated.

Running MacOS 10.14.6

Steps to replicate:

  1. File -> Resources... -> Choose
  2. Browse to a folder without any sub-folders so that the Open button is greyed out.
  3. Click cancel. Program crashes. No error report or error trap.
    (if program is run from the Terminal on MacOS, it yields: Segmentation Fault: 11)

Screen Shot 2023-02-06 at 10 40 33 AM

[Clil] '%' behaves strangely on large numbers

Using % on large numbers provides incorrect results. I also tried the operation without vectorization and got the same results.

  a:1092455,430625591
(1092455,430625591)
  m:16807,48271
(16807,48271)
  a*m
(18360891185,20786727903161)
  mod:2147483647
2147483647
  mod%a*m
(2147483646,2147483646)

Seems to be returning a power of two every single time.

  5%a*m
(2,2)
  6%a*m
(4,4)

the problem seems to pop up in this range:

  5%1000000000
0
  5%10000000000
2

The correct answers come up on JSlil:

 mod%a*m
(1181022009,1233683848)
 5%a*m
(0,1)
 6%a*m
(5,5)

For reference, this problem arose on on AOC 2017 Day 15.

Addition of strings produces 0

Bug report

According to Appendix 2 to Lil documentation: Binary Primitives operator + when acting on two strings should concatenate them:

Note that using , on two strings will result in a list of two strings, whereas using + will result in a single string!

How to reproduce

Open the Listener and run query "a" + "b".

Expected outcome

Listener returns the string "ab".

Actual outcome

Listener returns the number 0.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.