Tuesday, October 20, 2026

Lost Liberalism

   Somehow, we convinced ourselves that their initial demands were harmless, reasonable, or even morally righteous. A little censorship here: "Yeah, those words are offensive. Let's bleep them out or ban them altogether." A sprinkle of cancel culture there: "Yeah, that comedian was spreading hate. Pull their contract. Cancel their show." Then came the ever-expanding obsession with identity politics: "Yeah, they're a woman if they say they're a woman, and questioning that is hateful."

And so we conformed. Not necessarily because we agreed, not because the arguments were sound, and certainly not because the evidence was overwhelming, but because we feared the labels they'd attach to us if we dared to disagree.

Bigot. Racist. Nazi. Fascist. Sexist. Islamophobe.

These words became weapons of social coercion, wielded not necessarily to defeat arguments but to discourage people from making them in the first place. Rather than defend our principles, we surrendered them incrementally, convincing ourselves that each concession was too insignificant to warrant a fight. We traded intellectual honesty for social acceptance, rational skepticism for moral appeasement, and the freedom to question for the comfort of conformity.

But we were afraid of the wrong things.

We feared being called intolerant when we should have feared the erosion of intellectual freedom. We feared offending sensibilities when we should have feared the abandonment of scientific rigor. We feared social rejection when we should have feared the institutionalization of falsehoods. And above all, we feared being perceived as morally deficient when we should have feared the long-term consequences of allowing ideological conformity to supersede objective reality.

Because the danger was never merely any single concession. It was the precedent each concession established. What began as a request for tolerance became an expectation of affirmation. What began as an appeal for compassion became a demand for ideological obedience. What began as an effort to protect people from genuine harm increasingly became an effort to protect beliefs from scrutiny.

And each time we conceded, the boundaries shifted. Yesterday's controversy became today's orthodoxy, and yesterday's reasonable disagreement became today's unacceptable dissent.

This is the self-perpetuating nature of the woke mind virus: an ideology that increasingly treats its own moral convictions as unquestionable truths, then uses those convictions to justify suppressing the very criticism that might expose its flaws. It thrives not necessarily because its arguments are stronger, but because challenging them has become socially, professionally, and sometimes institutionally costly.

And at the center of it all is suicidal empathy: compassion so detached from reason, consequences, and self-preservation that it becomes destructive to the very society exercising it. An insistence on appearing compassionate, regardless of whether the policies being defended actually produce compassionate outcomes. A willingness to sacrifice long-standing institutions, freedoms, and social cohesion in pursuit of moral ideals whose practical consequences are treated as secondary, if they're considered at all.

Look at Europe, where I believe we're already witnessing the consequences of this mentality, and ask ourselves whether we're truly so exceptional that the same ideological failures couldn't take root here. Are we going to recognize the warning signs, or are we going to keep rationalizing each concession until the cumulative damage becomes impossible to ignore?

Then there are those who enthusiastically advocate socialism, or any of its countless denominations, seemingly without the slightest recollection of the historical failures, economic trade-offs, and institutional realities associated with the systems they champion.

And when confronted with those failures, what comes next? The Nordic countries, of course.

"Look at Scandinavia! Look at their healthcare! Look at their social safety nets!"

As though pointing to a handful of prosperous nations settles the argument. As though those countries exist in an economic vacuum, completely detached from the global markets, geopolitical arrangements, historical circumstances, and institutional foundations that made their prosperity possible. As though their market-driven economies, private enterprises, fiscal constraints, and dependence on international trade are somehow irrelevant to the discussion.

They praise the outcomes without adequately understanding the mechanisms. They admire the benefits without fully accounting for the costs. They point to the Nordic model while overlooking the broader economic order in which it operates, including the enormous influence of the United States and the advantages afforded by American economic and geopolitical power.

And somehow, this superficial understanding is presented as intellectual sophistication.

That's perhaps the most infuriating part of all.

These people behave as though they've figured everything out. As though history has nothing left to teach them. As though economics is merely an obstacle to be overcome by sufficient political will. As though human behavior, incentives, scarcity, unintended consequences, and institutional limitations can simply be wished away by declaring their intentions morally superior.

Their confidence is extraordinary, especially considering how little of the underlying complexity they often seem willing to acknowledge.

They mistake moral conviction for factual correctness. They mistake compassion for wisdom. They mistake ideological consistency for intellectual rigor. And perhaps most dangerously, they mistake their inability to comprehend opposing arguments for proof that those arguments have no merit.

They approach complex societal problems with an almost religious certainty in their own moral superiority, armed with just enough knowledge to believe themselves enlightened, but not enough humility to recognize the enormous gaps in their understanding.

They scratch the surface of an issue and convince themselves they've reached its foundational bedrock.

And from that shallow foundation, they presume the authority to lecture everyone else about morality, justice, economics, science, and the proper organization of society.

Yet the moment someone questions their premises, challenges their conclusions, or demands evidence beyond moral platitudes, the discussion so often retreats into accusations, labels, and emotional appeals.

Because when your worldview is built upon the assumption of your own moral infallibility, disagreement isn't merely an intellectual challenge. It becomes a moral transgression.

And that's precisely where the danger lies.

A society cannot sustain meaningful intellectual progress when questioning prevailing ideas is treated as evidence of moral corruption. Science cannot flourish when conclusions are determined by ideological acceptability rather than empirical scrutiny. Democracy cannot function as intended when citizens are pressured into professing beliefs they do not hold. And compassion cannot remain virtuous when its consequences are exempted from rational evaluation.

Good intentions do not guarantee good outcomes. Moral superiority does not establish factual superiority. And empathy, however sincere, does not absolve anyone of responsibility for the consequences of their beliefs.

We should have understood this from the beginning.

Instead, we allowed ourselves to be intimidated into conformity, one seemingly harmless concession at a time. We prioritized avoiding offensive labels over defending the principles that made open inquiry, individual liberty, and intellectual disagreement possible in the first place.

And now we're left confronting a question that should have been obvious long before we reached this point:

What good is a society's compassion if, in the name of exercising it, that society gradually destroys its own capacity to distinguish truth from falsehood, reason from emotion, and genuine progress from ideological self-destruction?


Given my political stance, rooted in classical liberalism, libertarian principles, and conservative pragmatism, it genuinely saddens me to see how far we've drifted from the very principles that made liberal society worth defending in the first place.

I believe in individual liberty, particularly negative freedoms: the freedom to speak, to think, to associate, to disagree, and to live without unnecessary interference from the state or the collective. I believe in a small but powerful government, one whose authority is limited in scope but effective in carrying out its legitimate responsibilities. A government that protects individual rights, upholds the rule of law, maintains national sovereignty, and intervenes where demonstrable harm warrants intervention, rather than attempting to regulate every perceived injustice, discomfort, or subjective grievance.

And I believe in a society where tolerance means allowing others to live differently, not demanding that everyone affirm the same beliefs.

That's an important distinction we've increasingly lost.

I don't have to agree with someone's lifestyle to respect their right to live it. I don't have to approve of someone's opinions to defend their right to express them. I don't have to embrace someone's ideology to recognize their individual liberties. And they, in turn, should not be required to embrace mine.

Tolerance is not agreement. Acceptance is not affirmation. And disagreement is not inherently hatred.

Yet somehow, we've allowed these distinctions to become blurred. We've increasingly entertained the notion that respecting someone's freedom requires validating their beliefs, that compassion requires ideological conformity, and that refusing to affirm a subjective claim is equivalent to denying someone's humanity.

But that's not the liberalism I believe in.

The liberalism I believe in protects the individual's right to be wrong, unpopular, offensive, unconventional, or simply different. It doesn't demand ideological uniformity as the price of participating in society. It recognizes that the same freedoms protecting the people I agree with must also protect those whose beliefs I find objectionable.

Because a freedom that exists only for those who hold socially acceptable opinions isn't much of a freedom at all. It's a privilege granted conditionally by whoever happens to control the prevailing moral consensus.

And privileges can be revoked.

What saddens me further is that so much of this appears to be justified in the name of progress, compassion, and equality, concepts that aren't inherently objectionable. But somewhere along the way, we've begun confusing equality before the law with equality of outcomes, tolerance with compulsory affirmation, and the protection of individual rights with the accommodation of every subjective grievance.

These are not interchangeable principles.

Equality before the law establishes a common standard under which individuals are treated as equals. Equality of outcomes, when pursued through coercive means, can require treating individuals differently to produce predetermined results. Compassion can motivate us to help those in need, but it cannot eliminate scarcity, economic trade-offs, or the unintended consequences of the policies we enact.

I support a social safety net that catches people when they fall and gives them an opportunity to recover. I do not believe that compassion obligates us to construct an ever-expanding system of dependency or that the existence of hardship automatically justifies expanding government authority.

There is a difference between helping someone regain their independence and constructing institutions that make independence increasingly difficult to achieve.

Likewise, I believe free markets, private property, voluntary exchange, and individual initiative are fundamental to a prosperous society. Not because markets are infallible, but because economic systems must contend with scarcity, incentives, dispersed knowledge, and human behavior. These realities do not disappear simply because someone's political intentions are benevolent.

And when markets fail, as they sometimes do, the appropriate response should be grounded in evidence, proportionality, and an understanding of the consequences of intervention, not an automatic presumption that greater centralized authority is the solution.

My political philosophy is not built on the assumption that government is inherently evil or that every regulation is illegitimate. It is built on the recognition that coercive authority carries consequences and therefore demands justification. The burden should fall on those seeking to restrict liberty, not on individuals to continually justify why they deserve to retain it.

And that burden should not be satisfied merely by invoking compassion, offense, equity, or the supposed moral righteousness of an objective. It should require a defensible purpose, a rational connection between the means and the ends, and evidence that the intervention is proportionate to the harm it seeks to prevent.

This is why I find the growing reliance on subjective offense as a basis for restricting behavior so troubling.

Subjective experiences are real to the individuals experiencing them, but that doesn't automatically make every subjective grievance a legitimate foundation for coercive public policy. The fact that someone finds speech offensive does not, by itself, establish that the speech causes an objectively demonstrable harm sufficient to justify restricting it.

If we're going to limit individual liberty, we should at least be capable of articulating a consistent, evidence-based standard for doing so.

Otherwise, what prevents the next person from demanding that their own discomfort be accommodated at someone else's expense? What prevents the expansion of restrictions from genuinely harmful conduct to merely unpopular conduct, and eventually to conduct that simply contradicts the preferences of those in authority?

The problem isn't that distinctions cannot be made. The problem is what happens when we abandon the obligation to make those distinctions objectively and consistently.

And perhaps that's what disappoints me most.

I don't expect everyone to share my political philosophy. In fact, the very principles I defend require me to accept that they won't. I expect disagreement. I welcome criticism. I recognize that my own beliefs are neither infallible nor immune to scrutiny.

But I expect the same intellectual humility from those who presume to tell the rest of society how it ought to function.

I expect arguments to be defended rather than dissenters demonized. I expect policies to be evaluated by their consequences rather than the moral intentions of their advocates. I expect scientific claims to withstand empirical scrutiny, economic proposals to account for real-world constraints, and political institutions to respect the boundaries of their legitimate authority.

And above all, I expect a society that calls itself liberal to understand why individual liberty must remain protected even when exercising that liberty produces opinions, expressions, or choices that others find objectionable.

What makes this especially disheartening is that I don't believe these expectations are particularly radical. Freedom of expression, equality before the law, due process, intellectual inquiry, and limitations on arbitrary authority are foundational principles of the liberal tradition.

Yet defending them can increasingly feel like an act of political defiance rather than an affirmation of principles that should transcend partisan allegiance.

I don't want a society governed by the ideological absolutism of the left any more than I want one governed by the ideological absolutism of the right. I don't want the state enforcing progressive orthodoxy, conservative morality, or any other comprehensive worldview upon individuals who do not share it.

I want a society capable of distinguishing disagreement from aggression, discomfort from harm, compassion from coercion, and moral conviction from objective truth.

A society confident enough in its principles to tolerate dissent, humble enough to question its assumptions, and rational enough to recognize that good intentions are not substitutes for good judgment.

Because the greatest tragedy wouldn't simply be that one political movement prevailed over another.

It would be that, in our desperation to appear compassionate, enlightened, and morally righteous, we gradually abandoned the very freedoms, institutions, and intellectual disciplines that made genuine progress possible.

And we did so not necessarily because we were forced to, but because we were too afraid to say no.

I don't fear a society in which people disagree with me. I fear a society in which people are no longer free to disagree, or have become too intimidated to exercise that freedom.

And if defending that distinction has somehow become controversial, then perhaps the problem isn't that classical liberal principles have become outdated.

Perhaps it's that we've forgotten why they mattered in the first place.

Thursday, September 11, 2025

VSCode + LMStudio via Continue

LM Studio

Download LM Studio: https://lmstudio.ai/


Search for a Model:

Download a Model (lets use OpenAi's open source model):

Enable local api and host the model:

Config our model (maybe increase the context length, GPU offloading, flash attention, etc) and load it:


Once its done loading the model successfully you should see something like this (copy down the loaded model name, we need it later):


We're all done with the LM Studio side of things.

VsCode

Download and install VsCode: https://code.visualstudio.com/


Go to Extensions and install the "continue" extension:


Click on the "Continue" button at the bottom right of the window and then click "Open Settings":


Click on "Agents" then "Local Agent", a "config.yaml" will open in the editor:



Add an entry for the OpenAi model we loaded in LM Studio (im loading the bigger 120b version here), and any roles you want it to have:


(snippet):
  - name: OpenAi (LM Studio)
    provider: lmstudio
    model: openai/gpt-oss-120b
    apiBase: http://192.168.1.254:1234/v1
    roles:
      - chat
      - edit
      - apply
      - autocomplete
      - embed

Save the "config.yaml" file (ctrl+s)

Go to "Models" and select OpenAi as the option for which features you want to enable with it (and additional options if you want):


Now that you've configured everything lets give it a try. Click on the bottom right "Continue" button again and click "Open Chat". A new window should come up for you to prompt in. Make sure the model selected is our LM Studio hosted model:



Let see if it can generate us a function in python for calculating the area of a triangle:


And it should work like so:



Friday, July 8, 2022

My First Ever Coding Job Interview

    Now I've worked for a couple companies already which required me to code but believe it or not none of them gave me coding interviews. I basically was thrown into the position and expected to catch up/learn what I had to and just work. Well here is my first ever coding interview and honestly I think I did horrible lol. The interview started off great, the interviewer introduced herself (who she was and how long she has been at the company), very nice person. It was then my turn to introduce myself a bit and I said my name and how I am passionate about code, and solving problems through programming. I don't remember the order of things but I will try to recall as best I can from this point. I believe she then asked me about scenarios on linux and wanted me to tell her what linux commands I would use to solve the scenario. I have linux on my resume but that was supposed to mean that I used linux and can navigate it, I didn't expect to have to remember commands for it, I mean I don't remember all the commands for windows (my daily driver). I guess its time I practice those commands for the future. Anyways now onto the part that I should've been good at.

    The question was very simple (though it wasn't immediately obvious to me because I overthought it). Return the number of days between two dates. The template code she had up was in python and while I don't code in python in my day to day, I've learned it enough through porting code etc to understand it. I then asked if I had to write the solution in python or java, to which she replied I can use any language. C# being my favorite language at the moment was what I chose. Opened Visual studio, created a new .Net 6 project and the first thing I did was recreate the class she had in her python example, no biggie. Afterwards I wrote the beginnings of what would be the GetDifference() method which is what the name of method for the solution was expected to be. Now having dealt with time in the past and all the time zone related stuff I immediately overthought the complexity of the problem. This didn't require time-zones etc but for some reason that idea stuck with me, I didn't realize it immediately, and I began to break even more than I already am. I thought, there is no way she is asking me to calculate date time accurately from scratch right? I asked... "Can I assume that months are exactly 30 days?". She (to my relief) replied yes. I thought "Oh, this should be easy now". I started to code, adding constants for the number of days in a month and months in a year so I can refer to them by name later if need be. This is around the time I realized that non of my questions had any relevance because we weren't dealing with time-zones, shoot we weren't even dealing with time, just dates. While this should make me feel better because the problem isn't as complicated as I had misunderstood it to be (to clarify this is entire my fault, I guess I was going into this expecting a much more complicated problem) but instead this error caused my mind to race. I glance over to her stream, she looked bored of it all (might have been my imagination), I had decided to say what I was doing. In hindsight I guess that was a good decision because talking to myself made me calm down a bit. Unfortunately that wasn't going to last for long. I finished my code, at this point I don't even know what logic I had just laid down, I run the program and immediately I get an error. Red everywhere, I have a micro freak-out to myself. Okay its not so bad. I fix it, this time it actually compiles, but it gives the wrong answer. I'm thinking "I Flopped, there's no recovering from this". She lets me know that the months don't have the same number of days. I thought to myself, "didn't you just say that I can assume that the months have 30 days?", maybe I was hearing things before. I go back to my code, the short little code I had written not long ago, seemed daunting and alien to me. I changed up the design, looking up how many days there were in each month and how many days are in Feb on leap years. I didn't know what I was even doing anymore. I somehow manage to focus on the array I had made to keep count of the number of days per month and from there I was able to focus a bit more on the flow of the code. My answer was off by about double, so I told myself it has to be the loop which counts the days for a year. I go to the loop and I see a potential issue, I added the "- 1". At this point I'm numb, I speak... "I don't know if this will work until i try it I guess", shoot... I didn't mean to say that out loud, I paused for the split second from the awkwardness. I click run, okay it compiles, and to my surprise the result was.... WRONG. I thought "Just kill me", if I cant even write a program to solve this easy problem, then how are they going to believe I have any competence in coding and solving problems. Sorry to say but at this point I had no energy, I was drained and I honestly didn't know where to even start debugging because my mind was in another universe. I was defeated. The defeat I had would be solidified as the interviewer said "its okay, you dont have to get the exact answer". I knew that because the number of days was indeed deterministic there should be no excuse why I couldn't provide the correct exact number. I was maybe 2 weeks off but because of the properties I just stated, that might as well be infinitely wrong.

    We ended the interview on a good note (or just my wish) with smiles although her smile might have been my imagination (she is nice and I was still in lala-land), but my smile was one which took effort to put on. I was a failure, there was nothing I could smile about. I look at my phone, and told my friends about the interview and how I felt about it. Some tried to cheer me up, some jokingly made fun of me, and of course some couldn't care less (these guys help me snap back to reality). I then sat there for a bit thinking about the interview and then tried telling myself "well the problem isn't solved until its solved". I hopped back on visual studios and proceeded to read my code. It's unbelievable how much more clear everything is when anxiety isn't tugging on your heart strings. I had made several mistakes and these where easily spotted if I had just read the code properly. In the ported code, the constructor takes 3 parameters which were day, month, year, in that order and all ints. When I went to create them in "program.cs" I had incorrectly used the wrong format of month, day, year. The dates I put there were probably wrong to begin with since I was dazed as all heck when she was reading them to me. The other issue I found was that the calculation for adding days to the total tally for a year was wrong. I fixed that as well and used https://www.timeanddate.com/date/duration.html to check my answers, each time with different dates. This all took no time at all and yet I couldn't do it during the interview. I thought I'd at least push it up to my git to add to my portfolio lol, for what its worth. I still have an in person interview tomorrow so I really hope I do better there.

ADDED: I forgot that during the coding portion she also pointed at the keyword "internal" and asked what it was for. I didn't really know what she was asking so I replied with "I can turn it to public if you want", I proceeded to change internal to public. She further explained that she wanted to know what it was and what its used for. I told her that it was an access modifier and that it used to let the the rest of the program see the class and its members. Now thinking back on it, maybe that was too simplistic of an explanation? darn it, I did horrible on that whole interview.

IN-PERSON:

    Now the drive there was pretty uneventful but as I got closer and closer to my destination, I can feel my heart rate quicken. I followed the instructions on the email I got for parking and parked the car. I started walking up the hill, with every step I realized more and more where I was. This was not some small startup, I was reminded that this is a big established company. I walk into the building and tell the front desk that I'm there for the interview. I sit and wait in the lobby, and I am dazed, I'm staring out the front window thinking "I can't believe I'm here". My interviewer introduced himself and I immediately missed his name, I reactively ask for his name again and then told him my name. I get my visitor
s sticker and I follow him. We reached the elevators and we got in. Yup just me and him in the elevator, I need to relax, so I breathe deeply but slowly. He breaks the silence by asking me how I pronounced my name, I told him its like saying the letters 'T' and 'N' and furthered it by saying I tell people that if they've watched DragonBall Z its just like the character Tien. Unfortunately he hasn't seen the show so I just reaffirmed that its just the letters 'T' and 'N'. We walk and entered a corner room. Two of the walls were glass and the other two were what seemed to be white boards. He further introduced himself and basically what they do there. I remember thinking this is some official shiz lol. I was then asked to give more of an in depth introduction about myself. I said I was passionate about coding, and I like making tools for people, and my hobby is coding to ultimately get better and learn new things etc. We proceed to talk about my reasons for leaving my previous place of employment and explaining the gap. He then explained to me that not everything there was going to be orderly and optimal and that it isn't going to go my way. I completely understood and thought it was perfectly reasonable. I guess I came off as if I left the old place because they didn't do things perfectly. I hope I reassured him that isn't the case. He was very level with me and honestly great to converse with. We also talked about teamwork and agile. I told him that at my old workplace we did agile but I wasn't too sure if it was what we actually did. By the end of the interview I essentially told him my strengths and weaknesses. I also asked a couple questions like "with the conversation we had thus far, how do you think I fare". He said he saw some of my code on GitHub but unfortunately he didn't look at one I had hoped people would look at which at the moment is BijouDB. I mean the one he looked at wasn't really bad I think but I don't think it is as impressive. Id like to get along with this interviewer seeing as potentially he would be my Lead but also to pick his brain and learn things lol.

Wednesday, March 23, 2022

Photino on Net 6

Photino is a way to develop cross platform applications utilizing web technologies. There is a .Net wrapper for it but it doesn't yet support Net 6 as of writing this, or does it lol. Here is a working snippet for their .Net sample project running on Net 6.

Friday, August 6, 2021

Making a virtual multi-tap using ViGEm/ViGEm.NET

Update 1/24/2022: Updated the download, includes the required but missing file this time, also fixed some bugs which prevents the addition of new controllers.

    So my brother has been playing a game on PCSX2 and its a multiplayer game and he asked me if I could make a program which acts as basically a virtual controller that mimics the actions of the physical controller. Now receiving controller inputs I was familiar with through DirectInput and XInput but simulating/emulating a controller is something I haven't a clue about but I know we have lots of talented people so I did some research. Now I am mainly a C# developer these days so I specifically researched on that front. Sure enough there is a driver for simulating/emulating a controller called ViGEm and even a .net wrapper called ViGEm.NET. With this in hand I did some tests and after all test passing, I proceeded to ask my brother the specifications he would like for the program and off I went. With the driver and wrapper it was easy functionality-wise but most of the work went into handling the mappings and conversions to a DualShock4. Weirdly enough the XBox360 controller emulation didn't work. I went into the discord channel for ViGEm and asked around and they couldn't figure out why either but that was fine, dualshock4 will do.

So I made this:
https://mega.nz/file/7FhWADTZ#mC76AbApajA6TSFJ0mIo3Zvq2k6yEhzJmhX3Epg6Phk

I'll number each step I mention here as a comment in the source here:
https://github.com/TizzyT566/VirtualMultitap

0) This step isn't going to be in the source code but you have to install the ViGEm.NET package which can be found here:
https://www.nuget.org/packages/Nefarius.ViGEm.Client/
Another thing is we have to specify useLegacyV2RuntimeActivationPolicy="true" in the App.config file. Finally you have to have the driver installed which can be obtained here:
https://github.com/ViGEm/ViGEmBus

1) I want to ask the user how many virtual controllers they want, since my brother only asked for up to 4 players thats what I did.

2) Now that I know how many controllers the user wants, we can leave that info for later, we'll come back to it, the first controller related step is to get user inputs for a single controller which will control the virtual controllers. We can do that via Manager.GetDevices(DeviceClass.GameControl, EnumDevicesFlags.AttachedOnly). We specify that we only want to get GameControllers that are currently attached. Each device has a device id which is represented by a guid. We can populate a list of these guids to query these controllers later.

3) Lets actually make some virtual controllers now. We first create an instance of the ViGEmClient so we can use it to make the controllers. The number we stored in step 1 will be used to create 2 arrays. One array to store the actual virtual controllers and a second to represent active ones. We want to be able to specify which of the 4 or even all of them to be active on the fly.

4) Now getting back to that list of device guids. We need to be able to single out a master controller for the virtual controllers.

4.1) We are only given the device guids so we cant really tell which device is which unless you memorized the guids. Even then because windows is wonky handing out these ids you'll never be able to distinguish any 2 controllers reliably. So there must be a method to detect which controller you want instead of selecting from a list. In this case I made it so that if the user selects 0, it would go into a sort of detection mode where the user physically presses a button on the controller they want to act as the master controller. To do that we create an array of devices and populate it with aquired devices using the guids from the list we created earlier. We have to make sure to se the data that comes back from the device be joystick data. Then we loop through the device array over and over again until one of the controllers DPad or buttons are pressed, and we make note of that device, setting it to a variable. To clean up we iterate over the device array one last time to Unacquire all the controllers we arent using.

4.2) If the user selects an option other than 0, the first thing we need to do is decrement the selected option by 1 since 0 was taking the place for Detecting a controller in step 4.1. We then initialize a Device using the selected guid. We set the dataformat and acquire it and make note of it just like in step 4.1.

5) Now that we have the master controller established we need to deal with the mappings. I decided to store the mappings in the Documents\Virtual Multitap folder. If the folder doesn't exist yet, we create it. We construct the mapping's full file path using the guid. The JoyStickState structure doesn't correlate directly with how the DualShock4 is mapped in ViGEm so I just associated one mapping to another using indexes. We loop over and over again for each input for a DualShock4 controller, mapping all buttons, sliders, axises, and the viewpoint (aka DPad). Finally I save the mapping with each dualshock4 input on a separate line in Document\Virtual Multitap\<guid>.

6) We now load the mapping we just made or load one if one already exists for that device guid.

7) The last thing to do in our routine is to kick off a loop to listen for keyboard presses and events on the physical controller and simulate them on the virtual controller. I don't use a regular loop, instead I use a SpinWait(). This allows the loop to process relatively fast while not hogging a bunch of CPU.

Friday, November 13, 2020

Mouse Speed Profiler

UPDATE 1.1: Previous versions lost profiles because the mouse ids would change upon system restarts etc. That has hopefully been resolved with this version. Download link updated.

    
So I work from home or more recently at a friends house. I use my friends computer to get work done but he has multiple mice, and they are all set to different DPI settings and every time I use one or the other I have to go into the mouse control panel, and adjust the cursor speed setting so that its comfortable. I decided it would be some what fun and useful if I made a program to automate the process either entirely or as much as possible. I had an idea which later turned out not to work. I was originally going to poll the mice with DirectX and using their DeviceInstance GUIDs. But I couldn't distinguish the mice from each other. What ever I did I could not associate mouse data separately. I went to researching, It turns out that since DirectX 9.0 Microsoft has pulled the plug on unique mouse and keyboard instances. All mice are merged together into one GUID and that's that, same with Keyboard it seem (haven't tested but was mentioned). So I thought, lets go the RawInput route, I hated this route as this wouldn't allow me to Poll anymore from a console application. Not only was RawInput a pain in the ass to get working properly, it didn't seem like anyone really had any real examples online on how to go about doing it. People seemed to always be very vague like, "you need a window, have the window register for rawinputs", I'm over here think "is there any chance I can make DirectX work" but no I finally found some sample code which semi worked. The code sometimes worked... well rarely worked, more times then not it would crash the program and this is the demo program the author made. The crash wasn't normal either, no error messages, codes or anything, it simply just closed the program. So I went to troubleshooting and debugging. Voila!!! now that I can distinguish between multiple mice, I can now work on getting and setting the windows mouse speed setting. This wasn't so bad, some MSDN C++ docs and P/Invokes later and it was all done. Finally I have to turn these functionalities into an application.

    When the program runs, it loads a "speed.prf" file (if it exists) which stores any mouse profiles. While its running and becomes focused (via Alt+Tab) you can switch to which ever mouse you want to use. A new mouse window will popup if a new mouse has been detected. You give the mouse profile a name (the mouse id is used as default), and you set what you want the windows mouse speed to be and click save; while you are moving the slider the mouse speed is set accordingly as well. You can then do the same with another mouse, etc. Now the next time you want to switch mice, you Alt+Tab to the profiler, and just start using the mouse you want.

DOWNLOAD:
https://mega.nz/file/rFow1b4S#qUNEYFMNhKf-3wqbML9bawgAxF9VOvUtin3fdDBpDo4

Wednesday, July 8, 2020

A very basic Sudoku game

   Here is a Sudoku game I made a long time ago, going through my old projects I came across it and I thought why not put this up on my blog since I haven't posted anything in a while anyways. I might come back to this but writing it from scratch since this was written in vb.net and I have since moved mostly to C# with that maybe new features etc.

DOWNLOAD: https://mega.nz/file/jZ4DWQQK#xrQgbgHqIbsNs0VEnYeMfgbAomof8L3R9hmI-J5aoWA