Networking in C#, a simple library

Recently I wanted to make a simple multiplayer game in Unity, but I didn’t want to use their terribly made UNET, as even though it’s barely a few years old, it’s already deprecated. I also didn’t want to go with a third party like Photon Networking, because I don’t want to pay for CCU (Concurrent User) usage, server costs, and other misc fees.

No, what I wanted was a solution such as Minecraft implements, where you directly connect to a server and it’s served through peer-to-peer networking, with one player being a server. The solution? A small library called LiteNetLib. This library allows you to build multiplayer games in .NET (C#), including Unity, with no limitations on usage, including player count. It was exactly what I needed.

The documentation is slightly sparse but it wasn’t rocket science to get a small example up and running, and the developer seems pretty open to questions. There’s also a small sample included so you can see what it entails.

Cheers!


It helps me if you share this post

Published 2020-02-13 00:39:20

How to Customize your Windows 10 Tiles

Windows is better (and worse) in many ways than it ever has before. One such apparent lack of basic functionality is the ability to customize your start menu tiles. No, I’m not talking about that simple right click menu, I mean something like this:

Of course I have a Windows update pending…

Which looks a lot better than something like this:

How, you may ask? Through something called the VisualElementsManifest.xml. It’s a feature of Windows that you can actually use an .XML file to instruct it how to display the tiles. There are only a few options, but the one we’re most interested in is the option to replace the icon with our own picture.

You can thus add one next to each application’s .exe that you’d like to replace the icon for, and then update the shortcut’s modified date (quick way to do so is cutting + pasting it out and in of the windows start menu icons folder), and bam!

Name the .xml file the exact same as the .exe.

Example Firefox visualelementsmanifest:

<?xml version="1.0" encoding="utf-8"?>
<Application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <VisualElements BackgroundColor="#000000" ShowNameOnSquare150x150Logo="off" ForegroundText="dark" Wide150x300Logo="firefox-customtile.png" Wide150x310Logo="firefox-customtile.png" Square300x300Logo="firefox-customtile.png" Square310x310Logo="firefox-customtile.png" Wide300x150Logo="firefox-customtile.png" Wide310x150Logo="firefox-customtile.png" Square150x150Logo="firefox-customtile.png" Square70x70Logo="firefox-customtile.png"/>
</Application>

But how do you get stuff like Groove Music UWP apps working?

Make another .exe that launches Groove, then put the VisualElementsManifest.xml next to that.

Sound complicated?

Good thing I’ve already done all of these steps for you.

All you have to do is download these two things (three if you want to launch steam games from the start menu):

  1. Tiny AppLauncher (open source; it doesn’t need to be – it’s like 3 lines)
  2. CustomNativeTile (will generate the .xml files for you, allow you to pick shortcuts from a UI, and auto-updates the start menu tiles after picking the picture)

And if you want to launch steam games from the start menu:

3. SteamLauncher (same idea as the AppLauncher, just for steam)


It helps me if you share this post

Published 2019-11-04 22:24:36

Welcome to the Age of Quantum Computers

From Bloomberg:

A team of scientists at Google’s research lab announced last week in the journal Nature that they had built a quantum computer that could perform calculations in about 200 seconds that would take a classical supercomputer some 10,000 years to do.

An age ofQuantum supremacywas duly declared.

Google’s claim to have achieved quantum supremacy that is, to have accomplished a task that traditional computers can’t was premature.

Although the specific problem that Google’s computer solved won’t have much practical significance, simply getting the technology to work was a triumph; comparisons to the Wright brothersearly flights aren’t far off the mark.

Congress should fund basic research at labs and universities, ensure the U.S. welcomes immigrants with relevant skills, invest in cutting-edge infrastructure, and use the government’s vast leverage as a consumer to support promising quantum technologies.

A more distant worry is that advanced quantum computers could one day threaten the public-key cryptography that protects information across the digital world.

This is big for a number of reasons but do not get too excited/scared yet! Quantum computing is still a number of years away. IBM was also quick to point out that Google’s estimate for how long “Summit” (the fastest computer in the world currently Google estimated against), was incorrect. According to papers published after Google’s report, “IBM’s engineers reckon, [adjustments would] allow Summit to breeze through the job in a mere 2½ days. Therefore, according to IBM, Google had not shown quantum supremacy after all.”

Well, that was quick.

What does that mean for their supposed success? Well, it’s still impressive. Google demonstrated a monstrous leap in technological prowess and got one step closer to proving a plethora of theories that many computer scientists are still eagerly waiting to take a crack at. P = NP anyone?

But wait, not so fast. Technically yeah, Google was wrong, but you still have to compare and contrast the differing performance results. Two and a half days is, after all, still about 1,200 times longer than 3 minutes.

Second, each extra qubit doubles the memory required by a classical machine put up against it. Adding just three qubits to Google’s challenger machine would have exhausted Summit’s hard disks. Quantum computers do not face such explosively growing demands. Google’s machine may not quite have crossed the finishing line. But it has got pretty close to doing so.

Additionally, Bloomberg has an excellent point when it says the U.S. should invest in this technology, if they aren’t already. They likely are behind the scenes, as a foreign entity such as China being the first to own a Quantum Computer is very scary. As Bloomberg pointed out, Quantum Computers make breaking passwords look like a walk in the park. Our current method of storing passwords would be under direct attack from Quantum Computing, and it’s one of the reasons the research is so dangerous.

Let me end your day off with this badass robot (fair warning, some of the video is fake) that some very talented individuals are developing.


It helps me if you share this post

Published 2019-11-01 11:35:18

What’s with the dark themes?

Some may have noticed the rising trend of dark themed applications and websites. This is not just your imagination. Dark themes are the latest design fad that regularly changes up every so often. Right now, flat, simple designs are in, as well as dark themes. macOS added dark theme to their entire OS, built in system apps included. Microsoft and many other vendors, including Android, and third-party applications implement dark modes into all their apps. There are extensions like “Dark Reader” that specifically render websites in dark mode. My website is entirely dark themed.

Why dark themes?

1. Choice is good.

2. It looks great.

3. Normal, white/blue light emitted from the screen keeps you awake (suppresses melatonin)

4. Eyestrain

5. Google confirmed that using dark mode on an OLED screen is a huge help for battery life. Dark mode interface in the YouTube app saves about 15% battery vs not using it on 50% screen brightness. If you use 100% screen brightness (the hell, are you on the sun or something?) then it saves a massive 60% of battery life

6. It’s easier for long periods of staring at the same image in specific

Let me point this out just for myself real quick, I cannot code on a white background. I need to look at the code for hours and hours at a time, my eyeballs would sear if I continued staring at a white background. Here’s a comparison of dark mode vs light mode from one of my favorite script editors.

Dark theme of IDE
Light mode of IDE

Plus, dark mode on an OLED screen blends into the bezels(?) so well, it looks practically magical. It’s possible to forget you have a camera cutout or notch if you choose the right wallpaper.


It helps me if you share this post

Published 2019-10-15 01:42:49

Google can track iOS users through fonts

https://twitter.com/sandofsky/status/1172200578207772672

Google’s Crashyltics allow them to track crashes from the “Beta” version of the app through a font.

https://twitter.com/sandofsky/status/1172215993625505792

However, there is at least a prompt to install it.

One of the things iOS has always lacked is the ability to install custom fonts. Apple has delayed it, stating security concerns. Proving Apple’s point, Google-owned Crashlytics is abusing the feature to track users by installing a font with a custom identifier embedded. Because fonts are installed system-wide in order to be used across multiple apps, it could be possible for any app to use Crashlytics’s font to uniquely identify users, and piggy-back off the tracking without doing any workthemselves.

This sets up a host of security and privacy concerns and problems. The basic fact remains that something as innocuous as a font should not be used for fingerprinting users, because most consumers will not know a font should/could be used for that purpose.


It helps me if you share this post

Published 2019-09-13 07:59:35

Hopper app update in progress.

Hopper is getting an update soon! Here’s a preview of one of the new characters that will be added:

Release should hit by next week, stay tuned! All added characters will be available to obtain for free.

This is the start of my first round of updates to my legacy apps in a few years. Hopper and Spin Ninja both fell behind in terms of support for new devices and performance, and they’re due for a dust off.

Most of the updates will just consist of making everything free and polished as potential showcase work.


It helps me if you share this post

Published 2019-07-21 00:48:42