#ot2-the-original-pubsta

652 messages · Page 103 of 1

rare moat
#

hi

jovial island
#

ayo wssup

rare moat
#
#include <unistd.h>

int main(void) {
    int child_pid = fork();

    if(child_pid == 0) {
        /* Code that runs in the child process */
    } else {
        /* Code that runs in the parent process */
    }

    return 0;
}

so building off this example.

#

if we wanted to, say, run the ls command in the subprocess, we would do:

jovial island
#

subprocess.run("ls")

rare moat
#
execl("/usr/bin/ls", "/usr/bin/ls", ".", "-a");
jovial island
rare moat
#

yes, the first argument is the path to the binary.

#

everything after that are the command line arguments you read in argv.

jovial island
rare moat
#

no you need to separate it across strings.

jovial island
#

so can you give an example for

#

start chrome

rare moat
#

if you want to write the command on its own you can just throw it as a string into /bin/bash or whatever your shell is haha

native cobalt
#

Oh, so the first argument tells the location of the thing to run, while the 2nd arg and onward is the actual command to execute along with any arguments?

native cobalt
#

MY BRAIN IS EXPANDING.

jovial island
jovial island
rare moat
#

do keep in mind to put the binary as the first command line argument though haha.

jovial island
rare moat
#

this is what i get when printing sys.argv.

#

as for starting chrome.

#

it depends what platform you are on.

jovial island
jovial island
rare moat
#

if you are on Windows none of this will apply to you unfortunately.

jovial island
rare moat
#

i assumed you were on Linux haha sorry

#

fork, exec*, and pipe, are POSIX functions.

#

if you have something like WSL you should be able to use them though..

jovial island
#

just leaves because of a trauma people gave...

rare moat
#

trauma?

native cobalt
#

Hmm, is there no windows equivalent?

jovial island
#

yeah

#

need it for windows

rare moat
#

Windows does have their own interfaces for creating processes.

jovial island
#

and i got traumatized because i am trying to fix it for days

rare moat
#

hold on

#

this exists

#

i am not sure how to use it though hehe.

jovial island
rare moat
#

i think someone mentioned that Boost has interfaces for it.

jovial island
#

is it c++

rare moat
#

they have a C++ example yes.

native cobalt
#

the real question is if it's malbolge
asking for a friend

jovial island
rare moat
#

asking for a friend
...sure.

rare moat
#

i am a C guy.

jovial island
#

no prob

native cobalt
#

all I know is that there's an endl thing

#

Why is that there

jovial island
#

BOOL CreateProcessA(
[in, optional] LPCSTR lpApplicationName,
[in, out, optional] LPSTR lpCommandLine,
[in, optional] LPSECURITY_ATTRIBUTES lpProcessAttributes,
[in, optional] LPSECURITY_ATTRIBUTES lpThreadAttributes,
[in] BOOL bInheritHandles,
[in] DWORD dwCreationFlags,
[in, optional] LPVOID lpEnvironment,
[in, optional] LPCSTR lpCurrentDirectory,
[in] LPSTARTUPINFOA lpStartupInfo,
[out] LPPROCESS_INFORMATION lpProcessInformation
);

native cobalt
#

why not "\n"

jovial island
jovial island
rare moat
#

apparently std::endl will flush the stdout?

native cobalt
#

oh?

rare moat
#

apparently....? that is just what i have heard haha

native cobalt
#

But I don't want to flush it until the end of execution?

native cobalt
#

What?

#

So unnecessarily complicated.

rare moat
#

C++ moment

#

fun use of fork and pipe for any passerbys looking at this conversation:

size_t extract_error_cb(void (*callback)(), size_t length, char *buffer) {
    int pipes[2] = {0};
    pid_t process_id = -1;

    memset(buffer, 0, length);

    pipe(pipes);
    process_id = fork();

    if(process_id == 0) {
        dup2(pipes[1], STDERR_FILENO);
        callback();
        exit(0);
    }

    return read(pipes[0], buffer, length);
}
#

extracting error messages spat out by a function on the stderr.

jovial island
rare moat
#

hi

#

yeah uh

#

i have. zero clue what that is haha.

jovial island
rare moat
#

i cannot

rare moat
#

all i know is that it is some function call.

#

you should join a C++ server and see what they say.

#

all i know is that it is a function call, and this is probably the path to the program to execute.

native cobalt
#

So, what about the other exec* funcs?
Like execv and what not

rare moat
#

execv accepts command line arguments in the form of an array of strings.

#

so:

#
char *arguments[] = {"/usr/bin/ls", ".", "-a", NULL};

execv("/usr/bin/ls", arguments);
native cobalt
#

ah, so it's all just variations on execl?

rare moat
#

execvp.. i have no clue. it looks identical to execv except for the change in argument names..

rare moat
native cobalt
#

Oh, well.
The more you know™️

rare moat
#

people looking at my C code

native cobalt
#

lmao

#

I'm rather happy I've learned fork() and exec*()

#

You still haven't talked about pipe(), but I know how piping works
Just not the implementation

rare moat
#

ooo boy pipes

#
#include <unistd.h>

int main(void) {
    int pipes[2] = {0};

    pipe(pipes);

    return 0;
}
#

basically, pipe creates two new pipes. one is a 'read' pipe, and one is a 'write' pipe.

#

which is which? i always forget let me see the manual page.

native cobalt
#

lmao

#

man moment

rare moat
#

pipes[0] is the read end, pipes[1] is the write end.

#

using this, you can communicate between a child process and a parent process for as long as the child process exists.

#

so if i wanted to send some stuff to a parent process:

native cobalt
#

Ohhh this is such cool shit

rare moat
#
#include <stdio.h>
#include <unistd.h>

int main(void) {
    int pipes[2] = {0};
    pipe(pipes);

    if(fork() == 0) {
        write(pipes[1], "foobar", 7);
    } else {
        char buffer[256] = {0};

        read(pipes[0], buffer, 256);
        printf("%s\n", buffer);
    }

    return 0;
}
#

and boom

native cobalt
#

you want seven bytes on that write() call

rare moat
#

child to parent communication.

#

right yeah

native cobalt
#

But this is snazzy af

rare moat
#

and so this is how Bash works. =D

native cobalt
#

thank you smoke pipe

rare moat
#

nope problem

#

🥴

native cobalt
#

mild aneurysm, don't mind me

rare moat
#

you can never be forgiven

native cobalt
rare moat
#

you can do all of this in Python by the way.

#

!d os.fork

clever salmonBOT
#

os.fork()```
Fork a child process. Return `0` in the child and the child’s process id in the parent. If an error occurs [`OSError`](https://docs.python.org/3/library/exceptions.html#OSError "OSError") is raised.

Note that some platforms including FreeBSD <= 6.3 and Cygwin have known issues when using `fork()` from a thread.

Raises an [auditing event](https://docs.python.org/3/library/sys.html#auditing) `os.fork` with no arguments.

Changed in version 3.8: Calling `fork()` in a subinterpreter is no longer supported ([`RuntimeError`](https://docs.python.org/3/library/exceptions.html#RuntimeError "RuntimeError") is raised).

Warning

See [`ssl`](https://docs.python.org/3/library/ssl.html#module-ssl "ssl: TLS/SSL wrapper for socket objects") for applications that use the SSL module with fork()...
native cobalt
#

thanks fork

rare moat
#

!d os.pipe

clever salmonBOT
#

os.pipe()```
Create a pipe. Return a pair of file descriptors `(r, w)` usable for reading and writing, respectively. The new file descriptor is [non-inheritable](https://docs.python.org/3/library/os.html#fd-inheritance).

[Availability](https://docs.python.org/3/library/intro.html#availability): Unix, Windows.

Changed in version 3.4: The new file descriptors are now non-inheritable.
native cobalt
#

thanks pipe

rare moat
#

🦀

native cobalt
#

and then fucking exec()

rare moat
#

!d os.execv

clever salmonBOT
#

os.execv(path, args)``````py

os.execve(path, args, env)``````py

os.execvp(file, args)```
These functions all execute a new program, replacing the current process; they do not return. On Unix, the new executable is loaded into the current process, and will have the same process id as the caller. Errors will be reported as [`OSError`](https://docs.python.org/3/library/exceptions.html#OSError "OSError") exceptions.

The current process is replaced immediately. Open file objects and descriptors are not flushed, so if there may be data buffered on these open files, you should flush them using `sys.stdout.flush()` or [`os.fsync()`](https://docs.python.org/3/library/os.html#os.fsync "os.fsync") before calling an [`exec*`](https://docs.python.org/3/library/os.html#os.execl "os.execl") function.
rare moat
#

oh okay good

native cobalt
#

there we go

#

!d exec

clever salmonBOT
#

exec(object[, globals[, locals]])```
This function supports dynamic execution of Python code. *object* must be either a string or a code object. If it is a string, the string is parsed as a suite of Python statements which is then executed (unless a syntax error occurs). [1](https://docs.python.org/3/library/functions.html#id2) If it is a code object, it is simply executed. In all cases, the code that’s executed is expected to be valid as file input (see the section [File input](https://docs.python.org/3/reference/toplevel_components.html#file-input) in the Reference Manual). Be aware that the [`nonlocal`](https://docs.python.org/3/reference/simple_stmts.html#nonlocal), [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield), and [`return`](https://docs.python.org/3/reference/simple_stmts.html#return) statements may not be used outside of function definitions even within the context of code passed to the [`exec()`](https://docs.python.org/3/library/functions.html#exec "exec") function. The return value is `None`.
native cobalt
#

ah, you little shit
You're not the right one

rare moat
#

maybe we should make it replace the process image. :^)

native cobalt
#

maybe we should annihilate it entirely

rare moat
#

i have a New Emoji.

native cobalt
#

I did NM_SadgeRain

rare moat
#

i love these

native cobalt
#

mf got a square in stocking for christmas

rare moat
#

jazz

#

Winter Coffee Shop Bookstore Ambience with Relaxing Smooth Jazz Music and Crackling Fireplace

native cobalt
#

That sounds like 5 people asking questions to you at the same time

rare moat
#

we should transcribe messages from #python-discussion, convert them into audio with text to speech

native cobalt
rare moat
#

then put it on YouTube as ASMR coffee shop ambiance.

native cobalt
#

1 hour of Python Gen

rare moat
#

1 hour of suffering

native cobalt
#

That would be fun ngl
But that means you'd need an hours worth of suffering

rare moat
#

a small price to pay for lolz

native cobalt
#

Reality is often pricy

rare moat
#

you do not know what i will do for internet clout.

native cobalt
#

for the silver award cheddar cheese.

rare moat
#

is that the cheese with holes in it

#

WAIT

native cobalt
#

no, that's swiss cheese

rare moat
#

WHY DOES SWISS CHEESE HAVE HOLES IN IT

#

???

native cobalt
#

cheddar cheese is the tiny sliced ones

rare moat
#

you mean the stuff made out of plastic?

native cobalt
#

yeah those

jovial island
#

whispers : ..... hey 8 ball

rare moat
native cobalt
#

no nononono

rare moat
native cobalt
#

that's american

jovial island
rare moat
#

are you implying there is a difference between american cheese and whatever place cheese

jovial island
#

to start chrome for example

#

the most basic one

native cobalt
#

cheddar

#

americano is that one you posted earlier

#

cheddar get sliced into thin slivers

rare moat
#

O_o

#

are you a cheese connesiour

jovial island
#

have a nice day

rare moat
native cobalt
#

mayhaps

rare moat
#

i did not respond for like 10 seconds

#

patience please

native cobalt
#

We don't need that rudeness here.

rare moat
#

wuh

#

did they tell me to go fuck myself or something

jovial island
jovial island
#

f... they or them

rare moat
#

alright, i did not know your prono-

#

wuh

jovial island
#

just him/she

rare moat
#

oooh boy.

#

alright

jovial island
rare moat
#

i did not know your pronouns.

native cobalt
#

<@&831776746206265384> Could you come down please?

jovial island
rare moat
#

sigh.

rare moat
#

i am going to regret this in the next hour.

jovial island
rare moat
#

Dev is a girl.

native cobalt
#

I am a woman.

rare moat
#

alright. no. the English language has quite a few pronouns. 'they' has always been singular and plural.

jovial island
#

why the mods

jovial island
rare moat
#

am i really about to argue about this

#

guess i am

native cobalt
#

No need to.

jovial island
#

the lgbtqstryquiey18272817x29923+ claimed the word them/they

rare moat
#

oh for fucks sake

native cobalt
#

We're not here for that.

jovial island
rare moat
#

next thing you know he is going to call them the alphabet people.

#

@_@

#

why do i try

jovial island
#

lol

rare moat
#

that is not how language works.

jovial island
#

abcdefghijklmnopqrstuvwxyz LGTBQCSX_2022++

native cobalt
#

I just ask that you don't say anything that may start an argument. @rare moat

rare moat
#

alrighty

jovial island
native cobalt
#

Walk away if you have to.

jovial island
daring jay
#

Can we please calm down here? they/them can be used as gender neutral singular pronouns, and has been used as such for a very long time.

rare moat
#

NOOOO MY COFFEE SHOP AMBIANCE STOPPED

jovial island
#

there is only him/her in this great world:)

#

lol

rare moat
#

Dawn you know what to do

jovial island
#

did you guys read the terms and service and the license of agreement?

jovial island
#

uhh hello my names jeff

#

dawn you making a story bout long time ago or nah?

daring jay
#

!mute 916414250027716618 3h Please take a break. Other pronouns do exist, and in this server, we accept that.

rare moat
clever salmonBOT
#

:incoming_envelope: :ok_hand: applied mute to @jovial island until <t:1641433402:f> (2 hours and 59 minutes).

native cobalt
#

Anyway, about cheese.

daring jay
rare moat
#

🧀

#

what the fuck

#

now that is cursed

native cobalt
#

swiss cheesed duck

#

No, it's beautiful

rare moat
#

who made these

#

i need to have a word with them

native cobalt
#

good people

daring jay
#

if I had to guess, fix

native cobalt
#

you do not need to have a word with them

daring jay
#

he makes some amazing duckies

#

like ducky_cloudflare

rare moat
#

does he like ducks

native cobalt
#

cough cough the leather one @daring jay

rare moat
#

the What.

native cobalt
#

Ahh... good times.

#

Anyway, this is the cheese i was talking about

#

da cheddah

rare moat
#

is this one made out of plastic

native cobalt
#

depends if the large block it was shaved from was made out of plastic

#

generally, no

#

american cheese is the plastic-y one

daring jay
rare moat
#

people unironically think that the sliced and packaged cheese is made of plastic.

daring jay
#

Are you referring to a fix ducky?

native cobalt
#

Really? He's posted it like one billion times!

rare moat
native cobalt
rare moat
#

this is sadly true

#

i am going to eat oil cow

native cobalt
#

I am going to cause a spill in the gulf of mexico

rare moat
#

wait if i ate plastic would i be eating oil

native cobalt
#

processed oil, yeah

rare moat
#

will that have any adverse health effects

#

like death

native cobalt
#

in large enough doses

#

I've seen people accidentally bite plastic off the wrapping and live

daring jay
#

this is why you don't heat food in plastic containers, kids

rare moat
#

will it explode?

#

or just.. melt.

native cobalt
#

Melt

rare moat
#

this sounds like a job for the legendary show 'Can you microwave it?'

#

if any of you remember that you get veteran points

native cobalt
#

You can microwave it, it'll just be all stringy and loose by the time it's done

#

Yeah, I was contestant-

rare moat
native cobalt
#

My dumbass microwaved a popcorn bag with the plastic wrapping still on

rare moat
#

353 episodes of microwaving random shit in a microwave.

native cobalt
#

The plastic was stuck to the dish for 2 weeks

rare moat
#

this should answer all my questions

native cobalt
#

microwaving my bic lighter
*nearly died*

rare moat
#

uuo

native cobalt
#

microwaving fire is a vibe I cannot explain

rare moat
#

i wonder how much property damage this can cause.

rare moat
#

you can make plasma apparently.

native cobalt
#

really?

rare moat
native cobalt
#

I heard you can do that with other stuff as well

rare moat
#

yeah go try it

native cobalt
#

Yeah hold on, lemme go get my grapes and recreate a small portion of the sun in my microwave

rare moat
#

make plasma in a horribly sealed container that can definitely survive such conditions.

#

what could go wrong

#

the person on the internet did it

#

it must be sage

#

safe

native cobalt
#

next thing you know i can microwave my iphone

#

and have it charge

rare moat
#

or Bend It

#

or FUCKING DRILL THROUGH IT.

#

for the headphone jack

native cobalt
#

fr that was the funniest shit

rare moat
#

why did people do that

native cobalt
#

impressionable americans

rare moat
#

the american dream

native cobalt
#

the american dream is spending 1300 on 2 phones because you broke the first one getting your 3.5 audio jack back

rare moat
#

can you imagine telling that to your insurance provider

#

'so how did your phone break?'

native cobalt
#

"and why did your phone break?"
"drilled."
"d-drilled? what maniac drills a phone?"
"me. I'm that maniac"

rare moat
#

'yeah so i took a 3 inch drill bit and shoved it through my iphone 6 because 4chan told me to.'

native cobalt
#

/b/ never lies

rare moat
#

honestly it just seems like natural selection to me.

#

it is just a matter of time until someone does something actually ill- OH WAIT.

vague shadow
native cobalt
#

natural selection of the gullibles

vague shadow
#

similar to microwave

rare moat
#

micro wave.

#

radio Waves.

native cobalt
#

nah mate, you bend your iphone and the kinetic energy charges the battery

rare moat
#

like one of those wrist light things you put on during Halloween.

#

glow sticks

native cobalt
#

snap that shit like a twix bar

rare moat
#

how do those work

native cobalt
#

the glow sticks?

rare moat
#

yeah

native cobalt
#

so, there's a solution in the stick
and when you break it, a chemical releases from an inner tube that reacts with the solution and floreses

#

Pretty sure that's how it goes

rare moat
#

and you know this off heart

native cobalt
#

because I remember the least useful things

#

forgot how to do my taxes,
but I know there's a place in texas called Texarkana

#

it's... a portmanteau of texas and arkansas

rare moat
#

who thought that was a good idea

native cobalt
#

texans

rare moat
#

right i guess it really does not need any further clarification does it.

native cobalt
#

texans thought it was a good idea

#

nah

#

Unless I dunno, maybe it was a compromise

#

maybe the town was half texas and half arkansas and they settled on Texarkana, Texas

#

Instead of Texas, Texas

#

or... Arkansas, Texas

rare moat
#

alaska

native cobalt
#

alaska, texas

rare moat
#

anyway, it was nice chatting

#

i have to Go

#

wow that was abru[pt

native cobalt
#

Ya don't say

rare moat
#

lmao

#

cya

native cobalt
#

but yeah, later goo

rocky nebula
real forum
#

Idk if it still is, but it used to be the most active topical channel in this discord, and with that came a lot of spammers. Along with reaction spamming, there were times where inappropriate emojis were used, and so they were subsequently disabled.

next otter
#

Hello could anyone give opinion on these notebook which is better

digital bane
#

i7 and 16 gb plus RTX3060...that is an upgrade for my current i7. I suggest it

next otter
digital bane
#

Lol probably 30 min and really hot played with an ROG ...not mine ...best to play plugged and notebook on desk...Good gaming laptops can be bulky and heavy too...

#

Battery will last longer if not playing a game of course lol. And battery life deteriorates with time

#

ASUS tend to have good after sales service. Dont overlook that too

next otter
#

Ohh i see thankyou

rocky nebula
#

i hate it when bot reviewer review my bot when replit hav error

cyan stone
#

@jovial island can v talk here?

covert plinth
#

anyone can help me extracting exe file?

cyan stone
covert plinth
jovial island
#

yes?

versed shuttle
# next otter

Better? The i7 with 3060 probably is your best bet

#

If your looking for work and no games then still get the i7 one even though the cpu is slightly slower. 16gb ram is much better than 8

thorny pivot
#

i have a question

smoky spindle
#

dup

heady frost
#

ouch.thank you so much. i had no chance to comprehend that without your help

small coral
#

@jovial island here

jovial island
small coral
#

Here

#

So what distro u use?

jovial island
#

arch

#

gonna switch to either gentoo or LFS soon

small coral
#

Gentoo nice

#

Lol

jovial island
#

lmao

smoky spindle
#

hey yo

smoky spindle
small coral
#

Hmm

sinful sun
#

If jarvis existed in the real world it would definitely not be written in python

odd sphinx
#

lol

hazy laurel
#

I'll never understand what merit people see in those distros

#

if you can consider LFS a distro instead of a masochistic hobby project, I guess

jovial island
#

cause their realistic value would be 700-800€ brand new

jovial island
#

???????

round moss
#

you need global thisnumber

#

otherwise it is a local variable

#

and as such, you are reading a local variable before you assign to it

jovial island
#

oh, alright

#

thank you

jovial island
#

how are you guys with flutter?

jovial island
#

scared

civic plank
median blade
jovial island
jovial island
#

Wat

odd sphinx
daring jay
#

you could set it to a picture of your face if you wanted

jovial island
#

Ik that, but it doesn't give the same feeling

#

Listen I just like to waste my time distro hopping, it's just fun

patent goblet
#

i putted my phone on charge but forgetted to turn the switch on for 5 hours
ooof 🤣 i am not kidding

fluid plank
#

like

#

why are u gambl-- i mean playing genshin

jade bolt
#

@hazy laurel should i gamble my wishes now or should i wait till feb?

hazy laurel
#

idk

#

if you want Xiao or Shenhe more than Zhongli or Ganyu then no

jovial island
#

a guy is charging 20$ dollars to reinstall windows 10

#

looks too expensive

hazy laurel
#

I carry around a Windows 11 ISO with me just cause, I'd not charge anyone just to borrow a stinky USB

jovial island
#

you can download it for free?

hazy laurel
#

most modern computers that shipped with Windows will store the license on the motherboard

#

if you're reinstalling, you'll probably already have a license that'll get activated automatically

jovial island
#

thanks my dude

fluid plank
#

no thanks

frigid pollen
#

@pure sentinel I love Devon Rexes. A friend has one.

pure sentinel
#

Also, well spotted

carmine herald
#

nah that sounds like getting paid to do a job whats wrong with that?
being paid for ownership of capital is where ppl should go "wtf this is bad?"

blissful coral
mystic bone
#

hi

#

the phrase Available in any color, as long as its white or black. is missing an apostrophe, right?

mystic bone
#

ok good

daring jay
#

"its" in this case represents "it is"

mystic bone
#

yeah

daring jay
#

and since it's a contraction, you need an apostrophe to compensate for the missing letters

mystic bone
#

i found this on a product page

#

like big product

#

$300

#

and this was in big letters oof

#

just wanted to make sure i wasn't insane

ornate scroll
#

they should give you a product for free for catching that error

#

:P

mystic bone
#

here's hoping 🤞

daring jay
#

if I would happen to want to learn OCaml, how would I go about doing so?

real forum
#

You don't

#

Ocaml learns you

daring jay
#

tyty

daring jay
#

tysm

#

I shall be sure to take a read

limber pollen
#

I didn't even realise how many the chapters are

#

They're not a lot, but it says something about how simple the language is

young raft
#

How many more variants do you think we’re going to go through before it becomes endemic like the flu?

dusky cliff
#

nice

gentle shore
#

Hey mod

#

is this name valid? チャラ98

dusky cliff
#

yes

gentle shore
#

Thanks

shrewd lance
#

ur not based

small coral
#

Ayy

jade bolt
shrewd lance
#

this is the discord message that will get me cancelled in 10 years when I'm wildly popular

#

this one comment will cost me my entire career

hazy laurel
#

yes.

jade bolt
dusky cliff
shrewd lance
#

hsp is making bank with his mod privilege

digital bane
#

Lol ask for Etherium or bitcoin

fluid plank
#

best render. just take a screenshot

#

no need for that

fluid plank
dusky cliff
#

no

fluid plank
#

or become my wife

dusky cliff
#

smooth

jovial island
#

with great power comes great responsibility

wheat rock
digital bane
#

I want that pizza power lol

wheat rock
#

take keqing for shogun 🛐

jade bolt
fluid plank
jade bolt
jovial island
#

Korean

jovial island
#

Yes

#

Ahhh, so me in an alternate universe with blue PFP is Korean xD.

#

Yes thats right

jovial island
#

yes, how did you know?

jovial island
#

I know that because I am stoopid in real life

#

And have heard that people are like totally opposite in their alternate universe form.

jade bolt
#

those characters doesnt look very korean

#

!charinfo チャラ98

clever salmonBOT
#

You are not allowed to use that command here. Please use the #bot-commands channel instead.

jade bolt
#

@jovial island according to !charinfo
those characters are katakana which is japanese 🥴

jovial island
#

I see.

#

@jovial island Bro, why lie to me¿

jovial island
gentle shore
hollow heart
#

it's not koreannnnnn

#

korean would be 챠라98

wheat rock
#

aph's time to shine

#

nvm its japanese

#

lol

jade bolt
# gentle shore Japanese

interesting. after reverse translating your name for three times returns "Character 98", which is "b"

jade bolt
#

japanese characters are rounder

#

korean characters are like legos

jovial island
#

I'm disappointed that tenor has no rush e GIF.

jovial island
#

hi is anyone here good with c++

wicked hollow
#

yes! 🙂

jovial island
#

is there anyway to iterate through datatypes in c++ by changing a character in the name your calling

#

for example if you have a bunch of arrays called line1, line2, line3, etc

#

is there a way to just use a for loop to change the last char

wicked hollow
#

you can do that with macros, though usage of macros is generally discouraged.

jovial island
#

kinda unrealistic but would make my life a lot easier

#

ohh

#

so i should use it?

#

shouldnt*

wicked hollow
#

🤷

#

"discouraged" doesn't mean "never", so much as that it's error prone and not usually a good idea.

jovial island
#

arcade is very cool omg

wicked hollow
#

it'd most likely be better to create a data structure that is an array of pointers to your original arrays, and then iterate over that data structure

jovial island
#

so im currently making a dots and boxes game with sfml

#

ok

#

that didnt work

#

here

#

so basically theres a bunch of dots and you have to connect the lines (it goes player by player turn by turn)

#

whoever makes a box gets a point

#

so i made all of the possible lines

#

int line1[3][2] = {{0,1}, {2,3}, {0,0}};

#

the first two are the coordinates of the two points that make the line

#

and the last one is (0,z) where z just keep tracks of whether the line is drawn or not (0 or 1)

#

i need to keep track of 40 lines

#

so what would be the best way to iterate through them

wicked hollow
#

I'd pick an entirely different representation for that. I'd only represent line segments of length 1, instead of arbitrary length, and I'd make a single array that represents whether any particular pair of adjacent points has a line drawn between them

jovial island
#

im confused

#

how would that look

#

are you saying youd just have an array of 1 and 0s and then instead of having the coordinates in the array

#

if i wanted to check which points are used by putting the points directly in the conditional?

#

int lines[40] = [0,0,0,0,0,etc]

#

and then

wicked hollow
#

that approach would be something like: ```c
bool connected_to_right_neighbor[5][4] = {};
bool connected_to_below_neighbor[4][5] = {};

jovial island
#

if (mouseClick1 = (point1) and mouseClick2 = (point2)) { drawline(point1,point2); set corresponding line that was made to 1;

#

smth like that?

#

o

#

is that a multidimentional bool?

#

thats a thing?

wicked hollow
#

sure - you can make arrays of anything; why not bool?

jovial island
#

ohh true

wicked hollow
#

if you really want to do it with N 2-dimensional arrays like you're doing, I'd just use a 3 dimensional array instead.

int lines[][3][2] = {
    {{0,1}, {2,3}, {0,0}},
    ...,
};
#

then instead of line1 you'd use lines[0], etc

#

and that's able to be looped over with just a regular for loop at that point.

jovial island
#

OHHH

#

so if you have a 3d one

#

then you can just loop through the 2d arrays

wicked hollow
#

yep.

jovial island
#

why didnt i think of that

#

i will try that

#

thank you for the help!

#

okay but first what you had up there seemed a lot cleaner

#

how does that work

#

why are you using 5,4 and 4,5

wicked hollow
#

I don't have to, I could use 5,5 for both - but only 4 points on each line have a right neighbor (the 5th of the 5 points on the line has nothing to the right of it)

#

likewise, only 4 points on each column have a below neighbor

jovial island
#

but how would you use that

#

sorry

wicked hollow
#

between those two arrays, they tell you whether each of the possible 40 line segments have been drawn

#

you could make it an array of int instead of bool and store which player drew that line segment, too - 0 means no one, 1 means player 1, 2 means player 2, or whatever

jovial island
#

ohhhhh

#

wait shouldnt the second array also be 5,4

#

or am i understanding this wrong

#

@wicked hollow

wicked hollow
#

no - the first one is 5 rows, each of which has 4 columns on which there is a right neighbor to which you can connect.

#

the second one is 4 rows, each of which has 5 columns on which there is a below neighbor to which you can connect

#

@jovial island

jovial island
#

oh okay

jovial island
#

box

wicked hollow
#

is a box a single cell, meaning they've got a line from (row, col) to (row, col + 1) and to (row + 1, col) and one from (row, col + 1) to (row + 1, col + 1), and one from (row + 1, col) to (row + 1, col + 1)?

#

in other words, in your 5x5 map, are there exactly 16 boxes?

jovial island
#

yea

#

and each box share a line with at least two other boxes

wicked hollow
#

then you could go with int box_claimed_by_player[4][4], and put a 0 in a cell if no one has claimed that box yet, and a 1 if player 1 has claimed it, and a 2 if player 2 has claimed it

#

and each time a player puts down a line segment of length 1, it could complete up to 2 boxes (a horizontal line could complete the box above or below it, a vertical line could complete the box left or right of it), so you check each of those two boxes to see if they're done now, and if so you record that the player claimed that box

jovial island
#

so besides recording if they are done or not, would i see if they are done or not by looking at the [5][4] and [4][5] array

#

or is there a better solution

wicked hollow
#

that's how I'd do it - each time a line was put down, figure out the one-or-two boxes it could have completed, and then check the [5][4] array and the [4][5] array to see if each of those 1 or 2 boxes are done now.

radiant socket
#

need to update this otn to f1re's current discord name lol

#

hey wait, your name is the same as f1re's name

jade bolt
#

dpet 3d

#

probably shouldn't be named dpet. i don't have any better names tho

#

making animations should be quite fun

fleet bane
digital bane
#

Looks lol ..a strange

ionic flax
#

What????????

dusky cliff
#

so hard to take something seriously when it says "create an advanced code"

fleet bane
jovial island
#

I would like one (1) advanced code please and thank you

fleet bane
#

Who hired this person

jade bolt
#

i did

fleet bane
#

like actually

#

that is so low effort

dusky cliff
#

tfw

fleet bane
#

thats the class I am taking

#

and the screenshot is the instuctions for final project

digital bane
#

Oh my advanced code in BASIC for irony

dusky cliff
#

hah

jovial island
#

anyway yeah that's a bullshit assignment

#

so uh... up theirs I guess

fleet bane
#

Im not going to do it

#

Its impossible

jovial island
#

which school is hosting this clown shit lmao

fleet bane
#

cant tell

#

it would reveal my location

dusky cliff
#

ok but what if the due date is 1st october and not 10th january

jovial island
#

that's actually something that I would put together as a cheap joke

jovial island
jovial island
fleet bane
#

learned that the hard way

dusky cliff
#

day before month makes it 1st october

#

👀

jovial island
#

Isn't that a standard thing in most of the world except the US?

dusky cliff
#

yes

jovial island
#

damn americans

fleet bane
#

indeed

#

the problem is my parents expect me to do it

#

on time

digital bane
#

Lol

fleet bane
#

It was assigned on Friday

dusky cliff
#

what about your classmates

jovial island
#

just hit them with the classic```py
def predict_groot_speech():
return "I am Groot."

dusky cliff
#

LMAO

fleet bane
digital bane
#

Then we are groot

frigid pollen
#

Maybe you could ask in #data-science-and-ml. They might know of some quick and easy toys you could make that technically satisfy the requirements.

fleet bane
#

It was literally assigned yesterday

odd sphinx
#

make code to generate a 1000 if statements

#

ez

jovial island
#

Not to mention that creating a program to predict the actions of a real person seems comically unethical

fleet bane
#

perhaps she works for the government

frigid pollen
#

Depends on how you interpret it.

fleet bane
#

I dont know what to tel you

jade tendon
#

create a giant list of common phrases, then just have a thing that chooses a random phrase, throw some random tensorflow stuff in there that does something completely irrelevant, and stretch some useless piece of code over the remaining hundreds of lines of code

#

/j

fleet bane
#

then it wouldnt have ai

#

so i would fail and get 0

jade tendon
#

adding some random tensorflow stuff would mean it technically has ai

fleet bane
#

wtf is tensorflow

frigid pollen
#

For example, imagine a computer vision thing where it watches you wave around a pingpong ball on a stick. It's mathy, but curve prediction is a thing. Not something I'd recommend to a beginner at any rate.

fleet bane
#

I started python 3 months ago

ionic flax
glossy frost
#

There's something very off going on here.

fleet bane
glossy frost
#

You got the assignment Friday, and were asked to deliver by Monday 1000 lines of code?

glossy frost
#

professional developers might write 1000 good lines of code per month

fleet bane
#

dont know what to tell you

jade tendon
#

This Juliana person is not doing their job right

glossy frost
#

not per weekend. and not after 3mo of learning

fleet bane
#

how do you know her name????

glossy frost
#

Are you in HS ?

jade tendon
#

the screenshot

fleet bane
#

thought I cut it off

#

oh well

glossy frost
#

Wait, so like 9th grade? aka 14yo ish ?

fleet bane
#

this is beginners intro to python in 9th grade

glossy frost
#

Yeah, that's BS. Take this to your parents kick them in the ass and tell them to go to the school and protest.

fleet bane
#

I tried

#

they were not happy

glossy frost
#

with you, or the school?>

fleet bane
#

they expect me to get straight As no matter what

fleet bane
frigid pollen
#

Why doesn't she have you solving something easier? P vs NP, for example.

fleet bane
#

they said I must not have paid attention during the previous classes

odd sphinx
#

ol

fleet bane
#

but I can show them the homework

glossy frost
#

because as someone that has a 15yo in school, who I expect to get straight a's in school, I would be pissed if a teacher gave that assignment

fleet bane
#

it was literally simple stuff like if else

jovial island
#

lmfao

jovial island
fleet bane
#

then she hit us with this

#

and I almost passed out

ionic flax
fleet bane
#

She was like "I shared a doc with you all with the instructions for the final project. Open it now and you can have the last 5 minutes to get started"

frigid pollen
#

Implement using an existing framework?

ionic flax
#

Ur teacher is crazy lmao

fleet bane
austere oak
#

She might have made a mistake or something

fleet bane
#

no

#

I already emailed her

ionic flax
#

Now how u gonna do

wicked hollow
#

and what did she respond with?

frigid pollen
#

"But Miss, it's not April."

ionic flax
#

Copy other people code?

fleet bane
fleet bane
#

they are accepting the F in the class

#

it is worth 35% of final grade

ionic flax
fleet bane
#

?

austere oak
#

Just write some bullshit and maybe she’ll pass you for submitting anything at all

jade tendon
#

write some random statement generator, hide it somewhere in a mess of tensorflow stuff, and hope for the best

austere oak
#

I know

fleet bane
#

you fulfill all the requirements perfectly or you fail

jade tendon
#

just a big list of things people would say

#

maybe make it in some weird way so she doesn't see

fleet bane
jovial island
austere oak
#

Well it’s ultimately her decision what score to give you, so she might just be lazy and pass you for submitting anything

#

Also the requirements are really vague

fleet bane
#

except for the fact that it must respond to questions and statements like the person would in real life

jovial island
#

Claim that such a program is impossible due to the existence of free will lmfao

jade tendon
#

I can dm you some random code in tensorflow that I just copy/paste from stackoverflow and change things around until it doesn't have errors

#

maybe

jovial island
fleet bane
#

print("Function is not possible because of free will")

austere oak
#

Also don’t a teacher’s bosses look into things if they end up failing all or almost all of their class? AND the students are saying they were giving an inappropriate assignment

frigid pollen
#

I'll come back around to narrowing the field of play. The assignment is meant to create something that acts like a person. Acts like them doing what? What about playing a game? What move is a given person most likely to make given the state of the game? Statistics. Then just choose the most likely move or near to.

glossy frost
#

Are your parents like computer illiterate?

wicked hollow
# fleet bane thats what Im doing

Make a program that simulates your future decisions. Whenever you ask it any question, have it say "I can't talk now, I'm working on an impossible assignment."

fleet bane
glossy frost
#

Like the teacher is a moron for assigning this to an intro class where 1/2 the kids can't even write tic tac toe. But wtf is up with your parents not having your back here.

wheat rock
ionic flax
fleet bane
austere oak
jovial island
#

welcome to clowntown USA 🤡🤡🤡

fleet bane
#

yeo

fleet bane
#

lol

wicked hollow
#

Best idea: Simulate yourself, and have it answer every question with "I'm too busy learning AI to talk right now." 😄

glossy frost
jovial island
#

Brilliant

ionic flax
#

I worked with dialogflow before

glossy frost
# fleet bane lol

Ok, so, given the parameters of your assignment here is what you should do:

fleet bane
#

I will just walk into the room and tell her that I made a tangble hologram while coding

glossy frost
#

You want your program to be able to take input, and deliver answers. No problem you can do that.

ionic flax
fleet bane
#

I'll convince her I am a hologram

odd sphinx
#

tf kind of assignment is that

jade tendon
#

Maybe you could just do a lot of if/else statements

glossy frost
#

You want it to "learn" Ok, no problem have it remember answers to questions. and use them.

odd sphinx
#

ok how about this

glossy frost
#

Don't worry about what machine learning is.

odd sphinx
#

put ur phone in a box

jovial island
glossy frost
#

worry about what a machine learning is.

fleet bane
#

I will submit google

odd sphinx
#

and change the hey Siri/google wake word

#

to ur own bots name

fleet bane
#

I will open a new tab on my pc and hand it in

frigid pollen
odd sphinx
#

and ask ur teacher to talk to the boz

fleet bane
odd sphinx
#

ez A+

fleet bane
#

I'll hand in an echo dot

odd sphinx
#

lol

ionic flax
odd sphinx
#

yes

fleet bane
#

thanks guys

#

im out

#

so many good ideas

dusky cliff
wicked hollow
#

ooh, easy peasy: Simulate Kanye West. Whenever someone says anything to the bot, he responds with "I'ma let you finish, but " and then says some random nonsense

dusky cliff
#

ahhahahahhaha

odd sphinx
#

lol

glossy frost
#

1000 if statements.

if input() == "do you like fish":
    print (answers['do you like fish'])
odd sphinx
#

also works

glossy frost
#

if question is unknown say " I don't know, what is the answer', and them store the answer for when they ask again.

jade tendon
#

you only need about 500 if statements for 1000 lines in that case

glossy frost
#

and if that is not sufficient take it to the dean, headmaster, principle, local super hero, or whatever god king is lying around.

jade tendon
#

but better safe than sorry

wheat rock
#

well there's a python chatt bot module

odd sphinx
#

advanced code

#

lmaoo

#

nope

ionic flax
# odd sphinx yes

I made an ai bot for a project once ago and it's requirements was reply a info for each message passed through dialogflow so I did this

Receive request from dialogflow with a webhook and pass it to a Google search Api then push the first results return back to it

wheat rock
#

!pypi ChatterBot

clever salmonBOT
wheat rock
#

give it some text , it will come up with some reply

#

1% accuracy btw

odd sphinx
#

lol

#

good enough

glossy frost
#

Fundamentally, if you do this project correctly: it's under 100 lines, if you do it badly it's over 1000 lines.

jade tendon
#

You could probably just include that package, and then just write some random nonsense for the remaining lines

glossy frost
#

What's your dad's phone number, let me give him a call and tell him he's an idiot.

#

🙂

#

Sure that would go over well.

ionic flax
frigid pollen
#

Some people have no business teaching coding.

wicked hollow
#

Does the phrase "markov chain" ring any bells? 3 months of learning Python might be enough to create a markov chain generator that generates random text based on things someone has said in the past.

digital bane
#

Ah hal ...sorry teacher I cant do that

glossy frost
frigid pollen
#

Predicting behaviour in real time, though?

#

Come on.

glossy frost
#

over a single weekend with no help from the teacher?

ionic flax
#

Well I learned python myself and I hate when people handle me impossible assignment. P.s I have thought of some impossible idea before

jade tendon
#

I mean, I'm thirteen, and I technically have created an AI before

#

But that assignment is just ridiculous

ionic flax
jade tendon
#

I've written too many discord bots

ionic flax
#

And I know how to setup gitea and nginx to reverse proxy

jade tendon
#

I figured out how to get SSL working on Apache, but it took a lot of pain and 45 minutes

wicked hollow
#

it'd be tough, but doable, I think.

#

probably easier than using an ML library

#

certainly easier, in fact

glossy frost
jade tendon
#

You could maybe just use fuzzywuzzy and get the closest result of the input with a set string and respond with the answer to that string and it would be good enough

ionic flax
glossy frost
wicked hollow
#

yeah. it feels like a tonedeaf joke on the teacher's part to me.

glossy frost
ionic flax
#

Lmao

odd sphinx
#

just use the phone in the box trick

#

or the echo in the box

jovial island
#

@wicked hollow have you used sfml before

blissful coral
#

if one really wants to build a simple chatbot using no Machine Learning/DL then they can still use quite many tricks

#

otherwise its still quite possible to use DL for a medium-level chatbot - the problem is that you won't understand any of it atm; but would still get the job done 🤷‍♂️

brazen jacinth
#

Hey

#

Heyoooò

rare moat
#

Universities offered themselves to be a place of learning where most resources are, in terms of many fields like medicine etc unis aren’t exam. But for programming it is
like Aboo said, YouTube can be a great place to learn, but how people learn varies from person to person.

languid osprey
#

^

brazen jacinth
languid osprey
#

Also, are you speaking from any experience?

rare moat
#

some people actively excel in a school environment where there is a knowledgable instructor there to guide you.

#

does everyone? no. i do not, but i am not everyone.

runic veldt
#

Whilst degree is a certificate of what you learnt. Many top companies are now understand that what universities offer is obsolete. In terms of computer science, You can learn most of the stuff from YouTube. And if you are talking about learning from a person lol Universities is the worst there’s bloody 300 students in a classroom with one lecturer give a lecture for 2-3 hours

brazen jacinth
#

If you expect to get a job by programming, you probably need a degree which you won't get from. Yt

languid osprey
daring jay
#

Whether unis are a scam are not, going to one is still pretty damn useful for Comp Sci jobs

languid osprey
#

I have a few friends that learn very well in a structured school environment

rare moat
#

i am the last person who will be defending the school system trust me haha.

languid osprey
#

Youtube isn't my go-to for programming tutorials either

runic veldt
#

On programming, most universities now offer a online based video where you can pace yourself and learn. And many students prefer that and so if you look at that from majority point of view universities are essentially scam for computer science, you are basically paying in the UK £27k for a certificate and most of the knowledge can be learnt online and even far better knowledge

rare moat
#

yeah.

wicked hollow
sturdy moon
#

I think it also depends on where you live, where I live it's very hard to get a job without a degree,there is always a minimum education

brazen jacinth
languid osprey
rare moat
#

well i mean, getting a degree and actually learning something are not necessarily going to happen at the same time.

languid osprey
#

Like I said above, it really depends on what environment you'll personally learn better in

wicked hollow
runic veldt
# languid osprey what experience are you speaking from?

The fact that my brother does Computer Science and Maths at a top university here and I can see his modules. The maths modules are actually good so my point stands that anything with maths, medicine and research universities are really good. But for programming it’s basically a scam considering his modules

rare moat
languid osprey
daring jay
#

Whether the content is good or not, it's still pretty useful to go to university for (comp sci) job purposes

runic veldt
languid osprey
#

And theres nothing inherently wrong with that

runic veldt
#

I understand it if it’s a small class

rare moat
#

implying you cannot talk to the teacher after class.

runic veldt
#

And I’d prefer that too if ‘twas small class say 20-30 people

abstract tapir
languid osprey
runic veldt
#

Like hell you can’t tell me you will focus for more than 1 hour the lecturer keeps on talking this is why most Unis provides a online platform where you can view the lecture lol

#

And pace yourself

brazen jacinth
wicked hollow
languid osprey
#

I have a friend that learned absolutely nothing with a few months of being self-taught, I on the other hand self-learned the majority of my current programming knowledge, it falls down to how you absorb information

rare moat
#

this is true

runic veldt
#

Universities are essentially scam and most companies are now starting to realise. Heck people are getting top class programming jobs by learning algorithms etc and completing online modules like on EdX

languid osprey
abstract tapir
abstract tapir
runic veldt
rare moat
#

i think we are just starting to repeat ourselves. @languid osprey

runic veldt
#

This is why in a small class you tend to have a little break after 50 minutes

abstract tapir
#

But hell, university is expensive here

languid osprey
#

conversation seems to be going in a circle, yes

brazen jacinth
abstract tapir
languid osprey
#

unis may be expensive, yes, but you can't deny that a degree is useful

sturdy moon
runic veldt
#

Universities are hella expensive and considering the knowledge they put out it’s a scam. They should offer something greater

languid osprey
#

cs50 is a college course, and its good

runic veldt
abstract tapir
languid osprey
runic veldt
languid osprey
#

Its not like college doesn't give you experience

hollow heart
#

uni is a pipeline, take advantage, or don't shrug

runic veldt
wicked hollow
#

regardless of whether you could learn the material without going to uni, the fact of the matter is that having the degree will open doors that you will not be able to open without it.

runic veldt
#

Not saying you can’t

languid osprey
#

We have people that are in college in this server

brazen jacinth
abstract tapir
languid osprey
#

People aren't going to stop going to college, whether its a "scam" or not

wicked hollow
#

I'm 36. We've got people of all ages.

abstract tapir
languid osprey
#

indeed

runic veldt
languid osprey
digital bane
abstract tapir
runic veldt
rare moat
#

when you get absorbed by a university.

brazen jacinth
languid osprey
wicked hollow
runic veldt
#

People are going into debt by paying for the degree lol

digital bane
#

Get a degree

#

Any

languid osprey
abstract tapir
rare moat
runic veldt
languid osprey
#

My point is that a degree is useful, whether its going to put you in debt or not

hollow heart
#

your total life earnings will be greatly affected by your earnings in the first few years of your career

runic veldt
#

Like heck people get a degree from law and move to programming

languid osprey
#

Sure, why not

runic veldt
#

So what was the point of the law degree you just wasted your money

brazen jacinth
languid osprey
hollow heart
#

i also know plenty of experienced people with industry knowledge and experience that have been hindered from climbing up the ladder bc they never finished their degrees

rare moat
wicked hollow
# runic veldt And you pay how much for that degree?

in the US, a CS degree will cost you somewhere between $60k and $120k on average, depending on the college. Entry level software developers command salaries of around $100k per year. Most people I know who graduated with CS degrees paid off their loans within 3 years.

runic veldt
digital bane
runic veldt
#

Then lol

brazen jacinth
hollow heart
languid osprey
#

its the degree part thats important

abstract tapir
languid osprey
#

you can't deny that a degree is useful :P

runic veldt
sturdy moon
#

You can think of a degree as your way to land a job

digital bane
#

Its useful as a baseline

runic veldt
#

Then why need a degree in cs?

languid osprey
rare moat
#

cannot get a degree if you do not get one. galaxybrain

hollow heart
languid osprey
#

Also, you can't say that all college programming courses are bad