#development

1 messages · Page 198 of 1

gentle grove
#

writing didn't work

wooden yarrow
#

wtf

gentle grove
#

maybe it has immutable attribute set or something

#

I can't check right now

#

idk why adding write perms would bypass that if so but

acoustic imp
#

any idea how to get CF tunnles running on jb iphone ?

#

ik theres ngrok but i need vnc

#

@visual meadow have u done anything like that ?

visual meadow
#

No

lament barn
#

cf tunnels?

tepid olive
acoustic imp
#

i got it working just i cant get NoVNC to work

#

simple jus pased tcp thru

kind herald
acoustic imp
#

this one

visual meadow
#

you dont even need dev acc

acoustic imp
#

oh it made me sign in tho ?

visual meadow
#

It makes you sign in but after that it just downloads

wooden yarrow
#

git itself is basic, that's why it's so hard to do shit

tepid olive
#

what's complicated about it

placid kraken
#

yall

#

maybe im just silly

#

but there has gotta be a simpler way to do this

#

basically

#

i want to allocate a string on the heap and then automatically update it when a variable changes

#

so i do this

string bouncesString = malloc(1);
defer free(bouncesString);
#

to initialize

#

and then lets assume i have this variable first right

int bounces = 0;
#

this variable changes and i want to put it into a string to put on the screen

#

first i get the length of the string with snprintf

int length = snprintf(NULL, 0, "Bounces: %d", bounces);
#

then i realloc

bouncesString = realloc(bouncesString, length + 1);
#

then i write to the memory

sprintf(bouncesString, "Bounces: %d", bounces);
#

then i use the string

DrawText(bouncesString, (screenWidth - MeasureText(bouncesString, fontSize)) / 2, 100, fontSize, YELLOW);
#

theres no way this is the easiest way to do it

#

however this is the approach i found when looking through the stdio docs lmao

#

meanwhile in python or something

# init
bounces = 0;
bouncesString = "Bounces: 0";

# update
bouncesString = f"Bounces: {bounces}";
#

lmao

vivid dew
#

well int_max is 10 digits so you can just make the string big enough to hold that many and not realloc or check the length

placid kraken
#

great that means i dont even need to use the heap i can just stack allocate it

#

thank you :3

#

i can just

// init
int bounces = 0;
string bouncesString[strlen("Bounces: ") + 10];

// update
sprintf(bouncesString, "Bounces: %d", bounces);
#

almost the same as py

gentle grove
#

you're ngmi

#

Do you have an issue though that I can help with

faint timber
#

finder try not to 0644 challenge: impossible!

#

lmfao xattr?

gentle grove
#

and what does git diff say

faint timber
#

git diff --color=always HEAD~ HEAD | tee
the only correct way ^

gentle grove
#

diff the last commit?

faint timber
#

exactly what you think it does but better

gentle grove
#

couldn't you technically omit the second HEAD

#

also how's it better

#

regular git diff with no flags is paginated and colored already

faint timber
#

its more of a guarentee

#

it opens in less by default

gentle grove
#

what does the tee even do

faint timber
#

tee makes it not open in less

gentle grove
#

oh

#

binary files

#

Wdym copy pasted the repo folder, I'm trying to visualize what you did

faint timber
gentle grove
#

like copied the entire folder or just .git?

faint timber
gentle grove
#

-r as well right

#

never seen someone use -a before

faint timber
#

-a is the only way

gentle grove
#

what happens if you git diff --stat

#

or you could try moving the file that it says is modified to another spot and then git restore it, and see if you can compare a difference now

faint timber
gentle grove
#

What's the difference between -a and -p

#

is it just attributes

faint timber
#

I hate the stack alloc every line tho wtf is that about

gentle grove
#

capt

#

That would've been useful to know

#

It's definitely not checked out

#

Hold on

#

I can't read the docs on my phone great

#

go back to the old repo and see how big the file is

#

i wonder if something was cached

#

what

#

It just said it was 111 bytes a moment ago

#

no

#

you're just stupid

#

Send me the directory fr

#

the only thing I can think of is maybe you didn't actually have the file stored in LFS in the previous repo

#

It definitely shouldn't be 333333 bytes in the index

#

but git says it is

#

it should be the 111 bytes in git because it's just a metadata file

#

but in the index it should be 111 so it's weird that it thinks it's being changed from 333333 (which it shouldn't be) to 111

#

Let me go home and do some investigation with a gif lfs repo

gentle grove
#

@grave sparrow for the record did you ever run git lfs install

#

run git lfs install again and see if it fixes it troll

#

or git lfs checkout but that doesnt really help figure out why it happened

#

on a fresh clone?

#

oh i thought this was only talking about copying a clone

#

weird

#

@grave sparrow so what do the lfs files look like inside, are they text files with the metadata

#

These pointer files usually start with the line version https://git-lfs.github.com/spec/v1.

#

what about git lfs pull

#

it should automatically do it but try it anyways

gentle grove
#

on github website when you look at the file, does it say stored with git lfs

#

that explains everything

#

so its committed to the repo without using git lfs

#

youll have to delete it from the repo in a commit and then add it with lfs

#

what does .gitattributes look like, is it configured to make *.dylib stored in lfs or whatever

#

no because its not stored in lfs

#

i think it wants to change it to an lfs file

#

look at .gitattributes

faint timber
#

@grave sparrow no stack space? wtf?

#

no Im at call #1 and only the 5th instruction in!

#

x8 is the reg I modify so I don't need to save it

#

I forgo

#

8 != 16 align

ashen canyon
#

im like 99% sure you need "stp x8, x9, [sp, #-16]!\n" for alignment

#

but i could be very wrong

#

i was in the process of typing it out before you said it

faint timber
#

I want working code copy pasted before I do good neat code

#

cool btw this code doesn't work at all lmao

#

not your code but that stack overflow code

ashen canyon
#

im like 99% sure you need 768 bytes

faint timber
#

yah it does idk why it failed the first time

#

thanks

#

thats stupid tho because im preserving lr I can't use ret, so I have to use a register to br back shame theres no br add reg like you wanted sad @grave sparrow

#

arm devs when they have to implement new features instead of sitting at their desk making free money supershocked

#

it is literally confirmed that nvidia work environment is that

#

just add and shifts

#

lsl

#

just listing all the options

#

nvm then

faint timber
#

exception hooking

#

oh you kinda already said that

#

oh stock yah I doubt that

#

windows go sicko mode

#

secweritwy 😵‍💫

#

pthread_create

faint timber
#
  1. page codesign?
  2. jit?
native orbit
#

breakpoint method not work on stock anymore?

#

apple just ruining shit to ruin shit

solar lagoon
#

on yourself you can do both

#

you can still set exc handlers on remote processes afaik

wooden yarrow
#
let llbpdig = dict.get("LLB")
                  .unwrap()
                  .as_dictionary()
                  .unwrap()
                  .get("PartialDigest")
                  .expect("Partial Digest not found")
                  .as_data()
                  .unwrap();

rust thumbsup

wooden yarrow
gentle grove
#

actual imperative code

pearl sail
wooden yarrow
#

like just getting rid of the last .expect() in exchange for if let Some(llbpdig) = ?

gentle grove
#

isn't dict.get just returning an Option

gentle grove
wooden yarrow
gentle grove
#

What

#

Wait you're literally just using x every time

#

That should just be a dot chain

wooden yarrow
#

those are closures

#

each time the type is diff

gentle grove
#

yeah

#

you're just using x.whatever

wooden yarrow
#

oh

#

right

#

i guess i could do like .and_then(Value::as_dictionary) ?

gentle grove
#

No and then

#

No functional

wooden yarrow
gentle grove
#

thats what and_then is

#

thats functional programming

wooden yarrow
#

is that not functional programming

#

or atleast return chaining

gentle grove
#

what type is dict.get

wooden yarrow
gentle grove
#
dict.get(comp)?.as_dictionary()?.get("PartialDigest")?.as_data()
#

something liek that

#

hard to know without seeing code for what the types are

wooden yarrow
#

is there so much of a diff

#

.

gentle grove
#

do you really want the and_then version

wooden yarrow
#

it looks cool

gentle grove
wooden yarrow
gentle grove
#

oh i didnt even know it was Result

#

i forgor

#

make a block troll

wooden yarrow
#

wouldnt i need to do some ass thing where i either put it in another function or closure

#

then end up using .expect anyways

#

💀

gentle grove
#
{
  dict.get(comp)?.as_dictionary()?.get("PartialDigest")?.as_data()
}.expect("fail whatever")
#

probably a better way to do this but i forgor

wooden yarrow
gentle grove
#

no

#
if let Some(c) = dict.get(comp) {
    c.as_dictionary()?.get("PartialDigest")?.as_data()
}

maybe that works

wooden yarrow
#

idk boba looks weirder to me then just using and_then

#

also additional branching supershocked

gentle grove
wooden yarrow
#

oh i guess there's branching anyways but

#

still doesn't look great i dont think

wooden yarrow
#

so after that block comes a .unwrap() or .expect()

#

👨

placid kraken
#

im making structs in elle

#

keyword ideas pls

#

struct or def?

#
struct AudioStream {
    long buffer;
    long processor;
    int sampleRate;
    int sampleSize;
    int channels;
};

struct Sound {
    AudioStream stream;
    int frameCount;
};
radiant idol
#

struct definitely

manic forum
#

each class is called a city made up of a bunch of houses

#

and the entry point of the program is called customs()

#

when something goes wrong you alert police::buffer_overflow_department

#

idk why i came up with this i'm just bored, struct sounds okay

#

a house may not contain itself directly or indirectly unless it is called leaves

#

in which case the compiler executes a fork bomb

placid kraken
#

lmfao

slender glade
#

You can't register exception handlers for your own proc??

#

I literally can't believe that for some reason

#

like that just cannot be true

#

setting thread states was entitle'd one day randomly but exception handlers??

solar lagoon
#

ellekit does it

#

plus dopamine doesn’t modify that stuff

#

@grave sparrow wtf are you talking about

#

ellekit uses mach apis to set exc handlers to hook functions

#

it works on all ios versions

#

what else is there to say

solar lagoon
#

uh ok

#

still you would need to store a 64bit address in the instruction

#

and that takes many instructions

placid kraken
#

ok ive confused myself

#

in qbe, types can be aggregate aka structs right

#

so you can write a declaration such as

type :Test = { l, w }
%tmp =:Test call $getSomething()
#

where :Test is the type

#

however to actually create one of these structs you need to do something like this

type :Test = { l, w }

export function w $main() {
@start
    %test.addr =l alloc8 12
    storel 10712512, %test.addr
    %tmp.addr =l add %test.addr, 8
    storew 252, %tmp.addr

    ret 0
}
#

i can get the compiler to generate this

#

but how do you get just the straight up memory as a type like before

#

because all you have when you create it is a pointer to the start of the allocated memory

#

i also do this when making local variables so i can get their stack address

%i.addr =l alloc4 4
storew 100, %i.addr
%i =w loadw %i.addr
#

but that doesnt really make sense for structs??

#

like you cant exactly do

%stream.addr =l alloc4 28 # longs are 8 bytes in this case
%tmp =:AudioStream call $GetAudioStream();
store:AudioStream %tmp, %stream.addr
%stream =:AudioStream load:AudioStream %stream.addr
solar lagoon
#

storing an address on stack takes instructions

acoustic imp
placid kraken
#

make it vertical

#

like into a dropdown

acoustic imp
#

Like do another drop down like I Alr have ?

#

(Also ik padding is messed up)

placid kraken
#

sort of ya

#

mobile phones have a lot more vertical than horizontal space

#

omg

#

why is this being generated

#

im going insane

#

i tried to debug it

#

this name isnt even used ever when assigning anything anywhere in the compiler

#

HOW IS IT BEING EMITTED

#

i even checked the statements in each block generated by the compiler

#

how in the heck is it emitting sound.addr

#

.

#

the generated string literally does not contain sound.addr

austere island
#

has anyone extracted the apple intelligence on-device model weights yet

acoustic imp
native orbit
#

is what u want to do is just changing pc without requiring another reg?

solar lagoon
#

what i’m saying is that idea doesn’t make sense since youd need to movk parts at a time and it would just be corrupted until the address is complete

native orbit
#

better get hired at arm cuz they aint gonna do shit 💀

ashen canyon
acoustic imp
#

yea il move it down

ashen canyon
#

no just remove it entirely

#

or make it smaller

acoustic imp
#

idk if IOS lets me do that, -webkit-scrollbar::{ display none} maybe

native orbit
#

if on mac can spin up a hacky kext lol

acoustic imp
ashen canyon
acoustic imp
#

im removing that tab thing part

#

it wil be a drop down

wooden yarrow
#

wait is this not just the jump insn

hasty ruin
native orbit
#

could handle it like how the kernel handles svc, and just set the thread state tbh

acoustic imp
hasty ruin
wooden yarrow
#

also I don't see the point of arm ever adding that insn because 1. more complexity and 2. you can already achieve this with a little extra instructions which wouldnt be a problem for code writers

#

also can you not just use page tables for this

#

remap to somewhere closer

acoustic imp
waxen prawn
#

good morning tweakers

acoustic imp
#

desktop* (yes ik colors are off)

waxen prawn
#

and um

#

it is installed but running $THEOS does nothing

#

==> Dependencies have been successfully installed!

==> Checking for WSL...

==> Seems you're not using WSL. Moving on...

==> Checking for $THEOS environment variable...

==> $THEOS has not been set. Setting now...

==> Checking for Theos install...

==> Theos appears to already be installed. Checking for updates...
Already up to date.

==> Notice: Visit https://github.com/theos/theos/commits/master to view recent changes.

==> Checking for iOS toolchain...

==> A toolchain appears to already be installed.

==> Checking for patched SDKs...

==> SDKs appear to already be installed.
==> Theos Installer: Theos has been successfully installed! Restart your shell and then run $THEOS/bin/nic.pl to get started.
xash@archiemarchie ~/t/bin (master)>

GitHub

A cross-platform suite of tools for building and deploying software for iOS and other platforms. - Commits · theos/theos

acoustic imp
#

did u restart ur shell ?

waxen prawn
#

sorry tweakers

#

1st yees i did

#

it was a problem with fish

acoustic imp
waxen prawn
#

apperantly fish shell is just ass

#

god but i love the autocomplete

#

okay

#

ok. Jce i am making a tweak

#

to get that juicy DEVELOPER role zzz

#

i am ma

#

fa

waxen prawn
#

nah i dont swing that way

#

💀

#

actual dev reasons

#

Qah r

ashen canyon
#

fr

reef trail
#

err moderators they’re abusing perms

placid kraken
#

with enough money anything is possible

gentle grove
#

He costs way too much

harsh junco
placid kraken
#

@radiant idol

function callableArray<T>(...array: T[]) {
    const _closure = (index: number) => index;
    const typedClosure = _closure as unknown as typeof _closure & typeof array;

    array.toString = function() {
        return `[${array.map(element => JSON.stringify(element, null, 2))}]`;
    }
    
    const proxy = new Proxy(typedClosure, {
        get(_, prop: string, __) {
            return !isNaN(+prop) ? array[+prop] : Reflect.get(array, prop, array);
        },

        set(_, prop: string, handler) {
            !isNaN(+prop) && (array[+prop] = handler)
            return true;
        },

        apply(_, __, [index]) {
            if (typeof index === 'number') {
                return array[index];
            }

            return null;
        }
    });

    return proxy;
}
orchid fulcrum
#

Well what do you personally think ?

#

Not long 💀

#

50 lines

kind herald
#

I modded my xbox do i get developer role

orchid fulcrum
#

I made a simple game looking step by step from a guide. Also working on a similiar game myself without guides but i kinda got stuck on it so doing tweaks rn

orchid fulcrum
placid kraken
#

its called

#

✨ Do Not Disturb ✨

orchid fulcrum
#

No thanks

#

Thats even worse imo 💀

#

I hate it so much so that if i had a jb its one of the first things i would get rid of

placid kraken
#

but the callable array part was easy

#

the hard part was to make it typed

#

so that indexing and calling the function returns the right type

#

thats what this

const _closure = (index: number) => index;
const typedClosure = _closure as unknown as typeof _closure & typeof array;
``` does
faint stag
#

yeah i know that wasn't a thing at some point but still

#

but yeah you can just bypass silent mode if you use the right kind of stream xd

#

i'm almost sure there's app store apps that do this

placid kraken
#

structs were too complicated so i did non-base-10 literals

use std/io;

fn main() {
    long a = 0xDEADBEEF;
    int b = 0o273451456;
    int c = 0b111010011011111010010100101;

    printf("a = %ld\nb = %d\nc = %d\n", a, b, c);
}
#

and i also cleaned up the function return type inference really heavily

solar lagoon
#

@grim sparrow Is the new porter robinson album good

granite frigate
#

russian roulette is banger

pearl sail
#

literately

faint timber
acoustic imp
#

im this close 🤏 to shooting myself over JS

tepid olive
gentle grove
#

SwiftScript

#

they should give me dev

gentle grove
#

imagine being sent into despair just because a language is a little silly

placid kraken
gentle grove
#

there's no way

orchid fulcrum
#

Still useful in games as they are mostly muting audio when in silent. Also idk about dnd or critical alerts i don't like those kind of workarounds much

faint stag
#

however that function is beyond my scope (wordplay not intended)

granite frigate
#

what’s thr windows version of dyld

#

that like finds dlls to inject them during runtime but windows

sonic totem
#

The DLL loader is the part of the operating system (OS) that loads DLLs and/or resolves references to DLLs.

#

Doesn’t even have a cool name troll

wooden yarrow
wooden yarrow
#

💀

faint stag
#

that one was a bit obvious

wooden yarrow
#

32 bit? in this day and age? supershocked

faint stag
#

no it's still named 32 for the 64 bit one

wooden yarrow
#

average windows

faint stag
hasty ruin
wooden yarrow
faint stag
wooden yarrow
#

the fuck did they do to the acronym

wooden yarrow
#

apple would simply not care

faint stag
wooden yarrow
#

.

#

windows should create a new C:\Windows\System folder

#

i think

faint stag
wooden yarrow
#

and the shit does that mean

frail cedar
#

ld used to stand for loader

#

not linker

faint stag
#

that too

wooden yarrow
#

right

frail cedar
#

the name changed but the command didn't

#

cause yes

wooden yarrow
faint stag
#

but yeah if ld is the command for your linker ldid does make some sense

wooden yarrow
#

guess that makes sense

frail cedar
#

it's dynamic linker, but ld

#

because yes

granite frigate
#

so dyld has insert libraries

#

what does rundll32 have

hasty ruin
#

Linker Dynamic edition

faint stag
granite frigate
#

oke

#

i was kinda curious about systemwide inject on windows

faint stag
#

yeah that's about right

#

rundll32 is more like
a symbol finder in some cases

#

oh and one more thing, you'll commonly see methods ending in A or W and wondering what the hell the differences are

Win32 APIs often support both -A and -W variants. -A variants recognize the ANSI code page configured on the system and support char* , while -W variants operate in UTF-16 and support WCHAR . Until recently, Windows has emphasized "Unicode" -W variants over -A APIs.

#

i haven't even looked into windows development that much
wchar_t is just a macro for implementing wide chars

granite frigate
#

noted trol

#

luv u

lime pivot
sonic totem
#

We’ve always seen eye to eye Kirb

lime pivot
lime pivot
sonic totem
hasty ruin
lime pivot
hasty ruin
native orbit
#

@hasty ruin aurora dash better Shrugg

hasty ruin
solar lagoon
grim sparrow
#

It’s very indie pop/rock

solar lagoon
#

i don’t like most electronic so we’ll see

native orbit
hasty ruin
#

Blades is ugly 👎

#

freestyle has a blades theme anyway

#

So it’s gotta be superior to aurora

native orbit
#

i like my coverflow games tho vexedtomato

solar lagoon
grim sparrow
#

Whereas it’s my favourite group of music :3

pearl sail
acoustic imp
radiant idol
#

Seems fine

waxen prawn
#

my fucking

#

locale

#

isc hanging

#

im gona cry

solar lagoon
#

russian roulette is good

#

the bridge is well done

#

plus it’s written by a member of bleachers wtf

solar lagoon
#

porter still has a place in my heart tbh he makes beautiful melodies

#

this is so good

cloud yacht
kind herald
#

the homebrew store for aurora though...

hasty ruin
#

Just soldered my finger 👍

kind herald
#

Oh

#

You're not supposed to do that 👍

#

are you okay

hasty ruin
#

Yeah lol

#

Just the first layer of skin

acoustic imp
#

TIL adding 'hidden' as an attribute to an html element hides it

light owl
hasty ruin
#

Not my pic

slim bramble
coarse moss
#

is there a discord server for apple development not related to jailbreaking?

acoustic imp
#

it works to

#

for linux ISO's *

#

try the theos server

#

they are good

native orbit
#

usually know*

acoustic imp
native orbit
#

bruh

acoustic imp
#

it was Moz docs, weird

#

whats the best way to do sorting? like subviews/children bassed of a property/attribute

#

(like the concept? or like fundimentals?)

placid kraken
#

if you want to sort in js tho,

#

you need to have a way to order each item

#

so if you wanna sort lexicographically

#

i think its something like

myArray.sort((a, b) => a.localeCompare(b))
acoustic imp
#

chat gpt gave me sm an i made it work ```js
function sortTorrentsByName(){
const torrents = Array.from(document.querySelectorAll("torrent"));
torrents.sort((a, b) => {
const nameA = a.getAttribute("name").toUpperCase().replace(/./g, ' ');
const nameB = b.getAttribute("name").toUpperCase().replace(/./g, ' ');
if (nameA < nameB) {
return -1;
}
if (nameA > nameB) {
return 1;
}
return 0;
});

  torrents.forEach((torrent, index)=>{
    torrent.style.order = index;
  });

}```

#

is this bad ?

placid kraken
placid kraken
#

use localeCompare

acoustic imp
#

it works 🤷‍♂️

placid kraken
#

does it work for if the strings start with the same first char but the rest are different

#

so like car and cat

ashen canyon
placid kraken
#

^

acoustic imp
#

oop

ashen canyon
acoustic imp
#

oops*

#

also who r u

ashen canyon
#

flamigno

#

that's my name

acoustic imp
placid kraken
#

prefer standard for loops over forEach because theyre much faster

acoustic imp
#

oh ok

placid kraken
#

you could even

#

there

#

that is faster because youre not allocating a function on each stack frame of the callback to .sort

ashen canyon
# placid kraken this is how i would do it ```ts function sortTorrentsByName() { const getNam...
function sortTorrentsByName() {
    const torrents = document.querySelectorAll('torrent');
    const sortedTorrents = Array.from(torrents).sort((a, b) => {
        const nameA = a.getAttribute("name").toUpperCase().replace(/\./g, ' ');
        const nameB = b.getAttribute("name").toUpperCase().replace(/\./g, ' ');
        return nameA.localeCompare(nameB);
    });

    for (const [index, torrent] of sortedTorrents.entries()) {
        torrent.style.order = index;
    }
}
#

i don't really use js- assuming that'll do the same thing

acoustic imp
ashen canyon
#

arrow functions my beloved

placid kraken
ashen canyon
#

that is the most cursed way to write a function (the first one)

placid kraken
#

its just preference if the function body is big

ashen canyon
#

well when you could just do

function a() {
  return 5;
}```
#

it kinda is

placid kraken
#

yea thats what i do

acoustic imp
placid kraken
#

but those arent actually the same expression

#
const a = () => {
    return 5;
}

is not the same as

function a() {
  return 5;
}
ashen canyon
#

yeah something like that

#

because you can reassign a if its not const ☝️frnerd

placid kraken
#

no

#

if you define the first one and try to access this, you will get the this of the arrow function scope

#

if you define the second one you will not, you will get the this of the parent scope (for example a class's this)

#

its a lexical scope difference

#

because anonymous functions dont create a new lexical scope theyre more of a "callback"

ashen canyon
#

i don't trust programming languages that use this instead of self

acoustic imp
#

js woeis

placid kraken
#

for example in a specific function in a class

#

i need to define this

ashen canyon
#

💀

placid kraken
#

i need to get a reference of this outside of the arrow function

#

because i wont have access to it inside of the arrow function

#

so i need to capture it beforehand to be able to use it

#

alternatively you can do ```ts
const a = (() => 5).bind(this);

ashen canyon
#

😭

placid kraken
#

✨ javascript ✨

acoustic imp
placid kraken
#

yay

acoustic imp
#

now for the rest sad

placid kraken
acoustic imp
#

localcompare does numbers right ?

placid kraken
#

locale = localization = language so no

acoustic imp
placid kraken
#

if you wanna sort by numbers do

myNumberArray.sort((a, b) => a - b) // ascending
myNumberArray.sort((a, b) => b - a) // descending
acoustic imp
#

k

placid kraken
#

itll insert it between 13 and 21

acoustic imp
#

oh

placid kraken
#

its sorting them by strings

#

localeCompare doesnt exist as a method on the Number class

#

or rather

#

a better example is this

#

because theyre already "sorted" in the array i showed in that screenshot

#

its sort of like sorting "an", "and", and "bat"

acoustic imp
#

would this work ```js
function sortTorrentsByNumAtribute(attribute){
const torrents = document.querySelectorAll('torrent');
const sortedTorrents = Array.from(torrents).sort((a, b) => {
return a.getAttribute("attribute") - b.getAttribute("attribute");
});

for (const [index, torrent] of sortedTorrents.entries()) {
    torrent.style.order = index;
    torrent.setAttribute("order", index);
}
console.log("sorted Torrrents By ", attribute);

}``` doesnt seam to

radiant idol
#

crazy how you actually name things properly now

#

good job

#

im proud

acoustic imp
#

🎉

fading shell
#

„Torrrents“

acoustic imp
#

oops

snow python
faint timber
#

but list comprehension and enumerate -> index, entry tuple's are super nice to have codewise

placid kraken
#

on node its almost exactly the same until 1 million+ permutations, yes

snow python
#

I would argue that readability is more important in this case, especially since its extremely unlikely they would be rendering 1e4 elements to the dom without it being virtualized anyway

placid kraken
#

lol yeah of course

#

fyi running a more heavy operation like logging to the screen on an array with more than like 200 elements kills the page due to not enough ram so i cant really test that accurately

#

with 2e2 elements the results are pretty clear tho

#

ideally i would run this test about 500 times and average it but it takes quite a while so i wont

#
const array = new Array(2e2).fill(null).map((_, i) => ({
    sayHi() {
        console.log(`Hi I am element ${i + 1}/${array.length}`);
    }
}));

const forStart = performance.now();

for (let i = 0, element = array[i]; i < array.length; i++) {
    element.sayHi();
}

const forEnd = performance.now();

const forEachStart = performance.now();

array.forEach(element => element.sayHi());

const forEachEnd = performance.now();

console.log(`for took ${forEnd - forStart}`);
console.log(`forEach took ${forEachEnd - forEachStart}`);
snow python
#

Im going to ignore that because forEach and map is easier to spell

placid kraken
#
use std/io;

fn main() {
    long a = 0xDEADBEEF;
    int b = 0o273451456;
    int c = 0b111010011011111010010100101;
    long d = 1.2e9;
    double e = 2.7182818e0;

    printf(
        "a = %X\nb = %d\nc = %d\nd = %ld\ne = %.7f\n",
        a, b, c, d, e
    );
}
#

it was a pain because i had to handle both ints and floats

acoustic imp
#

cursed ios 15.4> , anyone know how to solve the floating bar issue in css ? insead of using vh i use ?

#

ig im jus cooked

#

Oh well (ios 15.1.1)

acoustic imp
#

im 15.1.1 😭

placid kraken
#

does something like github even load on a webkit version that old

acoustic imp
#

no...

#

well only lightmode

#

and at that not well

#

"life of jailbreaker"

glad timber
#

hola, anyone know of a discord for macos/apple dev in general?

random root
#

If there's a developer here interested in a gig, I'm offering $2k for a custom Tinder Bypass

Requirements:
To work on iPhones 8 and X
Palera1n jb
ios 16.7.8
Has to be able to work with a few tweaks

Do not waste my time, we'll do the deal with a trusted middleman, that we both agree on.
Best regards

orchid fulcrum
glad timber
wheat grotto
#

Who’s that desperate to pay 2k for a tinder bypass

#

I’m honestly interested

robust radish
random root
#

If you can impletement everything in 1 tweak, budget is unlimited

wheat grotto
#

Token grabber :/

random root
reef trail
random root
rocky oriole
#

im making a tweak for the twitter app, do i put the twitter bundleID in MobileSubstrate bundle filter option? theos

robust radish
rocky oriole
random root
wheat grotto
#

Tho I’ve got no clue, haven’t had the need for tinder

waxen prawn
#

hepl polos gusy

drifting heron
#

this is so fucked up

waxen prawn
#

Like WHY WONT IT KOUNT

drifting heron
drifting heron
placid kraken
#

can someone explain in simpler details how logical AND/OR works

#

i implemented it but it feels a bit inefficient

#

for AND,

  1. it declares a temporary with 0
  2. it checks the left side
  3. if left side is 0 (false), it jumps to the end, otherwise it jumps to the right side
  4. if the right side is 0 (false), it jumps to the end, otherwise it jumps to a special label that sets the temporary to 1
  5. at the special label, it sets the temporary to 1 and then jumps to the end
#

for OR,

  1. it declares a temporary with 0
  2. it checks the left side
  3. if left side is 0 (false), it jumps to the right side, otherwise it jumps to the special label
  4. if the right side is 0 (false), it jumps to the end, otherwise it jumps to the special label
  5. at the special label, it sets the temporary to 1 and then jumps to the end
#

there has gotta be a simpler way to do that

manic forum
#

that sounds about right

placid kraken
#

however this means that if you do

fn meow() {
    puts("meow!");
}

fn main() {
    bool a = false;
    a && meow();
}
``` `meow` will never be called
#

likewise if you do

fn meow() {
    puts("meow!");
}

fn main() {
    int a = true;
    a || meow();
}
``` `meow` will never be called
manic forum
#

@placid kraken that also sounds right

placid kraken
#

oh true actually

#

i didnt think of that

manic forum
#

imo it'd be a bug if it were called

placid kraken
manic forum
placid kraken
#

oh ok

#

im not quite sure how to do it without a temporary tho

manic forum
#

isn't that the same as C's behavior?

placid kraken
#

yes

placid kraken
manic forum
#

consider this: a == null || !a.flag

#

you don't want the right side to be evaluated if the left side succeeds

placid kraken
#

yep makes sense

wooden yarrow
#

but

wooden yarrow
placid kraken
#

until now all "logical" expressions were just calling bitwise ones internally lol

#

now theyre actually logical

placid kraken
wooden yarrow
#

(which might as well be magic yes)

fading shell
#

Really useful magic though

manic forum
#

@placid kraken also what's the precedence of && and ||

placid kraken
manic forum
#

iirc || usually has precedence

placid kraken
# manic forum <@581573474296791211> also what's the precedence of && and \|\|
pub fn precedence(&self) -> i8 {
    match self {
        // Self::Exponent => 8,
        Self::Multiply | Self::Divide | Self::Modulus => 7,
        Self::Add | Self::Subtract => 6,
        Self::LessThan | Self::LessThanEqual | Self::GreaterThan | Self::GreaterThanEqual => 5,
        Self::EqualTo | Self::NotEqualTo => 4,
        Self::And | Self::BitwiseAnd => 3,
        Self::BitwiseXor => 2,
        Self::Or | Self::BitwiseOr => 1,
        _ => 0,
    }
}
manic forum
#

or maybe i'm wrong idk

placid kraken
#

i checked the java precedence table

manic forum
#

no wait it was && yeah

wooden yarrow
placid kraken
#

thats what i meant lmao

#

thats what it does right now

wooden yarrow
#

logically think through if things can be added/removed/rearranged without side effects

placid kraken
#

nope

#

even if i did that it wouldnt really matter due to dead code elimination later

placid kraken
#

like that example greencraze said

#

where you wouldnt want something to run if the first part is already true

#

so without the optimization some things might break

#

which makes it less of an optimization inherently and more of a compiler step

#

even though it is an optimization in nature

manic forum
#

short circuiting isn't an optimization, it is done even with no optimization in C

placid kraken
#

yeah

#

thats probably because its fundamental to the program running without undefined behavior, even though it technically optimizes the code

#

where UB is used in a slightly different context than usual, just not knowing what result the compiler will produce when you write the code

#

also does C have different syntax for sar and shr

manic forum
#

for what?

placid kraken
#

for shifting to the right preserving the sign or filling the freed bits with 0s

#

im gonna assume its always preserving the sign of the value?

manic forum
#

i'm not sure

#

i've only ever used shifts with unsigned numbers

placid kraken
#

considering this returns -32 and 32 respectively idk

int main() {
    int a = -64;
    a >>= 1;
    
    int b = 64;
    b >>= 1;
    
    printf("%d\n%d\n", a, b);
}
manic forum
#

then i guess it's always preserving

placid kraken
#

ya

#

easy enough to program that i guess

#

ah i see

acoustic imp
placid kraken
#

the background gets too close to the text on the sides

#

aswell as like these lol

#

other than that its pretty goo

#

d

acoustic imp
acoustic imp
#

not where it is

placid kraken
#

send css

slim bramble
placid kraken
#

lmfao

acoustic imp
#

how do i not make it teslaman-y

acoustic imp
# placid kraken send css
.panelStat{
    width: max-content;
    height: calc(100% - 22px);
    padding: 3px;
    margin:2px;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 5px;
    align-items: center;
    border: var(--GlassBorder) 1px solid;
    border-radius: 10px;
}

.pusher{
    margin-right: auto !important;
}

.panelStat img{
    width: auto;
    height: 100%;
}

.panelStat p{
    width: fit-content;
    height: 100%;
    display: flex;
}```
#
<div class="panelStat" stat="dl_info_speed">
  <img class="svgIcon" src="/img/cloud-download-svgrepo-com.svg" alt="">
  <p>0 B/s</p>
</div>```
#

why dows loging in freez the tab smh

#

oh it was nothing, nvm

acoustic imp
#

linux iso's 👍

manic forum
placid kraken
acoustic imp
manic forum
#

oh

wooden yarrow
manic forum
#

i'm blind

wooden yarrow
placid kraken
manic forum
wooden yarrow
placid kraken
#

what does ID stand for

#

oh

manic forum
#

implementation-defined?

wooden yarrow
#

implementation defined

placid kraken
#

yea

wooden yarrow
#

don't know if it's a real acronym but

#

I have made one up !

placid kraken
manic forum
placid kraken
#

maybe do like 4px if ur using px

acoustic imp
#

oh ok

#

px

placid kraken
wooden yarrow
placid kraken
#

margin-block is for vertical specifically

wooden yarrow
#

we are at the cutting edge of language 💪

placid kraken
#

margin-inline is for horizontal specifically

#

thats what ur setting

acoustic imp
placid kraken
#

no margin inline vs margin inline

#

its like magic

acoustic imp
#

oh uk ok

placid kraken
acoustic imp
#

ik but like its less lines yk

placid kraken
#

and u can also do padding: x y where x is for vertical and y is for horizontal

acoustic imp
#

fric

reef trail
#

i hate css, it never does what i want it to

placid kraken
#

lmao for realsies

#

thats why i use tailwind

#

the "cascading" part of css, its main selling point, is the worst part about it

acoustic imp
#

wow these look better to now

reef trail
placid kraken
#

and also duplication for the same code everywhere

#

where you have 25 different classes but theyre all basically just a flexbox

acoustic imp
#

yes.

reef trail
acoustic imp
#

*{
display: flex;
}
hm

#

are flexboxes like resource in-efficent ?

placid kraken
acoustic imp
#

i have sm like that

placid kraken
#

theyre called "utility classes"

acoustic imp
placid kraken
#

with very little inside of each

#

designed to be chained with other utility classes

acoustic imp
#

oh

placid kraken
#

so for example

<button class="bg-red-500 text-white py-2 px-4 rounded-none">
  Click me
</button>
cloud yacht
placid kraken
#

a button with a red background, white text, 2 padding vertical, 4 padding horizontal, no border

acoustic imp
#

my.css 💯

placid kraken
#

tailwind solves many problems its just hard to read with a lot of classes

#

ok now @wooden yarrow this is the real question

#

should this

fn main() {
    bool a = true;
    a && (int b = 5);
}
``` throw an error
#

its like conditional compilation but runtime

manic forum
manic forum
#

no frameworks, no compilation, just plain css

reef trail
#

i think i just need to relearn css entirely but it’s hard to forget what you’ve already learnt

placid kraken
manic forum
#

which is not often

reef trail
#

like should i use pixels or not

wooden yarrow
#

and since this is resolved at compile time

placid kraken
#

because right now it silently stops compiling anything after the declaration (thats obviously not correct behavior lmfao)

wooden yarrow
#

just include

manic forum
placid kraken
#

a isnt constexpr

manic forum
#

why declare a variable in there

wooden yarrow
#

so

placid kraken
wooden yarrow
placid kraken
#

idk C crashes

manic forum
#

but a && (int b = 5) ?

#

what happens if a is false?

#

is b set to 0?

#

is it undefined?

wooden yarrow
#

thumbs

placid kraken
#

nvm it doesnt what

wooden yarrow
#

then

#

error

#

!

manic forum
wooden yarrow
placid kraken
#

it does i was being stupid earlier and not wrapping it in ()

wooden yarrow
placid kraken
#

i know it does in elle too

acoustic imp
wooden yarrow
#

c v0.5 fr

placid kraken
acoustic imp
#

Ppl us rem units but like idk thoes

wooden yarrow
placid kraken
manic forum
#

@placid kraken will you support unions

placid kraken
reef trail
cloud yacht
placid kraken
#

structs are basically fancy arrays with multiple types anyway

manic forum
#

that's one way to put it

#

i guess

wooden yarrow
#

tagged enums

placid kraken
manic forum
#

i wouldn't call that an array

placid kraken
#

so

struct Foo {
    int a;
    long b;
}

compiles to

type :Foo = { w, l }
placid kraken
#

true

#

idk it is very similar to an array internally

wooden yarrow
#

also structs can have bit sized ints

#

so

#

which you cannot easily get with just casting in and out of arrays

placid kraken
#
  1. allocate memory the size of the array

  2. use store instruction for each value at each offset from the base ptr

  3. when retrieving, calculate an offset from base ptr and use a load instruction

  4. allocate memory the size of the struct

  5. use store instruction for each value at each offset from the base ptr

  6. when retrieving, calculate an offset from base ptr and use a load instruction

#

the only difference is youre doing more than just a multiplication to get that offset in structs

placid kraken
#

for now bool is just a typedef for int, true is a typedef for 1 and false is a typedef for 0

manic forum
#

i think that's also what C does?

placid kraken
#

oh

#

lol

wooden yarrow
#

C didn't even used to have bool actually

#

so everyone just used int

placid kraken
#

can you print bools with printf

#

like is there a format specifier

wooden yarrow
#

yeah

placid kraken
#

other than just %d

manic forum
#

there is?

#

i always used %d

placid kraken
#

yea same

wooden yarrow
#

sorry I lied

#

there is none

placid kraken
#

lmao

wooden yarrow
#

anyways I don't think the value for true is defined in C

#

actually

#

I think usually it's 255 or 1 though

placid kraken
#

stdbool.h

manic forum
#

stdbool.h has it i think

wooden yarrow
#

does that define a value though?

manic forum
#

ok i'll just stop typing

wooden yarrow
#

or is that just impl defined behavior

manic forum
placid kraken
wooden yarrow
#

hm

#

cool

manic forum
#

An application may undefine and then possibly redefine the macros bool, true, and false.
wtf

wooden yarrow
#

then it isnt defined

manic forum
#

yeah

radiant idol
wooden yarrow
#

i mean but then that's diff i think

manic forum
#
$ cat test.c
#include <stdbool.h>
#include <stdio.h>

#undef true
#define true 0

int main() {
  if (!true) puts(":troll~1:");
}
$ cc test.c
$ ./a.out 
:troll~1:
$ 
placid kraken
#

_Bool doesnt follow any convention of C ive seen before

#

istg

kind herald
#
meow
wooden yarrow
placid kraken
#

c has always had some weird conventions

#

like these make sense

wooden yarrow
placid kraken
#

idk why its f if it returns double but whatever

#

these also make sense more or less i guess

#

but still _Bool doesnt follow any of these

wooden yarrow
manic forum
#

pull a windows COM1 but with the name "girl"

placid kraken
manic forum
#

or recompile cat

#

that's probably easier

wooden yarrow
manic forum
#

lmao

manic forum
acoustic imp
manic forum
#

why do i need tex to compile coreutils trolldisappointed

wooden yarrow
#

trolling

#

wtf where it gone

manic forum
#

i failed to take a screenshot 4 times

#
$ ./src/cat girl
nyaa~
$ echo test > girl
$ ./src/cat girl
nyaa~
$ rm girl
$ ./src/cat girl
nyaa~
$
#

@wooden yarrow superior coreutils

wooden yarrow
#

🔥

wooden yarrow
manic forum
#

for future reference

diff --git a/src/cat.c b/src/cat.c
index b33faeb35..859d4bf98 100644
--- a/src/cat.c
+++ b/src/cat.c
@@ -671,6 +671,7 @@ main (int argc, char **argv)
       if (argind < argc)
         infile = argv[argind];
 
+      bool reading_girl = STREQ (infile, "girl");
       bool reading_stdin = STREQ (infile, "-");
       if (reading_stdin)
         {
@@ -679,6 +680,24 @@ main (int argc, char **argv)
           if (file_open_mode & O_BINARY)
             xset_binary_mode (STDIN_FILENO, O_BINARY);
         }
+      else if (reading_girl)
+        {
+          int fds[2];
+          if (pipe(fds) != 0)
+            {
+              error (0, errno, "%s", quotef (infile));
+              ok = false;
+              continue;
+            }
+          if (write(fds[1], "nyaa~\n", 6) != 6)
+            {
+              error (0, errno, "%s", quotef (infile));
+              ok = false;
+              continue;
+            }
+          close(fds[1]);
+          input_desc = fds[0];
+        }
       else
         {
           input_desc = open (infile, file_open_mode);

#

also wow patch highlighting in discord looks nice for some reason

placid kraken
#

@clear iron nice name and pfp

clear iron
#

Ty! ^^

native dune
manic forum
#

my first solution involved recompiling the kernel

#

and i still think that's the best solution

#

unless you can hook syscalls in the kernel with drivers?

#

i have no idea

placid kraken
#

@wooden yarrow real

fn toBool(bool value) {
    if value {
        return "true";
    } else {
        return "false";
    }
}
placid kraken
#

%s is my favourite bool format specifier

acoustic imp
placid kraken
wooden yarrow
#

toBool implies going to a bool

#

but this is going to a const char*

#

so toString?

placid kraken
#

btos

#

follow the C convention

wooden yarrow
placid kraken
#

lmfao

manic forum
#
$ cat test.c
#include <stdbool.h>
#include <stdio.h>

int main() {
  bool mybool = true;
  printf("check out my cool boolean: %s\n", mybool);
}
$ cc test.c
$ ./a.out
Segmentation fault (core dumped)
$
#

i love c

#

not even a warning

placid kraken
#

ill actually add this to the stdlib

manic forum
#

wait

#

free(long ptr) ??

#

does the language not have pointers

#

or how do you use them?

placid kraken
wooden yarrow
placid kraken
wooden yarrow
placid kraken
wooden yarrow
#

surely long is long int i.e. 64 bit int

#

??

#

(or well, 32 bit ig)

placid kraken
#

no in this case long is the memory address space

manic forum
wooden yarrow
#

wtf

wooden yarrow
#

that's just NULL

#

but type form

placid kraken
#

however in elle i made just basic pointers

wooden yarrow
placid kraken
#

string is a macro for char *

wooden yarrow
placid kraken
wooden yarrow
manic forum
#

something something arm64?

wooden yarrow
#

no not arm64

#

more like x86

manic forum
#

wow i was wrong

placid kraken
# manic forum does the language not have pointers
use std/io;

fn other(int *a, string *str) {
    printf("(fn other)\n\ta = %d\n\tstr = %s\n", *a, *str);
    *a = 542;
}

fn main() {
    int a = 39;
    string str = "Hello world!";

    other(&a, &str);
    printf("(fn main)\n\ta = %d\n", a);
}
wooden yarrow
#

like void in c

manic forum
#

actually yeah

placid kraken
manic forum
#

would make more sense than null *

wooden yarrow
#

yes

manic forum
#

which implies that it is always null

wooden yarrow