#programming

1 messages Β· Page 21 of 1

high sorrel
#

when you don't cache the info you grab from Steam and half your site breaks

#

πŸ˜‚

past shuttle
#

got bored and decided to create a "personal" website

shadow marsh
#

noice ^^

past shuttle
#

want to add more stuff but idk what to add...

winter badge
#

Buttons

#

Lots of buttons

shadow marsh
#

but... for what function tshrug

unkempt hamlet
#

Truckers Multiplayer (MP)
triggered

#

Official name is TruckersMP

ember canyon
#

u should link your hardware stuff to amazon partner links πŸ˜‰

fervent axle
#

@shadow marsh @past shuttle a fake button named Team that change a dark theme into white theme 😎 troll

high sorrel
#

ouch

past shuttle
#

MP is an abbreviation of Multiplayer

#

some people are dumb and probably dont understand

cinder spear
#

it also stands for Military Police

past shuttle
#

your brain is damaged if you think that would stand for Military Polcie with "Truckers" infront of it :LUL:

cinder spear
#

(but CJ's point was that the official name of the project is "TruckersMP")

past shuttle
#

my nitr oran out?...

shadow marsh
#

Noice :3

ember canyon
#

Thanks.

high sorrel
#

This is a bit of a shot in the dark but does anybody know if some kind of API or file or something exists for getting all the names of cities in game? Yes, I do mean all of them. Promods, DLC, base game, etc.

#

I'm too lazy to find them all myself

cinder spear
#

they're all in the save files (with promods used) but don't know of an online API

#

(as far as I know)

worldly tulip
#

Probably here πŸ‘€

high sorrel
#

oh damn

#

I totally missed that haha

#

thanks ❀

#

does this include promods cities?

worldly tulip
#

in traffic thingy yes

cinder spear
#

not in the cities API tho

high sorrel
#

Alrighty haha

#

Literally all I need is the cities and the country they're from πŸ˜‚

#

trucky has so much stuff I might need to use xD

cinder spear
#

promods have a list in their changelog per country IIRC

trail vector
#

This should be all cities and countries in ETS2 + DLCs + ProMods (w/ Middle East Addon)

trail vector
trail vector
#

And this should be ATS w/ all DLCs

raw notch
#

@high sorrel exists but is undocumented :D cannot do now but today or tomorrow I will send you the endpoint

mossy cloud
#

@high sorrel I've got an SQL file of it all

high sorrel
#

Ooo πŸ‘€

mossy cloud
#

You want it?

grim patrol
#

@ember canyon Wowloveit loveit loveit Awesome work mateβœ… loveit

ember canyon
#

@grim patrol. Thanks.

#

It also work for Forza, BeamNG, ATS, Asseto Corsa

#

Etc

grim patrol
#

Woowwwloveit Really well done I have to say!

ember canyon
#

I just work wirth a program.

#

And I modify the arduino code for add few things like the capacitive button and led support.

#

Led is for blinkers.

high sorrel
#

@mossy cloud yeah I'll take a look if you're offering πŸ‘€

mossy cloud
#

Sure, I'll DM you πŸ™‚

high sorrel
#

thanks ❀

lucid garden
#

whos a fivem developer?

high sorrel
#

I've just spent 2 hours playing a BTEC Sims game with networks and security

#

It was awful

raw notch
#

@mossy cloud why they seems Trucky data in some way? πŸ™‚

mossy cloud
#

?

raw notch
#

i mean, the locations list (a part the features columns) seems coming from Trucky Map

high sorrel
#

I'm going through it filling in the blanks for the promods ones, 12 down, 259 to go! thisisfine

#

at least 90% accurate πŸ˜‚

unkempt hamlet
#

I did the parser from scs files several years ago

#

Can't find it though 😭

#

I used to use it to fill up a base for RusConvoys website

high sorrel
#

nicee

past shuttle
#

website update

#

@fervent axle nice idea

unkempt hamlet
strong quail
#

Finally time for WebDeving! 😊
Jesus - my last time when I was on GitHub is 23 days ago... 😏

shadow marsh
#

Im working today since 5 am - cuz RC is going today in private beta - and ive many to do LUL but its easy lol

strong quail
#

I've needed to upgrade my phpMyAdmin, since package that Ubuntu 18.04 is outdated...

shadow marsh
#

there's an update?

#

lemme check that

strong quail
#

@shadow marsh I've done that manually :P
Not by sudo apt upgrade

shadow marsh
#

ahh, okay thinksmart

north flax
#

The GOPATH and dependency management was one of Go's huge weak sides, and was generally awkward to work with

cinder spear
#

it's still somewhat awkward but a lot better

past shuttle
#

another update

high sorrel
#

wooo updates

past shuttle
#

πŸ˜‰

ember canyon
#

You can add a Twitch integration

#

So you can see the stream when you arrive in the website.

past shuttle
#

another update

#

imma add twitch integration next

#

im enjoying this tbh

high sorrel
#

web stuff is fun

#

mostly

cinder spear
#

CSS is fun Kapp

past shuttle
#

I need a better β€œAbout Me” award winning description

lethal willow
#

notcied

past shuttle
#

?

#

oh

#

nah its GTC my dood

#

special edition 1050ti kappa

ember canyon
#

New version of my dashboard.

#

I've added some hole if someone want to build something for it.

#

That button is reversed

#

And it isn't normal.

prisma robin
#

Nice//

past shuttle
#

whats the best site to buy a domain? aswell as a website host?

unkempt hamlet
#

It goes down to advertisement, so I don't think will be a proper discussion.

mystic ridge
#

I don't see any issues with discussing such topics

#

Β―_(ツ)_/Β―

raw notch
#

@past shuttle domain from namecheap or godaddy

#

or google, or cloudflare

past shuttle
#

google sell domains?

#

oof

cinder spear
#

can't recommend namecheap... they escalated a bug I reported to their high priority queue and it sat there for 2 years before being closed without explanation or fix

past shuttle
#

oof

jagged palm
#

Get a domain from godaddy and then get a vps from a hosting company or get a deal from fast commet

cinder spear
#

OVH has their .ovh TLD for just a few pounds a year

#

and it's otherwise my choice for it too

tidal zodiac
#

I would not recommend godaddy at all. Just really bad experiences with their domains like putting up the price of their domains each year cause the website is receiving more traffic and just slow support

north flax
shadow marsh
#

as im a german, i use https://www.mc-host24.de/ πŸ˜„

#

its enough... and they have a webspace too πŸ˜„

unkempt hamlet
#

For VPS - Hetzner. Cheap and awesome.

raw notch
#

also Scaleway

shadow marsh
#

for VPS i use Contabo (as i need to look for the price too :/ )

cinder spear
#

scaleway is definitely is "you get what you pay for"

#

i.e. not very good quality service

unkempt hamlet
#

Pretty much the same as Hetzner

#

But it REALLY GOOD

raw notch
#

yeah, but get a vps for something like 10 euros month, with really few downtime is not so bad

north flax
#

You also got DigitalOcean, Vultr, Linode, etc for VPS'

cinder spear
#

had 2 servers with scaleway... took around 20 minutes to reboot a small linux instance

#

every time

raw notch
#

never had these issues, more for downtimes

cinder spear
#

just because they use network drives for those instances

unkempt hamlet
#

My 2.99 euro/mo VPS has never been down for 2 years

north flax
#

Ah yeah, the booting for my ARMv8 instance there is painfully slow

cinder spear
#

and fun fact: you can accidentally use iptables to lock the boot drive from the instance

north flax
#

And been down a couple of times, due to random failures

cinder spear
#

uptime was good, but occasionally you should reboot

unkempt hamlet
#

Yeah

cinder spear
#

so -> OVH for me

#

Hetzner for minecraft server, AWS for chat bot

raw notch
#

i have my dedicated in Kimsufi, a subsidiary of ovh

cinder spear
#

I have my dedi on SoYouStart, which is also part of OVH

raw notch
#

AWS is too expensive

cinder spear
#

I don't pay for the instance there πŸ˜‰

raw notch
#

oO

#

how? πŸ˜„

cinder spear
#

perks of the trade

raw notch
#

one day i have to ask my CEO to put Trucky on our virtual infrastructure

#

unlimited powaaa

#

we just installed two DataCores, and they are great

cinder spear
#
$ uptime
 22:53:12 up 1417 days

akappapeak

raw notch
#

well uptime is not network downtime πŸ˜„

cinder spear
#

true, it's had 2 network downtimes

#

1 was brief and related to routing to the IP (the VMs on the server didn't lose connectivity)

#

the other was when one of their switches responsible for my server blew up

#

that took a bit longer for them to fix

#

but overall 2 short downtimes in 4 years is not bad

past shuttle
#

@unkempt hamlet what provider was that?

#

was it Hetzner?

mossy cloud
#

I use namecheap for domain, Cloudflare for DNS and never had an issue

high sorrel
#

I agree with the little nootin' waddlin' character there

unkempt hamlet
#

@past shuttle Hetzner, yes

ember canyon
#

I use freenom. Because I'm poor and I can't buy domainname.

#

My website is 100% free

high sorrel
#

I mean it works, it's just not always the best choice depending on what you need

past shuttle
#

gonna try get a .gg domain

cinder spear
#

one of the more expensive ones

lethal willow
#

SSDNodes is a good provider for VPS'

north raven
#

yea with their fake ass sales and pricing

#

hetzner is the way to go imo

lethal willow
#

what's fake about it?

strong quail
#

Yay... I've sorted my English LP. 😊
Looks a lot better now.
Some pics.

#

BTW - We started learning Python on our "Basics of IT" classes.
However...
We had a massive problem. xD
Our professor sent us the books for Python 3, meanwhile PCs at our department not only have WinXP, but also Python 2. πŸ˜‚

#

Moreover - contact with him in Polish isn't great, because he is from Ukraine... 😏

#

He speaks Polish, but... not that good... Sometimes he uses some words from Ukrainian. πŸ˜‚

wise void
high sorrel
#

Arghhh they keep adding new cities and DLCs and my list is never up to date 😭

raw notch
#

if you use the Trucky API, yes :D @high sorrel

cinder spear
#

trucky api is nice, used it for my twitch chat location command

high sorrel
#

Haha yeah dow you never sent me that endpoint πŸ˜‰

raw notch
#

ah lol :D

#

true

cinder spear
#

my 100% got ruined by OVH pressing the power button on my server and not telling me about it pepeHands

ember canyon
#

That's an oof

cinder spear
ember canyon
#

sue for OCD issues troll

high sorrel
#

πŸ˜‚

#

Someone just running round pressing random power buttons for fun

unkempt hamlet
#

"Oooh, 3v, screw that guy" trolldance

ember canyon
#

this is a video game creation salon where for truckmp?

#

With my friends we will create a game a bit like Terraria

#

But we will change the characters to have no problem with developers terraria

high sorrel
#

I've never heard the phrase 'video game creation salon' before and I love it

ember canyon
#

xd

unkempt hamlet
wise void
mossy cloud
#

Ooooh nice

dense wedge
#

Oh yez very nice

wise void
#

@tardy smelt Bonsoir, vous parler franΓ§ais je suppose ?

tardy smelt
#

I may be able to talk french but the rule state that we must talk in english unless we are in the #french channel @wise void

wise void
#

Oh, okay, could we chat in private message?

tardy smelt
#

What do you need?

wise void
#

I would like to tell you about a platform I'm developing, so I'd like to collaborate with TruckersMP

tardy smelt
cinder spear
ember canyon
#

This guy has everything holy moly

#

3v is a gangster

#

( in a good way obv.)

high sorrel
#

That's handy

past shuttle
#

@cinder spear gimme affiliate πŸ™‚

cinder spear
#

it's automatic

unkempt hamlet
#

Huh?

sage trellis
#

oh scheisse.. wrong chat

shadow marsh
#

xD

past shuttle
#

does anyone know how bootstrap modals are actually created?

#

tried creating open but it doesnt even pop up

#
    <nav class="navbar sticky-top navbar-expand-sm bg-dark shadow">
      <a class="navbar-brand" href="#">
        <img src="img/favicon.png" alt="logo" style="width:30px;">
      </a>
      <form class="form-inline ">
        <button class="btn btn-info mx-1 font-weight-bold text-uppercase" type="button"><i class="fa fa-truck"></i> TruckersMP Profile</button>
        <button class="btn btn-success mx-1 font-weight-bold text-uppercase" type="button" data-toggle="modal" data-target="loginModal"><i class="fa fa-sign-in-alt"></i> Login</button>
        <button class="btn btn-primary mx-1 font-weight-bold text-uppercase" type="button"><i class="fa fa-user"></i> Signup</button>
      </form>
    </nav>

    <div class="modal" tabindex="-1" role="dialog">
      <div class="modal-dialog" role="document">
        <div class="modal-content">
          <div class="modal-header">
            <h5 class="modal-title">Login</h5>
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
              <span aria-hidden="true">&times;</span>
            </button>
          </div>
          <div class="modal-body">

          </div>
          <div class="modal-footer">
            <button type="button" class="btn btn-success">Login</button>
          </div>
        </div>
      </div>
    </div>
#

here is the code if you are interested

trail vector
#

looking at the documentation, field data-target on your button needs a # in front of the target modal id, and the modal itself needs said id

high sorrel
#

That seems to make sense haha give it a shot

#

I am late as heck but yeah should work lol

arctic wave
#

How do you make a custom driver hub?

raw notch
#

with a lot of work

mossy cloud
#

^

tardy smelt
#

A lot of work and dedication GWrjkKappaPeek

kindred wind
#

pls add a scania longline

ember canyon
#

omg krille can you not

kindred wind
#

yez. but the devs can

#

in some way. it is possible

ember canyon
#

This isn't the TMP Dev chat

#

Also they won't

past shuttle
#

Modal still aint working after that fix

#

nvm it did work ty for the notice

storm yarrow
#

Is it possible to post the feed of a Reddit user on your discord not a sub Reddit but the user

quick glen
#

Quite possible yeah. Reddit has an api that can be used to retreive submissions and comments done by a user.

storm yarrow
#

Do you need to host it ? Or can you use a webhook for it

ember canyon
#

Hey does anyone know how to make a application so i can change this to my vtc logo and my vtc name?

mossy cloud
#

That uses Discord RPC (Rich Presense)

#

You'll need to see the Discord Developers documentation

quick glen
#

@storm yarrow you would need to write your own implementation to query the Reddit api for new submissions which can then trigger either a discord webhook or make a bot send a message to the discord channel you want it at.

#

Personally I would write a discord bot to do it

#

I'm not aware of any pre-existing solutions to do this

ember canyon
#

Someone already made it for me! Still thanks for your help ❀️

raw notch
#

guys, someone know a good cloud storage with api possibly with some free space?

cinder spear
#

For simple object storage with solid APIs I'd look at S3 or compatible offerings from other providers... AWS has a free tier for a year (Azure and GCP probably do too). I'm biased towards AWS though

#

But fwiw I use AWS S3 (and pay for it) personally for my small video clips

unkempt hamlet
#

I used to use AWS to push and store TMP evidences with ShareX

cinder spear
#

so far my bill is 10 cents a month, 12 with tax

unkempt hamlet
#

Mine is 0 (it is empty troll)

cinder spear
#

all of it is from bandwidth, not from storage itself

raw notch
#

bandwidth... mmmm

cinder spear
#

pricing varies

#

but those types of APIs tend to have bandwidth pricing

raw notch
#

i would to add a new feature to trucky but it's storage intensive

#

sincerely I wouldn't pay... or pay too much

cinder spear
#

what's the scale here? GBs? TBs? PBs?

raw notch
#

mmmmmm

#

tb? i'm talking of photos, screenshots

quick glen
#

My laptop takes about 400 kb for a 1080p screenshot of my desktop, so with a terrabyte we're talking 2 and a half million screenshots here?

cinder spear
#

in the few TBs range it's probably cheapest to get like a large storage server from OVH or something like that and handle the API yourself

#

more than you can stick on a single server probably becomes cheaper and easier with object storage again...

#

could of course look at something like Google Drive too, but the API isn't going to be super good for the use case

quick glen
#

I'd personally start off by doing some number crunching to get an estimate of how much storage would acctually be needed, and the cost per image of the object storage vs a storage server. And then there's ofcourse the whole scalability to keep in mind if it turns out the feature blows up

cinder spear
#

honestly, object storage is probably the best option just because it's made for programmatic access to files

#

pricing comes out to be similar no matter what you do outside of free tier offerings or trial credits

#

and you can't really find completely free storage at that scale

quick glen
#

Benefit of AWS S3 is that you only really pay for what you use (if I'm not mistaken)

cinder spear
#

yeah, with intelligent tiering even more so, as it moves infrequently accessed files to colder, cheaper storage

raw notch
#

all good points

lethal willow
mystic ridge
cinder spear
#

where hmm

#

all I see is 59 a month

mystic ridge
#

Updated the link

cinder spear
#

neat!

mossy cloud
#

Already got mine, thanks!

cinder spear
mossy cloud
#

πŸ˜‚

meager olive
#

Humble Bundle has some great deals again for e-books and video's for developers and other kinds of IT staff!

raw notch
unkempt hamlet
#
Bootstrap Blog

Bootstrap 4 has a new update with a handful of feature changes. We’ve had quite the lengthy pull request to add responsive containersβ€”big thanks to the developers who contribute to Bootstrap for sticking with it and helping us along the way. Nearly all new features will b...

high sorrel
#

So I've just found out about error 418 and it's brilliant πŸ˜‚

pulsar jungle
prisma robin
glass laurel
#

anyone knowing if it is necessary/good to git a .classpath and .project file for each github commit?

mossy cloud
#

I don't

#

Never needed to really

tall orchid
#

Hi

rugged copper
cinder spear
#

time to break encryption Kapp

lucid frost
#

Quantum computing is going to change EVERYTHING.

#

How much faster is it than 01 again?

#

01010

#

u know

north flax
#

Depends what you'll be doing. Some operations will be better done with a quantum processors, others with a normal cpu.

cinder spear
#

it will and won't change everything both and neither at the same time with varying probabilities Kapp

north flax
#

As much as quantum computers are good at things, scaling them is currently hard, and they come with some overhead

cinder spear
cinder spear
#

Today in Spot The Bug we look at this function that should return the list of values for the given key.

mossy cloud
#

Have you actually defined 'similarities'? You have it on your foreach and if, but it's not defined or referenced by global scope

cinder spear
raw notch
#

lol adding the list to itself

unkempt hamlet
cinder spear
#

that it's elixir Kapp

mossy cloud
#

Yep, it should be TMPAPI technically as they're both acronyms πŸ˜‰

lucid frost
#

What ya'll think about zero trust?

unkempt hamlet
#

Higher security means less usability. It should be a balance depends on how much of a security you need.

cinder spear
#

There's no reason high security can't also be convenient

unkempt hamlet
#

Convenient security is the security when you do nothing additional than you want to do.

raw notch
#

so never :D

unkempt hamlet
#

In this point of view, passwords are inconvenient too.

cinder spear
#

passwords are inconvenient and not very seecure

barren laurel
#

Wazup

opal arch
#

I was hoping this is a joke but then I saw the tweet they retweeted...

cinder spear
#

mhm.. it vaguely makes sense

#

the issue is that people it still doesn't stop people from reusing passwords

#

they'll just memorize your generated one and reuse that elsewhere

opal arch
#

We should do that, too kappa

cinder spear
#

and it does nothing against malicious inside actors who are able to just take the password and do things as another user

mossy cloud
#

It's not worth the yearly cost imo D:

#

VSCode is free and works, just doesn't give you the advanced features that PHPStorm does, and those features doesn't justify a monthly cost of that amount :/

unkempt hamlet
#

PHPStorm has a free EAP.

#

I am using it for years and didn't spend a single dollar on it.

pulsar jungle
#

I've used PhpStorm for over 2 years now (or maybe even more, I don't remember)
In the past I usually used the EAPs to code with, but a year ago I saw JetBrains where in the GitHub Education program so I got a license from there.

unkempt hamlet
#

I am not a student anymore, so my Education subscription got revoked 😦

ember canyon
#

L

high sorrel
#

I'll have mine for the next 3 years 😏

quartz moth
#

I use the student deal

high sorrel
#

^

#

Don't use it as much as I used to though

north flax
cinder spear
#

Machine learning quiz.
A translator takes in nej., correctly detects it as Danish, and gives No. as English.
A translator takes in Nej., correctly detects it as Danish. What is the English output?

mossy cloud
#

So it becomes the Churchill dog xD

north flax
cinder spear
#

I think he inadvertently used the "classic VPS" on OVH instead of setting up a public cloud instance for the same price

#

would have solved the root pass being emailed instead of setting an ssh key for example

#

otherwise seems accurate for the ones I've tried

unkempt hamlet
#
GitHub

Bring GitHub collaboration tools to your small screens with GitHub for mobile. Sign up for the iOS beta or get on the list for our Android versionβ€”and we’ll let you know when your app of choice is ...

cinder spear
unkempt hamlet
#

Yep, that happened.

ember canyon
#

@unkempt hamlet @opal arch Sorry for ping but I have a question. Is a way to be a game moderator? I'm mature, and active. Up to 10-11 hours/day

mossy cloud
#

They'll announce when they're looking for more, and you can then submit an application there πŸ™‚

ember canyon
#

Oh okay

#

Thank you so much

mossy cloud
#

np πŸ™‚

unkempt hamlet
high sorrel
#

No harm in little mistakes like that, but just so y'all know, developer chat is not a chat to talk to THE developers, it's a chat for developers to talk to other developers :))

ember canyon
quartz moth
#

Unpopular opinion: I prefer windows to linux

#

It's because I have used windows my whole life and whilst linux is great it doesn't support all the things that I am familiar with

tardy smelt
#

What language are you using to develop?

ember canyon
#

I use windows cause I like it and I already have it lol

#

Also got it for free soo mmm

tardy smelt
#

So you're probably not developing anything πŸ˜›

ember canyon
#

not anything big

#

More scripting stuff

quartz moth
#

I use python and php

#

But I mean as in daily tasks etc

#

Like using TMP wesmart

#

That's probs why I wouldn't switch, or id dual boot

rugged copper
#

I find Mac OS to be the best for development

high sorrel
#

mac, that's an interesting choice

cinder spear
#

Linux all teh way

rugged copper
#

Unless I’m writing c#, then I tend to use windows. However, most of the time I’m just using PHP and Laravel so having a unix system works best

mossy cloud
#

I use PHP but I write to a linux server & source control so I do my work via FileZilla

rugged copper
#

If you’re using source control, what do you use FileZilla for? I can’t remember the last time I needed to use FTP

#

I can usually get away with ssh, git and auto deployment

unkempt hamlet
#

Exactly. FTP seems kinda redundant.

ember canyon
#

I prefer Linux. It have less critical bug than Windows

#

Like, I had to go yesterday with my father to one of his customer, because he can't print anything.

#

After 3hours of verify and testing we saw that was an Windows issue.

#

Because the printer doesn't work on wifi but on Ethernet

unkempt hamlet
#

I am using PhpStorm + Vagrant on Hyper-V for development. Works like a charm.

rugged copper
#

CJ which vagrant box you using?

unkempt hamlet
#

Homestead (since Laravel)

rugged copper
#

Yeah I thought that might be the case πŸ™‚

unkempt hamlet
#

But it is capable to hold any other frameworks and pure PHP as well

rugged copper
#

Yeah, I tend to use Valet being on Mac, but looking for a new solution for my PC, so might give it a go

unkempt hamlet
#

There is a Valet-ish experience on WSL, but it is not that streamlined.

rugged copper
#

I tried it a while back but seemed a bit buggy

unkempt hamlet
#

I've invested in WSL for PHP and it fails me. So now I am using WSL only for Node.js things.

rugged copper
#

Ah okay, that makes sense and like you said Homestead does the trick for most PHP applications

unkempt hamlet
#

Used to use something called Denwer back in the days, but Homestead is a way to go in this decade.

ember canyon
#

WSL is a nice "sandbox playarea"... but nothing u could use as a developer πŸ˜›

unkempt hamlet
#

I am using Redis off of it for Discord bots

ember canyon
#

ye i mean "bigger projects"... a discord bot is a small little "tool" i would say πŸ˜›

unkempt hamlet
#

I figured, yeah

#

One of WSL cons is an absence of systemd

#

So you will need to explicitly wake your services up after WSL init

#

It is not that convenient.

ember canyon
#

thats the reason why i do some more work before and use own containers also for smaller services like this... docker ftw πŸ˜„ or nano servers using WinSrv2019

unkempt hamlet
#

Oh, I used to use Laradock before Homestead, even contributing in it.

#

But Windows 10 came in and Docker on Windows gets weird.

ember canyon
#

Docker is a dead horse imo... πŸ˜›

unkempt hamlet
#

Kubernetes ftw

rugged copper
#

I currently use Laragon on windows but not a massive fan of it

unkempt hamlet
#

Homestead is more versatile and useful nowadays

rugged copper
#

Yeah definitely, I think I will give it a go later

mossy cloud
#

SFTP. Use it to write directly to the server

quartz moth
#

I'm not a a developer I'm just trying to improve my general coding skills by making my website and I use SFTP to connect and transfer files across

#

I imagine for a big project there are much better ways

#

But personally for my it works well for what I need to do

unkempt hamlet
#

I am using git for that. That way you learn Git very fast.

quartz moth
#

Ahh ok I'll have a look into that

rugged copper
#

@mossy cloud what are you writing directly to the server? Are you editing files which are in source control?

mossy cloud
#

Writing into files directly on the server yes then uploding to git

rugged copper
#

So your not making the changes on your local machine, pushing to git and pulling to server?

high sorrel
#

I don't even remember how to use git, it's been so long πŸ˜…

mossy cloud
#

Not at the moment Ratcho as the first release isnt live yet

#

So I'm using Git more of a backup at the moment

ember canyon
rugged copper
#

I would recommend using it from the start, just makes your life easier πŸ™‚

ember canyon
#

πŸ‘€

#

This overpowered gaming laptop

tardy smelt
#

First time I'm hearing this xD At this point you should just ssh into the server and vim to your file at this point GWrjkKappaLUL

#

At least with SSH you can use artisan command GWrjkKappaPeek

raw notch
#

first time? πŸ˜„ lol

tardy smelt
#

I feel like I'm going back 10 years by hearing this now xD

raw notch
#

i've seen this behaviour from professional developers on productio environment πŸ˜„

#

not so back in the time, less than 10

tardy smelt
#

I rather use SSH than FTP for anything.

I write code local push it to git and than pull it on the server πŸ˜›

raw notch
#

it's how things should work, or with another CI way

tardy smelt
#

Also where I work now they setup their "dev" env on a server and use automatic upload for FTP. I hate it so much lol

raw notch
#

we use local IIS configured with powershell and common dev SQL server

#

but in another place i worked, we had virtual machines on vmware cluster, not using local machine

#

and it's quite good, because devs have the same environment, instead of working on a client machine, you have the same OS of production env (windows server 2012 etc etc)

#

the whole machine is backed up and you can work remotely without your workstation

#

it's enough a RDP

cinder spear
#

me: merge to master
CI: runs integration tests -> deploys to canary -> waits an hour -> deploys to prod, cancels at any point if anything fails or metrics alarm
feelsgoodman

mossy cloud
#

Thing is, it works for me xD And I'm the only dev on my project so I don't have to worry about doing things "the right way" so much πŸ˜›

#

It may be good practice but I'd like to get this code written πŸ˜›

rugged copper
#

Is it a hobby or something you would like todo as a job?

mossy cloud
#

I'd like to make a job from it yes, but I wont earn enough money from Plasma to just do that

#

I'd have to go into proper PHP development work as well sadly

rugged copper
#

So in that case, I would recommend following the standards because you will probably use Plasma as an example of your work. If you can show that you are following the standards, you’re more likely to get a job. You’ll also find it easier going in to a job because you’ll have been using those standards. I’m not trying to have a dig, promise πŸ˜‚ just trying to give some helpful tips

mossy cloud
#

No that's great, thanks :)

ember canyon
#

What's the best program to make an bootabke usb

#

?

#

Because, I've used Rufus for flash Debian into my USB.

#

I need to disable Windows to access to my USB.

#

(Bios)$

unkempt hamlet
#

It is your BIOS problem

ember canyon
#

When I run the graphics installer nothing work. And on my VM everything is good.

#

My Bios run fine. Windows is the problem

#

My bios s made for Linux.

#

That the problem

mystic ridge
#

Your Windows install is likely UEFI based, and your USB key is setup for a CSM install

tardy gale
#

hi my name is kayla and i coded dyno with no programming language-

unkempt hamlet
ember canyon
#

I love that

teal cliff
#

Does anyone know anything that can learn me to do basic scripting for discord bots?

#

I can’t script well on bots

unkempt hamlet
#

YouTube is your best friend

opal arch
#

depends what scripting languages you know

#

creating a Discord bot is easy, you are just using an API of a library

ember canyon
#

"Developing" Discord Bots is more like creating Alexa Skills these days.... its a point&click adventure πŸ˜„

unkempt hamlet
#

Um, I don't think so

meager spoke
ember canyon
#

Well there are many drag and drop editors available to reali(s|z)e simple Bots with some functions and also logic in them.

#

sure if you need something special u need to script it yourself

ember canyon
#

@teal cliff. There so many tutorial execpt "TheSourceCode" who give outdated code.

arctic mica
#

Highly depends on which language you wanna use tbh

last spindle
#

Waa youtube for discord bot making?

#

Nonono

unkempt hamlet
arctic mica
#

Why not? I have learned it myself by watching other people.

last spindle
#

I learned it by someone gave me his bot and i expanded it and used this site

#

I dont like yt for coding tutorials xd sorryyy

arctic mica
#

Ye of course that is your best friend but you still need to know how to do stuff around that

unkempt hamlet
#

Well, it doesn't help you if you don't know how to actually code.

last spindle
#

Well

#

Ok

#

For JavaScript basics you can mayyyybeee watch a few videos

#

YouTube doesnt have videos for everything

arctic mica
#

Of course it doesn't but you can learn a lot from them. Once you have watched some you should be able to do it yourself with the docs.

unkempt hamlet
#

It kinda did. Depends on what you're searching for.

raw notch
#

learn to develop watching YouTube? oof...

unkempt hamlet
#

Watching alongside coding. What's wrong?

tidal zodiac
#

That’s how I started with Laravel... some YouTube video all those years ago. I can be a great starting point to get the basics of something so you know where to go from there

cinder spear
#

Nothing inherently wrong with learning from youtube

opal arch
#

Especially Laravel can be learnt from Laracasts

ember canyon
#

That how I started in python

#

Blink a led and now using python for start my JS bot.

#

πŸ˜‚

#

I just need to push on a button

fervent axle
#

YouTube is useful to learn about starting something and stackoverflow to understand what's wrong with all errors that I've written in my part of code kappa πŸ˜…

rugged copper
#

For those of you who use the TruckersMP PHP API Client, a new major version was released today πŸ™‚ https://forum.truckersmp.com/index.php?/topic/91673-truckersmp-api-client-for-php/

TruckersMP Forum

The TruckersMP PHP library provides a convenient way to access the TruckersMP API from applications written in the PHP language. It includes a pre-defined set of classes for each API endpoint to get the data as a collection or model. You can find the source code on GitHub and...

ember canyon
#

I prefer JSON to do this.

#

But PHP can be nice

rugged copper
#

How do you get the data though? This is basically a wrapper for calling the API

cinder spear
#

...json is a data model, PHP is a scripting language... They're not interchangeable parts of a system, they do a different job

raw notch
unkempt hamlet
#

ikr

rugged copper
#

Lol

#

How many lines is that file, it looks huge! confused

raw notch
#

about 800

#

90% all quick calls to other functions, is the background controller of the overlay

rugged copper
#

Ah

unkempt hamlet
cinder spear
rugged copper
#

CJ what language is that?

unkempt hamlet
#

Elixir

#

Based on Erlang

rugged copper
#

Ah

rotund lance
unkempt hamlet
#

Huh?

tardy gale
#

Oh?

last spindle
#

Waaaa?

mossy cloud
#

noot?

unkempt hamlet
#

Wrap it up.

north flax
#

@unkempt hamlet Using Elixir for TMP Helper? :p

unkempt hamlet
#

Yeah, it would be Elixir (Phoenix) + Vue.js

north flax
#

Ah, neat πŸ˜›

unkempt hamlet
#

Elixir is mind-blowing, honestly. In all ways.

north flax
#

I looked at it a while ago, but never got around to using it that much

#

Using a bunch of Python and some Kotlin nowadays though, along with Typescript and C# at work

unkempt hamlet
#

Oh, I wish I can learn Kotlin. Web is in my brain cells nowadays, can't do nothing.

north flax
#

Have you done any Java? :p

unkempt hamlet
#

Nope, and don't wanna.

north flax
#

Alright. If you had done, you'd have a decent foundation to just use it since it's based on the java ecosystem

#

But honestly, when you get started it's quite nice. It takes some concepts you'll be a bit used to from Elixir and functional languages too, like immutability

#

Non-nullable types are also nice :3

#

Another new thing is that you can make pretty good domain specific languages, but other than that, most of the concepts aren't that special :p

unkempt hamlet
#

Ah, I am far away from making DSLs πŸ™‚

north flax
#

Same, but I use them

#

Haven't had a need to make them yet

unkempt hamlet
#

Exactly

north flax
#

Here's an example of a database query using a kotlin DSL :p

        DBBid.find {
            (DBBids.artpieceId eq artpiece.id) and
            (DBBids.valid eq true)
        }.maxBy { it.bid }

#

DBBid is a class for the bid, DBBids is the table definition

#

Or how you can just use get("path/here") { call.respond("Hello world" } to defined a route with ktor, a http server and client library :3

unkempt hamlet
#
    get "/", PageController, :index
#

Phoenix is great πŸ™‚

north flax
#

πŸ˜›

#

It can be :>

unkempt hamlet
#

Btw, pattern matching is The concept. I like it so much.

north flax
#

It's nice, yeah :p

unkempt hamlet
#
  @doc """
    Lookup player information
  """
  @spec player(integer) :: TmpApi.Player.t()
  def player(id) do
    case makeRequest("player", id) do
      { :error, _error_code, message } -> raise message
      response -> TmpApi.Player.new(response)
    end
  end
#

Another example. It was painful to develop in the brain. Go figure.

  def makeRequest(url, params \\ nil) do
    finalUrl = "#{url}"
    finalParams = Keyword.merge([key: SteamApi.apiKey], params)

    with  { :commit, response } <- Cachex.fetch(
      :cache,
      finalUrl,
      fn () ->
        case get!(finalUrl, [], params: finalParams) do
          { :ok, response } -> response
        end
      end
    ) do
      Cachex.expire(:cache, finalUrl, SteamApi.cacheTime)
      response
    else { :ok, response } -> response
    end
  end
north flax
#

I feel like in that specific case, an exception would have worked just as well πŸ˜›

unkempt hamlet
#

Yeah, but it is +3 lines of code πŸ™‚

north flax
#

Define an TmpApiException, and throw it in makeRequest if there is an error :p

#

(You can also go full Rust, and not use exceptions, if you feel like it) πŸ˜›

unkempt hamlet
#

I don't think so 🀣

north flax
#

Or do like Go, and return a (error, result) tuple πŸ˜›

cinder spear
ocean mural
#

Looks like we got some genies here ;))

north flax
#

Yep, that's my issue with Go

#

For every call that can fail, you'll need to add at least 2 lines to check for errors

#

Compiling to standalone binaries is nice, and their handling of goroutines and garbage collection is nice though

cinder spear
#

and it's super easy for anyone familiar with any language to read

#

since there's no complex constructs

unkempt hamlet
#

I agree

cinder spear
#

unlike elixir.. I have no idea what those code snippets actually do (other than some caching and request/response)

unkempt hamlet
#

Well, it's pretty much straightforward, just with some weird structure

cinder spear
#

yeah, it's just the syntax

tardy gale
#

So much smarties here oh my god

north flax
#

But back on topic, most people perceived as smart have just learned or done something different than you have πŸ˜›

#

We don't know everything, but we have our areas of interest we've learned a bunch about

#

And that we spend time going deeper into

tardy gale
#

to be honest, i’m really interested in coding or whatever you guys do, i don’t know much because i’m so new to it but yeye

raw notch
#

there are so many resources to start from, just pick a language. take an idea you have and try to realize it.

unkempt hamlet
quartz moth
#

Tbh I'm relatively new to coding so just trying to get a hang of it all e.g PHP SQL and Python so Im probably not doing things totally "correct" like using github but for the moment the way I do it works fine for me and I will of course make mistakes and hopefully learn from them

#

I just wonder how different it will be coding in a professional environment which is what I want to go into compared to home projects where I do things "my way"

unkempt hamlet
#

It depends on actual environment in place

quartz moth
#

Wdym CJ, do you mean as in the professional environment and how different it is to a home project?

unkempt hamlet
#

In home projects, you can do whatever you want to feel comfortable. In professional projects, you should adapt to standards and procedures.

quartz moth
#

Ahh ok

mossy cloud
#

I'd recommend using GitLab anyway, as then you have an extra backup should things go wrong

unkempt hamlet
#

Yeah, Gitlab is a place-to-go for personal projects

quartz moth
#

Ahh ok I'll have a look into that

#

Im guessing there's quite a lot of integration with IDEs

mossy cloud
#

GitLab is so much better than GitHub imo. Can have unlimited private projects and for teams as well

#

So useful for Plasma

unkempt hamlet
#

If you feeling out of knowledge of Git, you can start with just a folder in a cloud (i.e. OneDrive)

mossy cloud
#

Yes, VSCode and PHPStorm have good integrations with Git

unkempt hamlet
#

But learning Git is needed anyways.

mossy cloud
#

I use PHP Storm fully now, used to use VSCode

quartz moth
#

Ok, that's something I definitely need to learn since I have never really used it

#

Yeah I use PHP storm since they do a good deal for students

unkempt hamlet
#

Sublime Text 2/3 -> VSCode -> PhpStorm

mossy cloud
#

As long as its not Atom πŸ˜‚

#

May as well use Notepad if you're using that

unkempt hamlet
#

Atom was the reason I didn't jump on VS Code early on

quartz moth
#

I have atom installed and use it for like config editing

unkempt hamlet
#

It feels way more slower than native ST (ofc)

quartz moth
#

Like game configs etc

mossy cloud
#

VSCode is good for that πŸ™‚

#

What games do you config @quartz moth ?

#

My main one is Minecraft as Plasma has about 6 MC servers on one network πŸ˜‚

#

It's annoying when it comes to updating plugin time xD

unkempt hamlet
#

CI ftw

quartz moth
#

Well I don't config games, I meant as in like editing simple values such as ETS2 config

#

But I recently got a Raspberry pi for discord bot hosting

#

Cause I thought it would be a good idea

#

Not sure if it has paid off yet tho

unkempt hamlet
#

There are many other free places to host your bot - Heroku Personal, AWS EC2 free tier, Firebase, Glitch(?), etc.

#

If you feeling confident you can spend some money for cloud hosting. I am used to use Hetzner instance for my projects, 3 euros per month (incl. snapshots).

mossy cloud
#

Oh that's interesting, they're cheaper than OVH

unkempt hamlet
#

And Scaleway

mossy cloud
#

Might look into that as one of our VPS's is a mail server, so the cheaper I can get that the better (while at least keeping 2GB RAM)

quartz moth
#

Well I guess I've already made the investment now and I way as well use it xD

unkempt hamlet
#

I am using free mail server provider for that purpose

mossy cloud
#

Not bad with Scaleway there

#

I can't imagine needing much Bandwith for a mail server πŸ˜›

unkempt hamlet
#

I am feeling more confident with Hetzner though

mossy cloud
unkempt hamlet
#

Well, that's obvious

mossy cloud
#

Yeah, won't need it lol but just seeing how expensive it is lol

rugged copper
#

I tend to use digital ocean for ease. I use laravel forge to configure all my servers and it integrates with it perfectly

mossy cloud
#

I need to write a bash script actually that updates all my MC plugins but the issue is they sometimes have version numbers in the JAR so I don't want to edit the bash script each time a new JAR comes out

rugged copper
#

You should look into gitlab CI/CD

mossy cloud
#

Hmm, I will do thanks. I'll see if it affects plugin configs though (shouldn't do as it's normally just replacing a JAR file)

hollow topaz
#

unless you're selling hosted/managed servers, you don't want to be automatically updating plugins, it breaks compatibility sometimes, especially with sponge

mossy cloud
#

Well if there's something I can say to manually run the script its fine. Because I can do it manually on one server then if it works fine I can run the script on the rest of them

#

It just saves updating 6 servers manually

#

I'm also taking a look at Laracasts... and I'm kicking myself because its actually a LOT more simple than it looks

tardy smelt
#

Github is better for public repo and gitlab for private repo I would say

cinder spear
#

Using a cheap VPS as a mail server can often land you with an IP address that has a reputation for spam

#

Landing a lot of your mail in spam or outright declined

hollow topaz
#

Definitely, always spamhaus your assigned ip range

ember canyon
#

Depends,

mossy cloud
#

Already had words with MS about getting de-listed as we were already listed. We're fine now

tardy smelt
#

That's why I use Gmail Business thing for email. Otherwise I would always land in spam folder.

ember canyon
#

And thats a great idea,

mossy cloud
#

$7.80 per user compared to Β£3 for unlimited users , aliases etc

tardy smelt
#

Yeah but than you get your email in the spam folder so what's the gain if your user doesn't receive the email?

mossy cloud
#

It's not going into Spam though?

#

It did when we first got it, but it's fine now πŸ™‚ Goes into normal inbox and everything

ember canyon
#

kinda weird not to check the spam folder either way ngl

#

Seeing as that stuff happens all the timel

cinder spear
#

I check my spam maybe once a month

quartz moth
#

I hardly check it unless I'm expecting an email and it doesn't arrive

ember canyon
#

Some bad email etiquette ngl

tardy smelt
#

Yeah I never check Spam folder unless I've not receive an email I was supposed to receive. Outlook doesn't have good spam detection anyway. But I rather be safer than sorry since when I usually send email with that email they are pretty important and business related stuff πŸ˜›

rugged copper
#

Has anyone done much with serverless applications, something like AWS Lambda or Laravel Vapor?

cinder spear
#

I've done a few lambdas, but nothing I'd call advanced

rugged copper
#

Ah okay

unkempt hamlet
#

Sorry, what?

mossy cloud
#

I've never seen an admin login that requires Google+

tardy gale
#

Google+? People still use that?

unkempt hamlet
#

No

ember canyon
#

I thought google+ shut down?... 0.o

quartz moth
#

Same tbh

tardy gale
#

and i oop-

unkempt hamlet
ember canyon
#

Key starter

#

For ETS2

#

Can I use it for TruckersMP ?

unkempt hamlet
#

TruckersMP is ETS2.

#

It depends on what action this key starter produces.

ember canyon
#

I mean

#

At a rules point

mossy cloud
#

You'd need to get it to generate a key press

#

It's fine from a rules point

ember canyon
#

It does it

#

Ok

#

If it's fine for the rules.

#

So i'm fine

mossy cloud
#

Yep, it interacts with ETS2, not TruckersMP so you're good πŸ™‚

ember canyon
#

Then it's good

unkempt hamlet
#

Good

ember canyon
#

good

mystic ridge
#

I’ve seen someone wire up an entire Scania dashboard here and use it with TMP :p

ember canyon
#

Wow pepeexcited

ember canyon
#

It's easy

#

Only one Arduino and a external APU

mossy cloud
#

Heya. I'm new to and learning Laravel and passing data from a news table to a view in my controller, but I've noticed I haven't made use of my Model. What is the 'best practice' for this as I understand that logic = Model but it seems to work in the Controller?

unkempt hamlet
#

Check Eloquent in Laravel documentation

mossy cloud
#

ty

ember canyon
#

In two hours: Setup NodeJS, Apache2, mysql, phpmyadmin.

#

And transfer my bot into the new host

#

Started it

tardy smelt
rugged copper
#

Is there any particular reason you don’t use the API middleware for your β€œAPI” routes? And use the api routes file?

unkempt hamlet
#

API routes/middlewares are for stateless calls.

rugged copper
#

Yeah I get that, but surely these api routes have the web state?

#

I may be wrong πŸ˜‚

unkempt hamlet
#

Because they're in Web group

#

API group is stateless

rugged copper
#

Fair enough

unkempt hamlet
#

If you want to make it Laravel-way, you can use Passport package with oAuth2

rugged copper
#

Yeah or API tokens

tardy smelt
#

It the new Laravel update the API routes stopped working for auth user and you're forced to use Passport for authentication.

The way I did the application is the auth user send post, put or delete request to the API base on the auth middleware and this stop working in the newer version so I just moved it to web instead πŸ˜›

#

If you want to improve it feel free to contribute πŸ˜›

rugged copper
#

Ah okay, makes sense

mossy cloud
#

Got user auth working and news articles done today :3

#

^_^

tardy smelt
#

For the auth were you using the Laravel built in one?

mossy cloud
#

Using the laravel\ui package πŸ™‚

mossy cloud
#

@tardy smelt In Laravel 6 the php artisan make:auth command has been removed so now the ui package is required

#

Doesn't help much as now I have a node_modules folder the size of St Paul's cathedral πŸ˜›

unkempt hamlet
#

That's OK since 2018

#

Β―_(ツ)_/Β―

mossy cloud
#

What about the node_modules folder?

unkempt hamlet
#

I meant that folder

mossy cloud
#

Yeah it's okay, but I'm the kind of person that wants to keep files and projects as light as possible

unkempt hamlet
#

Just do not push node_modules on production

#

And .gitignore it

cinder spear
#

it's fine, my npm audit shows literally 1.2 million packages thisisfine

mossy cloud
#

Stupid question but why wouldn't I push my node_modules if they're important to the project?

#

As they contain .JS files won't that cause things not to work? (in the auth views/routes)

cinder spear
#

you usually don't want node_modules in the git repo, but have a caching npm server in the internal network keeping the packages safe for CI/production

#

it bloats the git history just like it bloats the directory

#

the relevant diff is the one in package.lock

unkempt hamlet
#

You do npm prod and it bundles the things

north flax
#

It's supposed to be reproducible based on package.json and package.lock/yarn.lock

cinder spear
#

and yeah, you should be building a prod bundle to run on prod, not npm running it

mossy cloud
#

Alright, thanks πŸ™‚

cinder spear
mossy cloud
#

O.o

#

Yeah let's try and avoid that xD

ember canyon
#

xD

quartz moth
#

Im new to web development. Would people recommend I improve my skills with pure php such as making my own authentication systems or learn laravel as well?

#

Because at the moment Im just using PHP

#

As well as html, css, js of course

unkempt hamlet
#

Well, to improve your skill you need to do a project.

quartz moth
#

Yeah Im working on my own website, Im thinking of a system for users to upload images

#

Ik it sounds kinda simple, however its something to aim to get working

#

Users can currently, sign up, login and change account settings e.g email password username

unkempt hamlet
#

With Laravel, uploading images is not a hard thing.

quartz moth
#

So would you recommend that I try and learn laravel for my project or get used to using php?

unkempt hamlet
#

Well, Laravel is written on PHP, so you will eventually learn both.

quartz moth
#

When you started developing CJ, did you start off with just PHP or learn Laravel?

unkempt hamlet
#

Well, that way depends on the human itself. I can do pure PHP easily as well as learning new language.

#

It is personal. If you think that learning Laravel makes your skills build up faster, it is way to go. You will make to pure PHP part eventually.

quartz moth
#

Ok thank you CJ, it's something I'll start looking into more

last spindle
#

MyPHP is so confusing

#

how can I create an account with that?

unkempt hamlet
#

It is not the right question.

last spindle
#

well

#

xd

#

i have no clue how i should

unkempt hamlet
#

Account creation is not a magic.

last spindle
#

or where i should start

#

well it seems to be magic to me

unkempt hamlet
#

Start with the learning how PHP works.

last spindle
#

e.e

#

i wish i could buuuuuuuut

#

i have no clue where to start

#

like ofc reading those docs

unkempt hamlet
quartz moth
last spindle
#

Well

#

I sorted it out

#

without learning php

#

xd

quartz moth
#

How can u do it "without learning php"

#

thonk xD

unkempt hamlet
#

Well, the point with programming languages IS that you don't need to do it by hand.

last spindle
#

ik

unkempt hamlet
#

So, maybe you have your question wrong.

mossy cloud
#

@last spindle What you screenshotted there was MySQL, which is a database engine. PHP is not related to MySQL but they can be used together in what is called a 'stack'

#

So most websites use the LAMP stack, which is Linux, Apache, MySQL and PHP

#

Apache is the Web Server

#

My most helpful resource was W3Schools, as I found that to be more useful than the PHP Docs :)

lethal willow
ocean mural
#

What is the best Language i should learn next?

serene trout
#

How do I create a trailer skin in Mod Studios 2 because the walls, front, and doors are all separate files?

echo scaffold
#

How do i get stream role

last spindle
#

@ocean mural well what did you learn yet

#

And you actually donβ€˜t learn something you wonβ€˜t need

#

Because you wouldnβ€˜t be able to try what you learnt

unkempt hamlet
#

There is NO best language.

quartz moth
#

True, it depends on what you've already learnt and what you plan to accomplish

last spindle
#

Right

serene trout
#

I need some help with skinning ATS and ETS2 Trailers

mystic ridge
ember canyon
#

My website have finally a Discord Auth

last spindle
#

Well, show us a pic

regal crystal
#

Hello, Developers

last spindle
#

hi

worldly pine
#

Hey guys, I'm in the middle of doing a Java project parsing some Json into objects. I've got it working to an extent however, I have noticed that it's not coming in the same order as what the json file displays?

#

I should also mention that I'm relatively new to java!

#
      try  {
           URL jsonUrl = new URL(url);

           BufferedReader input = new BufferedReader(new InputStreamReader(jsonUrl.openStream()));
           String inputLine;
           JSONArray result = new JSONArray();


           while ((inputLine = input.readLine()) != null) {
               Object obj = parser.parse(inputLine); 
               JSONArray TrainList = (JSONArray) obj;
               result.addAll(TrainList);

           }

           //Read JSON API



           System.out.println(result);

           //Iterate over trainlist array
           result.forEach(stop -> parseNameObject( ( JSONObject) stop) );


       } catch (Exception e) {
            e.printStackTrace();
       }



        }

       private static void parseNameObject(JSONObject Trains)
       {
           //Get Stop object within list
           JSONArray stopObject = (JSONArray) Trains.get("stops");

           JSONObject name = (JSONObject) stopObject.get(0);
           if (name != null) {
               System.out.println(name.toString());
           }
#

I don't know where I'm going wrong!

cinder spear
#

he said Java

winged schooner
#

my bad

floral mist
#

@worldly pine If it doesn't come in the order as in the json file, how does it appear? Is it sorted by name? is it in reversed order?

worldly pine
#

@floral mist the way the json file goes is... name, arrival, depart. For some reason unknown to me, my program outputs arrival, name, depart.

tardy smelt
#

If you request JSON from multiple url. It will order base on the speed the server respond in. So some request the server might respond faster than the other one.

quick glen
#

@worldly pine As per http://www.rfc-editor.org/rfc/rfc7159.txt only the orders of elements in a JSON array are ordered, whilst the orders of elements a JSON object has may or may not be preserved. That depends on the implementation.

#

And afaik, thats how the implementation in java goes too.

unkempt hamlet
#

Also, order of elements in associative arrays doesn't matter since you're getting the value by the key.

cinder spear
#

reading a json file line-by-line almost certainly isn't what you want to do when using a json parser from a library, but idk java that well

quick glen
#

So its not you doing something wrong, its simply working as intended! :)
But in your parseNameObject function I notice you are using an index to access the object's element. Because the order of elements in a JSON object is not preserved, thats a no-go. You should access it by its key.

worldly pine
#

Aaaah that makes much more sense, java is completely new to me so just using this as a learning curve! πŸ˜„

quick glen
#

I do have to say the way you implented the "reading of the API" is a bit.. strange.. but it gets the job done! JSON is only represented as multi-line to make it easier on our human eyes, but to the computer its just one line. So having support for multiple lines isnt necesarry at all

worldly pine
#

Aaah okay, Just trying to self teach at the moment, but thanks for everyone's feedback, it's much appreciated!

cinder spear
#

there are some use-cases where line-by-line json appears (json-based log files for example)

raw notch
#

prettyprint

cinder spear
#

breaks json to multiple lines yes, but it's not complete json per line

quick glen
#

yeah, there's always a million ways to do and implement things xD

worldly pine
#

I mean, there's no wrong way of doing something, just a more efficient path.

cinder spear
#

oh there are wrong ways

quick glen
#

Looots of wrong ways

#

Aspecially the ones that end in a memory leak lol

worldly pine
#

I guess I didn't consider stuff like that haha

cinder spear
quick glen
#

Java was notorious for memory leaks back in the day, but nowadays you kinda have to try (or not know what you are doing at all) to make it have one

cinder spear
quick glen
#

But with the code you had there Fezz. Apart from the .get(0); theres nothing wrong about it! Quite fine for someone relatively new to java πŸ™‚

raw notch
#

oh let's reinvent the wheel!

worldly pine
#

Aaah okay, It was the only way I could get a decent result

quick glen
#

Like, its not wrong to use .get(0) at all, but because the order of elements in a JSONObject isnt preserved its kinda up to chance which element you get.

worldly pine
#

Aaaah I get what you're going with that

unkempt hamlet
prisma robin
#

I have a random question eyesshaking_KnK

#

Who is the Discord server owner?

quartz moth
#

I believe Krashnz is @prisma robin

cinder spear
north flax
unkempt hamlet
mossy cloud
quartz moth
#

Oof

#

Perks of being a student

#

You gonna carry on paying @unkempt hamlet or look for another product?

unkempt hamlet
#

I will wait for another EAP round.

quartz moth
#

Ahh ok

unkempt hamlet
mossy cloud
quartz moth
#

Im still a student :p

mossy cloud
#

You can get PHP Storm for free then @quartz moth πŸ™‚

#

Just use your Educational email address

quartz moth
#

Yeah I use it xD

mossy cloud
#

Ah nice πŸ˜„

quartz moth
#

πŸ™‚

mossy cloud
ember canyon
#

:d

pulsar jungle
#

My PHPStorm edu license expires on the 5th of December 2020 so it's a bit left.

tardy smelt
#

I still have a student license even tho I've not been in college for 4 years ish now xD ablobpeek

grave palm
#

What was updated just now?πŸ₯³

unkempt hamlet
#

Internal changes

unkempt hamlet
#

Huh

quartz moth
#

Interesting

#

Might have to give it a look

unkempt hamlet
#

I used to use Iosevka for that purpose, but this font seems more basic.

quartz moth
#

I just use phpstom's default theshrug

unkempt hamlet
#

It is a Consolas iirc (up to 2019.3.2)

ember canyon
cinder spear
#

firacode ftw

unkempt hamlet
#

Hooray!!!

ember canyon
#

For everyone who want to have the schema. I can even send it.

unkempt hamlet
#

You can show your progress in a forum post πŸ™‚

ember canyon
#

I'll make one since my first time.

#

It was my first arduino project.

unkempt hamlet
#

I have my Arduino too, can't decide what to do with it yet.

ember canyon
#

If you want, you can make a meteo satellite with a little receptor in 2.4ghz.

unkempt hamlet
#

Nah

ember canyon
#

Ok , but I can't send it in space

#

It still need a USB to recharge the battery.

#

Does someone know good Solar Panel in 5v ?

ember canyon
tardy gale
#

pretty

#

the yellow thing looks like an old ipod

ember canyon
#

Or a multimeter ?

tardy gale
#

yuh

ember canyon
#

USB Powered

last spindle
#

Noice

harsh glacier
#

Multimeter better than iPod thonk

tardy gale
#

tbh

#

the green thing looks like an ipod

mossy cloud
#

Now installed, Server Management for Minecraft πŸ˜„

#

Each on it's own docker container πŸ˜„

#

But also allows us to manage stuff like discord bots and CSGO

north flax
#

Premade thing, self made, or combination? πŸ˜›

#

Guessing the first, really. I don't keep track of what minecraft server admin systems exist though :3

mossy cloud
cinder spear
#

mine are just good old systemd units... UI looks neat

mossy cloud
#

Well I normally use screen and just manage it in SSH but I'd rather not give team members SSH access xD

#

And it means I don't need to be bothered for so much if they can manage the servers themselves πŸ˜›

#

Because each server runs on it's own docker container it provides users with SFTP access to that server, so they can edit server files without destroying (or being able to access) anything else on that server

#

Useful feature really πŸ™‚

thick hatch
#

Ptero is great

strong quail
#

Hi bois.
Woah... That is quite some time from my last message here. πŸ˜‚
Idk why I can't use https://fb.me format instead of https://facebook.com while setting my profile on truckersmp 's site.
It goes to same site, however it's a bit strange that I can't use the shortlink.
Translation from Polish "Adjust to format" which is the url you are posting below the text input.

unkempt hamlet
#

Ouch

#

Never know about fb.me links.

#

Gonna fix this. Thank you.

strong quail
#

You're welcome. 😊

quartz moth
unkempt hamlet
prisma robin
#

πŸ˜‚

tardy smelt
#

πŸ’―

prisma robin
glossy granite
ember canyon
#

Ok guys. I have some problem.

arctic mica
#

ye a really messy desk run

ember canyon
#

lol

ember canyon
#

@arctic mica. It isn't.

fervent axle
#

It is. kappa

#

Look like C-D road but on a desk troll ( otherwise, what is the problem then? )

thick flower
#

For me, the messy desk isn’t the problem. It’s the messy desktop that is

ember canyon
#

I got an APU problem

#

So when I use my virtual engine to 100%. My lcd screen shutdown

#

Now it's good

#

But still not working how I want

#

But still. It isn't a mess. I make it clean before to take the pic

ember canyon
lethal willow
outer ice
#

Bastiti what are you trying to do (just curios cant really offer any support :P)

unkempt hamlet
#

Tinkerwell is kinda not logical.

#

You have so many choices, but you rather pay money for THAT? It doesn't even have a quote-on-quote environment, so it is just a dumb PHP shell

lethal willow
#

wait, i didnt even see it was paid

#

I just saw it on Reddit and had a quick glance

quartz moth
#

Oof

mystic ridge
#

A true Redditor is their habitat, doesn't read much about it but it looks cool anyway LULW

lethal willow
#

TRUE

ember canyon
#

@outer ice. Dashboard for ETS2/ATS.

unkempt hamlet
#

Um, you can say it's an ETS2 for dashboard troll

ember canyon
#

...

#

Also, I've printed the wiring schema.

cinder spear
limber tide
#

how can i hyperlink again?

#

nvm

mystic ridge
#

In HTML?
<a href="#link">Text</a>

limber tide
#

yes forgot it but thanks xd

last spindle
#

Eh

#

xd

quartz moth
#

πŸ‘€

nova goblet
#

Ahh yes, Infinite truckers

#

xd

opal arch
#

How is your message connected with this channel at all?

shadow marsh
#

That's, what I'm asking too.

Anyway, I want to begin with website designing/coding (HTML, PHP, etc.) - what can the Webdevs tell me :3 (What do I need, etc.) πŸ™‚

mossy cloud
#

@shadow marsh Do you have a Windows or Mac PC?

shadow marsh
#

Windows thisisfine

mossy cloud
#

I'd recommend you download a program called Laragon. That will install Apache, MySQL and PHP

#

You can then use that to get started, as it creates a web server on your local PC

shadow marsh
#

I already have a local webserver (debian 9 with MySQL, Apache & PHP ) πŸ˜„

mossy cloud
#

Awesome!

shadow marsh
#

thats the reqierements, I know - but - I wanted to know, what do I need as IDE ex. Eclipse πŸ˜„

mossy cloud
#

I would recommend PHPStorm but if you can't afford that I'd recommend VS Code

shadow marsh
#

VS Code - any version or a specified one? πŸ˜„

#

Visual Studio Code, right?

mossy cloud
#

Yeah, always go latest :)

shadow marsh
#

okay :3

#

so, I am now in it - don't I need anything else? πŸ˜„

quartz moth
#

If you're completely new I found w3schools to be more helpful than the php docs @shadow marsh

#

In most cases

shadow marsh
#

yah, Im completely new - only know Java atm πŸ˜…

quartz moth
#

Then w3schools I found to be the most useful

#

But stackoverflow etc is a good place to start

shadow marsh
#

okay, thanks ^^