arisuchan.xyz arisu
[ tech / cult / art ]   [ λ / Δ ]   [ psy ]   [ random ]   [ meta ]   [ all ]   [ irc / radio / tv ]
[ tech / cult / art ] [ λ / Δ ] [ psy ] [ r ] [ q ] [ all ]
Arisu Theme Lain Theme


/λ/ - programming

STRUCTURE AND INTERPRETATION OF COMPUTER PROGRAMS.



File: 1767159624935.jpg ( 493.24 KB , 1544x720 , Screenshot_20251231_123234.jpg ) ImgOps

[Reply] No.23

http://tululoo.com/ where to find more tutorial for this tool, even it's YouTube is lacking and I struggle to even, make projection. I just need… A huge book of… SNES programming. But using that tool. Also less math or typing ..just because.

 No.24

>>23
why are you choosing to use that in the first place if it has no documentation? besides the documentation issue, its extremely uncommon, and also quite old for web technology at this point (tululoo's development ceased 13 years ago…)

apparently someone created their own game-making-engine that was inspired by tululoo:
https://comigo.games/en/p/ctjs/

that projects website is here:
https://ctjs.rocks/

are you a beginner trying to learn? damn near anything else would be a better learning experience than 13 year old shovelware - that is such an odd choice

 No.25

>>24
Hey cheers for commenting.
First of all, don't they say, the harder the better, no pain no gain, no discount for all you can eat, SpongeBob wears only one suit?
Ok last one not real quote.
>Comigo ctjs
Oh yeah I know that one. Quite good, rather big… Well.
There is also whimsy.rocks
Almost like the slimmed version of ctjs.

I think I CAN, use them. So aren't I considered, "learned"? After that though, it just don't translate to tululoo. Maybe I am just, curious and obsessed at this point, but bringing up tululoo to, a med student, seems awkward anyway. Other than that again, does ctjs teach you how to embed in center? I have ALot, like, alot to know still.

 No.26

Bump

 No.27

File: 1768904628177.png ( 1.54 MB , 2049x1521 , THE PIRAT!.png ) ImgOps

>>26
>BumpBumpBumpBumpBumpBumpBumpBumpBumpBumpBumpBumpBumpBumpBumpBumpBumpBumpBumpBumpBumpBumpBumpBumpBumpBumpBumpBumpBumpBumpBumpBumpBumpBumpBumpv



Youtube Embed (Click thumbnail to play)

[Reply] No.18

DO NOT FEAR DEAN THEY WILL GUIDE U IN NON EUCLIDEAN SPACE

 No.19

File: 1766246536610.gif ( 4.97 KB , 315x360 , hyper14.gif ) ImgOps

Ayo, so peep this—binary hypercubes is like CUBES, but on some next-level ish…
You know how a regular cube got corners and edges, right? What if you start stackin' more dimensions on that? So you ain't just stuck in the third dimension—now you got 4, 5, maybe even 10 dimensions, all twisted up.

Each corner of this cube is a "bit." It finna be like a 0 or a 1–just like yo phone. And all them edges connect the bits–just like how wires hook up yo computer. In a 4D hypercube, you got 16 corners, 32 edges—mad complex.

MAKEUP OF A 4D HYPERCUBE (TESSERACT):
Vertices: \(2^{4}=16\).
Edges: \(4\cdot 2^{4-1}=4\cdot 8=32\).
Faces (Squares): \({4 \choose 2}\cdot 2^{4-2}=6\cdot 4=24\).
Cells (Cubes): \({4 \choose 3}\cdot 2^{4-3}=4\cdot 2=8\).
Total Sub-Hypercubes: \(3^{4}=81\)

Imagine you add another layer of dimensions on top of each other. Now your mind can’t even process it. The more dimensions you add, the crazier it gets, fam.

Bottom line? It’s like a cube that keeps gettin' mad complicated, built outta binary numbers. Ain’t no way to really picture it, nigga. Just know it’s like the next step in computer math and how everything’s connected on a higher level.

 No.20

>>18
that video is really cool

 No.21

bump

 No.22

This was pretty sweet



File: 1732336800903-0.png ( 130.2 KB , 717x976 , Capture d’écran du 2024-11….png ) ImgOps

File: 1732336800903-1.png ( 76.96 KB , 717x599 , Capture d’écran du 2024-11….png ) ImgOps

[Reply] No.1

Glad to see this place back online! Been far too long.
Let's start this board back up with a code review; you show some code you wrote and other brutally tear it to shreds for fun.

Mine is some code I wrote a month or two ago to make my own version of cat(1) that just prints one text file to stdout. I figured it would be a good thing to write before I started some college classes about C.

I also called it p after an old video of Brian Kernighan demonstrating unix pipes and he used a homonymous program to print a file to stdout before using some text processing on it.

Let's all love lain!

 No.11

being that lainchan has nice syntax highlighting for code i modified our vichan instance to support highlighting as well

for example, if you type:

[code php]
some php code…
[/code]

then it renders like this:

	// Fix code markup
	if ($config['markup_code']) {
		foreach ($code_markup as $id => $val) {
			$code = isset($val[2]) ? $val[2] : $val[1];
			$code_lang = isset($val[2]) ? $val[1] : "";

			//$code = "<pre class='code lang-$code_lang'>".str_replace(array("\n","\t"), array("
","	"), htmlspecialchars($code))."</pre>";
			$code = "<pre style='max-width:90em!important';><code class='language-$code_lang'>".str_replace(array("\n","\t"), array("
","	"), htmlspecialchars($code))."</code></pre>";

			$body = str_replace("<code $id>", $code, $body);
		}
	}

if you dont include the language in the code tag highlight.js will try to guess (it doesn't guess perfectly every time but eh)

>that snippet happens to include the change i made in vichans functions.php to enable highlighting with highlight.js and add a scrollbar for code that overflows a posts body


also vichan stripped the <> characters from my code snippet and i dont feel like finding where to disable that after hacking this shit together, feel good though i fixed up a handful of things on the site today just for shits

 No.13

I can't program…. except in x86 but that was years ago and I was never good at it.

 No.15

File: 1736837731241-0.png ( 31.45 KB , 630x357 , 2025-01-14_00-59.png ) ImgOps

File: 1736837731241-1.png ( 40.16 KB , 590x466 , 2025-01-14_01-00.png ) ImgOps

i rarely ever write code by myself nowadays since LLM's came out

just had ChatGPT spit this out for me and figured someone else may find it useful

it runs a short SMART test on all your ZPOOL's disks and sends you an email about any disks that fail SMART checks
set it to run with cron for automated tests/reporting

it requires smartctl and msmtp (and that msmtp is configured to send mail properly)

edit the EMAIL and ZPOOL_NAME variables to match your setup

>the log file output is a bit ugly, but i dont really need logs for this so eh



#!/bin/bash

# Email configuration
EMAIL="your@email.address"  # Your email address
SUBJECT="SMART Errors on $(hostname)"
LOGFILE="/tmp/smartcheck.log"
TMP_EMAIL="/tmp/smart_email.txt"
FAILED_DRIVES=()

# Dynamically retrieve drives from ZFS pool
ZPOOL_NAME="dozer"  # Replace with your ZFS pool name
DRIVES=($(zpool status "$ZPOOL_NAME" | grep -E '^\s+(scsi|ata)-' | awk '{print $1}'))

# Clear previous log
> "$LOGFILE"

echo "SMART check started..."

# Initiate and check each drive
for DRIVE in "${DRIVES[@]}"; do
    DEVICE="/dev/disk/by-id/$DRIVE"

    # Output progress
    echo "$DEVICE - in progress"
    echo "Initiating short SMART test for $DEVICE..." >> "$LOGFILE"
    smartctl -t short "$DEVICE" >> "$LOGFILE" 2>&1

    #echo "Waiting for test to complete for $DEVICE..."
    while true; do
        TEST_STATUS=$(smartctl -a "$DEVICE" | grep '^# 1 ' | awk '{print $5}')
        #echo $TEST_STATUS
        if [[ "$TEST_STATUS" == "Completed" ]] || [[ "$TEST_STATUS" == "Failed" ]]; then
            break
        fi
        #echo "Test in progress for $DEVICE..."
        sleep 10
    done

    echo "Checking results for $DEVICE..." >> "$LOGFILE"
    SMART_OUTPUT=$(smartctl -H "$DEVICE" 2>&1)
    echo "$SMART_OUTPUT" >> "$LOGFILE"

    # Output progress
    echo "$DEVICE - done"

    # Check for errors in the test results
    if echo "$SMART_OUTPUT" | grep -qiE "FAILED|impending|critical|failure"; then
        ERROR_LINE=$(echo "$SMART_OUTPUT" | grep -iE "Health Status:.*|FAILED|impending|critical|failure")
        FAILED_DRIVES+=("$DEVICE: $ERRO
Post too long. Click here to view the full text.

 No.16

File: 1736845678682.jpg ( 39.81 KB , 500x500 , qu9tv.jpg ) ImgOps

ok, i finally figured out what was going on with the stripping/replacing of certain characters within code tags

i had to make this change in functions.php:

before
$code = "<pre style='max-width:90em!important';><code class='language-$code_lang'>".str_replace(array("\n","\t"), array("&#10;","&#9;"), htmlspecialchars($code))."</code></pre>";

after
$code = "<pre style='max-width:90em!important';><code class='language-$code_lang'>".str_replace(array("\n","\t"), array("&#10;","&#9;"), $code)."</code></pre>";


funny enough thats the same line i changed to enable highlighting but my dumb ass did not consider what htmlspecialchars() was doing

previously, code blocks within a posts body had HTML characters double-escaped
HTML renders escaped characters back into their original non-escaped form, but not double-escaped characters

now that those characters are only escaped once, code in code tags wont have any replaced characters (after your browser renders them)

>i also changed max_body from 1800 to 5800 so you can make much longer posts now

 No.17

so I tried making a Logger that can be used in a cpp project and used makros to avoid the mess of the singleton and to get automatically the current parameters for the vLOG (verbose logging) I was told that this is old c-style and "not good" ….


#define vLOG(entry, tag) \
  Logger::getInstance().logWithContext((entry), (tag), __FILE__, __LINE__, __func__)

#define LOG(entry, tag) \
  Logger::getInstance().log((entry), (tag))

#define REGISTER() \
    Logger::getInstance().registerTask([&](bool isPaused){ \
    (Logger::s_thread_local_pause).store(isPaused); \
   })

#define PAUSE() \
    Logger::getInstance().pause(); \

#define PAUSE(id) \
    Logger::getInstance().pause(id); \

#define RESUME() \
    Logger::getInstance().resume(); \

#define RESUME(id) \
    Logger::getInstance().resume(id); \




Previous [1] Next
Catalog
[ tech / cult / art ] [ λ / Δ ] [ psy ] [ r ] [ q ] [ all ]