#development

1 messages · Page 70 of 1

tired juniper
#

it's not the exact same name but I renamed it,and still the same

tired juniper
#

finally! there might be some unused code there but honestly I don't care! If it works,it works!

#

It turned out that you have to use a Validating event even on the button to be able to set the DialogResult to false,otherwise even if you set it it doesn't care,it acts as if it's not.WTF? But it actually works now @warm sleet

peak acorn
#

Does java have an equivalent to python's "x = y or z" where if x=y iff y isn't null, otherwise x=z

hollow basalt
#

just use ternary

warm sleet
#

@peak acorn Ternary operator

#

@peak acorn condition ? true : false

#

int wat = (foo != null) ? foo.intValue() : 0

#

@tired juniper I still struggle with building coherent applications in .NET forms

#

deperating view logic from functionality is annoying

#

I usually try to associate event handlers with this, and then making references on those

#

like, getting a thing to work in .NET forms is easy enough

#

but building larger applications without it turning into a total mess, is a bit more difficult

warm sleet
#

@tired juniper generally, you should define your own events

#

things like validation, would be its own event

tired juniper
#

yeah

warm sleet
#

@tired juniper do you know how to use events in C#?

#

language has some constructs built in

#

to make this easy

tired juniper
#

yeah I think,you mean thouse evnets with the lightning icon in the designer. For example mouse click event(you type a custom name for the method) and then it creates the event

warm sleet
#

Nah, I mean

#

defining your own events

tired juniper
#

well I haven't done that yet

#

is it difficult

warm sleet
#

not really

#

the idea, is that you decouple functionality from your logic

#

so your logic listens for an event

#

like, ValidationEvent

#
public class SampleEventArgs : EventArgs
{
    public SampleEventArgs(string text) { Text = text; }
    public string Text { get; } // readonly
}
#

you create a class that holds the properties of that event

#

like ValidationEventArgs

#

and then to create an event, you need an event handler

#

Im assembling some bits of code

#

hold on

tired juniper
#

ok

warm sleet
#

right, so in my case, I have a special interface for the handler

#
public interface ISimpleEventHandler{
    void OnSimpleEvent(SimpleEventArgs e);
}
#

this is used a reference for the delegate itself

#

now there's two bits missing

#

the handler itself, and the code that you write to invoke an event

tired juniper
#

yeah,that is not as difficult as I thought. You make your own class and then handler but how do you exactly invoke it?The event

warm sleet
#

right, for that. the language has a special keyword

#

hold on

#

so in your class that raises an event

#
    // Declare the event.
    public event SampleEventHandler SampleEvent;
#

you just declare this field

#

wait scratch what i posted before

#

I found a simpler example

#
class Counter
{
    public event EventHandler ThresholdReached;

    protected virtual void OnThresholdReached(EventArgs e)
    {
        EventHandler handler = ThresholdReached;
        handler?.Invoke(this, e);
    }

    // provide remaining implementation for the class
}
#

so this declares an event, and a method that you can invoke to call this event

#

to add a handler

#

what you do

#

you 'add' your delegate to the event handler

#

this.ThreshHoldReached += <delegate>

#
class Program
{
    static void Main()
    {
        var c = new Counter();
        c.ThresholdReached += c_ThresholdReached;

        // provide remaining implementation for the class
    }

    static void c_ThresholdReached(object sender, EventArgs e)
    {
        Console.WriteLine("The threshold was reached.");
    }
}
#

^ this is the kind of method that the editor generates when you add an event handler for a button click

#

the event itself is declared in the class that represents the button

#

and you just attach a handler to it

#

so imagine you had a counter that used the system clock with a specific timeout

tired juniper
#

ok I see so when you make it yourself you just have to write your own class. And then attach the handler and trigger the vent and then you can use the method just like in the automatic ones

warm sleet
#

once that timeout has been reached, the Counter would raise OnThreashholdReached

warm sleet
#

and the event handler, then executes every single delegate added to that event

#

since you are not limited to 1 event handler

#

though if you wish to do multiple event handlers, you do need to modify the construct slightly

#
    // Define the delegate collection.
    protected EventHandlerList listEventDelegates = new EventHandlerList();
#
    // Define the MouseDown event property.
    public event MouseEventHandler MouseDown
    {
        // Add the input delegate to the collection.
        add
        {
            listEventDelegates.AddHandler(mouseDownEventKey, value);
        }
        // Remove the input delegate from the collection.
        remove
        {
            listEventDelegates.RemoveHandler(mouseDownEventKey, value);
        }
    }
tired juniper
#

yeah so you make like a list with eventhandlers

warm sleet
#

yeah

#

the concept that really, powers this

#

is 'delegate'

#

think of a delegate, as a function pointer

#

instead of holding a reference to a value or object, it holds a reference to a method

#

C#'s guide defines them as:

#

A delegate is a type that represents references to methods with a particular parameter list and return type.

#

you can even define a delegate

#

public delegate int PerformCalculation(int x, int y);

#

and then implement it as: (x, y) => x + y

#

anonymous functions

tired juniper
#

so it defines what your method will accept and return

warm sleet
#

exactly

tired juniper
#

for the event

warm sleet
#

a delegate describes the signature of the method

#

in this case, we use it to define the signature of the event handler

#

because remember, each event has a different class for the EventArgs

#

so by using a delegate, the compiler is type safe when making these references

tired juniper
#

so you choose what EventArgs will be for your event

warm sleet
#

There's some type variance as well in delegates

#
class Mammals {}  
class Dogs : Mammals {}  
  
class Program  
{  
    // Define the delegate.  
    public delegate Mammals HandlerMethod();  
  
    public static Mammals MammalsHandler()  
    {  
        return null;  
    }  
  
    public static Dogs DogsHandler()  
    {  
        return null;  
    }  
  
    static void Test()  
    {  
        HandlerMethod handlerMammals = MammalsHandler;  
  
        // Covariance enables this assignment.  
        HandlerMethod handlerDogs = DogsHandler;  
    }  
}  
#

so you can use it with OO inheritance

#

but this is advanced C#

#

to use delegates, you only need the basics

#

to write them, is a bit more involved

#

and my C# knowledge is rusty ;)

#

I wrote in it many years ago

#

I now mostly do Java, and recently I picked up TypeScript

tired juniper
#

yeah,but that's not as complicated as I thought. thanks! I mean the inheritance is a bit more complicated but without it it'snot as hard,I might try to define my own handlers if I need specific things that don't exactly exist already

warm sleet
#

Inheritance isnt that complicated. its just knowing how and when to apply it correctly, is difficult

tired juniper
warm sleet
#

many people tend to overcomplicate their structures

tired juniper
#

yeah

warm sleet
#

@tired juniper I draw from general OO concepts

#

these ideas work in many languages

#

its just the semantics that are different

#

this is incredibly powerful

#

subtyping is a form of polymorphism

#
abstract class Animal {
    abstract String talk();
}

class Cat extends Animal {
    String talk() {
        return "Meow!";
    }
}

class Dog extends Animal {
    String talk() {
        return "Woof!";
    }
}

static void letsHear(final Animal a) {
    println(a.talk());
}

static void main(String[] args) {
    letsHear(new Cat());
    letsHear(new Dog());
}
#

C# would look incredibly similar

#

(this is Java)

#

where java uses the word extends C# just uses the : operator

#
class MyForm : Form { 

}
#

this makes MyForm inherit from Form, it is a subtype

#

I think C# also uses the keyword abstract

tired juniper
#

aha so the first one is the inherited one,and it inherits all the properties

warm sleet
#

yeah, abstract types cannot be instantiated

#

they are like interfaces

#

but they can contain properties

#

so you can't do new Animal()

#

but you can declare Animal[] animals; arrays and such

#

and this animal array can then contain both dogs and cats

tired juniper
#

yeah

warm sleet
#

but you can only use the functions and properties they both share from their parent type

#

you can for example do animals[0].GetType()

#

and if you compare this with == typeof(Dog)

#

it would be true, if that Animal is of type Dog

#

^ this was C#, but in java this would once again be very similair

#

animals[0].getClass() == Dog.class

#

^ java

#

objects are instances of classes

#

and you can always get the type of an object

#

if you now, wish to call a method on that Animal, that you checked and found that is a dog

#

you could cast this

#

Dog myDog = (Dog) animals[0]

#

however, if the animal in questioin is not of type dog, this would raise an exception

#

^ this is bad practice though if you have to do this in your code a lot
its usually the result of bad OO design

#

Polymorphism allows for generalization like: Animal foo = new Dog()

#

and casting allows you to do the inverse

#

@tired juniper a good tip I can give you

#

in your visual studio solution

#

create a 2nd project

#

Right click the solution in the explorer

#

and click 'add new project'

#

and select Class Library

#

in your class library, you can create all the program's internal functions and logic

#

and your winform application, then uses this class library to provide a visual input/output layer for the logic

#

so your entire validation logic, the datastructures it uses, all of that, you store in your class library

tired juniper
#

oh so you can modify the logic and add custom stuff

warm sleet
#

yeah, so the calculations and such that you do

#

are not dependent on a form

#

the form merely uses that code

#

so you could turn it into a console application as well as a graphical application

#

or whatever

#

slap a webserver in

#

and make it into a webapp

#

xD

tired juniper
#

wow

#

nice

#

so technically you can make your own app which looks the way you want without the constraints the form puts on you

warm sleet
#

well, there's a concept of layering in software design

#

data layer, presentation layer

#

Like for example, consider this project I made in java, a project that consists of multiple libraries and programs

#

this is for a minecraft server of mine

#

This is the service-api-server its a project that provides a webservice

#

it depends on data models and classes described in the stubs

#

each of these blocks are class libraries, and the arrows point to the other libraries that they use

#

this plugin runs on the actual minecraft servers (there's total of 4)

#

plugin, a webservice, and a webapplication

#

the stubs describe the data structures, and the client connects them all up

#

maybe this example is a bit over the top
But what you should take away from this is that by turning your software into small blocks or units of code, that each have their own function

#

you can keep your code easy to read and understand, even if it is part of a larger project

#

in fact, you need this kind of structure, for larger programs

#

because at some point the complexity just becomes overwhelming, and this slows down development

#

That screenshot, let me show you how simple the code is behind that

#

So the webapplication, has to fill that table with data, which it gets from the client

#

this is the presentation layer, and it doesnt need to know anything about the data layer

#

since it is abstracted away.

#

this is the power of object oriented programming

tired juniper
#

and definitely it can get messy with bigger projects

warm sleet
#

:D

#

This is what that client exchanges with the server

#

just xml documents going back and forth

tired juniper
#

also you have your own Minecraft server nice

warm sleet
#

well, someone else technically owns it

tired juniper
warm sleet
#

but i have access to all the admin stuff on all our machines

#

oh and! it can do json

#

if you just send an HTTP header

#

it will also provide data in json format

#

building webservices with .NET is also not that hard

tired juniper
#

nice,I also like your name Hogwarts,I am a big HP fan

warm sleet
#

@tired juniper haha, I am not at all lol

#

I joined them, because they needed a skilled programmer, and I was looking for a hobby project to hone my skills

tired juniper
tired juniper
warm sleet
#

I talked to their owner on IRC back in 2014

#

who had just split away from some other community, and were using this crappy minecraft hoster

#

I was like 18 at that time, and I had already got some linux experience

#

so I set them up with a dedicated server, and in 2015, I made efforts to build a cross-server synchronization system

#

we have like 5 worlds, and we synchronize inventories and such

tired juniper
#

nice

warm sleet
#

lot of effort xD

#

but its quite cool, we have realtime chat synchronization as well

tired juniper
#

yeah sounds like it but you found a nice job

warm sleet
#

and our players each have a roleplay name

#

I don't get paid lol

#

this is all a hobby

#

we make a net loss on the server

tired juniper
#

oh ok:D

warm sleet
#

beefy box we've got

#

12 core xeon with 64GB ram

tired juniper
#

well I mean it's a cool hobby then

tired juniper
warm sleet
#

we want to upgrade

#

ideally to a threadripper platform

tired juniper
#

😮

warm sleet
#

more per core perf

tired juniper
#

yeah,well it's a beefy machine but I get it there is probably lots of people on the server

warm sleet
#

not as many as we used to

#

now we have like 20-30 people on in the weekend

#

during 2016-2018, like 100+

#

but everything we have

#

is all custom

#

potions, quidditch, wands and spells

#

roleplay classes and such

#

If you add those up ^

tired juniper
tired juniper
warm sleet
#

we have like 50k users or something like that

tired juniper
#

nice

#

I might consider playing in your server sometimes I love the role playing stuff

warm sleet
#

I feel too old for the community

#

mostly younger people that play there

tired juniper
#

just like Hogwarts

tired juniper
warm sleet
#

I'm 25 lol

#

owner is now 29

#

but yeah, thousands of lines of code

#

and many years of effort from about 3-4 people, and 50+ some who had minor contributions

#

this core project I wrote, for just the database synchronization and web api and panel

#

is just under 30k lines of code

#

I also wrote the potions engine

#

though that is getting a rewrite by someone else soon

tired juniper
tired juniper
warm sleet
#

we scraped the harry potter fandom wiki

#

to get a list of every single potion ingredient known about

tired juniper
#

yeah there should be everything you need there

warm sleet
#

and then I had an army of minions give catchy descriptions to each item

#

and come up with textures

tired juniper
warm sleet
#

Imostly wrote code

#

ye

tired juniper
#

well yeah everyone's got their own thing to contribute with

warm sleet
#

we do that a lot lol

#

we use json for a lot of this stuff

#

its simple enough to understand for someone writing things like translations

#

most of our plugins that do a lot of text output to the user

#

are in multiple languages

tired juniper
#

cool multilanguage support

#

so even non English speakers can play

warm sleet
#

ye

tired juniper
#

wow you guys really put a lot of effort into that well done! Also I really want to try your server now I like HP stuff,does it have a code or something(i don't know how minecraft sever joining works)

#

I can join and try it out when I finish with my school projects

warm sleet
#

well, you need to have a minecraft account, and have purchased the game ofc

#

nah, its just join by IP

#

I think its either hp.knockturnmc.com or play.knockturnmc.com I think either work

tired juniper
#

thanks!

#

I will give it a try

warm sleet
#

but yeah its at least worth checking out the scenery

#

there's a bit of scripted roleplay when you first join

tired juniper
#

oh yeah that would be awesome

warm sleet
#

buying your first wand and traveling to king's cross station

tired juniper
#

wow it's like an actual Harry Potter game in mineccraft I love it!

warm sleet
#

Quests are also a thing now.. I believe

#

I haven't really kept up with the developments in the last 2 years

#

I mostly maintain servers and our network

tired juniper
#

I haven't played minecraft a lot but I might now xD

warm sleet
#

I play modded mc

#

I have a private server up for that >_>

#

whitelisted to anyone cool enough to join

tired juniper
#

you have an important role in it

warm sleet
#

I was one of the original founders yeah

#

though I don't really play at all

#

I am in schoolyear 3 by just afking

#

with 0% class attendence

#

there's a very slow passive xp trickle you get from being online

tired juniper
warm sleet
#

pfff

#

I outrank them

tired juniper
#

😆

warm sleet
#

I can just turn that 3 into a 4 in the database

#

its just sql xD

tired juniper
warm sleet
#

I should know, since I wrote it

tired juniper
#

also it's really nice that you even get any XP by not playing just being online

warm sleet
#

Found this theme online

#

thought it was neat, and wanted to see how hard it was to make something with it

tired juniper
#

yeah looks neat

warm sleet
#

only thing that is not real in that view, is that network graph

#

I was trying to get a visual representation of what servers are bound together

tired juniper
#

ok

warm sleet
#

I just wrote some random graph in there to test

#

DOT lang

#
graph graphname {
    a -- b -- c;
    b -- d;
}
tired juniper
#

oh ok didn't know there was a language for graphs that's really neat

warm sleet
#
graph graphname {
    // This attribute applies to the graph itself
    size="1,1";
    // The label attribute can be used to change the label of a node
    a [label="Foo"];
    // Here, the node shape is changed.
    b [shape=box];
    // These edges both have different line properties
    a -- b -- c [color=blue];
    b -- d [style=dotted];
    // [style=invis] hides a node.
}
#

javascript library that can consume DOT, and display it on screen

tired juniper
#

nice

warm sleet
#

but yeah

#

this is why its a hobby project

#

I try out new things

tired juniper
warm sleet
#

knockturn has some things completely overengineered

tired juniper
#

also I will have to buy Minecraft when I play on the server because I admit I tried it on a pirated version because I didn't know if I would be playing it a lot so

warm sleet
#

pirated version can only do singleplayer or multiplayer on servers with authentication disabled

tired juniper
#

didn't want to pay money and I played just a few hours and got bored from the survival mode so don't regret not buying it

#

but for your server it would be worth it

warm sleet
#

survival in vanilla is kinda boring, unless you like building

#

I play modded

tired juniper
#

yeah don't have enough patience mining

warm sleet
#

in modded minecraft

#

you build a machine

#

that mines for you.

tired juniper
#

oooh so much nicer

warm sleet
#

and you have pipes

#

to funnel items to machines xD

midnight wind
#

you saw that minecraft turtle vid?

warm sleet
#

lol that one was great

#

He wrote a webservice in typescript

midnight wind
#

minecraft virus

warm sleet
#

and then a turtle ingame, would connect to his webserver

#

and he could then control the turtle

#

from outside the game

tired juniper
#

cool

warm sleet
#

he wanted to get onto this one minecraft server, that was whitelisted

#

so he got someone, to sneak his program onto the server, and run it on a turtle

#

xD

peak acorn
#

minecraft mods have unbalanced power creep

midnight wind
#

the name turtle is a reference to the turtle library right?

warm sleet
#

true

midnight wind
#

computer craft is only forge?

warm sleet
#

all mods are through curseforge

#

though the source is usually public

#

on github

midnight wind
#

because forge is kinda annoying

warm sleet
#

works

midnight wind
#

fabric server is kinda beter

warm sleet
#

you just need a modpack descriptor

#

and it downloads it all from curse

#

manually modding minecraft is annoying

#

because you need many compat libraries

peak acorn
#

real homies remember deleting META-INF

warm sleet
#

and overwriting jar files

tired juniper
#

that's so cool having that turtle just mine for you I just saw the vids

warm sleet
#

yes

#

programming a turtle is annoying though

#

if you just want fast mining

#

you use a quarry

tired juniper
#

and also he created some nice looking computers for minecraft

#

well yeah you have to spend time programming it

warm sleet
#

automated farm in the middle

#

big tank full of oil in the back, next to the power plant building

tired juniper
#

nice,that looks advanced

warm sleet
#

I need to rebuild it, somewhere with more space

tired juniper
#

yeah it could use more space there is a lot of stuff

warm sleet
#

most of that was still manually operated

tired juniper
#

thanks for telling all about that classes and inheritance stuff by the way I saved the code so I can learn some stuff,you explained it really well and easy to understand

warm sleet
#

Digital item storage. with searchable inventory :)

tired juniper
#

your workshop looks awesome

warm sleet
#

@tired juniper if you want to learn some tricks with code

tired juniper
warm sleet
#

using a console application is easier

#

because its just raw input output,a nd you can use it to easily test things

tired juniper
#

well yeah because you don't deal with other stuff just code

warm sleet
#

most of the programs I write are console applications anyways

#

those webservices

#

are in essence just console apps

tired juniper
#

well yeah you don't need graphical stuff for them because users can't see them anyway right

warm sleet
#

yeah console usually gives information

#

like errors

#

and other information

tired juniper
#

yeah

#

I started with console apps before forms and stuff

warm sleet
#

nice

tired juniper
#

yeah well my school did start on this but it's better like that because you understand the code better because otherwise just jumping into the forms from the beginning would be a bit overwhelming

warm sleet
#

my school actually introduced procedural programming first

#

using Processing2

#

after which they went onto Object oriented

#

processing is a dialect of java, more simplified

tired juniper
#

also searchable storage in minecraft is a blessing xD I have seen big youtubers struggle with their storage so I imagine how cool it would be having searchable one

warm sleet
#

but I already wrote java when they tried teaching me processing

#

so I got an F in the first assignment, because I was using classes

tired juniper
#

oh no

warm sleet
#

you can use those in processing.. xD

tired juniper
#

xD

warm sleet
#

you can also just import java types

#

if you put import at the top

#

they didnt like that

#

@midnight wind if you want to do computers in minecraft, OpenComputers is still superior

#

it has the ability to do remote terminal

#

and set up networks, as well as read and write data from tile entities from various mods

#

so chest contents, tank contents, or even control machines

midnight wind
#

anything fabric based?

warm sleet
#

?

tired juniper
midnight wind
#

lighter than forge

warm sleet
#

yeah nobody uses fabric

#

all these mods use forgegradle

midnight wind
peak acorn
#

sodium goodly tho

warm sleet
#

@midnight wind fabric lacks a coremod

#

common interface to provide integration with multiple mods

#

such as a fluid API

#

its "light" as in, it provides a thin integration layer between vanilla minecraft and custom code

#

servers such as spigot probably would use this

#

but a server with client side mods, forge is still superior since it provides many APIs so that mods themselves don't have to modify the game's code

#

forge is more than just forge

#

it provides a modloader, core mod, toolchain and are also the guys who maintain the obfuscation list, the same one used by fabric

spring pond
warm sleet
#

@spring pond you know how they populated their db?

hollow basalt
#

do it

warm sleet
#

they had an IRC bot in one of their channels
and you just sent it a command to give methods a name or add descriptions, to parameters and such

#

once an hour, it will export these definitions

#

and put them on their archive

spring pond
#

are you saying that they crowdsourced their signatures? thats pretty cool if they did

warm sleet
#

they did

#

MCPBot

#

operated by briefcase speakers

#

or bspkrs for short xD

#

oh actually Mobius was the one who wrote original version

#

Mobius has close ties with Mojang

rancid nimbus
#

Does anyone who writes code use gdb to debug there programs?

livid fiber
#

Hey guys, does anyone have experience with using microsoft playfab with unity for Android?

midnight wind
spring pond
#

i only use it for C, but i do use it

tired juniper
#

ok what's wrong here? WPF StreamWriter streamWriter = File.CreateText(studentid+" "+label_facno.Content+".txt");

spring pond
#

you havent given any information

#

you need to give at least a snippet of the variable object types

tired juniper
#

oh now it's just I used my label which had an unsupported character

urban flint
warm sleet
#

@tired juniper StreamWriter is an unmanaged resource

#

So you have to declare it with using

#
using (StreamWriter writer = new StreamWriter(@"C:\wat.txt")) {
  sw.WriteLine("Hello World")
}
#

There's a couple parameters you can set, such as encoding and flushing behavior

#

Once the code steps out of the using { } block, any resources it declared will be disposed of

umbral saffron
#

I want to hack Alexa with a pi

#

So I can add more stuff it can do

#

Extended smart home capabilities

#

But I’m working on a way to connect it

spring pond
spring pond
#

just set up your pi as a receiving server and aws will send commands once you integrate into the api

late whale
dim lava
peak acorn
#

You sound like an ad and im not giving my email to this random website without any understanding of what it is

warm sleet
#

I'm ISO 27001 certified :P

#

dont need some free training to know about confidentiality

rancid nimbus
#

Well, programmers should learn, but also data science want to be people that are causing a bunch of the data leaks. They ask for a bunch of data and do not realize that it include SSN, credit card numbers, or other confidential information the decides that it is too hard to type a password so they make the data not password protected. They then forget about the database and the company realize that database exists, so they think there security is good.

hollow basalt
peak acorn
#

lol

vale pine
#

Heyo
I've been thinking about pros and cons of using C# vs Node.JS for a backend + REST API + DB
I'm familiar with both and I keep finding pros and cons for both
Sooo, anyone that could give more reasons or point toward a specific direction?

warm sleet
#

@vale pine are you only interested in backend technologies?

#

benefit of Node is being cross-platform

#

Unless you use .NET Core

#

REST APIs you can do in either .NET WebAPI with ASP.NET
Or just a mundane expressjs API

vale pine
#

Mainly yes
Because for now the frontend would be mobile apps but would then probably expand to websites and stuff
The target was making it scalable and stable basically

warm sleet
#

scalability has more to do with the middleware layout you use

#

the way you track session information

#

as long as you keep your application stateless, you can scale it

#

@vale pine I'd say the choice between those two technologies makes little sense, unless you can provide some more context

#

Like, experience in the team that will be using it, as well as library support and target platform

#

if you aim to build lightweight cross platform applications, I'd say node is superior

#

Though, even then, I would stay away from pure javascript

nocturne galleon
#

i am not responsible for any brain damage caused by this picture, this is just a segment of almost 256bits of memory that is writable, readable, stackable and fast.. the problem is that it takes up way too much space o-o

#

(minecraft btw)

#

i need to make this shiz more compact or imma have a seizure

warm sleet
#

@nocturne galleon ever used Project Red ?

#

more advanced variant of redstone

#

doesnt require repeaters, allows for the stacking of 16 signals onto a bus cable

#

and even has integrated circuit support

#

so you can have 16-bit busses

#

and easily build 8-segment display decoders using those ICs^

midnight wind
#

but that loses the novelty of doing it completely vanilla

warm sleet
#

vanilla redstone is ass

hollow basalt
nocturne galleon
#

ill try it out... im learning computer science for the most part, so this will save me time instead of tinkering with redstone in mc

warm sleet
#

@nocturne galleon only time I ever do redstone stuff its with computercraft

#

they have a lua api for redstone, as well as those project red busses

nocturne galleon
#

computercraft?

warm sleet
nocturne galleon
#

okay

warm sleet
#

@nocturne galleon its pretty cool. You can attach peripherals such as a display or network

#

and communicate with other computers xD

nocturne galleon
#

okay

#

wow

#

thank you a lot!

warm sleet
#

It is slightly more realistic, and integrates with other mods much better than computercraft

#

Like, I've used these things to make all kinds of crazy contraptions

#

from automated doors that only open to specific users

#

to nuclear reactor control

#

and its pretty funny :D

#

cus its a unix-like system

nocturne galleon
#

so much info

#

whoops, didn't know there was a caps limit yeesh

warm sleet
#

xD

#

One of the reasons that i like project red in this context, is because computercraft has an API for those 'bundled' redstone cables

nocturne galleon
#

okay that is cool, is there any other mods for fabric that you recommend when it comes to redstone? i run fabric and fabric_api btw

warm sleet
#

I don't use fabric mods

#

lame modding api with poor integration

nocturne galleon
#

ah

warm sleet
#

forge is where its at

#

well, there's some mods that allow for wireless redstone

#

though I find this a bit cheat-y

nocturne galleon
#

well, i use fabric because there is sodium, phosphur, and lithium, which makes loading and generating 50x faster (not even exaggerating), and the game runs at a smooth

#

300-800fps+

#

300 during my 1000tnt explosion test

warm sleet
#

huh. I've been using forge for the longest time now

#

FML provides a layer between minecraft and mods, so that mods don't conflict with eachother

#

fabric lacks this 'core' mod

nocturne galleon
#

yeah, but it isn't that hard to figure out what works with what on your own

warm sleet
#

Yeah, but fabric breaks down

#

once you have a modpack with a 100 or so mods

nocturne galleon
#

generally, very custom minecraft scenarios like heavy modding like you stated is better for forge, but, for performance and general game improvements using fabric is a go to in my opinion

warm sleet
#

if your environment isnt going to change, fabric is easier

nocturne galleon
#

yee

warm sleet
#

server mods such as spigot use fabric

nocturne galleon
#

okay, this conversation is no longer worth having in here, this is a development channel, not 'mc-mods'

warm sleet
#

xD

#

I mean, coding in minecraft

#

good enough excuse for me

nocturne galleon
#

we weren't talking about coding just there were we? just saying

warm sleet
#

^ KEKW

warm sleet
nocturne galleon
#

oh

warm sleet
#

xD

nocturne galleon
#

yes okay, i can find the rest myself, or ask you if i need help in the future, but im not really intrested in api rn, im more interested in the actual assembly of a cpu. thank you though

warm sleet
#

^^ project red should be enough then

#

major benefit when using them for redstone is just the signal length

#

minecraft has a 15 block limit, redpower is like 255 I htink

nocturne galleon
#

okay

#

is red power a mod for minecraft, or is it that program you showed me earlier?

warm sleet
#

well, redpower was the original mod, its now called Project Red

#

Its a mod for the game

nocturne galleon
#

oh okay

warm sleet
#

@nocturne galleon goes up to 1.12

#
Feed The Beast Wiki

Project Red is a mod by Mr_TJP and ChickenBones. This mod is an unofficial continuation of the RedPower 2 mod, using all original code. This mod is focused on redstone circuitry, logistics, automation, decoration, and constructing large mechanisms. Furthermore it includes its own energy system, called Electrotine Power, to operate different mach...

nocturne galleon
#

yes, i found it

#

:> thanks again

warm sleet
#

their logic gates are awesome

#

AND gates and such, in a single block

#

configurable clock source, and such

#

@nocturne galleon oh one thing the wiki mentions, the mod is broken up into multiple smaller mods

#

the logic gates are a seperate package from project red

nocturne galleon
#

okay, im going to go now, im in the middle of class, no more pinging pls

warm sleet
#

ok

nocturne galleon
#

thanks

tired juniper
#

hey any of you interested in purchasing from me a 1 dollar Amazon Gift Card xD? I am short of a less than a dollar for a purchase and I have to go to the bank physically tomorrow for a few cents because those greedy fucks taxed me as soon as I got money in the card like instantly

#

through PayPal

last dagger
#

that i cant spend cuz theres notbjng to buy that ships free

#

ill dm u the code

#

u good w/ that??

tired juniper
#

wait is it like in Amazon

last dagger
#

yes

#

i have $7.52 left and j cannot spend it

tired juniper
#

is it like a gift card or cash in your account

#

in Amazon Pay

last dagger
#

cash but i can buy a gift card with it

#

it was previously from a gift card

tired juniper
#

can you send me as cash? Because I need it for paypal

last dagger
#

idk how to do that lemme check

#

i’ll dm u

tired juniper
#

ok

warm sleet
#

guys

#

can we not?

tired juniper
#

yeah sorry I just posted here should have been general or somehting

rancid horizon
#
var topic = Console.ReadLine(Crystal);
if (topic != developement) {
MentionGeneral(topic); }

fixed it

last dagger
astral rapids
#
Topic currentTopic = Console.ReadLine(Crystal);
if (currentTopic != Topic.DEVELOPMENT) {
  Channel.getByName("general").mention(currentTopic);
}
#

Java, mm.. nicer.

dim lava
pliant marsh
#

every time load up visual studio installer it just crashes

hollow basalt
#

nice

lapis tusk
#

Yeah visual studio is great once its downloaded, but i always found it annoying downloading it and also any add ons like monogame. And uninstalling it is even worse

peak acorn
#

how in the world do you check if a number == 0 with only bitwise operators

#

in C particularly but any language is basically the same for bitwise operators

hollow basalt
#

@peak acorn explain the problem more

peak acorn
#

Create a function that takes in a char (1 byte type) and returns 1 if the input is zero, otherwise 0

#

Only using a single statement for return and only using ~ & ^ | >> and << operators

#

One way is just to do 7 bit shifts and & everything together but sheesh that's ugly

warm sleet
#

@peak acorn mask and compare

#

if you want to check if the 3th bit in an integer is high, you can mask it

int i = 5; // 0101

when you do:
i & 4 it would return 4
so by doing: (i & 4) == 4 you can check

spring pond
#

this might work, got it from SO

return ~(((n | (~n + 1)) >> 31) & 1) & 1;
tired juniper
#

hey so how do you create an event for a submenu in WPF? Like I have a menu with 2 submenu items and I don't want them to use the same code when you click on them,so I can't create an event for the menu item,I have to create separate events for the subemnu items but how?

#

there's a command property on each of them but that doesn't accept string so what the heck do I type there?

craggy acorn
#

can someone recommend me a course on javascript?

rancid nimbus
#

@craggy acorn
This one is helpfully for basics https://www.w3schools.com/js/DEFAULT.asp
This one is helpfully for just about anything web related. Even wired functions.
https://developer.mozilla.org/en-US/docs/Web/JavaScript

craggy acorn
#

thanks

midnight wind
rancid nimbus
#

Well, that's the best way to learn, but the real more entery leaves stuff would be better learned through tutorial like if else, functions, array, bars and types. Maybe classes.

grizzled oar
#

who can do js backend development?

tired juniper
#

hey so I open a file in WPF(a text file using StreamReader and then edit the contents) but then how when I click save do I overwrite the file I just opened?

deep scarab
#

StreamWriter

#

but since you have a gui you should probably use SaveFileDialog

tired juniper
#

oh yeah but can I do it so as soon as I press save in my gui it overwrites the file I just opened without me typing the filename

tired juniper
midnight wind
grizzled oar
midnight wind
grizzled oar
# midnight wind Me, why?

coz i have a project im trying to do need someone to do the script behind it while i do the frontend like desing etc etc

#

hop in dms for more info..

grizzled oar
#

okk 😄

tired juniper
#

hey is there a method of the streamwriter in c# that can save changes to a file you just opened(the contents of the file)?Like I open a file edit the contents in a textbox and then I want to save them to the same file without having to use the filename again

tired juniper
#

nvm I found a way

warm sleet
#

@tired juniper write or append mode

#

the first overwrites, the latter appends

dim lava
#

@warm sleet why is C# so popular here lol

tired juniper
#

by the way you told me about some class library in which I could modify logic or something for my app

#

where can I find it? I forgot can you tell me again

warm sleet
#

@tired juniper if you look in the solution explorer

#

there's a solution, and within that solution is your project

#

you can have multiple projects within a solution

#

so if you right click the solution, and click add project

#

@dim lava idunno?

#

I dislike C#, but I can still program in it

#

I prefer using Java

#

a good developer picks the best tool for the job

dim lava
#

Indeed

warm sleet
#

and best can depend on a lot of factors

dim lava
#

I've only used C# at a surface level, never went deep into the STL or its features

warm sleet
#

I've done bytecode manipulation stuff and low level class loading in java

#

xD

dim lava
#

oof

#

I would always go to C++ for that kind of stuff lol

warm sleet
#

well

#

I wrote a module system

dim lava
#

although for what I'm doing right now, it even requires assembly

warm sleet
#

that allows realtime upgrades

#

without downtime

dim lava
#

Like, C can't do a few of the tasks in here

dim lava
warm sleet
#

dynamic class contexts

#

you load all the libraries yourself

#

and then invoke them

dim lava
#

Interesting, what's the purpose?

warm sleet
#

xD minecraft

#

let me pull it up

#

@dim lava I used it to modularize a plugin platform

#

this thing can just load .jar files

#

all the magic is abstracted away ofc

dim lava
#

That's awesome

#

Love things like that

warm sleet
#

in our case we use it to keep track of lore information in our roleplay server

dim lava
#

Only thing I've done similar was a completely abstracted away compile-time inheritance system for a Unity-like 2D game engine

warm sleet
#

static game objects and settings

dim lava
#

nice

warm sleet
#

and we also use it as an API platform

#

so our other plugins can integrate with one other, using an API provided by a module

#

so we don't run into stupid circular dependency issues

dim lava
#

👌

#

So some sort of IPC/stream system?

warm sleet
#

its powered by redis yeah

#

its running on multiple minecraft servers

#

provides an abstraction layer for player profiles across servers

#

as well as chat and synchronization

#

quite a lot of stuff in here

dim lava
#

awesome

#

and databases, hate em

warm sleet
#

exactly

#

we have a bunch of developers that are good at writing minecraft plugins

peak acorn
#

why r we still talking about minecraft haha

dim lava
#

Also, I see what you mean now by bytecode manip

peak acorn
#

its been days

warm sleet
#

but they suck at databases lol

#

so I wrote an API for them

dim lava
#

hahahaha

#

How much work was getting the actual dynamic loading working?

warm sleet
#

errr

#

well, persistence is done by the sql database

#

there's some logic in the proxy server

#

that makes sure one server saves a profile, before it is loaded on another server

#

chat and other realtime information, is synchronized through redis

#

we also use roleplay names, so that roleplay profile also has to be cached

#

so other servers where chat is received without a loaded profile, have to hit the cache for this

#

redis takes care of all of this

#

specifically

#

the hash sets

#

and pub/sub

dim lava
#

Oh so this is even multi server too?

warm sleet
#

Hashes ^

#

@dim lava that's the point yeah

dim lava
#

I like

warm sleet
#

and then there's pubsub

#

you basically have channels

#

on which you can subscribe

#

and other clients can push messages

#

so for example, if someone talks in global, you push a UUID + message on the redis channel chat.global

#

other side, receives this message, decodes the UUID and fetches profile from the cache (redis)

#

and then formats the message :)

#

this is how we got discord chat integration working as well

dim lava
#

woaaaaaah

warm sleet
#

there's just a discord.js bot that communicates with redis

dim lava
#

Yeah real time web technologies have always eluded me lol

warm sleet
#

and a special channel and class handler

#

Its so generic

#

the same code that works for discord also works for IRC

#

in fact, that's what it was designed for xD

#

@dim lava event driven programming, have you heard of this before?

dim lava
#

Yup, absolutely, and I wish JS, being an event-driven language, actually took it to heart

#

Instead of needing huge libraries to properly do event-driven programming

warm sleet
#

well

#

its more from an architectural standpoint

#

between multiple applications, there may be an overarching process

dim lava
#

Things like GUIs and web are absolutely the best targets for event-driven programming models

warm sleet
#

involving multiple messages between different systems

dim lava
#

yeah that sounds like a pain. Do you have mock testing to help you develop that?

warm sleet
#

you can do that yeah

#

mocking away interfaces

dim lava
#

Mocking is the worst in C++ I'll tell ya

warm sleet
dim lava
#

C++ was not designed for it at all

#

Now, I said i hate databases, but I've actually done a fair amount of SQL and PL/SQL 😅

warm sleet
#

you don't hate databases

#

you just get bothered by the impedance mismatch

dim lava
#

Well, I'm not a big fan of server code to begin with so 🤷‍♀️

cinder willow
#

You should try out cassandra. I’m sure you’d have a lot of fun there

warm sleet
#

relational model just doesnt mesh well with the object oriented model

dim lava
#

very boring and repetitive

warm sleet
#

and there are other database types that might be more suited for the job

dim lava
warm sleet
#

thats why ORMs are almost always a nightmare

#

they are nice in theory

dim lava
#

ORM?

warm sleet
#

but in practice, they bring up all kinds of edge cases and strange behavior

#

Object Relational Mapping

#

so instead of querying the Person table

warm sleet
#

you have an object in code representing that table

#

but implementations are awful

cinder willow
#
warm sleet
#

since OO encourages references

#

and relational model only uses scalars for this

cinder willow
#

It’s an Apache product so you know it’s good Kappa

warm sleet
#

@cinder willow like their webserver? KEKW

#

nginx is king

cinder willow
#

Of course, apache2 never fails cringe

#

Apache2 never decides to fault when loading a page and then decide to spawn 700 connections extra crashing your database

#

Nah couldn’t be it

warm sleet
#

@dim lava examples of ORMs are: Hibernate for java, Doctrine for PHP or Entity Framework for .NET

#

out of all of those

#

EntityFramework is the least shit one

dim lava
#

Yeah I've never used em

warm sleet
#

because they encourage code first database design, and actually does a decent job

dim lava
#

Although most of the query programming I did was without any sort of library

#

I did 4 years of raw PHP and MySQL in HS

warm sleet
#

ouch

dim lava
#

kill me

cinder willow
warm sleet
#

I recently discovered Typescript

#

actually makes javascript bearable

#

and has some powerful language features

dim lava
cinder willow
#

As someone who starred by learning js, js is terrible, and ts only marginally helps.

dim lava
#

I don't want to touch web ever again

cinder willow
#

Web is a scary place.. compaction hides

dim lava
#

It's also nice because there's no such thing as users being shit in embedded 😂

cinder willow
#

That is true

#

See what I do I have to deal with double dumb users

warm sleet
#

@cinder willow I did my graduation project in Typescript, with 0 experience in practical nodejs

#

Wrote a software generator and backend framework for writing SPAs with a headless CMS

dim lava
cinder willow
#

Not only does our own internal engineers service the product, but the clients use it as well. So we have two different levels of stupid useless

dim lava
#

React was actually nice to work with

cinder willow
#

Users*

dim lava
#

I wish JS had the same event constructs that React did

#

Node was frustrating as hell because of the damn package management

warm sleet
#

^

dim lava
#

Mongo I had no comment on

warm sleet
#

Nothing beats Maven. NOTHING

#

Just, the way maven sets up their project architecture and dependency tree

dim lava
#

I also did 95% of the programming out of the 5 person team, because I was the only person that had done both front end development and back end development

cinder willow
#

Hahahhha npm i <package> —save

warm sleet
#

NPM has no support for reactor projects.

cinder willow
#

> Would you like to install and save this package?

warm sleet
#

you can't do multimodule projects in npm

dim lava
warm sleet
#

You can, but its really painful

#

git clone ...

cinder willow
warm sleet
#

mvn package

cinder willow
#

They’re different windowsssss

warm sleet
#

done.

cinder willow
#

Oh got the amount of times I had to reinstall npm was insane

warm sleet
#

with maven if you fucked up your local repo somehow

cinder willow
#

It gets stuck on old versions occasionally and there’s no good way to update it

warm sleet
#

you just do mvn clean package -U

#

to force a refresh of the local deps

cinder willow
#

Oh that would be nice

warm sleet
#

@cinder willow node_modules

#

how

#

is it 200MB.

#

its fucking rediculous

cinder willow
#

Only 200mb LuL

warm sleet
#

@cinder willow for an empty project, typescript, mithril and expressjs

dim lava
#

Downloading from node whatever.com doesn't give you the proper configuration to start running

#

It gives you an older version with things like import not working

warm sleet
#

oh yeah

#

I had a fieldday with that

cinder willow
#

Wait really?

#

I haven’t downloaded it in awhile lol

dim lava
#

Yeah, I spent a whole day realizing that my node was just out of date

warm sleet
#

because I had a multimodule system in npm xD

dim lava
#

even though I just downloaded it from the website

warm sleet
#

and there's like, NextJS

#

and es6

#

in module types

cinder willow
#

Yeah the out of date npm is very annoying

warm sleet
#

its all very confusing

cinder willow
#

I’m so happy I switched to Java/c#

#

I’m so much happier in life

warm sleet
#

@cinder willow mhmm welcome to the club

cinder willow
#

But on the flip side we also have to use Perl

#

Sooooo

#

Not so happy

warm sleet
#

lol. I remember using jdeb

#

to build debian packages with maven

#

that was actually not that bad

#

you know what sucks?

dim lava
warm sleet
#

systemd integration.

dim lava
#

Like, yeah, I'm compatible with every library ever written

#

But I can' fucking build it

warm sleet
#

have fun with boost

#

spend 5 hours compiling

dim lava
#

I have never used boost

#

never will

#

C++ STL now has basically all you'll need from it now, except for a few small things here and there

#

like flat_map

warm sleet
#

I've only written a tiny amount of native code before, besides microcontrollers

dim lava
#

or ASIO, which we should be getting std::networking in C++23

warm sleet
#

@cinder willow have you used the jni before?

#

javah Foo.java

#

generates a Foo.h

cinder willow
dim lava
#

i'm sorry

#

what

warm sleet
#

@cinder willow haha, I had to do that to work with OpenCV.

cinder willow
#

Yup

warm sleet
#

@cinder willow I ended up running into issues, during development

dim lava
#

how does that handle objects

warm sleet
#

so we wrote a seperate program, and just hooked it up to java with a shell call

#

xD

#

exchanging json over the shell.

cinder willow
#

That reminds me of my freshman year of high school programming

warm sleet
#

one guy was using a macbook

#

and the rest of us on linux

cinder willow
#

We were learning python and I didn’t know python

warm sleet
#

and he couldnt get his toolchain to work..

cinder willow
#

And instead of googling “how to add a wait in python” I called a js file where I knew how to do it lmao

warm sleet
#

the shell

#

the ultimate interface

cinder willow
#

Ah yes

warm sleet
#

it plugs into anything

cinder willow
#

Our company had to spend 3 weeks of dev time cause one engineer refused to use windows

warm sleet
#

good.

#

I stand with that guy

cinder willow
#

Sorry

warm sleet
#

fuck windows xD

cinder willow
#

Refused to use linux*

#

Got that switched

warm sleet
#

OH

#

rekt.

#

ye learn linux u noob

#

windows is legacy in 20 years anyways

cinder willow
#

I personally duelboot windows/arch

warm sleet
#

I use windows to game on

#

my laptop dual boots. but I never really use windows

cinder willow
#

My poor laptop... it’s been through so much water

#

When powered on

#

And it’s still working just fine

warm sleet
#

I have one of those duo core i7s

#

@ 3GHz

cinder willow
#

Sounds like my work laptop

warm sleet
#

its really slow

cinder willow
#

That is the only thing we can actually do work on

warm sleet
#

but the thing is

#

I tweaked my kernel pretty hard

cinder willow
#

Now imagine compiling that thing

#

Compiling on*

warm sleet
#

kernel preemption makes an underpowered machine useable

#

it reduces throughput of the system, but at least the desktop is responsive even at 100% CPU

#

so under heavy load, it just tasks switches more often, so the system doesn't lock up

#

thats how I am able to run a windows vm in the background without grinding to a halt

cinder willow
#

I’ve missed so many deadlines because I have to wait 18 years to compile anything

warm sleet
#

maven compilation isnt that slow?

#

and I compile the kernel for my laptop with distcc

cinder willow
#

It is for compiling our projects lol

warm sleet
#

you can just have a server somewhere, as a compiler host

#

and you can cluster your build

cinder willow
#

For final tests we aren’t allowed to partially compile

cinder willow
#

Work rules

warm sleet
#

well

#

adjust those rules

#

they are lame

cinder willow
#

I wish I could

warm sleet
#

laptop needs like 2 hours to compile lol

#

but thats the entire ubuntu distro kernel

#

desktop needs like 15 mins

cinder willow
#

Have you ever used opal?

warm sleet
#

nop

cinder willow
#

Don’t

warm sleet
#

another language?

#

I'm currently learning Cypher

cinder willow
#

Yup. My company decided to create part of our software in a custom Opal

warm sleet
cinder willow
#

I’m so happy I’m not in that project

cinder willow
warm sleet
#

Query language for graph databases

cinder willow
warm sleet
#

neo4j currently

#

Graph databases have some benefits over other nosql variants

#

they allow for atomic updates and transactions

#

so they are ACID, yet distributed

#

currently writing a report on the differences between RDMBS and graph databases

#

a graph of graphs

cinder willow
#

Graphs on graphs on graphs

#

You know what I think? We should just all return to writing machine code

warm sleet
#

xD

#

but interesting cases such as the privacy that comes with DNA tests like 23&me

#

such databases

#

allow you to store information seperate

#

yet still have relationships

#

but only from certain perspectives, depending on the level of access

dim lava
#

I THOUGHT I was using SVCall, but I was actually using PendSV. This caused me to not configure PendSV, giving it a default priority of maximum (when it needed to be minimum for the correct behavior).

#

So it made me convinced that the problem was either in how i constructed the stack here

#

Or that I was choosing the wrong value from this table

#

Turns out, it was technically the second, but not because I was wrong, but because my misconfiguration made the PendSV exception interrupt the SysTick exception, causing there to be 2 active exceptions, meaning I couldn't return in Thread mode, I had to return in Handler mode. But that's not what I wanted. So after 5 hours of debugging, I fixed the priority of PendSV and it's all working now 🥺

tired juniper
#

hey by the way mouse enter in wpf is mouse hover right?

slate frigate
#

@cinder willow Build a lost opportunity cost graphic to show to management alongside a request for a server/host to run the big compiles

cinder willow
slate frigate
#

bring up saving money and pretty pictures to management is always a good attempt

#

especially the pretty pictures

cinder willow
last lance
#

I'm trying to make a basic caculator that tries to detect what you choose by geting the first letter or number in the string you submit and use a if statement to figure out which operation to do to the 2 numbers. Python

`print("What is your first number")
v1 = int(input())
print("What is your second number")
v2 = int(input())

print("Add")
print("Subtract")
print("Multiply")
print("Divide")

print("What would you like to do to these numbers?")
type = input()

type0 = (type[0])

print(type0)

if type0 == '1' or 'A' or 'a' or '+':
result = v1 + v2
print(result)
elif type0 == '2' or 'S' or 's' or '-':
result = v1 - v2
print(result)
elif type0 == '3' or 'M' or 'm' or 'x' or 'X' or '*':
result = v1 * v2
print(result)
elif type0 == '4' or 'D' or 'd' or '/':
result = v1 / v2
print(result)
else:
print("Not a valid value")`