#development

1 messages Ā· Page 65 of 1

warm sleet
#

I did this for my minecraft server >_>

shy helm
#

Also hotspot optimization are šŸ‘ŒšŸ¼

warm sleet
#

the native code it generates is pretty much on point

#

@shy helm major mistakes that people make with java, is creating too many objects

#

this is why minecraft on java, is kinda a bad idea

#

since everything is an object

#

and short lived objects are bad for performance

#

at least function calls in java are lightweight

#

minecraft is an interesting case though xD

#

without java, I don't think the modding community would be like it is today

shy helm
#

Yeah if you’re creating tons of objects often then recycling is better for performance

warm sleet
#

@shy helm well, I'd still be careful there

shy helm
#

Wait every block in mine craft is an object?

warm sleet
#

@shy helm yeah, so chunk data internally is stored as a byte[]

#

but when you use the APIs or any sort of code interface

#

if you request a block instance for a given location

#

it creates an instance

shy helm
warm sleet
#

immutable

#

@shy helm because immutability

#

if you mean to reuse an object, or modify it in some way

#

you create a new object

shy helm
#

Immutability is not a good property if you’re constantly creating and destroying objects

#

You destroy your performance

warm sleet
#

yeah

#

these are two conflicting principles

#

OO philosophy says: do not reuse objects that can be modified

#

eg; make em immutable

shy helm
#

Which OO philosophy says that?

warm sleet
#

I forget if it was SOLID or GRASP

shy helm
#

I don’t think either say that

#

šŸ˜‹

#

I don’t think immutability is a doctrine in traditional object oriented philosophy

warm sleet
#

I think you're right

shy helm
#

It’s definitely a good property for some stuff

#

Generally simple data classes

warm sleet
#

@shy helm only benefit I can say from the top of my head

#

thread safety

shy helm
#

Yep, agreed

#

But like, if it’s not a POD it probably shouldn’t be immutable

warm sleet
#

@shy helm I think I just confused this with the open closed principle

#

where objects themselves should limit what can be changed

shy helm
#

Ah yeah

warm sleet
#

like these formalities and such, I was taught this stuff

shy helm
#

Open to extension closed to modification

warm sleet
#

but half the time when I am writing code, I apply these patterns automatically without thought

#

because they make sense :D

shy helm
#

If you fundamentally get good code design they do šŸ˜‰

#

From code I’ve read in the workplace, not everyone does

#

Lol

warm sleet
#

@shy helm the biggest design pattern that helped me write larger applications and avoided spaghetti:

#

Dependency Injection principle

#

Its such a powerful pattern

shy helm
#

Yeah, using DI effectively is very good

warm sleet
#

I use it in all my projects now

shy helm
#

The thing though is that you can still have terrible code with DI

warm sleet
#

@shy helm I like using it in places where I am not the initiator of an action or instance

#

like with rest services

shy helm
#

It’s so convenient, but at the same time, you can get into DI hell, which is what springboot has some times

warm sleet
#

class instances get created by the webservr

#

so I don't have control over the constructor

#

but I can.. inject stuff in there

#

@shy helm I like Guice

#

its simple DI framework

shy helm
#

I haven’t touched Java in a bit, but I want to look into guice

#

I’m currently using gnu-smalltalk and ocaml

warm sleet
#

Its runtime DI

shy helm
#

Get me out

warm sleet
#
    private ServiceAPI() throws Exception {
        loadProperties();
        Sentry.init(generalProperties.getSentryDsn());
        injector = Guice.createInjector(this);
        init();
    }

    /**
     * Main entrypoint for the application
     */
    public static void main(String[] args) throws Exception {
        new ServiceAPI();
    }
#

@shy helm app entrypoint^

#

Guice.createInjector(this) calls:

#
    @Override
    public void configure(Binder binder) {
        binder.install(new DatabaseModule());
        binder.install(new WebModule());
        binder.install(new RedisModule(redisProperties));
        binder.install(new StatusModule());
        binder.install(new MetricsModule("metrics.properties", getDataFolder()));
        binder.bind(ServiceAPI.class).toInstance(this);
        binder.bind(GeneralProperties.class).toInstance(generalProperties);
    }
#

even static references

#

can be done by instance

#

so bye bye static objects. and bye bye factories

#

only static instance that exists, is the application entrypoint. and it is stored by the injector

#

so you can just create a 2nd instance of the class

#

and run two applications in paralel

#

in same environment

#

@shy helm example for a database module:

#
public class DatabaseModule extends AbstractModule {

    private final Logger logger = LoggerFactory.getLogger(getClass());

    protected void configure() {
        bind(SqlDatasource.class).to(SqlConnectionPool.class);
        bind(PlayerDao.class).to(PlayerConnector.class);
        bind(HighscoreDao.class).to(HighscoreConnector.class);
        bind(LivePlayerDao.class).to(LivePlayerConnector.class);
        bind(FamilyDao.class).to(FamilyConnector.class);
        bind(ServerProvider.class).to(ServerRmiProvider.class);
        bind(SpellDao.class).to(SpellConnector.class);
        bind(BanDao.class).to(BanConnector.class);
        bind(DaoProvider.class).to(ServiceDaoProvider.class);
        bind(HouseDao.class).to(HouseConnector.class);
        bind(ApiUserDao.class).to(ApiUserConnector.class);
        bind(PermissionDao.class).to(PermissionConnector.class);
        bind(SshProvider.class).to(RedisSshProvider.class);
        bind(LessonDao.class).to(LessonConnector.class);
        bind(new TypeLiteral<Set<String>>() {}).annotatedWith(Names.named("rmi.blacklisted")).toProvider(this::getBlacklistedServers);
    }

    @Provides
    public DatabaseProperties getProperties() {
        return loadConfiguration(getClass().getClassLoader(), "database.properties", DatabaseProperties.class);
    }

    @Provides
    public File getServerList() throws IOException {
        return getConfigFile(getClass().getClassLoader(), "server.list");
    }

    private Set<String> getBlacklistedServers() {
        try {
            return new HashSet<>(Files.readAllLines(getServerList().toPath()));
        } catch (IOException e) {
            logger.error("Failed to load RMI server blacklist: server.list", e);
            return new HashSet<>();
        }
    }
}
#

So it binds bunch of interfaces to class implementations

#

bind(new TypeLiteral<Set<String>>() {}).annotatedWith(Names.named("rmi.blacklisted")).toProvider(this::getBlacklistedServers);
you can also do filtering

#
    @Inject
    RedisSshProvider(Redis redis, @Named("rmi.blacklisted") Set<String> blacklistedServers) {
        this.redis = redis;
        this.blacklistedServers = blacklistedServers;

        try {
            JAXBContext context = JAXBContext.newInstance(SshConfig.class);
            sshConfigUnmarshaller = context.createUnmarshaller();
        } catch (JAXBException e) {
            throw new RuntimeException(e);
        }
    }
#

named parameters

shy helm
#

Looks pretty similar to spring DI

#

Which makes sense

#

Lol

warm sleet
#

It uses the same underlying API

#

javax.inject

shy helm
#

Yeah

warm sleet
#

this is why DI in java is so nice

#

doesnt matter what lib you use

#

the interfaces themselves are interoperable

#

@shy helm but the reason I think guice is better, to say Dagger

#

you get to dynamically assemble your injector

#

so you could have a config file option for db_type: mysql | mssql | oracle

#

provide a module for each of them

#

and then dynamically load the module, depending on your needs

#

Dagger has its DI tree in XML, and it generates a class file during compilation

#

Dagger is faster at runtime, Guice has slower initialization to build the DI tree

#

@shy helm lol, you know you hate spring, when you refuse to use it and implement your own Authorization provider for JAX-RS

#
    private static final String AUTHORIZATION_PROPERTY = "Authorization";
    private static final String AUTHENTICATION_SCHEME = "Basic";

šŸ§€

warm sleet
#

In software engineering, dependency injection is a technique in which an object receives other objects that it depends on. These other objects are called dependencies. In the typical "using" relationship the receiving object is called a client and the passed (that is, "injected") object is called a service. The code that passes the service to th...

#

its just a technique to implement inversion of control

#

commonly used for larger modular applications

#

In software engineering, inversion of control (IoC) is a programming principle. IoC inverts the flow of control as compared to traditional control flow. In IoC, custom-written portions of a computer program receive the flow of control from a generic framework. A software architecture with this design inverts control as compared to traditional pr...

ember torrent
#

So, not sure if this is the right place to ask. But, would 2 3090s be complete overkill for machine learning?

autumn swan
#

"It depends"? A friend is very happy using 1, but says he could make use of 2. He's also actually making money with it though, which changes his approach to it.

ember torrent
#

Well, see I'm upping my workstation later this year and I was looking at 1-2 of them for Blender and Maya for game development, but also for machine learning. I'm still thinking of doing it on the server build, but I'm assuming a 3090 would be better than a P4000 for machine learning due to the vram

shy helm
#

@ember torrent what kind of ML?

#

There's a lot of ML workloads that dont particularly benefit from GPUs

#

or are not worth getting a GPU for

warm sleet
#

getting a GPU for ML is only useful if you have a very specific workload that requires it

ember torrent
#

@shy helm Still doing research on the matter/just getting into it and plan to pursue it. However, I'm still set on a 3090 for the rendering performance. So, I'll probably just stick with one if it's not needed.

#

that's why I'm asking lol

autumn swan
#

I mean, it's certainly not needed šŸ˜„

ember torrent
#

Ya, I'll probably just stick with an asus strix 3090+5900x in my workstation and use the P4000 and the avengers i9 in the server.

shy helm
#

3090 is good for ML workloads

ember torrent
#

But, basically I want to get into excessive AI development.

shy helm
#

unless you're doing deep learning or transformations you probably wont make much use of it

#

more specifically, unless you're doing research on transformations, you probably wont make much use

#

3080 is much more economical option

#

but if you have a 3090 then obviously its fine šŸ™‚

#

but honestly, unless you're planning on doing a PhD, something like a you really dont need a high end card

#

learning AI can likely be done more than easily on something like a 2070

ember torrent
#

Well, I'm an IS major, have CS done on my own+at college, and I don't think I need a 3090 for my other degree, Asian Studies.

#

But, I do music editing/gaming coding/animations/3d modeling/now AI and more/cyber security/networking and more.

#

The reason I'd prefer a 3090 over a 3080 is also the vram for blender and maya

shy helm
#

Fair, but if you're not making money from any of this I would say a 3090 is not worth it

#

price to performance a 3080 is much better for ML, not sure about rendering

#

and if youre just learning ML, you likely wont notice a difference

#

a lot of the workloads you'll do can be done on CPU in a reasonable time

ember torrent
#

For rendering and other aspects the more vram the better. But, it also "depends" on several factors. For gaming a 3090 is overkill, for ML it seems so, but for the projects I work on I've also consumed a lot of vram. Was helping a friend with his studio, and my VII was getting congested.

#

Which is 16gbs of hbm2.

shy helm
#

You sure you were memory limited?

ember torrent
#

I mean that was one factor, not the only. But, it was still a factor and I get annoyed easy with that. I'm still holding off to see sw improvements that could help sorta. But, I also could just get a 5950x I have to go to blender's site again and check a few things.

#

I'm also curious about what render engines are the best. I typically stick to cycles. I haven't really followed lately to see if the 3090 is worth it or not. As the last time I followed it was like 4-5 months ago maybe?

trail prism
ember torrent
#

@shy helm so, after doing excessive research a 3080 or 6900 xt is a better investment for blender. On one hand the 6900 xt is just now maturing, and oddlyg with the new pro render engine by AMD the 3090 gains a frame over cycles. XD So, I'll just wait for a 6900xt red devil or sapphire higher end one.

#

the 3090 only gains 5-10 seconds, but at the cost it's not worth it.

shy helm
#

For ML though AMD GPUs suffer

ember torrent
#

Is it at the sw or hw level?

shy helm
#

Both?

ember torrent
#

I'm getting mixed answers on the matter. Going to check a benchmark on the matter, but uh it might be a temp thing as they still haven't figured out a portion which is, from my understanding, holding the cards back.

runic plinth
vague temple
#

Card

#

They are talking within the 6900xt/3080 range

runic plinth
#

But you’re looking at 25 seconds in classroom vs 79. That’s a huge difference

#

The 3080 is still going to hugely outperform the 6900xt. Only issue is vram

ember torrent
#

@runic plinth well, that depends on the render engine too and other factors.

#

haven't checked in awhile, but doesn't optix disable the ability to do cpu+gpu rendering in favor of just the card?

runic plinth
#

I believe so. But the difference with optix is going to make that option moot

runic plinth
ember torrent
#

@runic plinth Well, what I'm talking about is there's CUDA, Optix, and OpenCL in the settings. Does the Optix settings allow you to enable both CPU and GPU rendering at the same time, or is that still restricted to just the card in Blender? And, have you tested using more than 1 render engine to prove that? Because in every case I've seen originally, and not the difference isn't as drastic as you guys have claimed. It's like 6 seconds for a lot more money, but if you give me minutes sure I'll pay more. I went from a 1950x to a 3900x due to that. But, I'm going for a 5900x for other reasons too outside of just Blender.

runic plinth
#

Yeah it doesn’t allow you to use the cpu as well. But the difference between cuda and optix is better than using my cpu. And I have a 3960x

ember torrent
#

Plus, after looking at certain render engines AMD is going to have advantages that Nvidia has, but they're still being programmed in.

runic plinth
#

And it’s not just a few seconds. With classroom it’s 79 seconds vs 25. That’s 3x

#

Like seriously for blender Nvidia is king

ember torrent
#

So, that's the other reason I was looking more at a 6900xt because 5900x+6900x in the new, not old crap render engine, is supposed to add what optix does but for these cards. It's not there yet, so you have to wait. I'm not buying now as I just dropped a lot on my server lol

#

I'll make my final decision later this year I just dropped over 2000 on server stuff, books, and a tube amp for my guitar.

runic plinth
#

Unless amd comes up with something huge it’s gonna lose in Blender

#

And even if it’s as good as optix it still isn’t gonna be as good as Nvidia just because of how far down it is

ember torrent
#

The main difference is the raytracing factor, and that's what gives them the advantage at the moment. AMD hasn't enabled their RT factor yet, so it's a maybe. That's why I'm waiting.

runic plinth
#

First gen ray tracing isn’t gonna make that big of a difference

ember torrent
#

I mean I still have some doubts because AMD is using SW to handle it for the most part while have some currently disabled physical ones, where Nvidia uses more physical raytracing based cores. So, it will be interesting to see where it goes. But, it's the new AMD Pro Render engine vs Optix. And, hopefully the new one gits gud because the previous one they did was garbo tier from what I heard.

#

The current/new render engine is out, but it's not like "complete" due to them still working on key factors of it. It's beta, but they're acting like it's not.

runic plinth
#

Yeah I’d still go Nvidia for blender. But it’s up to you.

ember torrent
#

What's funny is the 3090 beats it in bmw, for example, by like 6 seconds with some of the RT aspect. They used optix for the 3090, I think, and opencl[clearly] for the amd card. Not sure if they enabled CPU or not in opencl settings. Forgot the classroom difference. I'll give AMD until the fall to improve their stuff, but I'm also not paying current GPU prices.

runic plinth
#

What’s the time in bmw?

ember torrent
#

34 vs 40 I'll have to go back and check the conditions they set as I was watching an anime. I just remembered the 3090 winning by that much. So, again that is a factor to aka the render engine from what I've seen. But, in the default render engine, cycles, with optix ya. What you said is very likely true. I also wonder if AMD is getting an update later outside of just the pro render engine like Nvidia got in the settings. Or, will we be limited to OpenCL?

runic plinth
#

That’s not with optix

ember torrent
#

Let me see if I can find what I was looking at unless you did. I only remember the chart portion from yesterday, so you could be right.

#

I know with Nvidia you can use either CUDA or Optix.

runic plinth
#

With optix I got 11 seconds

ember torrent
#

Using the latest pro render from AMD?

runic plinth
#

3090

ember torrent
#

I'm talking about the render engine not the card or API factor

#

You're using cycles most likely

runic plinth
#

Yes cycles

ember torrent
#

We're talking about 2 different things

#

Also, what version of bmw?

little zinc
#

Hello guys I’m searching for a new laptop for programming only and I found the huawei matebook 14 2020 which as an amd ryzen 7 4800h and 16gb of ram, do you think that will be enough ?

runic plinth
#

Why would I use amd pro render on an Nvidia card

#

1225 sample version

ember torrent
#

I was asking for test reasons lol not for logical reasons also why use cycles and not something else?

runic plinth
#

Cause cycles with optix works

ember torrent
#

Is it still restricted to cycles?

runic plinth
#

I believe so

ember torrent
#

I was going to suggest vray, but I forgot cycles kinda contradicts the need for it in a lot of areas.

runic plinth
#

Btw adding the cpu in makes the render a lot slower

#

The biggest issue with using both is tile size

ember torrent
#

I'm curious if that's on both sides of the aisle or just restricted to certain combinations. Like is it a problem with Intel+Nvidia, Intel+AMD, AMD+AMD, and AMD+Nvidia? Or, is it just the scenario in general?

runic plinth
#

It’s due to how they render.

#

Cpu wants smaller tiles

#

So make small tiles and the gpu suffers. Make large tiles and the cpu holds the whole thing back

ember torrent
#

True, but still I'm curious as to how much AMD gains by finally enabling their RT method. I mean I still feel like Nvidia is going to win due to the higher physical factor vs the small physical factor and heavy SW factor that AMD uses.

runic plinth
#

Like my cpu renders the scene with small tiles in 1:03. My gpu does it in 0:11. Combining them took 3:14

#

3960x and 3090 btw

ember torrent
#

Wow

#

Well, I'm still going to wait until the fall since I just did upgrades I really needed to do more. Our current server was using a 5950, I'm trying to do 4k bluray, and I'm still adding storage to it. Plex, there was restrictions due to the GPU. I probably went overkill cuz I got a P4000 XD

runic plinth
#

I do 4k Blu-ray on my igpu for my Plex server

ember torrent
#

You have to, but the igpu doesn't have NVENC. So, I'm using both the igpu and the p4000. igpu due to the dumb drm factor that only intel has, and p4000 for no restrictions and other things. I'm majoring on the IS side in networking and cybersecurity but I prolly went overkill even for that. I have to take a 3rd language which is probably going to be scripting related like javascript.

runic plinth
#

But yeah for blender get the 3090. If you don’t need the vram get the 3080

ember torrent
#

I mean I'll see what happens in the fall and if the RT add in is not that great then I'll prolly get a 3090 or 3080

#

Ya, I overpaid for the i9 because I'm a comic fanboy

runic plinth
#

Actually if you don’t really need the vram get 2 3080s. It’ll kill even the 3090

ember torrent
#

I'll consider it I was originally going to get 2 3090s XD

runic plinth
#

I just have a little case with 4 10tb and an i3 for a Plex server

#

Little itx build

ember torrent
#

Well, we have 2 networking people and lots of users accessing it and doing a lot on it

runic plinth
#

Ahh nice

ember torrent
#

but, I had to go with intel cuz drm

runic plinth
#

Ahh

ember torrent
#

ya, you still need to use intel for sgx and hdcp which is required for 4k bluray, but you also have to use the igpu for that cuz drm by the bluray thing that like sony, lg, and a few others are the heads of. The alternative is yar har related, so I won't get into that. But, I plan on toying with scripting languages for it. The p4000 was a deal because they're hard to find on the used market atm under 600 bucks. Now, you can hack the nvidia driver if you're using linux iirc to remove the stream restriction, but that's kinda buggy and even a p2000 still wins in plex.

runic plinth
#

Oh I just rip the Blu-rays

ember torrent
#

Though due to plex's limitation factor I've heard, not confirmed, the p4000 does up to 64 unrestricted 4k streams. However, your ISP will hate you most likely.

runic plinth
#

That’s true. I do have gigabit upload tho

ember torrent
#

As do I from "verizon" so, they'd throttle me if I tried that. XD

runic plinth
#

But that’s not enough for even like 8

ember torrent
#

well, it was 300-400 for a p2000 or a 530 shipped for a p4000. So, I got the p4000.

runic plinth
#

Fair enough

ember torrent
#

I'm just happy that usb one now comes with the right cyberlink sw for free, so I can actually watch the movies. I also live in a state where EULA's are actually law. Fun fact, if you live in the US technically ripping is illegal, and even buying keys that technically violate EULAs is illegal. Now, MS came out and said they don't really care if you buy OEM keys, so I'm fine there. They just won't help ya if ya do. As for, ripping a copy you own for your own use even that can be illegal. However, playing it on your own server is not illegal because not going to get into it due to the rules XD

#

So, if you want a backup headache live in either MD or VA.

#

Where EULAs are laws. The rest of the US ruled against it.

runic plinth
#

Yeah it’s a grey area.

#

But yeah I own all the copies. It’s just for ease of use

ember torrent
#

I have Aspergers, and we become obsessive with collecting things that interest us. Glad I didn't get into cars, but tuned down my gaming collection stuff and focused my rigs on school/server/development factors. Quit playing Destiny 2, started reading books for school in advanced, and I'm reading one on C++ to update myself on the game development factor. I'm debating between an SQL or a Javascript course for networking. As, I want to focus more on developing, through scripting, improvements in security factors like 2FA. I already have Java done on the CS level, I taught myself C++ as well as Python and HTML.

#

I got into HTML after toying with site builders 20ish years ago like tripod and anglefire

#

@little zinc Sorry, missed your question. I mean 4800h is great for it but might also be overkill depending on what you're doing. IDE, what your doing, and how long you need it to last are key factors. For a long term C++ one I'd say yes, but if it's a shot term one and you're not really using the full aspect of it then it might be overkill. I went with a lenovo ideapad with a 4700u and 8gbs of 3200mhz for my small mobile workstation. Getting an Nvidia rtx/ryzen gaming one for my mobile one unless a company like system76 doesn't break my arm on pricing.

#

Also, I get grant money all the time and due to conditions I have to blow it on tech or asian stuff. XD So, this is what I blow it on

warm sleet
#

@ember torrent SQL is useful to learn

#

learning SQL the proper way, you first learn information theory

#

and collection theory

#

Learning SQL from a conceptual background is more useful, than learning it through queries

#

knowing how your db is structured, and how you design optimized databases is a skill you need to be taught

#

Normalizing data is also something I was taught during SQL classes

#

and this ^ is the most important skill to have when working with structured information

#

Database normalization is the process of structuring a relational database in accordance with a series of so-called normal forms in order to reduce data redundancy and improve data integrity. It was first proposed by Edgar F. Codd as part of his relational model.
Normalization entails organizing the columns (attributes) and tables (relations) of...

umbral saffron
#

trying it again with a new mic,

import speech_recognition as sr

listener = sr.Recognizer
try:
    with sr.Microphone() as source:
        print("Go ahead...")
        voice = listener.listen(source)
        command = listener.recognize_google(voice)
        assert isinstance(command, object)
        next(print(command))```
#

this gives an eof error

ember torrent
#

@warm sleet Well, isn't SQL more for databasing where javascript is used for that and other aspects?

warm sleet
#

javascript is just a language

#

but learning SQL isnt just a language

#

because the database itself also has a lot of magic to it

ember torrent
#

Well, I'm focusing less on the database factor and more on the security factor while also focusing on that on the side.

warm sleet
#

@ember torrent sql is a tool to learn on the side tbh

#

but its often not taught properly

#

As a java developer myself

ember torrent
#

I mean I might just learn it myself then while learning javascript, but I'm at one of the better schools for scripting in my area.

warm sleet
#

moving to javascript was an odd experience

#

I hate the ecosystem, npm and such

#

such a mess

#

and there's no simple and easy way to write modular applications with deployment inbetween

#

like with maven

#

like, java is so good because it has maven

#

nuget for .NET is also garbage

#

doesn't properly build dependency trees

#

@ember torrent I recommend trying Typescript if anything

#

it feels more familair

#

it adds a typing system

#

and you can make interfaces

#

modules and such

midnight wind
#

plain js has modules?

warm sleet
#

@midnight wind yeah but js modules suck

midnight wind
#

how? just curious, because it works for me

warm sleet
#

require('wat')

ember torrent
#

I mean I'm more of a C++ game developer that does all the work on their own so like the game art, animations, etc while also helping others. But, I learned HTML first from my stepsister then I learned more of it in hs a long time ago. At uni we started with alice3d and raptor then moved on to VB for Windows Programming and then I learned Java for CS1. At uni 2 the VB and Java courses translated to my first 2 requirements now I'm required to take a 3rd which typically the suggest scripting, but the only offer sql and javascript.

warm sleet
#

in typescript you do

#

import {MyType} from "./relative/path/to/file

#

by using export default <>

midnight wind
#

that's also plain js

#

I use that

warm sleet
#

@midnight wind works with typescript

#

but typescript also adds

#

async and await

midnight wind
#

yeah, but that's not something exlusice to typescript

ember torrent
#

So, the requirement for scripting is one or the other, and what's more beneficial to one who's mostly focusing on the cyber security factor?

warm sleet
#

and automatically assumes a Promise

#

and you never have to do .then()

midnight wind
#

ah

warm sleet
#

so you can do

#

const wat = await someFunction()

#

but only

#

if the scope its calling from

#

is also async

#

so you just add it to function parameter

midnight wind
#

wait

#

isn't that also in plain js as well?

#

because I used that

warm sleet
#

@midnight wind its veeery similair

#

its javascript

#

with a typing system

#

but its gradually typed

#

so you can do {wat: string, foo: int}

#

as an implicit type declaration

#

if a function consumes an interface, and the object you put it matches the signature

#

it compiles fine

#

that's 'gradual' typing

#

@midnight wind lemme find some code

midnight wind
#

they go hand in hand in web dev

#

I myself don't know sql

warm sleet
#
export const renderComponent = async <T>(component, content: T, client: UmbracoBlog) => {
    const items = await client.getMenuItems()
    return ({
        rendered: await render({view: v => m(Container, {pages: items, languages: langMap}, m(component, {content}))}),
        content: {...content, culture: client.getCulture(), project: client.getProject(), root: defaultPath}
    })
}
midnight wind
#

ah so TS automatically returns a resolved promise?

warm sleet
#

ye

#

raises an exception otherwise

#

  public async contentRoot(culture?: string): Promise<Umbraco<any>[]> {
    return this.client.delivery.content.root({culture: culture ?? this.culture})
  }

  public async getByUrl(url: string, culture?: string): Promise<Content> {
    return this.client.delivery.content.byUrl(url, {culture: culture ?? this.culture})
  }

#

@midnight wind this is with signatures added

#

you can let the compiler do it implicitly

#

or declare them explicitly

#

in this case, I had to declare them explicitly

#

since its an API

umbral saffron
#

ok so I tried just fixing it and putting the rest together to see if that fixed it and now I have

import wolframalpha
import pyttsx3
import speech_recognition as sr

listener = sr.Recognizer
try:
    with sr.Microphone() as source:
        print("Go ahead...")
        def input():
            voice = listener.listen (source)
            command = listener.recognize_google (voice)
            command = command.lower ()
        print(command)
except:
    pass

client = wolframalpha.Client("private ip")
assert isinstance(client, object)

SearchString = input
res = client.query(SearchString)

print(next(res.results).text)```
and got a bunch of errors
midnight wind
warm sleet
#

@midnight wind like, a method's signature

#

is erm

#

name, parameter and return type

#

like in OO

#

thats the minimal stuff you put in an interface

midnight wind
#

ah

warm sleet
#

In computer science, a type signature or type annotation defines the inputs and outputs for a function, subroutine or method. A type signature includes the number, types and order of the arguments contained by a function. A type signature is typically used during overload resolution for choosing the correct definition of a function to be called ...

#

Type signature describes its methods

midnight wind
#

ah, I now know what it's called. I used it, never knew the name

warm sleet
#

@midnight wind you know what function overloading is ?

midnight wind
#

yep

#

never used it in js though

warm sleet
#

well, you know of the concept

#

where

#

two functions within a scope have the same name

#

but their signature is different

midnight wind
#

yep

warm sleet
#

so different input parameters

rotund plover
#

someone have a good and fast meme api link no reddit?

warm sleet
#

ycombinator?

#

for your daily internet giggles

midnight wind
#

kinda need to show the errors, saying "I got a bunch of errors" doesn't help

warm sleet
#

I cant smell the problem from here

#

@umbral saffron have you tried using the debugger?

#

its a very powerful tool

umbral saffron
#

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/wolframalpha/init.py", line 89, in getattr
val = self[name] if name in self else self[attr_name]
KeyError: '@results'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/name/PycharmProjects/HMA_2.2/lib/python3.9/site-packages/pip/_internal/main.py", line 23, in <module>
print(next(res.results).text)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/wolframalpha/init.py", line 91, in getattr
raise AttributeError(name)
AttributeError: results

warm sleet
#

I still don't see the problem from your source

#

what line is line 23

umbral saffron
#

print(next(res.results).text)

warm sleet
#

yeah

umbral saffron
#

it worked before

warm sleet
#

thats wrong

umbral saffron
#

just after adding speech recognition it wont work

warm sleet
#

@umbral saffron different queries in WA have different structure in their responses

#

there's some fields that are always present

#

others you have to be careful with

#

I recommend using the debugger

#

you can set a breakpoint at the line of code

#

and then in that, you can press the a little calculator button, and run small fagments of code at the frozen point in code

#

so you can figure out what res.results is

#

and what

#

next(res.results) does

umbral saffron
warm sleet
#

@umbral saffron on the left side, you can click on the space left of the text

#

and if you do

#

a red circle appears

umbral saffron
#

oh I know the breakpoint thing

warm sleet
#

yea

#

so when you run your program with the little bug icon

#

it will halt the program if it hits that point

#

and then you can look at all the variables

#

and their values

#

and run small lines of code instantly, to test and mess around

#

figure out what is happening

umbral saffron
#

is this it?

SyntaxError: Missing parentheses in call to 'exec'```
warm sleet
#

idk

#

Again

#

I'm no python expert

#

but you must have made a mistake somewhere

umbral saffron
#

on the right side theres a bar showing ur errors and it says nothings wrong

warm sleet
#

yeah those are syntax errors

#

actual program errors

#

you should fix those lol

#

SyntaxError means you dun goofed up

umbral saffron
#

it says py from _pydevd_bundle.pydevd_comm import CMD_SET_BREAK, CMD_SET_NEXT_STATEMENT, CMD_STEP_INTO, CMD_STEP_OVER, \

#

is wrong

ember torrent
#

Apparently, for me I can do one of two things. I can take the first course which is basic interactive SQL then take the following which is focused on using the understanding of SQL and developing/dealing with cybersecurity. Or, I can just take the one that focuses on AI development.

umbral saffron
#

wait im fixing the issues

#

slowly

midnight wind
#

I myself like cybersecurity, actually just today I "hacked" into some of the beginner machines on hackthebox (with the help of the guide of course). You can get a good sense of security vulnerabilities by actually hacking into them @ember torrent

umbral saffron
#

pentesting

warm sleet
#

@ember torrent cybersecurity is very simple

ember torrent
#

Well, I do have the benefit of living with a retired cybersecurity professional

warm sleet
#

never. ever. send user input to system

#

that includes a shell, a syscall, or a language command

ember torrent
#

I know my mom was a cybersecurity professional for the US coast guard and became a VIP for one of the DC area early physical 2FA makers, I live with a former federal agent for several agencies and was an instructor who had his masters in networking and cybersecurity, and then I'm one of those bored Aspies who did some shade stuff. The reason I am getting into it is to fix bad cybersecurity which is way too common here.

#

Most government sites and servers have more security flaws than they think, and that's partly why they get hacked so easily.

#

There is also the fact that there's no such thing as perfect security, and someone will always find a flaw that they can manipulate.

#

oh right, this is the course that kinda caught my eye " Introduction to Artificial Intelligence: Concepts and Applications"

umbral saffron
#
Traceback (most recent call last):
  File "/Users/masonhowell/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-C/ch-0/203.6682.179/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/_pydevd_bundle/pydevd_console_integration.py", line 4, in <module>
    from code import InteractiveConsole
ImportError: cannot import name 'InteractiveConsole' from 'code' (/Users/masonhowell/PycharmProjects/speechrec_deeplearning/code.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/masonhowell/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-C/ch-0/203.6682.179/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/pydevd.py", line 39, in <module>
    import _pydevd_bundle.pydevd_comm
  File "/Users/masonhowell/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-C/ch-0/203.6682.179/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 91, in <module>
    from _pydevd_bundle import pydevd_console_integration
  File "/Users/masonhowell/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-C/ch-0/203.6682.179/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/_pydevd_bundle/pydevd_console_integration.py", line 6, in <module>
    from _pydevd_bundle.pydevconsole_code_for_ironpython import InteractiveConsole
  File "/Users/masonhowell/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-C/ch-0/203.6682.179/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/_pydevd_bundle/pydevconsole_code_for_ironpython.py", line 305
    exec code in self.locals
         ^
SyntaxError: Missing parentheses in call to 'exec'

Process finished with exit code 1```
#

These are the ones I have left

#

and I dont see an issue with any

ember torrent
#

I think I'll do cybersecurity on my own and networking and focus on AI/ML

shy helm
shy helm
#

Good fundamental understanding of moderately advanced statistics and calculus is a requirement to actually study the underlaying work

ember torrent
#

I got an A in calc and I have to take stat based algebra course first.

shy helm
#

Like high school calc?

#

Or uni calc?

#

The math is not taught in high school, nor likely in first half of under grad. The basis for most AI at the moment involves high order partial differential equations, stochastic optimization, matrix operations (stuff like LU factorization, eigen values), hessian matrices, to name a few things. You should also be comfortable working with proofs (reading and writing)

#

Not trying to discourage you, I just want to make convey that AI is a complex subject rooted in complicated math, if you find the kinda of stuff mentioned above interesting you’ll likely pick it up quite well šŸ™‚

ember torrent
#

I'm 30, not 17 lol. I have a degree that focused on computer science and advanced mathematics. I also did college tier in early hs.

#

I'm good at trig, algebra, statistics, calculus, geometry, physics, and several other variants. Asperger's and interest lol

deft sigil
#

does any one know if you can get pycharm to see a tab as a single char, because its madning , i find settings for tab with and such but it always transforms them to spaces upon editing the text .... i mean notepad.exe does it right cant be that hard...

hollow basalt
#

Are you sure you didn't set the indention as spaces

barren egret
#

Hey any atmel flip user here?

peak acorn
#

Just spent, 40 minutes trying to figure out on my own how to reverse a linked list, and then in the last 5 minutes i realise im stupid and it's like you know less than 10 lines or so

rotund plover
#

Hey someone have a good and fast meme api link no reddit?

ember torrent
# shy helm Oh lol fair

Ya, I went to a 2 year and did up to trig then transferred and did applied calculus, mainly used in IS and accounting, which is basically calc without trig, but I've being doing physics and calculus with trig since I was 14. But, I did get offered to be a TA due to my grade and background of Calculus. A homeschooling teacher I had was a math nerd from the NSA, iirc.

ember torrent
#

I'm loving this new text book I need for one of my IS classes. I've yet to understand how the lower programming class and calculus is needed for it, though.

#

Actually, I hit chapter 2 and now I get why. Anyone have experience with this book? I've heard it's problematic, but the ebook version is the worst.

ember torrent
#

@shy helm @runic plinth I might be getting a 3090 ftw3, actually.

runic plinth
#

That’s what I have

ember torrent
#

someone's offering a used one with the traded warranty for a fair price, so I made an offer to her.

#

It's not scalped either

#

Figured it will be more useful in the long run for ML and other tasks for 3-4 years of not upgrading.

deft sigil
#

@hollow basalt ,... here is the real funny (or not so funny part) if i write the utf8 codes to a file with python , the tabs behave like tabs but if i ad a tab to the same file and then do backspace its spaces again ...

ember torrent
#

@runic plinth well, she sold it. So, I made a scalper's day and got the version I wanted. An asus strix oc 3090. But, I have no confidence in stock for the version I want. On the plus side, I don't plan to upgrade my gpu now for several years.

ember torrent
swift yacht
#

Hello guys,

#

I just got a code for a API i'm trying to run it i'm not sure in what format and how it would run actually

#

`var server = "http://localhost:1300";

$.ajaxSetup({
async: false
})

function getCurrentMatch(){
let currMatch;
$.getJSON(server + "/api/match/", function(response){

}

warm sleet
#

@swift yacht you can just use XMLHttpRequest

#
function reqListener () {
  console.log(this.responseText);
}

var oReq = new XMLHttpRequest();
oReq.addEventListener("load", reqListener);
oReq.open("GET", "http://www.example.org/example.txt");
oReq.send();
bleak breach
honest sleet
#

Hey! I've made a new development log video for the game I'm making with godot engine, showcasing my new textures, shaders and gameplay feature 😃! https://youtu.be/Q9xPZfGWw1g

The antennas are now used simultaneously as collectibles, checkpoints and gameplay elements. I think that it's great in a game to have multiple purposes for each element, instead of just collecting things, make those things give you back some life points for instance like coins in most 3D mario games. I did that in a way with the antennas.

Prev...

ā–¶ Play video
errant raptor
#

`<html>
<head>
<style>
table, th, td, th {
border: 1px solid black;
}
</style>
<body>

<table border ="1" style='border-collapse: collapse'>
<?php

for ($row=1; $row <= 6; $row++) {
    echo "<tr> \n";
    for ($col=1; $col <= 6; $col++) {
       $p = $col * $row;
       echo "<td>$p</td> \n";
           }
          echo "</tr>";
    }
    echo "</table>";

?>
`

hollow basalt
#

what do you mean randomize

#

you are creating a multiplication table

errant raptor
#

simply said

#

i want random icons from a fixed set of 5 icons and a random icon from a fixed set of 5 colors

hollow basalt
#

ok

thorny narwhal
#

@south pagoda sorry to text you here, can we talk in the dm?

#

@south pagoda cause the author of the BR template told me a while ago to not share code of his project in public discord channels

warm sleet
#

cough

#

that php code is toxic

#

CSS, HTML, PHP all in one file kek

rotund plover
fallen cedar
#

it's fine šŸ™‚ he's not writing the next facebook or amazon

#

at that size, i don't see a problem with having things in one file

vital blaze
#

At least it's not the webdev course at my uni that makes the students use images a buttons on the website.

hollow basalt
#

I mean that's basic html

#

make anything a hyperlink

analog notch
#

So i know absolutely nothing about C++ but im trying to compile this github file and its trying to include "winternl.h" but the problem is, all the files it has in there, theres nothing that tries to include winternl.h so i dont understand why there is this error

warm sleet
#

@analog notch lol you casually sliding your black hat business in here?

#

ultimate script kiddie.

analog notch
#

no

#

im legit just trying to figure out why this cpp file isnt working

warm sleet
#

its missing a headerfile

#

@analog notch yeah I am not going to help you build malware

analog notch
#

its not malware

#

its simply just detecting my machine to see if its a VM

#

search it on github

warm sleet
#

I'm looking at it rn

#

@analog notch might need msbuild to compile this project

#

@analog notch there's a project solution file in this repository

#

just install visual studio

#

and open that .sln file

#

install the VC++ development kit

analog notch
#

alright i got it to work through visual studio code

#

thanks

#

Sorry if it seemed if i was doing black hat shit, im just trying to run programs that have anti vm detection and i need to figure out what to change to get it to work on a VM

umbral saffron
#

so Ik i put print(error)
but i dont want it to

#
import speech_recognition as sr

listener = sr.Recognizer()
try :
    with sr.Microphone() as source :
        voice = listener(source)
        command = listener.recognize_google(voice)
        assert isinstance(command, object)
        print(command)
except :
    print("ERROR")```
#

it should take my input right

autumn swan
#

@umbral saffron Did you mean to pass voice (which is just listener) into recognize_google? You basically have listener.recognize_google(listener) which seems wrong (not familiar with this library though, I'll be of limited help). Also source is unused.

#

Also, if you remove the try ... except print("ERROR") you'll get much more information about what actually went wrong.

urban flint
#

anyone know anything about time sync across computers? I have two linux boxes (one VM and the VM host) and I'm trying to determine the lag from send to recieve.

The program is written in python so I'm basically just sending a packet with time.time() and subtracting that from time.time() on the other system.

I'm curious about how precise something like that is.

#

But it also started me on the rabbit hole of how can we even tell that two computers have the same time down to the smallest increment? Both boxes are ubuntu 20.04 with the same timeserver configured so I'm not sure where to go from there.

umbral saffron
#

my css code isnt working

#

like its not doing anything

midnight wind
#

So I guess you could maybe make a program that sends the time across via udp and then corrects for network latency

#

IDK why you are trying to do that though

urban flint
#

True but that's the timing from send-receive-send-receive no? So it's not a measure of the precision of the two computers time

#

like if I set the time on one computer to 5 seconds ahead/behind the ping lag wouldn't change right?

urban flint
#

yeah i read up a little on that. Was more just a passing curiosity about how you would even start to be able to compare times that fast.

hollow basalt
#

since we have time dilation

umbral saffron
#

how do i call a variable i defined but nothing else

#

this is in python btw

hollow basalt
#

uhh what

hollow basalt
umbral saffron
#

so lets say I did
def 123():
1+2 = a
2+2 = b

#

how do I call just 123 and nothing else

#

@hollow basalt

hollow basalt
#

call like invoke?

123()
umbral saffron
#

ohhh

#

I feel dumb now

#

ty

peak acorn
royal agate
#

hey guys does anybody know a good guide or smth to start with c++ from scratch? i study electrical engineering and my professor isnt really good at teaching

ancient thunder
royal agate
#

ok thanks

daring saddle
#

and how do I make http into https

warm sleet
#

@royal agate Codeacademy, Arduino is also a nice learning platform for C/C++, electronics and DIY

ancient thunder
frail jewel
#

@royal agate cherno project's videos, they take about 20 videos before they actually get into it but besides that just think of something you want to make, break it down and google each issue you have, there is no quick way to learn how to code without knowing another language, if you do know another language then hop on C, you can learn C in about 3 weeks if you have some experience, it is a pretty easy language and will be helpful when you start tackling x64 and x86 asm in the future.
guides and stuff like that dont tend to help, you mainly just need to learn the syntax and google every issue you have and you cant just watch a video or read a book, you need to get your hands dirty and try something, apply what you're absorbing, even if it is very basic.

warm sleet
#

Rickrolls were funny in 2005

acoustic stratus
#

hi, i need help with a java code

ancient thunder
#

i would suggest to put your question here, not asking for help

daring saddle
#

and thank you

hollow basalt
daring saddle
#

@devout bluff (dont worry diffrient guy)

umbral saffron
autumn swan
warm sleet
#

IPC benchmark is umbrella term here

#

latency also depends on the kind of virtual machine you use

urban flint
#

My weekend project, a "KVM" that can send your keyboard/mouse signals over websockets to as many computers as you want. The keyboard/mouse have to be connected to a linux machine but there are clients for mac/windows/linux as well.

#

The Mac one is fucky as hell rn because the way it handles some keyboard modifiers are weird

autumn swan
#

Kinda reminds me of a multiterm thing one of my coworkers needed to do (sending same commands to n servers)

urban flint
#

I worded that kinda funky but it only outputs on one computer at a time haha

#

I ordered a rpi0w and want to make my own "wireless" wired keyboard

warm sleet
#

@urban flint using OTG mode?

#

there's a kernel driver in there to emulate a keyboard yeah

urban flint
#

No, just basically strapping a keyboard, battery and rpi0 together and have my program run on startup and connect to my other computers via WiFi

warm sleet
#

@urban flint ew

#

that latency though

urban flint
#

That's why I was asking about timing between computers! šŸ˜‚ Depending on the setup it's anywhere from 20ms to 5ms and below. Which is fine for my purposes. I have some ideas for further optimization but the current lag is not noticable to me

#

And that's wireless-wireless too not a vm

#

It's a 2011 Mac book too so it only gets better I would think šŸ˜‚šŸ˜‚šŸ˜‚

peak acorn
#

ok i wanna know if its possible to like cause and detect a memory error that ECC would otherwise detect

#

can you just like, run a loop a billion times setting a variable to like max_int and then sometimes it wont be equal to max_int?

fallen cedar
#

MemTest86 and Memtest86+ are memory test software programs designed to test and stress test an x86 architecture computer's random access memory (RAM) for errors, by writing test patterns to most memory addresses, reading back the data, and comparing for errors. Each tries to verify that the RAM will accept and correctly retain arbitrary patterns...

peak acorn
#

can i do that myself in any basic language

fallen cedar
#

not sure, not an expert

#

i have a feeling, that you have to be pretty low level to write a useful memory tester (that's why memtest runs outside the OS as a bootable program)

#

if you're running an application within an OS, you won't be really able to write to any random physical memory address AFAIK

peak acorn
#

alr i probably wont bother cos i dont care that much, I was just curious because I feel like if you cant write a programing like java,python, or anything like that, that can cause a memory error without ecc, then ecc seems kinda useless. . .

fallen cedar
#

it's probably possible
but again, not an expert

#

memory error can definitely be triggered from anywhere :) anything that reads/writes memory

peak acorn
#

so youd think you can just make a 1 billion int array and eventually you'll find one that has an issue right?

fallen cedar
#

here they say there is a chance to detect it with write/read loops

https://stackoverflow.com/q/7086236/4620101

In any case, one common way to detect problems in any sort of memory is to run simple write compare loops over the address space. Write 0's to all your memory and read it back to detect stuck '1' data lines, write-read-compare F's to memory to detect stuck '0' data lines, and run a data ramp to help detect addressing problems. The width of the data ramp should adjust according to the address size. (i.e. 0x00, 0x01, 0x02... or 0x0000, 0x0001, 0x0002, etc). You can easily do these types of things using storage performance benchmarking tools like Iometer or similar, although it may be just as easy to write yourself.

If you do decide to go ahead anyway, the obvious way to test is allocate some memory, write values to it, and read them back. You want to follow sufficiently predictable patterns that you can figure out the expected value is without reading from other memory (at least if you want to be able to isolate the error, and not just identify that something bad has happened)

although if i can guess these errors are probably very rare (in non-malfunctioning memory)

deft sigil
# fallen cedar here they say there is a chance to detect it with write/read loops https://stac...

About that last part, 'errors are probably very rare (in non-malfunctioning memory) ' .... Im not that sure about that, enjoy, super interesting presentation : https://youtu.be/aT7mnSstKGs

Speaker: Artem Dinaburg Security Researcher, Raytheon

We are generally accustomed to assuming that computer hardware will work as described, barring deliberate sabotage. This assumption is mistaken. Poor manufacturing, errant radiation, and heat can cause malfunction. Commonly, such malfunction DRAM chips manifest as flipped bits. Security re...

ā–¶ Play video
peak acorn
#

i just started watching this and i know this is gonna be good

peak acorn
#

I tried making *the most epic compression algorithm* which takes bytes and finds the position where N calls of nextInt() in a java new Random(0) that your file appears.
Good news, I can compress a 2 byte dataset into, erm, one 64 bit long. Bad news, It hasnt solved any 3 byte dataset in about half an hour now.

#

Grubby

ancient thunder
#

just refresh the page a few times for new ones

#

a couple of them are genius

fallen cedar
urban flint
#

RE: comparing time between computers. The "lag" between my server and VM (on the same machine) is now around -0.03 seconds per message šŸ˜†

#

from wifi connected computer to wired computer it is reported as around 0.04

#

and after rebooting the vm its +0.16 lol

deft sigil
deft sigil
#

not that the vid i poste d was not educational , because the info in the video is much more detailed but here is the one i was looking for (damn youtube

hidden kettle
#

Hi! I'm trying to learn how to use Ktor, but I ran into a problem. When I try to do this in main:kt val server = embeddedServer(Netty, port = 8080) { install(ContentNegotiation) { gson { setPrettyPrinting() } } }
setPrettyPrinting() cannot be found. I have the io.ktor:ktor-gson dependency installed. What's going on? (I can send code if needed)
Note: I'm following this tutorial: https://ocallaghan-donal.medium.com/building-a-kotlin-back-end-in-15-minutes-5ffdbe018776

umbral saffron
#

how would I import things on rpi python

#

ping me

spring pond
#

@umbral saffron use pip?

#

python is meant to be platform-independent so its pretty much the same on all platforms

hollow basalt
#

Agreed, unless the library has some platform dependent calls

#

Now that I think about it

urban flint
#

sudo apt install python3-pip
Pretty sure the pip search function hasn't worked for months at this point but the rest works fine.

peak acorn
#

I will be poor forever, statistically proven

warm sleet
#

@peak acorn lol, tabs and spaces

#

if I press tab on my editor, I get 4 spaces

#

other developers go into a feud over 2 vs 4 spaces

#

tabs are really anoying, and I filter them with a git hook.

#

source code is monospaced, so you don't need TAB to 'tabulate' to the nearest column

pliant siren
#

Tabs can be configured by the person's editor to fit their preferences. Spaces can not. If you insist on spaces in code I just assume you're a selfish ass.

#

Tabs: "I like 4 spaces. Joe likes two because he still uses 640x480 or some giant font. Let's just each configure our settings and we can both work the way we like". Using spaces is idiotic.

warm sleet
#

@pliant siren tabs have no set width.

#

so when you have code styles that define an 80 or 120 column limit

#

tabs just mess you up

#

Favoring spaces over tabs has nothing to do with selfishness

#

Its just clean code.

midnight wind
#

and people actually use spaces?

#

isn't that annoying

hollow basalt
#

Spaces are more uniform

midnight wind
#

I didn't even know this was a big debate

hollow basalt
#

One thing is certain

#

These rules are overridden by your local configuration

#

e.g. your company or your project

warm sleet
#

@midnight wind there is no issue

#

as long as its either: all tabs, or all spaces

#

but the problem comes when you have a mix.

hollow basalt
warm sleet
#

yeah but tabs are evil, just replace with 2 or 4 spaces depending on your style.

hollow basalt
#

Editors should be smart enough to stop people from mixing

midnight wind
warm sleet
#

@midnight wind not every editor uses same width

hollow basalt
warm sleet
#

and sourcecode is written and displayed with monospaced fonts

#

so tabs are utterly pointless

#

only place where it makes any sense to use tabs is in languages that ask you to do so

#

like YAML

hollow basalt
#

I decide on using space vs tabs when using different prog languages

#

in java,c++ i use tabs

warm sleet
#

heretic.

#

4 spaces you goof.

hollow basalt
#

in python I use spaces

warm sleet
#

@hollow basalt I still use the TAB button, all the time

#

but a single TAB indents by 4 spaces

#

and if i press backspace, it also removes 4 spaces

hollow basalt
#

That's not my point whether you use the button or not

#

I simply use tabs for java

#

cause

#

why not

warm sleet
#

Not sure what the default is that IDEA uses

#

but I think its the oracle code style

#

google's code style is slightly different

#

mostly identing rules and column width

#

I prefer 120 over 80

#

@hollow basalt at the end of the day it dont really matter, as long as everyone uses the same style

#

but thats what we have a .editorconfig for now

#

somewhat standard way to describe line indents and linting logic

ivory bear
#
ZDNet

The vulnerability, named "Baron Samedit," impacts most Linux distributions today.

The Qualys Research Team has discovered a heap overflow vulnerability in sudo, a near-ubiquitous utility available on major Unix-like operating systems. Any unprivileged user can gain root privileges…

warm sleet
#

oof.

#

time to patch my servers

#

thanks for the heads up

shy helm
#

Fewer keystrokes, less time to write the same code, more time for me to not spend writing code šŸ™‚

urban flint
#

I just have my text editors convert tabs to spaces lol

#

I made a shitty interstellar meme using my cross platform(ish) kvm thingy

warm sleet
#

@shy helm my IDE replaces tabs with spaces automatically, and a single backspace also removes same amount of spaces

#

its just how you configure your indentation

shy helm
#

so you basically use tabs but not tabs

warm sleet
#

this is complete ass on editors like visual studio where a tab = 4 spaces, but backspace 1

shy helm
#

curious

#

šŸ˜›

warm sleet
#

yeah

#

@shy helm it makes for cleaner code when reformatting and such

#

it just means I use the tab button, but dont actually inject tabs into the textfile

shy helm
#

idk, I find tabs to be easier to use

#

no need to setup rules to deal with it, it just works ā„¢ļø

hollow basalt
shy helm
peak acorn
#

Glad i started a battle of tab v spaces with one graph hahaha

rotund plover
#

Can I create the register db connection in js without nodejs and connect it to my html registration form ?

spring pond
#

having a frontend database connection is a very big security vulnerability

#

so just dont do it

rotund plover
#

That's what the teacher asked

#

I just wanna finish this project xD

midnight wind
#

he wants you to do that?

spring pond
#

😬

rotund plover
#

He didn't teached us how to do it yet but want a working register

#

And login

#

Well he didn't teached anything but he want the project

spring pond
#

well if he's gonna teach you later then yeah you can do it but just know not to do it in the future

rotund plover
#

Ik

#

I'm planning to create my own website with nodejs express and react or something

midnight wind
rotund plover
#

This is just a project for him

midnight wind
#

but later

rotund plover
#

Ya why not

#

Do you hosting it somewhere or at home ?

midnight wind
#

I will later host it

#

right now it just lives at local host

rotund plover
#

Oh ok

urban flint
#

no idea what caused these spikes. I don,t remember having shitty internet during those time periods but who knows.

peak acorn
#

what is this

#

automated speed test collection?

urban flint
#

basically lol that plus some R code to make pretty graphs

peak acorn
#

Does anyone know what language the software on satellites like starlink would be made in?

warm sleet
#

@peak acorn probably some RT system

#

We can only speculate

#

This is common in telecommunication systems that work in realtime

midnight wind
#

the only concrete answer I found from the spacex team is that they use linux with a special kernel patch

#

And yes, we do a lot of custom ASIC development work on the Starlink project. – Matt

#

All of the application-level autonomous software is written in C++. We generally use object oriented programming techniques from C++, although we like to keep things as simple as possible. We do use open source libraries, primarily the standard C++ library, plus some others. However, we limit our use of open source libraries to only extremely high quality ones, and often will opt to develop our own libraries when it is feasible so that we can control the code quality ourselves. In terms of error handling, there are a lot of different facets to that. Radiation induced errors in computers are handled by having multiple redundant computers and voting on their outputs. Errors in sensors are handled by having multiple different sensors. Errors in data transmission are handled by using error-detecting or error-correcting codes attached to payloads. The software is definitely composed of multiple small modules, the design of which was one of the main things I worked on. There is a hierarchy to the design from low-level component, to sub-system, to entire vehicle. Different subsystems are generally isolated from each other, sometimes in the same computer, sometimes across different computers, with narrow interfaces between them. I'm not sure how long it would take us to re-write the code base from scratch. We don't plan on deleting it any time soon. – Josh

#

All of the application-level autonomous software is written in C++. We generally use object oriented programming techniques from C++, although we like to keep things as simple as possible. We do use open source libraries, primarily the standard C++ library, plus some others. However, we limit our use of open source libraries to only extremely high quality ones, and often will opt to develop our own libraries when it is feasible so that we can control the code quality ourselves. In terms of error handling, there are a lot of different facets to that. Radiation induced errors in computers are handled by having multiple redundant computers and voting on their outputs. Errors in sensors are handled by having multiple different sensors. Errors in data transmission are handled by using error-detecting or error-correcting codes attached to payloads. The software is definitely composed of multiple small modules, the design of which was one of the main things I worked on. There is a hierarchy to the design from low-level component, to sub-system, to entire vehicle. Different subsystems are generally isolated from each other, sometimes in the same computer, sometimes across different computers, with narrow interfaces between them. I'm not sure how long it would take us to re-write the code base from scratch. We don't plan on deleting it any time soon. – Josh

warm sleet
#

@midnight wind so realtime C++ on linux

#

yeah that seems reasonable

#

linux kernels can be compiled for realtime applications

urban flint
#

anyone work with stuff like R or matlab or numpy regularly?

#

How do you do it without wanting to kill yourself?

peak acorn
#

@warm sleet @rancid nimbus @midnight wind thanks

shy helm
umbral saffron
#

So on my raspberry pi it doesn’t have speech_recognition built it on python

#

So I tried to import it and it says it doesn’t exist

hollow basalt
#

Should it

umbral saffron
#

Wdym

#

Oh

#

Yes

#

It’s built into python usually right?

midnight wind
#

you need to install it

#

pip

umbral saffron
#

I did pip3 install speech_recognition

#

It says speech_recognition doesn’t exist

midnight wind
umbral saffron
#

Ahh tyty

hollow basalt
umbral saffron
#

Now I have an unexpected eof error

#

How would I fix that

urban flint
#

you probably have some mismatched quotes or brakcets or something like that

#

the error should give you the line number it happened on

umbral saffron
#

The line is

#

assert isinstance(command, object)

urban flint
#

looks fine to me lol

umbral saffron
#

I don’t see an issue with it either

urban flint
#

would have to see the wider context of the error. Check the lines above and below it as well sometimes line error numbers can be weird

umbral saffron
urban flint
#

object is not defined

#

lets say you wanted to check if x was a str:

x="s"
isinstance(x, str)
#

you can see what type something is (if you don't know) with print(type(<thing>))

#

doing print(type(x)) would print:
<class 'str'>

#

does your RPi have a microphone? that might be another speedbump you run into lol

umbral saffron
#

It does not but I added an external one

#

So I removed the object var

#

Still gives the eof error

urban flint
#

Well something need to go there, the isinstance looks for two variables. But in either case post the whole error code

umbral saffron
#

Traceback (most recent call last):
File "/home/pi/Documents/`.py", line 9
print(command)
^
SyntaxError: unexpected EOF while parsing

urban flint
#

Is the assert still in there? Honestly not a python pro but I use it fairly often and have never run across that before. Comment out that line and see what it does

umbral saffron
#

same error but on the print line

urban flint
#

idk man I typed out the program in your picture and didn't get that error

#

are you sure it is being saved correctly? that you are running the correct file?

umbral saffron
#

I am\

#

its weird

#

i get a lot of weird errors on every device i use

urban flint
#

also you should use a different filename. I don't think that that is the issue but still lol

umbral saffron
#

it autosaves like that lol

urban flint
#

Are you copying this code from somewhere? Not familiar with SR but the

voice = listener
        command = listener.recognize_google(voice)

line is weird to me it's equivalent to
voice.recognize_google(listener) no?

urban flint
umbral saffron
#

indeed

umbral saffron
#

lets see if that fixes it

#

hmmm

#

it gives me the eof error even if i remove the print function or the assert function

urban flint
#

make it just print("test")

#

lol

umbral saffron
#

hmm

#

same error

urban flint
#

save it under a different name and try running it via commandline

umbral saffron
#

how

#

the commandline part

urban flint
#

python3 <filename>

#

the terminal should be in whatever your startmenu is called

umbral saffron
#

hmm

#

well

#

it doesnt exist apparently

urban flint
#

you have to make sure you are in the right directory. Try to save the file as /home/pi/test.py

#

by default on most (if not all) distros when you first open the terminal you are in the /home/<username> directory. this is often abbreviated as ~

umbral saffron
#

i got it to run

#

same error

urban flint
#

open a different text editor and put the simple print("test") in it and try to run that

urban flint
#

No news is good news?

umbral saffron
#

well I had to do something

#

lets see

#

well that worked

#

new Idea

warm sleet
#

The end of the file must have an empty line

#

or you get an end of file error

#

I highly recommend using an IDE with syntax highlighting

#

helps tremendously with spotting issues like these

#

also, every python script should start with a shebang

#

#!/usr/bin/env python3

#

after you chmod +x script.py

#

you can do: ./script.py

#

instead of python3 script.py

#

same goes for bash scripts or any language for that matter

#

just include interpreter information in the shebang, and the shell will call the right interpreter

urban flint
warm sleet
#

pycharm generally quite easy too

#

with built in debugger

urban flint
#

it's the winrar-esque payment model where they tell every x number of saves that you are not using a registered copy or something but it is not that intrusive

warm sleet
#

I use the jetbrains toolkit for all my projects

#

all those IDEs for the various languages behave the exact same way

#

so its a lot easier to get your work done

#

its all based on IntelliJ

#

best IDE imo

#

I get you can write small scripts with a simple text editor

#

but once you work on large systems, with database and server facade integrations

#

having this kind of program is just nicer xD

urban flint
#

also if you use linux to linux sshfs is amazing for editing remote files you could probabny find a linux to windows but i use mainly linux so it fits great in my workflow

warm sleet
#

@urban flint yup

#

if you do development for an rpi

#

always use sshfs :D

#

its great

#

@urban flint I can usually get my software to run on all operating systems

#

its just, the moment you have to work near things like filesystem and driver integration

#

that it becomes hairy

#

just hope that someone had this problem before you, and wrote a library for it xD

#

I've written my own javascript standard library before >_>

#

for nashhorn in java

#

interpret javascript, gets compiled and executed as java byte code

#

for writing testcases in a healthcheck daemon, that had a bunch of legacy libraries it needed

#

now they could be changed by the sysadmin, without the need for recompile of software

#

and then oracle pulled the plug on Nashhorn with java 9 rip

#

@urban flint thing is, I can do development on macOS just fine with brew, since its bash and a unix system

#

windows just feels so flaky, as if its not designed for it in the first place

#

and linux, I can do development and also tweak everything on my system to my liking

urban flint
#

i use windows in a VM occasionally and it is nuts how bad it has gotten, the popups the pushing of edge. how that doesn't violate the same thing they got busted for in the 90s is beyond me

#

the only macos version i currently have access to is high sierra and half of the brew packages doesn't even install lol

warm sleet
#

@urban flint my windows is stuck on version 1909 lol

#

thats before they took it to the extreme

#

but it does do shit like this if you search for 'chrome'

#

New

Launch Now

urban flint
#

how the hell is that not violating anti-trust or some shit.

warm sleet
#

you think microsoft cares?

peak acorn
#

The idea you can customize everything on Linux is fine until you have to learn how to customize and you realise you would just prefer explorer.exe and whatnot

warm sleet
#

there's plenty of DE choices

urban flint
#

yeah the "linux is only free if you don't value your time" thing is very true in my experience

warm sleet
#

@urban flint the problem is that there's no good defaults for the devices you want to install it on

#

when you buy an asus, acer or whatever laptop

#

it comes with windows preinstalled

#

and all the software to interact with the unique hardware, is built into windows programs

urban flint
#

there's system76, and I think dell was putting ubuntu as an option for a while

warm sleet
#

@urban flint yeah but that is a unicorn in a field

peak acorn
#

^^ expensive AF

warm sleet
#

everyone is stuck into this ecosystem

#

where documents are word documents

#

and email is outlook

#

especially businesses

#

and microsoft is clever in this regard

#

office for mac only exists

#

so microsoft doesn't have to compete with apple

#

all the windows software is deliberately locked down, so you buy their operating system

urban flint
#

libre office works fine for me. I usually just google what I want to do + excel and the solution is identical for libreoffice lol

warm sleet
#

@urban flint yeah thats not the issue

#

but the moment you send an .odp or .odf file to a collegue

#

this breaks appart

peak acorn
#

Do they not do pdf

warm sleet
#

that's not a document you'd edit, would you?

#

that's an interchange format

#

Windows is everywhere, everyone is used to it, and the moment it is slightly different, it upsets people

#

and the main problem with windows, is that legacy hardware and software, is no longer compatible

peak acorn
#

Well yea cos u dont wanna install new software lol

warm sleet
#

and if I buy something, I expect to be able to use it in 20 years lol

urban flint
#

you can probably set docx as default format for libreoffice to save in

peak acorn
#

Can the libres not do docx and xsx or whatevrr excel is?

#

Well, just csv is fine for that part. But docx?

warm sleet
#

@peak acorn they can open microsoft documents and vice versa, but you get a lot of render issues

#

CSV is an open standard

#

I don't even use libre lol

#

I use LaTeX for documents

urban flint
#

ah a man of taste

midnight wind
#

Yeah Kile is nice

peak acorn
#

I have to learn latex for my cs papers this semester q_q

warm sleet
#

@peak acorn for simple documents in pdf I use pandoc

#

it can convert markdown into latex, and then pdf with pdflatex

#

so you can do chapter headings with markdown like # Hello whatever

#

and by adding the -N flag to pandoc, it enables numbering, and at the top of your document you just leave a \tableofcontents

#

and it generates that too

#

markdown is generally easier for simple chapter constructs

#

and all the tex stuff you can put in a header file and load that with the document

#

but resource inclusion with images is just much easier

#

when you have diagrams that are generated as data output

#

you don't have to copy paste them into word every time xD

peak acorn
#

Hmm

#

Good to know about

warm sleet
#

latex is just nice, because you can use it purely from commandline

#

I've used it in the past for generating reports in software

#

get nicely styled, but generated pdf documents

#

for invoices and monthly reports

#

and other things that people might want to print

#

@peak acorn also, if you ever need to write something for foreign markups

#

like a forum that uses BBcode or mediawiki's horrendous markup language

#

you can use pandoc to just generate that from a markup you prefer, like markdown :)

peak acorn
#

Bruh my college aint teaching me shit l0l

warm sleet
#

they only teach you the relevant skills to further teach yourself

#

thats what studying is

#

xD

#

even if you have a degree in software development, you still need to teach yourself

#

stay up to date with new tech, attend seminars and such

peak acorn
#

Yea bla bla i know i know but these classes hardly even teach

#

I can write poor c im pretty sure i could pass this class after a week or less of review

warm sleet
#

@peak acorn I had one teacher in college that gave me pandoc as a tip

#

since he saw me working on linux primarily

#

and he was one of the only teachers I know of that actually used linux on his primary system

#

all the others were windows or macs

peak acorn
#

My teachers are on macs

warm sleet
#

I saw my embedded hardware teacher try to install Windows IoT core on a raspberry pi

peak acorn
#

Lol

warm sleet
#

he had his laptop on the beamer after the slides were through

#

and everyone was tinkering with their electronics

#

I knew what kind of person he was when I asked: what kind of kernel does that thing use?

#

"why would I care"

#

he only cared about the runtime lol, which is .NET portable

peak acorn
#

Hm

#

Yeah ive only had 1 kinda 2 cs classes so far any they were fuuuuuckin easy

midnight wind
umbral saffron
#

ty tho for the help

midnight wind
#

Vscode allows remote ssh

#

So vscode runs a server on the pi, but the gui is on your machine

umbral saffron
#

Oh cool

midnight wind
peak acorn
#

All the things i actually want to tey with tend to he a lot more eectronics than programming

#

But once i get started i hate electronics

#

Code good

warm sleet
#

@midnight wind you can do this without visual studio code

#

just saying, these tools have existing long before microsoft ever put them out

midnight wind
#

I'm just familiar with this tool

warm sleet
#

@midnight wind microsoft has just after 30 years finally acknowledged linux

warm sleet
#

is that BoomerMode?

#

@rancid nimbus you should call the plugin Silver Surfer

peak acorn
#

Because people want virusses

marsh cobalt
#

idk why

warm sleet
#

@marsh cobalt I broke my windows store install

marsh cobalt
#

lol

warm sleet
#

so I could remove the telemetry

marsh cobalt
#

oh ok

warm sleet
#

just yeeted a bunch of DLL's

#

xD

#

it still gets security patches

#

but no feature updates

marsh cobalt
#

when searching chrome

peak acorn
#

No way

#

What the fuck i need that lol

marsh cobalt
#

I know that sometimes 2y ago

#

I disabled those fucking annoying edge search results

#

or bing search results

#

Maybe it affected this

peak acorn
#

I didn't evn know u can

marsh cobalt
#

Well you should not

#

But it is possible by overwriting some registry keys

peak acorn
#

Damn

#

Cos it's atrocious and nobody ever uses it

marsh cobalt
peak acorn
#

🐸

#

🐸 we like windows 🐸 we like windows 🐸 we like windows 🐸

marsh cobalt
#

I hate windows NGL

peak acorn
#

I like it over any Linux on desktop

marsh cobalt
#

I use it only because raytracing in games is not a friend with linux

#

Or at least, Wine does not support it atm

peak acorn
#

I dont rly care but i like using windos

marsh cobalt
#

I wish I could say that

gusty girder
#

I was researching gzip, and pretty much all implementations use on the fly server-side encoding.
But for static content, is there a way/point to storing it already gzipped and just serving the gzip file instead?

honest sleet
#

Automating a noise reduction filter presents two main issues. I found nice and "clever" ways of dodging those issues, I explain and try to vulgarize them in my latest video: 😊
https://www.youtube.com/watch?v=YAR4DRFxKU4

I'm automating the noise reduction filters applied on my audio tracks. This presents two issues, having to find an audio chunk containing only noise and having to deal with artifacts from SoX's built-in noise reduction filter. Fortunately, I found nice ways of dodging those issues, and I'm quite proud of them, especially the removal of artifacts...

ā–¶ Play video
ashen sky
# gusty girder I was researching gzip, and pretty much all implementations use on the fly serve...

There is a way to do it, it might make sense if you have huge chunks of text, like static HTML, text files, CSS, javascript etc. Some webservers (I know Apache for sure can do it) will server file.html.gz in place of file.html, even when the browser just asks for file.html. That will save bandwidth, disk space and CPU time. However, unless you are able to reduce the size substantially, and have a HUGE number of visitors, not much will be gained from precompressing the data. And for binary content, like image and video, the compression already applied, is usually so good that gzip will not be able to reduce the file much, I've even seen the resulting file increase in size after "compression"

urban comet
#

Does anyone use grafana and prometheus?

urban flint
#

I tried to document it well. Tell me if you have any questions/feature requests

#

honestly just need way more deskspace for more keyboards and usb ports lol

vestal glen
frigid knot
#

You guys are all smart

#

Why cant I import mysql data

warm sleet
#

@rancid nimbus lot of thirdparty plugins for a minecraft server rely on mysql as a storage backend

#

while some may do flatfile, others prefer an SQL db

#

@frigid knot does your data export include table definitions?

marble hedge
#

hello. I just wanna ask if someone is currently running a JRE 9

#

@rancid nimbus I tried to pm u but I can't. Anyways, so I installed JRE 9...But when I tried to check using java -version, it says its not installed lol

#

yah jre se 9

#

hello?

obtuse night
#

Is the path to your java exe in your $PATH environment variable? this is usually done automatically but sometimes isn't

#

eg. for the dotnet command for C#, i have the following PATH entry:

C:\Program Files\dotnet\

which points to the following folder with dotnet.exe

marble hedge
#

oh btw...im running Ubuntu 20.04 I forgot to mention :c

marble hedge
obtuse night
#

/etc/environment

#

java should be installed to /usr/local/java/

frigid knot
#

You need mysql if you are using bungeecord. And I figured out what was causing issues, apparently the .sql file is corrupt. So that’s great.

marble hedge
marble hedge
#

ALREADY DID FINALLY LMAO.