Giter VIP home page Giter VIP logo

ltw-client's Introduction

A passionate backend developer with a strong interest in DevOps, automation, and API development. Over the course of my career, I have worked on a variety of projects, from web scraping and data analysis to CI/CD pipelines and automated software testing.

In my free time, I enjoy staying up-to-date with the latest developments in the field of software development and experimenting with personal projects. I believe that continuous learning is essential for staying competitive in the industry.


๐Ÿ’ป Tech Stack:

C C# C++ Dart Go GraphQL Java JavaScript LaTeX Lua Python Shell Script Cloudflare Azure Oracle .Net FastAPI Flask Flutter jQuery GODOT Xamarin Nginx Apache Maven SQLite MicrosoftSQLServer Postgres Redis Blender LINUX CMake Docker ElasticSearch Kubernetes Swagger

๐Ÿ“Š GitHub Stats:



๐Ÿ† GitHub Trophies


โœ๏ธ Random Dev Quote


๐Ÿ” Top Contributed Repo


๐Ÿ’ฐ You can help me by Donating

Ko-Fi

ltw-client's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

debarchitodev

ltw-client's Issues

InputElement necessary features

Some of the features which should be added to the InputElement:

  • LinerIndex (character indexing, so it supports left and right clicks)
  • Select text
  • Copying text
  • Support emojis (hard task)
  • Support multi-line
  • Support markdown (never mind this one, it's for far future)

Shortcut keys for InputElement

We need to create shortcut keys for InputElement

Like:

  • Ctrl + V : paste the text
  • Ctrl + C : copy the text
  • Ctrl + A : select all the text

Don't raise events in separated threads

Using Task.Run is not acceptable everywhere

	[EditorBrowsable(EditorBrowsableState.Never)]
	protected internal virtual void OnRightUp()
	{
		Task.Run((() =>
		{
			// raise the event in another thread.
			this.RightUp?.Invoke(this, null);
		}));
	}

So what's wrong with this code?

  1. You are creating a new thread, even if the action won't do anything.
  2. You are running every single event on a whole separated thread.

This will cause some problems in the future, such as hug memory leak.


So what to do?

I think something like this will be okay:

	[EditorBrowsable(EditorBrowsableState.Never)]
	protected internal virtual void OnRightUp()
	{
		this.RightUp?.Invoke(this, null);
		if (this.RightUpAsync != null)
		{
			Task.Run((() =>
			{
				// raise the event in another thread.
				this.RightUpAsync?.Invoke(this, null);
			}));
		}
	}

This way, we won't create new threads over and over.

Failed to create graphics device

I think it's better to prevent this error with a try...catch:

Unhandled exception. Microsoft.Xna.Framework.Graphics.NoSuitableGraphicsDeviceException: Failed to create graphics device!
 ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at MonoGame.OpenGL.GL.GetString(StringName name)
   at MonoGame.OpenGL.GL.LoadExtensions()
   at MonoGame.OpenGL.GL.LoadEntryPoints()
   at MonoGame.OpenGL.GraphicsContext..ctor(IWindowInfo info)
   at Microsoft.Xna.Framework.Graphics.GraphicsDevice.PlatformSetup()
   at Microsoft.Xna.Framework.Graphics.GraphicsDevice.Setup()
   at Microsoft.Xna.Framework.Graphics.GraphicsDevice..ctor(GraphicsAdapter adapter, GraphicsProfile graphicsProfile, Boolean preferHalfPixelOffset, PresentationParameters presentationParameters)
   at Microsoft.Xna.Framework.GraphicsDeviceManager.CreateDevice(GraphicsDeviceInformation gdi)
   at Microsoft.Xna.Framework.GraphicsDeviceManager.CreateDevice()
   --- End of inner exception stack trace ---
   at Microsoft.Xna.Framework.GraphicsDeviceManager.CreateDevice()
   at Microsoft.Xna.Framework.GraphicsDeviceManager.Microsoft.Xna.Framework.IGraphicsDeviceManager.CreateDevice()
   at Microsoft.Xna.Framework.Game.DoInitialize()
   at Microsoft.Xna.Framework.Game.Run(GameRunBehavior runBehavior)
   at Microsoft.Xna.Framework.Game.Run()
   at LTW.Program.Main() in /home/runner/work/LTW-client/LTW-client/LTW/Program.cs:line 44
/home/runner/work/_temp/b23d8555-d18e-4640-b831-7b70b0e74f92.sh: line 1:  2187 Aborted                 (core dumped) LTW/bin/Debug/net5.0/linux-x64/LTW
Error: Process completed with exit code 134.

Mouse events bug when elements are not applied

see the code below:

	//test.Apply();
	//test.Show();
	testInput.Apply();
	testInput.Show();
	//events:
	this.InitializeMainEvents();
	//---------------------------------------------
	//addRanges:
	this.ElementManager.AddRange(
		this.FirstFlatElement,
		test,
		testInput);
	//---------------------------------------------

as you can see here, test (which is a sandbox in this case), is not applied nor is it visible.
but if I try to trigger one of mouse events on testInput element, it won't be triggered (like MouseEnter effect)
it won't, because we have add this to ElementManager and it won't check for testInput anymore.

StrongString operators bug

they won't check if left or right is null or not.
they will just call GetValue() directly, so it will result in a NullRefrenceException

public static StrongString operator +(StrongString left, StrongString right)
	{
		return left.GetValue() + right.GetValue();
	}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.