#ot2-the-original-pubsta

652 messages · Page 90 of 1

civic wharf
#

ȵice

echo fern
#

same, how else should it?

dusky cliff
#

idk

#

looks more like a circle than a curl

civic wharf
#

definitely is a whole circle

echo fern
#

a circle has constant curl, yes

civic wharf
#

only 14 characters blessed with curl/circle

dusky cliff
#

hmm i think its supposed to be

civic wharf
#

13 if you don't count "PAGE' as a letter

#

maybe Dutch

lapis plinth
#

i love it when google drive tells me that my own python script is a virus

jovial island
#

!server pithink

clever salmonBOT
#
Server Information

Created: <t:1483877013:R>
Voice region: europe
Roles: 91
Member status: status_online 51,023 status_offline 218,500

Members: 269,523

Helpers: 130
Moderation Team: 31
Admins: 15
Owners: 3
Contributors: 45
Leads: 13

Channels: 231

Category: 30
News: 8
Staff: 69
Stage_Voice: 2
Text: 112
Voice: 10

fluid plank
hollow heart
#

cute

fluid plank
#

yes

#

🥺

#

new artist so good 🥺

hollow heart
gritty current
#

photons not fotons

fluid plank
#

futons

gritty current
#

||fuck||ons

jovial island
#

It is almost Halloween!

gritty current
#

woo!

jovial island
#

Is Sir Lancebot always online or something??

#

Oh, it runs on the server huh

#

Your computer's gonna burn if you run it 24 hours.

#

-a day

remote cave
gritty current
jovial island
wheat rock
#

my ot does not exi- 😔

jovial island
#

You can be orea

rotund python
#

Terrific. Golang devs live without try catch exceptions

#

their code is full of verbose error catching after every action, all the errors are returned in tuples as secondary func output!

#

They have idioms to fight it though

wheat rock
worldly harness
rotund python
worldly harness
#

we do have panic and recover tho, but the go creators purposely didnt want people to use it (avoid it at least)

rotund python
#

it looks just more readable

#

in golang case I guess we have a choice only to allign the happy path at the left to reach something similar

worldly harness
#

in languages with try / catch patterns, the error handling part would happen at the very end, meaning you can put more than one pieces of code that may error out and catch it at once. it does look more readable, whereas in go you'd have to check if errors at every step. in python:

try:
    return_value = job()
    return_value2 = job2(return_value)
except JobError as e:
    handle_error(e)

and go:

returnValue, err := job()
if err != nil { handleError(err) }
returnValue2, err := job2(returnValue)
if err != nil { handleError(err) }

however, it makes it easier to ignore errors. in python:

try:
    return_value = job()
except:
    pass

in go:

returnValue, _ := job()
rotund python
#
try:
    return_value = job()
except:
    pass

and to ignore even language syntax errors

#

that's why it is the biggest anti pattern #1 ;b

worldly harness
#

right, in that case it just doesn't make sense. why would one want to ignore a syntax error unless they're using eval on arbitrary input

#

but that would only happen in interpreted languages

rotund python
#

anyway, if you want to ignore specific error (which we always want being specific), python offers... readable and compact alternative, although even here you could try to ignore everything with pointing to suppress Exception

#
from contextlib import suppress

with suppress(FileNotFoundError):
    os.remove('somefile.tmp')
worldly harness
# rotund python anyway, if you want to ignore specific error (which we always want being specifi...

however, it makes it less readable if we're handling an error specific to a job when we have multiple things to do:

try:
    one()
    two()
    three()
except OneError:
    pass
except TwoError:
    pass
except ThreeError:
    pass

in the above case it's more readable to handle the error after each job, but that would just be the same as go

try:
    one()
except OneError:
    pass

try:
    two()
except TwoError:
    pass
# etc
err := one()
if err != nil {}
err := two()
if err != nil {}
err := three()
if err != nil {}
dusky cliff
#
from contextlib import suppress

suppress(BaseException).__enter__()
# full code
suppress(BaseException).__exit__()

🧠

dusky cliff
#

lmao

rotund python
worldly harness
#

err != nil does just that, you can also err == package.SomeError || err == package.OtherError. but your code is only if we're handling those errors together

dusky cliff
#

i think in rust you return a Result enum variant which can be either Ok or Err and then you have to pattern match against that

worldly harness
worldly harness
dusky cliff
#

wdym

worldly harness
#

nvm maybe it's another language

dusky cliff
#

so you can either return Results or you can panic!

rotund python
#

I like using just assert in python

assert Something == WithSomething
#

always available ;b and verbose enough to find the problem

tranquil ridge
#

Rust has assert macros too

#

assert! asserteq! thinkmon

fluid plank
tranquil ridge
#

vinam == void* for now

fluid plank
wheat rock
#

so we can catch the exception directly from the enum :pog:

fluid plank
#

yes

#

imma have to fork rust to introduce type Null

#

and get bashed

#

😔

wheat rock
#

lol

worldly harness
rotund python
#

everything begins and ends with testing

#

I went even further, my coding begins with building CI/CD pipeline

worldly harness
#

TDD isn't always that good

tranquil ridge
#

Imagine

#

I have never used TDD

rotund python
#

I am not exactly following TDD to... all specifications
but still, it has quite great point. Build your software with testing in mind in advance

#

I start with writing infrastructure code, building the pipeline
packing my application to containers, running unit and integration tests

#

it is all just makes better final product and allows me to have less strain on remembering how to deploy things (because everything is automated)

dusky cliff
#

damn

wild sluice
#

hey

dusky cliff
#

hello

river rampart
#

hey

fluid plank
#

but usually it is mostly used because it fits to almost anything

#

if for example your project cant be checked through tests alone, then probably you need to choose BDD

worldly harness
fluid plank
#

im drinking coffee and it tastes good

rotund python
fluid plank
#

the right tools for the right job is usually the go to choice unless you wanna live on the edge

rotund python
#

DevOps is really fresh, it is already living on the edge

#

among its instruments is certain competion, which will win

worldly harness
fluid plank
#

there is also MLOps which i am interested to learn. i dont have time though. school succs

rotund python
#

for example among Configuration Management tools, I like Ansible pretty much. in comparison to other similar tools, it wins really strongly IMO because it is agentless and decentralized-serverless.

fluid plank
# worldly harness behaviour driven? how does that improve upon tdd?

it covers and borrows the principles of TDD
https://en.m.wikipedia.org/wiki/Behavior-driven_development

i still wonder why my teacher on highschool mentioned this kind of things. 🤔 probably because he expects some of us will learn programming in the future which I did. Still noob though lol

In software engineering, behavior-driven development (BDD) is an agile software development process that encourages collaboration among developers, quality assurance testers, and customer representatives in a software project. It encourages teams to use conversation and concrete examples to formalize a shared understanding of how the application...

#

Oh well. i havent finished my coffee yet.

worldly harness
#

it looks to me like TDD plus natural language, user behaviour and... more descriptive I guess

fluid plank
#

It is like TDD is the dough of the pizza and the other things are the toppings

sinful sun
#

Speaking of tests

#

Does anyone know of a gui project with testing done

#

I got one at work and i dont even know how to start testing tkinter shit

pliant trench
#

That's why I don't like to write tests >:(
Sometimes it's impossible to implement tests

fluid plank
#

because sometimes there is no need to test it and let the users tell u there is an issue

#

dunno. just my observations on some stuff like window managers

wide totem
sinful sun
jovial island
#

Would it be disrespectful/weird to wear a shirt that says ‘Captain’ to MEPS? 🤔

jovial island
#

will someone join my server and leave?

sinful sun
#

no

jade bolt
#

yeah, that is 200% advertising

jovial island
#
import discord
from discord.ext import commands

intents = discord.Intents.default()
intents.typing = False
intents.presences = False

TOKEN = open('token.txt', 'r').read()

bot = commands.Bot(command_prefix="lk!", intents=intents)

@bot.event
async def on_ready():
    print('Loki In Charge as @{0.user}'.format(bot))

@bot.command(name="hello")
async def embedm(ctx: commands.Context):
    embed = discord.Embed(color=0x00ff00)
    embed.title = "Hello!" 
    embed.description = f'{ctx.author.mention},Ok! Maybe Boy or girl!'
    await ctx.send(embed=embed)
  
@bot.event
async def on_message(message):
    if message.content == "hello":
        await message.channel.send(f"Hey Man! Whats up?{message.author.mention}")
        await message.author.create_dm()
        await message.author.dm_channel.send(f'Hi {message.author.name}, Hope you are Fine!, Isnt? {message.author.mention}!')

    elif isinstance(message.channel, discord.channel.DMChannel) and message.author != bot.user:
        if message.content == "hello":
            embed = discord.Embed(color=0x00ff00)
            embed.title = "Hello!" 
            embed.description = f'{message.author.mention},Ok! Maybe Boy or girl!'
            await message.dm_channel.send(embed=embed) 
 
    await bot.process_commands(message)

@bot.event
async def on_member_join(member):
    await member.create_dm()
    await member.dm_channel.send(f'Hello {member.mention}!! Welcome to Our Discord Server!')
    await bot.process_commands(member)

bot.run(TOKEN)
#

seee

#

full code

#

@jade bolt

#

!e

clever salmonBOT
#
Command Help

!eval [code]
Can also use: e

*Run Python code and get the results.

This command supports multiple lines of code, including code wrapped inside a formatted code block. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.

We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!*

jovial island
#

!e

import discord
from discord.ext import commands

intents = discord.Intents.default()
intents.typing = False
intents.presences = False

TOKEN = open('token.txt', 'r').read()

bot = commands.Bot(command_prefix="lk!", intents=intents)

@bot.event
async def on_ready():
    print('Loki In Charge as @{0.user}'.format(bot))

@bot.command(name="hello")
async def embedm(ctx: commands.Context):
    embed = discord.Embed(color=0x00ff00)
    embed.title = "Hello!" 
    embed.description = f'{ctx.author.mention},Ok! Maybe Boy or girl!'
    await ctx.send(embed=embed)
  
@bot.event
async def on_message(message):
    if message.content == "hello":
        await message.channel.send(f"Hey Man! Whats up?{message.author.mention}")
        await message.author.create_dm()
        await message.author.dm_channel.send(f'Hi {message.author.name}, Hope you are Fine!, Isnt? {message.author.mention}!')

    elif isinstance(message.channel, discord.channel.DMChannel) and message.author != bot.user:
        if message.content == "hello":
            embed = discord.Embed(color=0x00ff00)
            embed.title = "Hello!" 
            embed.description = f'{message.author.mention},Ok! Maybe Boy or girl!'
            await message.dm_channel.send(embed=embed) 
 
    await bot.process_commands(message)

@bot.event
async def on_member_join(member):
    await member.create_dm()
    await member.dm_channel.send(f'Hello {member.mention}!! Welcome to Our Discord Server!')
    await bot.process_commands(member)

bot.run(TOKEN)
clever salmonBOT
#

@jovial island :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | ModuleNotFoundError: No module named 'discord'
jovial island
#

!e
import os

clever salmonBOT
#

@jovial island :warning: Your eval job has completed with return code 0.

[No output]
sinful sun
#

my guy what

#

#bot-commands

worldly harness
slow valve
#

ah yes

hazy laurel
#

well, this is depressing... Apparently I've only been in this server for a day lemon_angrysad

#

!user

clever salmonBOT
#

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

hazy laurel
#

youch

grim seal
#

don't think so

worldly harness
#

"language apart from go" lmao

wild python
#

I just put a 100ms sleep in a program so that things happen in the right order... I feel dirty

worldly harness
wild python
#

not really - it's a gtk application and there's probably some kind of timer in another thread. it's not my program and the other threads appear to be blocked/idle while the main thread sleeps, but clearly do something in those 100ms

tawdry fog
#

First time I've disliked python a lot was just now...

#

I just printed 14 pages accidentally because instead of typing console.log(first_elem) I typed print(first_elem)

median blade
#

lol

daring jay
#

print() does actual printing in JS? That's pretty funny.

#

also, please indent your code

#

No one likes to read code that isn't

foggy flicker
#

never knew about print in node

#

wait

#

thats not node

#

sad

jovial island
#

I was once so fucking confused that what the fuck is happening

dusky cliff
#

F

tawdry fog
#

Yes, that's what I was saying, I'm teaching myself js and from instinct from coding in python for so long instead of typing console.log I typed print thus printing out the pages.

royal topaz
#

hello guys

#

I am coding this event input leaderboard thing

#

and I am stuck at the moment, using python

#

is anyone down to help

carmine herald
#

i think its just how the lemonsona works

tranquil ridge
#

because it does

echo flower
#

as in physical paper?

#

oof

tawdry fog
jovial island
#

We added that cause lemon had a beard

#

Has*

dim root
#

a big beard

radiant socket
#

@plain granite

plain granite
wheat aurora
radiant socket
formal basin
#

a char is a size of integer and you can convert (in some cases lossily)
a string (c calls it a char *) is a collection and you cannot convert

plain granite
#

it's just coercion lol

radiant socket
#

char in rust is not an int type

plain granite
#

you get the idea

formal basin
#

Doesn't rust use u8?

plain granite
#

substitute it with other types if you wish

#

the syntax wouldn't compile on rust anyways lmao

radiant socket
#

yeah, but you can't add it to u8, you have to cast it

plain granite
#

it's just an example

#

i bet there's types in rust you can coerce

radiant socket
#

such as? i can't think of any

formal basin
#

"char" in rust is not equivalent to the concept of "char" in other languages

#

Char typically refers to a byte, but in rust it's a unicode scalar.

#

The equivalent type in Rust would be u8, not char

radiant socket
#

i think it's a unicode scalar, but i'm just nitpicking

plain granite
#

ok, i guess rust is an exception, but other languages work like that

formal basin
radiant socket
#

that's because their char type is basically just a reskinned u8

plain granite
radiant socket
#

well yeah. he basically said "you can pass a u8 into a function othat accepts a u8"

plain granite
#

ok, well java also has parameter coercion

radiant socket
#

does it?

plain granite
#

yeah

radiant socket
#

can you show me an example?

plain granite
#

so does C#

shrewd lance
#

C# does allow defining implicit conversions

#

Not sure about Java

#

Extending an int to a larger size and/or a float is walking on the border of "Yeah, it technically is a coercion, but come on" though

radiant socket
#

yeah, a lot do widening conversions like thata

plain granite
#
public class Main
{
    public static double coerce(double x) {
        return x;
    }
    
    public static void main(String[] args) {
        System.out.println(coerce(4));
    }
}
#

there

#

that's a working java example

#

don't judge my code 😭 i dont do java

dusky cliff
#

afaik java only allows coercion from char to int to float to double

plain granite
#

^there you go

shrewd lance
#

Yeah, that's what I'm talking about. Technically you'd call that a coercion, but it's really just... it's very, very far removed from coercing a string to an int

dusky cliff
#

oh, and the byte short long thingies too ig

shrewd lance
#

Oh, java also coerces to string on +

dusky cliff
#

oh right

shrewd lance
#

But yeah, these are the very basic conversions that are rarely problematic. Except for the string one, I prefer Python's approach

dusky cliff
#

it doesnt have a f-string equivalent so its handy 🤷

shrewd lance
#

Yeah fair

dusky cliff
#

i think c# has something like f-strings?

radiant socket
#

yeah it does

shrewd lance
#

Yeah, $ for interpolated string literals

plain granite
#
package main
import "fmt"

func coerce(x float32) float32 {
    return x;
}

func main() {
    fmt.Printf("%T\n",coerce(5))
}

here's one in go

shrewd lance
#

Again, it's the same

plain granite
#

@radiant socket as you can see it will compile on most languages

shrewd lance
#

Extending to a different numeric type is the most "ackchyually" coercion of all coercions

radiant socket
#

fair

#

but then again the original point was statically typed languages do more coercions in general, not just widening conversions of numbers

#

whatever ¯_(ツ)_/¯

plain granite
#

widening numbers are pretty much the essence of coercion

radiant socket
#

if you say so ¯_(ツ)_/¯

odd sphinx
#

wait

#

I don't understand why u have the same types for the return value and the parameter of that coerce function

#

isn't that useless

#

or is 4 not a double

#

right

#

so can't u do (double) 4

#

or 4.0

dusky cliff
#

the point was that ints get coerced to doubles implicitly

odd sphinx
#

oh

#

lol!

rain cave
#

@rugged portal 🥳

rugged portal
#

:)

#

Can't wait to play beamng mp

rain cave
#

Yeah sorry, I see if you wanna leave dude

rugged portal
#

It needs to download first

rain cave
#

Its my fault to have too many things on my plate so

#

ok then maybe we can finish this one?

rugged portal
#

i need to download 120 gb

#

So we got around 45 min

rain cave
#

fast internet!

#

ok lets go then while I got you here hehe

#

So we have the functions, but the one with average need to be N=28

#

and then we somehow need to get the results from different functions into a new function tabell(vaxthusgaserdata)

#

im clueless hehe

rugged portal
#

When is this due anyways?

rain cave
#

ehm

#

im ashamed to tell you xD

rugged portal
rain cave
#

tomorrow before lunch

rugged portal
#

how

#

on a saturday

rain cave
#

yepp xd

#

chaos

#

I've had so much in school so I really coudln't get to this before a couple days ago

#

and a bunch of things outside school happend so yeah

rugged portal
#

Could you repost the table structure>

#

?

rain cave
#

For sure

#

So im guessing its "just" to forst print the header, then the -----, then more headers, then info then ===

#

"just"

rugged portal
#

Judging on this we would need to find the longest string an make a table based off of that.

rain cave
#

I mean maybe we can make it look like a table using format?

rugged portal
#

idunno

#

no one does this manually

rain cave
#

oh maybe that's wrong then

#

i odn't know

#

I googled on how to make a table wihtout modules

#

But I think that's th eonly way

rugged portal
#

Is this good enough?

#

!e ```py
table_data = [
['a', 'b', 'c'],
['aaaaaaaaa', 'b', 'c'],
['a', 'bbbbbbbbbb', 'c']
]
for row in table_data:
print("{: >20} {: >20} {: >20}".format(*row))

clever salmonBOT
#

@rugged portal :white_check_mark: Your eval job has completed with return code 0.

001 |                    a                    b                    c
002 |            aaaaaaaaa                    b                    c
003 |                    a           bbbbbbbbbb                    c
rain cave
#

yeeah for sure!

#

and I can add the lines and stuff

#

and the header and center it somehow

rugged portal
#

Baby steps

rain cave
#

yeah sorry its just fun when its start making sense in my head

#

and you're damn good

rugged portal
#

so done ig

#
  Livsmedelsindustri                  936                  845
Metallindustri (exkl. jarn- och stal)                 1319                 1121
        Kemiindustri                 2103                 2022
Ovrig (gruvindustri travaruhandel m.m.)                 2710                 2402
Massa- och pappersindustri samt tryckerier                 2613                 2272
Raffinaderier samt distribution av olja och gas                 2206                 2333
Mineralindustri (exkl. metaller)                 3065                 2659
Jarn- och stalindustri                 5584                 5434
#

😂

rain cave
#

we need the years of min and max

#

and average of the entire row

#

hmmm

rugged portal
#

I got this so far

rain cave
#

dude!

#

that looks amazing!

#

just some lines and headers and its 10000% good

rugged portal
#

There are headers it's just that small lol

rain cave
#

Yeah but over that there's some text "Utsläppsnivåer av koldioxidekvivalenter (uttryckt i tusen ton) inom olika branscher under åren 1991 till 2018."

#

centered over the table

rugged portal
#

?

rain cave
#

in the screen shot

#

u can just paste in what I wrote in swedish heh

#

its that long text over the headers

rugged portal
#

naahhh your goood

rain cave
#

ok ok!

#

Looks super nice tho

rugged portal
rain cave
#

dude you're a geniuus

#

that is perfect

#

thanks man

rugged portal
#

You can also see it's sorted on avg price lol

rain cave
#

haha hooow are you so good

#

I need to know

rugged portal
#

covid, a pc and 6 months

rain cave
#

no way you learned this in 6 monhts? 😮

#

MENSA member?

rugged portal
#

I started python 6 months ago but i already coded some things in PHP

rain cave
#

how old are you?

rugged portal
#

18

#

hbu?

rain cave
#

22!

#

damn dude, you have a super bright future

#

congrats!

rugged portal
#

i wished lol

rain cave
#

and youre nice too!

#

ofc you do!

rugged portal
#

Well maby not in coding since in our school we're forced to also study our own language.

#

And if you happen to suck at it you basically can't do any education :)

rain cave
#

whaat

#

but that's a great thing tho about this buissnies

#

you don't need a degree

#

make a good portfolio and you'll have job offers everywhere you look

#

I have a freind who taught himself coding, he works in copenhagen now and earns 5+k euros a month as his first job

#

no formal coding education

rugged portal
#

Oh btw i found some old code of mine from before i learned python

#
function firsterr(array $num, int $pr): int {
    $err = 0;
    for ($i = $pr; $i < count($num); $i++) {
        $encc = false;
        for ($j = $i - $pr; $j < $i; $j++) {
            for ($k = $i - $pr; $k < $i; $k++) {
                if ($num[$j] + $num[$k] == $num[$i]) {
                    $encc = true;
                    break;
                }
            }
            if ($encc) {
                break;
            }
        }
        if ($encc === false) {
            return $num[$i];
        }
    }
    return $err;
}
``` so don't feel too bad 😂
rain cave
#

hahah that looks crazy xD

rugged portal
#

Ah y know with me it clicked one day

rain cave
#

I hope that happens to me too!

rugged portal
#

You start learning about functions and objects and if your are busy with those you just learn alot

rain cave
#

yeah after this assignment i wanna learn "for real"

rugged portal
#

I recommend learning functions, objects and OOP

#
import csv

with open("./vaxthusgaserdata_3.csv", "r", newline='') as csv_file:
    csv_data = list(csv.reader(csv_file, delimiter=";"))

def func_max_min(input_list: list) -> tuple:
    min_val, max_val = input_list[0], input_list[0]
    min_year = csv_data[0][1:][0]
    max_year = csv_data[0][1:][0]

    for year, item in zip(csv_data[0][1:], input_list):
       if item > max_val:
           max_year = year
           max_val = item
       if item < min_val:
           min_year = year
           min_val = item

    return (min_val, max_val, min_year, max_year)

def avg_co2(input_list: list, N: int) -> list:
    def chunks(lst: list, n: int) -> list:
        for i in range(0, len(lst), n):
            yield lst[i:i + n]

    result = list(chunks(input_list, N))
    years = list(chunks(csv_data[0][1:], N))

    return ", ".join(
        [
            f"{sum(r) / len(r)} (avarage of years {'+'.join(year)})"
            for r, year
            in zip(result, years)
        ]
    )

headers = ["name", "min_val", "min_year", "max_val", "max_year", "Model 1991-2018 (avg)"]
print("{: >60} | {: >10} | {: >10} | {: >10} | {: >10} | {: >20}".format(*headers))

for row in csv_data[1:]:
    numbers = list(map(int, row[1:]))
    min_val, max_val, min_year, max_year = func_max_min(numbers)

    data = [row[0], min_val, min_year, max_val, max_year, avg_co2(numbers, 28).split(' ')[0].split('.')[0]]
    print("{: >60} | {: >10} | {: >10} | {: >10} | {: >10} | {: >20}".format(*data))
rain cave
#

thaaanks man

#

hmm

#

I get the avg before the name

#

but I think that a Jupyter issue cause the string looks right

rugged portal
#

wut?

rain cave
rugged portal
#

That is bcs your screen is too small lol

rain cave
#

yeah I figured xD

rugged portal
#

do ctrl+ -

#

I never use jupiter anyways i find it really weird.

rain cave
#

Yeah It doesn't make sense to me at all

#

that solved it! Thanks! ❤️

#

So dude, I hate, really hate to ask but... could you help me with one or two more depending on your download?

rugged portal
#

I did it in record time so.

rain cave
#

hahah yeah you could get a job today

#

promise

rugged portal
#

doubt

rain cave
#

Do you know plotting?

rugged portal
#

I'm a quick learner

rain cave
#

I can tell!

#

Yeah so next assignment is to take the CSV file and make a diagram

rugged portal
#

... do we need to use plotter for that?

rain cave
#

Look something liek this

#

plt thingt I think

rugged portal
#

Is this also due for tomorrow?

rain cave
#

The funciton name is plotta_data(vaxthusgaser)

#

Yes 😦

#

But If you don't want to do it

#

I ll leave it blank and I think I can squeeze out an extra few days

#

this hand in is to other students, then we can change a few things and then its the hand in for grading

rugged portal
#

Tbf this one is doable, you should look into it, it's not that late yet.

#

I think you could solve this one in an hour tops

rain cave
#

Yeah It looks super hard, I have never done any plotting or something

rugged portal
#

You basically need to pass the lists in the function object then print it to an img.

rain cave
#

If you can't help I will for sure try! But I have somethings with my family members I have to help them with tonight

rugged portal
#

There are tons of examples online.

rain cave
#

Yeah sounds easy when you write it like that haha

rugged portal
#

Haha, no but i've been coding since 9 am now so it's me time now :)

rain cave
#

Ok dude, Thanks for the help. Wanna answer my friend request? you seem nice, maybe we can play a game or something some day

#

no pressure

rain cave
#

I really appericiate your help so much, I can barely describe

rugged portal
#

Also if you deliver these results you will likely get some extra time..

rain cave
#

might ACTUALLY save my studies

rain cave
#

there's been things outside of school happening which I couldn't control really so

#

thanks man

rugged portal
#

Atleast i can help someone make their studies instead of my own😂

rain cave
#

I will see If I can make a try tonight. Otherwise Ill be in here again begging for help on sunday haha 🤣

rain cave
#

*after my hand in heh

rain cave
rugged portal
rugged portal
rain cave
rugged portal
#

Really? Huh weird.

rain cave
#

xD

#

Cya!

rugged portal
#

👋

gaunt jacinth
#

@grim seal i know i keep bothering you about this (sorry sad) but can you just confirm this is right? (if im hosting a web AND mail server on my network)

#

the mail bit is tripping me up

grim seal
#

uhhh

jovial island
#

Is that how MX works

grim seal
#

yeah that should be right

gaunt jacinth
grim seal
#

yes

#

it is

jovial island
#

What a weird record

grim seal
#

oh actually no

#

close, but it needs to point to an A record, not a CNAME

gaunt jacinth
#

oh

grim seal
#

NS and MX and a few others cannot point to CNAMES

jovial island
#

Okay, that's just stupid at that point

#

I can see why NS

#

But not why MX cannot point to a CNAME

gaunt jacinth
grim seal
gaunt jacinth
#

where the two blacked out ip's are the same

grim seal
#

it's because MX records should resolve backwards as well

gaunt jacinth
#

ah makes sense

hazy laurel
#

Does hiding the IP do anything? Isn't it public anyways

grim seal
#

a lot of email relies on being able to resolve a domain name from an IP, CNAME breaks that

#

I like it that way

jovial island
#

Isn't that what RDNS is for?

gaunt jacinth
#

it is, and currently it isnt even my ip so i dont know why im bothering lol

grim seal
jovial island
#

Well just make your RDNS return one record and not two?

gaunt jacinth
jovial island
#

Or is that a bad thing

grim seal
#

no, RDNS should only ever return 1 record

#

but which do you return

#

it's similar to the reasons why CNAMEs do not work at the root

#

if a CNAME RR is present at a label then no other record data should be present

#

and it also just isn't great to have mail servers recursive resolving to high heaven

jovial island
#

So how can RDNSing that IP can return two records

#

If RDNS is only ever supposed to return one

grim seal
#

well the IP will be valid for mail.whatever.com as well as whatever the CNAME points to

gaunt jacinth
#

it means you have to update the ip in both A records (mail/web) tho if it changes right?

grim seal
#

whereas for simplicity it should really be one, and the returned value should be a label, the label matters more than the IP in some scenarios for MX

#

yes you would need to update the A

gaunt jacinth
grim seal
#

eventually ALIAS RR might exist

#

and then that'd even work on the apex

#

expired in 2017 though

#

some DNS providers might implement it

#

it's basically a standard for CNAME flattening

#

and with that you could have an MX that points at an ALIAS

#

Authoritative name servers with support for ALIAS records MUST
support both A and AAAA materialization. When an authoritative name
server receives a request for a name, and the zone contains an ALIAS
record at that location, the authoritative name server MUST respond
as follows:

The server will respond with one or more A records (for a QTYPE A) or
one or more AAAA records (for a QTYPE AAAA) obtained by either: *
executing a recursive query for the ALIAS content or, * returning a
previously cached response.

If the recursive query returns an NXDOMAIN response, then the
authoritative name server MUST return an NXDOMAIN response as well.

#

it'd be nice to have a standardised ALIAS but no one desperately needs it

gaunt jacinth
grim seal
gaunt jacinth
#

many thanks 😄

#

now i gotta learn SMTP from scratch 🎉

grim seal
#

oof

#

that's a choice

#

if you actually want to use that domain for email in the future, don't learn SMTP on it

gaunt jacinth
#

wdym?

grim seal
#

if you start playing around with SMTP and don't get it fully right then email servers will blocklist your domain and IP

#

and it's almost impossible to rebuild that

#

get a burner domain and IP if you want to play with SMTP

gaunt jacinth
#

ive installed an SMTP server locally and am writing scripts that hopefully communicate with it to learn locally before expanding

#

so if i block my own IP i can just delete the entry

grim seal
#

if someone like Microsoft or Google block you then you can't use that domain anymore

gaunt jacinth
grim seal
#

just don't leak SMTP onto the public web

gaunt jacinth
#

ill try not too lol
and ill really try to not accidentally implement an email proxy for anyone to use (which ive heard is more common then i think)

grim seal
#

that's most smtp

#

to some extent it's the point lol

gaunt jacinth
#

cant i just proxy messages from my own custom email address ONLY
so noone but me can use it?

formal basin
#

yes, but you need proper authorization for that to work

gaunt jacinth
#

yeah that fine, i can make... something that will work

#

a public/private key perhaps

digital ledge
jovial island
#

Hey @lucid girder, pls rate my design

#

My game so far

upbeat sandal
jovial island
#

exactly!

ionic locust
#

What game is this?

jovial island
#

factorio

upbeat sandal
ionic locust
#

Thanks

lucid girder
#

factorio

clever salmonBOT
#

factorio

jovial island
#

fair

tawdry salmon
#

factorio

jovial island
#

it is already past midnight, dear god

#

I thought I played for like an hour max

#

I could watch trains all day long

#

Thank you 158

#

always more

upbeat sandal
pliant trench
slow valve
slow valve
fluid plank
#

cant relate

#

i guess i will buy it

jovial island
#

If it gets too hairy and I cannot kill them in time, I just do a artillery launch

#

It will destroy some of my buildings but I have drones, sooo

#

I wonder if there are death counts somewhere

#

Honestly I think the train damages are way too high

#

I have like three MK. II shields and the best armor and they still destroy me

slow valve
jovial island
#

60h of gameplay

slow valve
#

Lol use train to kill those bitters

quaint siren
jade bolt
#

nvm factorio

#

gotta check out

#

need to get rid of my genshin addiction

jade bolt
pliant trench
#

factocool

carmine herald
#

i like when games let me instate a dictatorship supremacy and then commit genocide
rimworld go brrrrrr

median blade
#

lesgo

jade bolt
#

i wish genshin gives me more freedom

#

i want to kill every npc

carmine herald
#

or u can get a bethesda game then quick save and murder everyone on the town then reload

fluid plank
#

elemental burst the heck out of them

jade bolt
#

who doesnt

#

i get an easy commission

fluid plank
#

me

jade bolt
#

for killing timmy's birds

fluid plank
#

i kill timmy himself

#

not the birds

jade bolt
#

and killing timmy's ducks

jade bolt
fluid plank
jade bolt
#

i tried to destroy/eat the food timmy's mom gave

#

but failed

fluid plank
#

okay im pretty sure im at the point of trolling again byebye

jade bolt
jade bolt
#

i killed timmy's son

fluid plank
#

at least we are not like the other trolls that really disrupt shit and become an annoyance to mods even to disrespect them lol

#

but imma head out. im reading an article and u dont wanna read what im reading

jade bolt
#

send me, bet

#

im reading weathering with you's novel because i have too much time to waste

fluid plank
jade bolt
#

k u win

full marlin
#

ooh virus rep

#

cool

ionic locust
median blade
fluid plank
#

i prefer the original format

#

otherwise it becomes unfaithful

median blade
pliant trench
#

this vadar one's great haha

carmine herald
#

what is this an image for ants?

fluid plank
#

goodnight zzz

carmine herald
#

imagine going to bed at 11am

#

weird

fluid plank
#

well maybe u. it is 12AM here

carmine herald
#

timezones are a myth

#

its 11am

fluid plank
carmine herald
#

most likely

fluid plank
#

my eyes are falling now

#

night

carmine herald
#

baii

real forum
dusky cliff
real forum
#

And what's the wrong time zone

dusky cliff
#

the one you live in

real forum
#

I don't live here

#

So

carmine herald
#

its 11am yall are buying into fake time made up by BIG TECH smh

real forum
#

Technically big tech made your time

#

Since Europe was first

#

But ok

carmine herald
#

no thats what BIG MEDIA wants you to believe

#

europe aint reak

#

look at briish food its like an alien tried to copy human culture and then came up with nonsense like WATER SANDWICH

odd sphinx
#

jellied eel

lusty brook
#

what is going on here 👀

tribal tinsel
odd sphinx
#

zucc hometown 😂

carmine herald
tribal tinsel
hazy laurel
#

lol

tribal tinsel
#

Yep. He's lying on a circular mat. Perfectly

hazy laurel
#

I remember reading that cats like to lay on contrasting objects

#

like things that stand out from what they're on top of

tribal tinsel
#

Well, he doesn't seem to mind being basically the same colour of the mat and the table

hazy laurel
#

lol

#

my cat always loves to lay on my mousepad

#

... while I'm using it

tribal tinsel
#

I have photos with the other cat in the box. But my nibling is also in the box, so I'm not gonna post it

hazy laurel
#

I'll send the shipping label

dusky cliff
hazy laurel
#

oh damn

#

I never thought of that

keen burrow
#

Perfect, it is already in the box. I'll DM you my address.

#

It is cuuute!

carmine herald
tribal tinsel
carmine herald
#

damn wake up sheeple, BIG CATTO is here

normal quartz
#

not longer

rotund python
#

<@&831776746206265384>

#

Spammer Scammer from this server

odd sphinx
#

bruh

royal lantern
shadow gate
#

lol even i got a similar message

carmine lance
#

Lmao it's the same freaking message 10000% selfbots

wide totem
frail steppe
#

Hey everybody

#

I'm new here!

crystal bramble
carmine lance
#

No, they clearly said that they are "new here" not "new" :^)

fluid plank
frail steppe
#

hehe

jade bolt
#

dont mistake me and them

worldly harness
#

hi new and new here!

jovial island
#

Happy Halloween

jovial island
tribal tinsel
carmine herald
normal quartz
tribal tinsel
#

Also, the longer thing was mainly to make the joke about big catto (after Starcy mentioned big tech/big pharma as jokes )

normal quartz
normal quartz
#

but I enjoy nitpicking

tribal tinsel
tribal tinsel
#

Hm, since when do I have 180 notifications...

#

157 from one server XDDD

#

And it's not a spam server!

#

Just a gdkp server, with over 15 channels for raids...

frigid pollen
#

@pliant trench [*zip(*matrix)] Try this on for size.

pliant trench
radiant socket
#

transpose 🎉

vague smelt
#

'CALL "C:\Program Files\nodejs\\node.exe" "C:\Program Files\nodejs\\node_modules\npm\bin\npm-cli.js" prefix -g' is not recognized as an internal or external command, operable program or batch file.

#

why does this happen when i run npm

jovial island
#

i think u should ask that in the node server

vague smelt
#

what node server?

jovial island
#

the discord one, cause this is for py only

real forum
jovial island
#

ah. mb i thought this was like general or something

#

cause discord is glitchy asf on linux

real forum
#

Np np

jade bolt
#

you will most likely have less issues in linux

vague smelt
#

why does that have anything to do with it

jade bolt
#

linux just fixes everything

#

i switched to wsl for everything

elfin vine
rare stratus
#

#bot-commands

sterile nymph
#

How far is checking crypto transactions to training a model for image recognition

mental idol
#

Mmmmm, feels good on a chill Sunday. vvSmug

radiant socket
#

how does one create a matrix with a kernel that has a basis {(2, 2, 1, 0), (3, 1, 0, 1)}

echo fern
#

let's choose (totally arbitrarily, in such a way as to simplify the matrix as much as possible) two other eigenvectors are (0,0,1,0) and (0,0,0,1), both with eigenvalue 1. Then:

A[:,3] = (0,0,0,1)
A[:,2] = (0,0,1,0)

so this choice gives us half the matrix already, and then we're left with:

A =
a00 a01 0 0
a10 a11 0 0
a20 a21 1 0
a30 a31 0 1

A (2, 2, 1, 0) = 0
A (3, 1, 0, 1) = 0

which we solve:

2a00+2a01 = 0 (from first)
3a00 + a01 = 0 (from second)
therefore a00=a01=0
Similarly a10 = a11 = 0
Third row is slightly different:
2a20+2a21+1 = 0 (from first)
3a20+a21=0 (from second)
therefore -4a20+1=0 => a20 = 1/4, a21 = -3/4
So is fourth row:
2a30+2a31 = 0
3a30+a31+1 = 0
-4a30-2=0 => a30 = -1/2, a31 = 1/2

So

A = 
0 0 0 0
0 0 0 0
1/4 -3/4 1 0
-1/2 1/2 0 1

fits the bill. We can multiply it by the two original vectors to see that we indeed get zeros.

#

@radiant socket

radiant socket
#

:O

hidden kernel
#

@sharp wyvern Can you change your profile pic?

copper tartan
#

love this otname

proper python
#

WOOOO WHO ARE THE LOSERS IN CHAT TONIGHT

jovial island
#

?

radiant socket
#

?

mental idol
#

@shadow plover - You made a comment in #python-discussion earlier that having all the automation tests written by devs runs the risk that the devs don't know the end-user experience like a QA team does. You're 100% correct and what my workplace is finding is that it isn't an excuse we accept anymore. The devs step up, level up, and consider not only how the code should work but how a user might use it.

Not easy, with plenty of struggle in the process. We're merging QA teams into dev teams to help break the silo's down and spread the knowledge. A year will show if we've learned anything rooHmm

shadow plover
#

u need ppl to use it in weird ways u cant think of and break it xD

dusky cliff
#

A QA engineer walks into a bar. Orders a beer. Orders 0 beers. Orders 99999999999 beers. Orders a lizard. Orders -1 beers. Orders a ueicbksjdhd.

First real customer walks in and asks where the bathroom is. The bar bursts into flames, killing everyone.

shadow plover
#

lmao

mental idol
#

My teams struggle to bring on new folks because "They just work on tier one". Oh boy does that get me on my soap box rooFight

#

JUST tier 1? My friends, those folks know more about how to use our systems than you do.

shadow plover
#

lul. so many bugs in my code were when something happened that i didnt think of.. which is why getting other brains to interact is importanto

mental idol
#

The Phoenix Project changed my mind on this humorous concept.

hazy laurel
#

hsp has a brain??

fluid plank
#

literally i can classify him as a slime

#

just poop

hazy laurel
#

that is an interesting thought I don't want to follow through with

fluid plank
#

hmm imma register his species

#

Slimus feceae

hazy laurel
#

that reminds me

#

apparently our state has a "state lizard"

#

the New Mexico Whiptail

fluid plank
#

yeah and?

hazy laurel
#

"Aspidoscelis neomexicanus"

#

I just thought the "neomexicanus" was funny lol

fluid plank
#

i find it fit for the theme of the species

#

since it is new mexico

hazy laurel
#

apparently it's comprised of only females

fluid plank
hazy laurel
#

The New Mexico whiptail (Aspidoscelis neomexicanus) is a female-only species of lizard found in the southwestern United States in New Mexico and Arizona, and in northern Mexico in Chihuahua. It is the official state reptile of New Mexico. It is one of many lizard species known to be parthenogenetic. Individuals of the species can be created eith...

hazy laurel
#

oh nah

fluid plank
#

rawr x3 pounces on you uwu u so warm

#

damn

#

makes me

#

giggly

hazy laurel
#

._.

fluid plank
fluid plank
#

mood

#

my other part of my brain slaps me too

hazy laurel
#

oh my. I updated pipewire-media-session

#

and my laptop audio seems so loud now

#

👀 GitHub Copilot works on CLion now

dusky cliff
#

hm

fluid plank
#

there is a lot of fixes

dusky cliff
#

it has been working in pycharm since i got it

fluid plank
#

i dont use github copilot

#

sad

hazy laurel
#

but now it works on all of them, I think

#

PyCharm was one that worked, along with I think WebStorm and IntelliJ

#

but now CLion and Rider work as well

#

dunno about GoLand or anything

dusky cliff
#

arent all jetbrains ides basically just intellij with different skins lol

hazy laurel
#

Apparently not

#

Well, I'd think they're more diverse than that

fluid plank
#

but

#

each IDE is specialized for it. it is not just a reskin

dusky cliff
fluid plank
hazy laurel
#

#000000

fluid plank
#

#ddddddd

dusky cliff
fluid plank
#

i have committed a sin again zzz

#

im fancy with light theme

carmine herald
wheat rock
#

git commit sin

fluid plank
dusky cliff
#

he isnt indian lol

dull ridge
#

oH

jovial island
#

And you find your parents and all the neighbor uncles and all the family folks on fblemon_angrysad

frigid pollen
#

@regal plume You almost have it. You need to call your analysis function and give it the array. You assign the return of that to your vars.

regal plume
#

but ITS NOT MAKING SENSE

#

i have analyzeValues(floatArray)

#

so my function is running

#

but how do i access the return

#

and put it o my variable

#

its not clicking

frigid pollen
#

a, b, c = analyzeValues(floatArray)

regal plume
#

OH

#

OH MY GOD

frigid pollen
#

Where a,b,c are the appropriately named vars

#

and the right number of them

#

and in the order you returned them

regal plume
#

yes

#

thank god

#

thank you so much

#

@frigid pollen i appreciate it so much, have a great night, enjoy your dinner

kindred bridge
fluid plank
#

?

#

how is indonesia a neighbor to pakistan

carmine herald
#

is it not

jade bolt
#

pakistan is a neighbor of indonesia, if you're comparing between sun and earth

fluid haven
fluid plank
#

probably a messed up sense of geography but okiee

carmine herald
#

is it a problem to not really know much about geography on the other side of the world? pithink

odd sphinx
#

yes

#

well

#

u gotta know a drop of something about the other side of the world at least

sinful sun
#

no, geography is irrelevant

#

why would i have to know about some country when they definitely dont know about mine

fluid plank
#

oooof

real forum
#

Why learn about it when you can literally just google it

sinful sun
#

bet you alpha centaurians dont know where earth is

fluid plank
real forum
fluid plank
#

probably

sinful sun
#

Americans should learn geography if they wanna play world cop so bad

sinful sun
#

You should know by now that everything i say is the unfiltered raw truth

fluid plank
#

unless

#

youre my dad

sinful sun
#

I can be both if need be

fluid plank
#

im a chimera

carmine herald
#

an advantage of not having a dad is that you can trigger conservatives over that

#

apparently believing in human rights and shit is a sign of lacking a dad, lol

sinful sun
#

What if i dont have a mom instead

#

Am i triggering libs now?

tribal tinsel
sinful sun
#

i'll adopt every one here whether they want it or not

real forum
carmine herald
real forum
#

You're old but not boomer old

#

Just like, gen X old

carmine herald
#

not really

real forum
#

K

carmine herald
#

i barely got to enjoy mj before paparazzi killed him

#

but hey i got to see nikocado kill himself slowly...
ok take me out of this timeline

real forum
#

Yeah...

jade bolt
#

ιτ τοοκ α λονγ τιμε φινδινγ τηισ ινοθτ μετηοδ ον γβοαρδ

#

:πενσιωε:

carmine herald
#

@real forum how many years do u even have left before ur out of touch and old too anyway lemon_smug

real forum
#

I will never be old

carmine herald
#

4?

real forum
#

I will always be hip

carmine herald
#

ok old lady

#

need help crossing the street?

jade bolt
tribal tinsel
carmine herald
tribal tinsel
#

No, one is irl friend which love of my life 'adopted', and the other is our common online friend whom I've been helping a lot and who was worried about it and I said 'at this point, you're already my kid'

carmine herald
#

mmm keds

tribal tinsel
#

They both are just slightly younger than me XD

pliant trench
#

Hmmmmm

hollow heart
#

idk if i'll be able to find the specific issue i got though

#

what were you using?

wheat aurora
#

I was using that as well

hollow heart
#

oo. and what was the error again?

wheat aurora
#

So I got two, one was a "-5: Unfinished Bytestream" or whatever, essentially the pdf was too big for the buffer. The other was the EOF marker missing

hidden kernel
#

i wrote a script with this several years ago and I think I got the bytestream error, but I don't remember how i fixed it

#

happy to help, any time

wheat aurora
#

I think I have to like manually decompress it and then extract it or something? I did not care enough last night to troubleshoot it

hollow heart
#

bc it was a final step for me i ended up continuing using pdftk to merge (not python)

wheat aurora
#

Context: my script takes many resumes (pdf and docx) and combines it into 1 big pdf for a sponsor. The combined pdf ended up being 547 pages without the handful of resumes missing, so I called it good enough. (Sponsors still get them all individually as well)

tribal tinsel
hollow heart
#

i'm trying to resurrect this script to see what my issue was lol

hollow heart
#

ok idk if this is the exact error i got last time, but i'm getting RecursionError: maximum recursion depth exceeded while calling a Python object when attempting to merge 1500 2 page pdf files

#

i guess i can change the recursion limit? but i don't think this is the error i got last time actually

jovial island
#

yo peoples social credits gone down

sinful sun
#

<@&831776746206265384>

#

go spam elsewhere

keen burrow
#

what the heck

#

!mute 801053892832919562 investigating

clever salmonBOT
#

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

keen burrow
#

!mute 253696366952316929 No pope allowed here

clever salmonBOT
#

:incoming_envelope: :ok_hand: applied mute to @upbeat sandal until <t:1635790466:f> (59 minutes and 58 seconds).

sinful sun
#

preach steler

upbeat sandal
#

You can't mute the Pope

keen burrow
#

!tban 801053892832919562 14d Seems like you have just been sending spam here so far. If you want to join again, make sure to read our rules this time.

clever salmonBOT
#

:incoming_envelope: :ok_hand: applied ban to @hearty ferry until <t:1636996506:f> (13 days and 23 hours).

keen burrow
upbeat sandal
keen burrow
#

I can tell you mine instead pleading_taco

upbeat sandal
#

!unmute 253696366952316929

clever salmonBOT
#

:incoming_envelope: :ok_hand: pardoned infraction mute for @upbeat sandal.

upbeat sandal
#

Now I'll never get to know the secret

keen burrow
#

too bad

#

if the secret is how I can not get destroyed at my week five (?) exam they can get unbanned

real forum
#

I always miss the fun fun rule stuff, such as when people get muted/banned

odd sphinx
night needle
#

@tall sparrow over here

tall sparrow
#

Didn't want to overexplain the situation in case it wasn't particularly relevant

night needle
#

What game is it by the way, if I may ask?

calm bolt
#

Kohan: Ahriman’s Gift, awarded “Strategy Game of the Year” by Computer Gaming World, is a real-time strategy game set in the fantasy world of Khaldun. Built on the award-winning Kohan:Immortal Sovereigns gameplay, Ahriman’s Gift is the stand-alone prequel to Kohan: Immortal Sovereigns. Experience the world of Khaldun from a whole new perspective...

Price

$9.99

Recommendations

103

Metacritic

79

tall sparrow
#

It's Kohan: Ahriman's Gift. Context wise, the company that made the game (TimeGate) is dead, the online services for it (GameSpy) is also dead, and the modding tool that was released for the game is very buggy and restrictive. The mods we still use today were made a long time ago by people with python experience, using a script.

calm bolt
#

that game

tall sparrow
#

And unfortunately a lot of those guys are no longer reachable anymore, a lot of them have moved on. So I have to make something from scratch.

night needle
#

Ah .... and the creators have yet to update it for something else?

tall sparrow
#

You mean the game creators, or the script creators?

night needle
#

If I may ask ....

tall sparrow
#

Sure, go ahead.

night needle
#

What type of genre is it?
RTS? Real time RPG? Turn-based RPG? etc.

tall sparrow
#

It's a fantasy RTS game.

night needle
#

... heard of OpenRA ?

tall sparrow
#

Bit like Battle For Middle Earth or Dawn of War, if you've ever seen those ones. And yes, I'm a huge fan of OpenRA.

night needle
tall sparrow
#

Yep. Got it installed.

#

Even their Tiberian Sun beta.

night needle
#

I got C&C: RA2 / YR in CD form, but sadly I don't have a drive to install them with

#

Stupid "use online / USB to get everything" ideas

tall sparrow
#

Yep, an external DVD drive is also really useful for that sort of thing.

night needle
#

I got to purchase one in-person ....

#

rules that I cannot just do on my own

tall sparrow
night needle
#

I only got a CD player ... and it is part of my alarm clock

#

But there's bad news with that ... I cannot get the batteries out of it

tall sparrow
# calm bolt that game

Sorry, didn't answer your question before about libraries. Bit of a coding pleb here, but I basically need the script to read a directory filled with ini files, and compile it all into a single .tgx file. So I'm using os and sys for now, os for reading directories and sys for being able to point the script at different directories, I guess?

night needle
calm bolt
#

damn their site 404's

tall sparrow
#

Yeah timegate abandoned kohan a long time before they went bankrupt

calm bolt
#

odd that the game itself is still sold

tall sparrow
#

It's a very special RTS game, though.

calm bolt
#

it looks cool

tall sparrow
#

My understanding is that the CEO bought the rights to kohan at his own bankruptcy auction

#

So the steam pages aren't managed, the game doesn't even work right away if you just download it and play. It's been a pretty big struggle to rebuild the community for it, but we've been doing well.

#

Still, the lost art of proper mod making is something we need to get back

night needle
#

But it does allow me to play my old "Age of Empires II: The Age of Kings" in-game background music on loop ... (only audio track on it ... starts on track 2 (data is on track 1, and that data is not meant for human ears)

tall sparrow
tall sparrow
night needle
night needle
tall sparrow
#

Did try that.

calm bolt
#

@tall sparrow It is probably because messing with the file alters the header or something

tall sparrow
#

Unfortunately, 2001 game. Lots of sites have shut down since then

calm bolt
tall sparrow
#

I did, yes

#

They aren't the same thing, unfortunately

calm bolt
#

ooh

tall sparrow
#

I think tgx for kohan stands for timegate x - Or something like that.

calm bolt
#

how big is the average file?

#

I guess they vary a lot?

tall sparrow
#

So I have a script for extracting a tgx file

#

Which works

calm bolt
#

ah cool

tall sparrow
#

So in that screenshot there. apaladinshield.tgx is a quick mod I made with the tool K-Mod, that has one unit changed. Patch 1.3.10 is one of the more robust patches I was talking about, but it has only unit data in it, no added custom content like audio or art

#

So the average size of the patches was about 450 kb, for one that changes a lot of values

#

The PatchMP-0.2.0.2.tgx was explicitly made with a python script, and has a whole lot of extra stuff in it, so it's a self contained thing. It's much much larger, and it seems there isn't really a limit on how large they can be.

calm bolt
#

at such a small file size it must be referencing more data though

#

wish i had the game, I'd open the file in a hex editor to see if I can glean some info there. or perhaps open the game in hex editor while running

tall sparrow
#

Just need a moment to make a basic script that can show you what the raw data in the tgx looks like

#

I had it earlier but changed a lot of things

tall sparrow
#

@calm bolt It's basically this, but in the tgx format, there's a lot of extra data that I'm not sure if it requires to work or not

calm bolt
#

so the output is a bunch of hex values?

tall sparrow
#

I'm reading the tgx in binary mode in the top pic, and the bottom pic is what the data looks like when extracted

#

I don't have a script that writes tgx files yet

#

But yeah the tgx itself is a bunch of hex values thrown in with plain text

tribal tinsel
calm bolt
#

ooh

#

I would assume the ini's are plain text

tall sparrow
#

They are, yeah.

#

Very easy to edit in that form. Problem is, I'm not sure if I try to put them back into the tgx format whether or not I'm going to have missing data

#

And if I'm missing data, it probably won't work.

calm bolt
#

man, that is over my head. Sounds cool.

tall sparrow
#

Threewood is the guy who used to create mod files for the game, he was diagnosed with cancer and unfortunately it's not possible to contact him anymore, but he used a python script to do it

calm bolt
#

Maybe it is checking if the ini file size has changed

tall sparrow
tribal tinsel
tall sparrow
#

But nobody bothered to get it from threewood, so we're back at square one

#

We're playing the game with community patches that were made 10+ years ago, because we don't know how to make our own

calm bolt
#

That sux, pretty much the whole situation from dude getting cancer to source code disappearing

tall sparrow
#

Yeah, really really sad. Feels like we went into a bit of a dark age from then on. I hope the guy is doing alright, but there's been no word from him at all.

round moss
#

how do you extract the file?

tribal tinsel
clever salmonBOT
#

Hey @tall sparrow!

Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:

• If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)

• If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:

https://paste.pythondiscord.com

calm bolt
#

pastebin probs

tall sparrow
#

Ah, seems the perl script is a bit too long

#

Yeah, pastebin

tall sparrow
#

open (MOD,$modfile) or die "Unable to open mod file ".$modfile;
read *MOD,$mod,10000000;

@data=split /\x00+/,$mod;

$firstFileIndex=0;
@fileNames=();

for ($i=0;$i<@data;$i++) {
    if ($data[$i] =~ /data\\[\w\\]+/i) {
        push @fileNames,$data[$i];
    } elsif ( ! $firstFileIndex && length($data[$i])>100){
    $firstFileIndex = $i;
    }
}

if ($createDirStructure) {
    for ($i=0;$i<@fileNames;$i++) {
        &CreateDir($fileNames[$i]);
        open (INI,">$fileNames[$i]");
        print INI $data[$firstFileIndex+$i];
        close INI;
     }
}

sub CreateDir {
    my($fileName)=$_[0];
    my(@elements)=split /\\/,$fileName;
    my($i)=0;
    my($dirName)="";
    for(;$i<@elements-1;$i++) {
        $dirName= $dirName . $elements[$i] . "/";
        if ( ! -e $dirName ) {
            mkdir $dirName;
        }
    }

}