Wednesday, November 1, 2023

Coding: Design Pattern Factory: Comparing Tutorials

 I had some difficulties understanding the design pattern factory and watched a few tutorials.


The tutorial I found most helpful for understanding: Christopher Okhravi's Factory Method Pattern – Design Patterns (ep 4)
(https://www.youtube.com/watch?v=EcFVTgRHJLM&ab_channel=ChristopherOkhravi)

This tutorial was good too and for me a good supplement to Okhravi's tutorial: Code with RaiGenics' Factory Method in C# I Design Pattern (Part 3) - How and When to use Factory Method
(https://www.youtube.com/watch?v=tdMOdeewTnc&ab_channel=CodeWithRaiGenics)


This may potentially due to it being later and I have been understanding a bit more after each video. I do not think so but wanted to mention for transparency. Below is the order that I watched the videos.


Microsoft Video Studio

https://www.youtube.com/watch?v=JEk7B_GUErc&t=427s&ab_channel=MicrosoftVisualStudio

This just did not help me understand why I needed a factory. There was an example about pizza which I later learned from my recommended video by Christopher Okhravi that this is from a book called "Head First Design Patterns" which sounds like the exact same example.

PRO: Robert Greene asked a couple good questions. Otherwise, nothing obviously helpful to me. It was the first video I watched. Watching again after understanding does not seem useful. 

CON: The tech guy (Phil Japikse) is not very good at answering or describing the questions by host (Robert Greene).

IAmTimCorey

https://www.youtube.com/watch?v=2PXAfSfvRKY&t=246s&ab_channel=IAmTimCorey

I am usually a fan of IAmTimCorey videos but this video was very hard for me to follow as there were too many new terms for me to learn and understand like delegates, dependency injections, and Blazor. This may be good for those who have more experience.

PRO: This may be helpful later when I get into Blazor.

CON: Too advanced. I need to understand delegates, dependency injections, Blazor, and probably a few other things that I do not understand enough to even not understand.

Code with RaiGenics

https://www.youtube.com/watch?v=tdMOdeewTnc&ab_channel=CodeWithRaiGenics

This was a bit too technical to start off with but is also a good tutorial. This is include a good example in C# which is what I ultimately needed too.

PRO: Used most basic example and basic code to demonstrate factory design pattern.

CON: Seemed too technical at first but upon reviewing it again later, this video probably would have been fine. Although this had the best code example, it was just short of one of my biggest question. After I create the object, it is in the base class like IMobile. After I get the object, what if I want to use a specific method in the sub-class like SamsungA9? I am sure I can look this up and could be unrelated. I personally would have preferred that it added that one bit anyways.

Christopher Okhravi

https://www.youtube.com/watch?v=EcFVTgRHJLM&ab_channel=ChristopherOkhravi

PRO: I understood the example better. I agree the example about the pizza was a bit confusing to me too. The pizza example is still a bit confusing even after understanding the factory pattern. The UML diagram was also helpful in answering my question on what is the difference between interface and factory pattern. The other tutorials almost seemed like it was just explaining how to use an interface. The UML diagram helped me get over that hump. I would recommend this video is a good overview for the design pattern. For me, it was a bit better than RaiGenics'.

CON: No code example but it obviously was not meant to have one as it was a generic overview. For example, RaiGenics' was the most helpful. For more advanced, Tim Corey may eventually be an ultimate code example as I do plan to eventually work with Blazor.


Summary

My recommendation is to start with Christopher Okhravi then RaiGenics and finally Tim Corey. MS Visual Studio was not helpful to me before or after understanding.

Saturday, September 9, 2023

WinMerge: Excluding files Appears to not exclude file but kind of is

When I use an exclamation in the filter like !*.txt to exclude txt files, it always seemed like it came up in the results. What I "failed" to realize was that txt files will still appear in the list while the compare is going on. Once the compare is completed, then it removes it from the results pane.

I have only used this in my work experience when comparing tens of thousands of files, so I never let the compare complete before fully "testing" the exclusion. I have to say this was quite confusing. I have only realized this weeks later when I actually left it running due to other distractions and realized no txt files were in the results.

Wednesday, September 6, 2023

Buggish: Microsoft Web Excel Copy/Paste

 I totally hate Microsoft's copy/paste feature on its Excel web application. It does not comply with the traditional copy/paste feature.

Certain actions like clicking into a cell will clear the clipboard. Worse yet, some actions appear random. For example, I want to move a part of a text from one cell to another. I double-click, select the text I want, cut, and I see the text disappear. I then double-click in the cell I want to paste, and nothing pastes. Try pasting elsewhere like notepad, nothing... zippo.... nada.... zilch. Undo, and try again... and still the same result.

Because I am insane, I try a third time... and behold... it now pastes. What gives?!

This is definitely not the first time. I believe I have an older post complaining about this copy/paste. It is annoying enough that I may keep posting about it.

Friday, August 18, 2023

Buggish: Tesla Account Locked, Then Locked Out of Car

I regret purchasing a Tesla.

Account Lock Out, Now I cannot Drive My Car

So, I am trying to lookup my insurance info and try to log in. I sign in, I get to the 2 factor-authentication where it sends a code to my phone. AND IT NEVER COMES! 

Whatever the case... I tried to reset my password to maybe reset the 2FA. WORST MISTAKE! This signs me out of my app and now I cannot use my car at all.



Saturday, August 5, 2023

C# SMO: Unable to get objects by name but able to get by index

Replicating Issue

StoredProcedure sp = db.StoredProcedures["spName"]; // Returns null

Does not return the same as 
StoredProcedure sp = db.StoredProcedures[0]; // Returns object


If I traverse the array (technically a collection), I will find spName. Even if I do:
StoredProcedure sp = db.StoredProcedures[0]; // Returns object
StoredProcedure spByName = db.StoredProcedures[sp.Name]; // returns null


Possible Solution

First I tried. https://www.tek-tips.com/viewthread.cfm?qid=1736324
StoredProcedure storedProcedure =
db.StoredProcedures.Cast<StoredProcedure>().SingleOrDefault(sp => sp.Schema == "YourSchemaName" && sp.Name == "YourSprocName"); 

This worked and this caused me to see that the schema is explicitly entered. After some more research, I could not find how you would provide the schema to the stored procedure name.

Later I tried to look under Database which has a property, DefaultSchema. After setting this, this also returned the correct result.

So the simplest solution:

db.DefaultSchema = "schemaName";
StoredProcedure sp = db.StoredProcedures["spName"]; 

Root Cause Analysis

For my specific case, our DBA changed the default schema of the user. 

Thursday, July 27, 2023

EXCEL: Create new lists of data that contains both (A and B), only A, and only B

 Both

=FILTER(A2:A1019,ISNUMBER(XMATCH(A2:A1019,B2:B1119,0)))


Only A

=FILTER(A2:A1019,ISNA(XMATCH(A2:A1019,B2:B1119,0)))


Only B

=FILTER(B2:B1119,ISNA(XMATCH(B2:B1119,A2:A1019,0)))



Setup

1. Column A includes the data for Table A with a header
2. Column B includes the data for Table B with a header
3. User equation for "Both" in Cell C2
4. User equation for "Only A" in Cell D2
5. User equation for "Only B" in Cell E2
6. Modify data size

Monday, July 24, 2023

Buggish: Microsoft Web Excel keeps clearing out clip board

 Any activity with a cell in the version of Microsoft excel keeps clearing the clipboard. I do a lot of cross-referencing with it and I constantly have to re-copy data.

Any activities like create insert new line, clicking inside a cell, escaping select cell(s), pretty much anything that has to do with a cell will force me to copy from origin again.

This is the global clipboard meaning even if the copied data is not for excel, it is cleared out.

This is quite annoying. This has been going on for a very, very long time. The straw that broke the camel's back was that the cell errored for some reason and I still lost my data.

Not life critical... but extremely frustrating to work around.

Wednesday, June 28, 2023

DEV: Finding Google Client Id and Secret

  1. console.cloud.google.com
  2. APIs & Services
  3. Credentials
  4. Under OAuth 2.0 Client IDs
  5. Click client
  6. Find Client ID and Client secret

 

To add Google authentication for Microsoft Blazor Server: https://learn.microsoft.com/en-us/answers/questions/830958/how-to-implement-google-authetication-in-blazor-se


Install nuget: Microsoft.AspNetCore.Authentication.Google

Thursday, June 22, 2023

Buggish: Outlook 2023 Disable Automatic Image Download

Outlook > Settings > Mail > Junk email > Block attachments, pictures, and links from anyone not in my Safe senders and domain list


Feedback

I went through almost all the options. I did not look into Junk email because why would it be in Junk email? Block? Pictures? I searched for download or image ...............

It was also so difficult to find a page because all the sites were for the old outlook where the first step was to find the "File tab".... WHERE IS THE FILE TAB!!?!?! Answer is that there is no file tab in 2023. I don't know when it disappeared. I don't know when this option was disabled.

I would like this option even for anyone in my Safe list. Yes, I want this for all received emails even from myself. I want to manually download the image each and every time.

Reference

https://answers.microsoft.com/en-us/outlook_com/forum/all/how-to-stop-images-from-automatically-download-in/9b4b080b-0fba-4c6c-bfc2-3799cb386a50

Monday, April 24, 2023

Buggish: Citrix with Microsoft Authenticator Not Logging In (Kind Of) With Chrome

Using Google Chrome to log into my Citrix to access corporate resources. I have to access the Citrix login which triggers my Microsoft Authenticator. This is too short of a time if I do not unlock my phone first. For some reason, Citrix times out around 30 seconds. It takes my phone a few seconds to reach my Microsoft Authenticator, then a couple seconds to open, then accept the authentication. Then a couple more seconds for the pin request to come up. Then a few more seconds for the keyboard to come up. This is usually the limit of the Citrix time out. I always miss this if I have to unlock my phone first.

Friday, April 14, 2023

Buggish: MS VS does not display git branch names with slash properly (I was wrong-ish)

EDITED (2023-04-24): As I watched demos for other features, I noticed that people used the slash to organize their branches. So, it seems this was intentional. Below is the original post.

Original Post

Microsoft Visual Studio 2022 does not display git branch names with forward slash properly although it is allowed in git and GitHub. Does it do the same with backslash? I do not know and do not wish to test this.

Basically VS will display it with a folder name then a branch in the folder with a name with the rest of the branch name text. For example if the branch name is abc/def, then there will be a folder called abc and a branch in their named def. In GitHub, you will see branch abc/def. Thus this is a bug in Visual Studio.

You cannot delete the folder, but if you delete the branch ('def' from the example above), this will delete both the folder and the branch. Which makes this a visual bug only. Functionally, looks like everything else will work properly.

OR... maybe this is a feature where you can group branches but only in Visual Studio?

Wednesday, March 29, 2023

Scammish: MtGA still rigged... un-retirement

Saw a new update and wanted to try it out.

Some cool new features... experience is still poor.

MTGA random stats?

There are lot of pages discussing the RNG of MtGA and how it is well distributed or even slightly biased. None seems to be close to my playing experience.

All the studies are based on numbers by WotC, so I am just going to say BS on whatever they publish. I do not believe the people who are saying good things about the MTGA RNG. Do not belittle the posters that the negative outcomes are due to the sheer number of games that we play or that our memory only remembers negative events more prevalently.

Rigged opponents

I have been playing black for a couple days. 60+ games and a couple red aggros. Lots of white aggros. Still lots of droughts and floods with a 24/60 land ratio.

Today went back to my red aggro deck. 20+ Suddenly half of my opponents are red aggros. No white aggros.

RNG? Cheating?

3 games in a row. I play against someone who had at least two Wandering Emperor.
1 game with 2 four-of-a-kind cards within 8 rounds
There are pairs of cards that I always see with opponents like Djinn / Tolarian Terror, Sheoldred / Obliterator, etc. Do I ever just see one? Nope. Do I ever get both? Nope. I will concede that it is likely that a mono-blue deck have a higher chance due to the amount of cards that it draws... but the consistency is still too high. 

Opponent rarely floods or droughts

Ever notice that the opponent never gets stuck on two lands? I have seen that maybe twice in the last half year. Maybe if you include everyone that quits without playing, that is maybe once a day.

Ever notice that opponent multi-color deck always has the right lands? I've played against many 5-color decks and they have all 5 colors with their first 5 lands. With duress, I even saw one that only had 2 of the same land then drew 4 lands of each other color and play Jodah by round 5.

Yet when I play 2-color deck, I consistently only get one color. I even mulligan 3 times in a row and drew only one color.

I have droughted several times up to rounds 9 and 10... always stuck with 2 initial lands.
  1. 7 draws no lands, (20/60 = 1/3) which is 0.04% or 1:2187. So even if my memory is inflated, I should have seen this once since I started playing. Yet, I see get this daily which is far less than a hundred games. Even if you want to argue weekly, this is a very far cry from expected value.
  2. When I flood, half my cards are land. This almost always happen right after I break out of a series of drought.

Bots? Suspicious

Are the bots really bots? Do they leave without playing a card? Do they leave because you kill one creature? Do they chat? Do their cards highlight as if they are looking at the cards?

I guess you could program that... but why? Particularly when there are so many other issues...

Toxic opponents

And for real players, why even have a limited chat options? Why is there no option to auto-mute? "Oops" after I play a card is clearly sarcasm. As much as I do not take it to heart, it still decreases my liking of this game and makes me regret the times that I forget to mute the opponents. Half the "Good games" is un-sportsman where I am afraid to even say Good Game because I do not know if they have something up their sleeve. I also have a hard time responding to people saying Hello but at he same time thankful they reminded me to mute the chat.

Game still crashing

Game still continuously crashing. Every time the phone goes to sleep or locks, the game has to reconnect to the server. No other games I played has this "feature". Also it takes longer for the game to reconnect than to just shut it off and start it up again. So..........

Monday, February 27, 2023

Work Life: Cannot get the value of a token type 'StartObject' as a string. (Jira and C#)

Using JSON deserializer for the response from Jira. This is caused by Jira admins updating one of the fields from a string to an object.

Is there a way to default problems to a value or null instead of failing? The field was a minor field but the entire report fails. Would like there to be a way to still get the report minus the one field.

C# provides the error on the character count. I had to use an editor to search the character count as my response is well over 10k characters.

Wednesday, February 15, 2023

Scammish: (Opinion) MtGA rigged... eventually leading to quitting the game

This may come from me being triggered but it won't change the fact that I am quitting this game. I just lost the last 6 games. Each game the opponents had exactly the mana they needed and the cards they needed to counter my deck.

Again, I played another multi-color deck with Jodah, the Unifier. Guess when it played each and everytime? On the fifth round. One of each color. I barely can get two different lands with a two color deck. I barely even get three lands by the third round. Yet, every multi color deck is able to not only get one of each color but 5 lands.

I played a black deck which always seem to be able to play a Sheoldred by round 4. Then always followed by a Phyrexian Obliterator. If not Sheoldred by round 4, then Obliterator by round 4. I have a black deck with 4 Sheoldred. I barely even get a Sheoldred in a game. So, not only that I have to face this card occasionally but  every mono-black deck.

Then you play a blue counter deck. Play a creature? Create counter. Early game? Counter unless you pay extra obviously no one has extra mana in early game. Play sorcery? Counter that. Play a mix? Exactly the counter they need for it.

Play a Djinn deck? Always by round 4. I have played it so many times that I can tell when I play against one. Basically, if it is not a pure counter deck, it's a Djinn deck.

Cannot leave out that MtGA also loves to play mono-red aggro deck against my own mono-red aggro deck. Yet each time, I either drought or flood.

Prior dry run included 3 games in a row with only 2 lands from a 21 land / 60 deck with at least 11+ draws. Then followed by 3 floods where I drop more than 50% lands in 15+ draws from the same 21 land / 60 decks. If random, this is the crappiest RNG engine. Ending with 3 lands after 17 draws....

That's it. I'm triggered. I'm done with this game. In my opinion, this is a scam. I was happy to pay to play, and I have but now sad that I did. I was happy to play Magic online. But this supposed "RNG" is too ridiculous. If this is a case of just being bad luck, then... well... still quitting.

Some posters say losers don't know how to build a deck and say others don't know what randomness is. I think they are paid "opinions". This sort of randomness is almost on the scale of Zynga's "randomness" which is designed only to feed on people's addictions which in my opinion is a scam. Which makes this scammish but nearly a scam.

#MagicTheGatheringArena

Monday, February 13, 2023

Buggish: MtGA RNG Land Pulls (Droughts, Floods)

The random number generator or whatever algorithm MtGA is too unrealistic. Also the opponent decks that you play against is definitely some sort of algorithm dependent on the deck you play.

RNG

Majority of the time, I play a 20-land 60-card aggro deck. In the latest expansion, ONE, this has been much less successful. The reason I still play it is because I lose quickly and win quickly. My other decks are also performing worse across the board.

With 20 of the 60 cards being land, I expect to draw about 1 land and 2 non-land cards. Overall, I may average out to that. But the amount of droughts or floods is unbelievable.

Droughts

Majority of the time, I start with one or two lands and more on the two-land side. When I start with 1 land, I draw a land about a third of the time as expected. This odd is totally not worth it because I have lost every game where I do not draw a land within two draws.

Majority of the games are with two lands. And there have been several games where I reach rounds 7-8 rounds with no more land. This means that I have my initial 7 cards plus another 7 cards. With 14-15 cards, I have only 2 lands where I expect to be around 5 lands.

I have been able to win a minority of the games with two lands due it being an aggro deck. The other decks with more lands never wins with two lands.

The odds of this happening should be around 6%. At 45 games a day, I should expect this about 2-3 times a day. I see this about a third of my games.

Floods

And the other half of the time, I just get round after round after round of lands. The funny part is that this also tends to happen when I draw an initial 3 lands which should DECREASE the odds of pulling another land due to there being more non-land cards remaining.

In the last game which triggered this post, I reached round 6 with 6 lands plus two more in my hand then drew another land. I have gone through 13 cards and have 7 lands. That is over 50% land. And this happens quite frequently in a single day. The odds that this should happen should be way below 1%.

At 45 games a day, I should see this maybe once a week. I see this about a third of my games.

Opponents

I do not understand this part but it ALWAYS seem like my opponents are able to drop a land every, single round. The frequency of my opponents not drawing more than 3 lands in the first 3 rounds is extremely low. I have maybe 2-3 quitters, which if I assume are due to lack of land, per day. I play over 30+ games per day, probably more like 45+ games. I have played with nearly half land decks, and I still cannot pull that kind of stats.

Also with how quickly the game can find me an opponent is extremely good. I suspect several of my games are not human players or at least not normal players. By that, I mean that some may be hired players. Although the game says they'll have special highlight in the player name, I have never met one.

One that almost seems definitely rigged is the blue counter-decks if you play a red-deck. The game-play is almost always identical: two considers, an impulse, and 2-3 negates. Djinn never on round 3; always on round 4 or later. The one mana is always for Slip out the Back if you have a burn card or some sort of single-blue counter spell. And the rare chance that I manage past round 4, it is followed by not just 1 that already can kill me but 2 or 3 Tolarian Terrors.

Then when you are tired of losing to that deck which I face multiple times a day, I play a white or black deck. And BEHOLD, I never see a blue-counter deck.

I do not even have to note it, but there is definitely a set of opponents when I play certain decks. I have played so much that I notice it almost immediately when I switch decks. It is not just color, it is the content of the deck. Even between my red burn deck and my red aggro deck, there is a definitely a pre-set type of decks it plays against.

In the latest expansion, the red aggro has been seeing a lot of black annoying decks where it seems EVERY SINGLE OPPONENT has not just one but 3 Cut Downs.


Cards

Which leads me to the odds of getting a three of a kind with a smaller deck is 4.83% in the initial draw. I do not know how many times I have seen 3-4 of the same cards. 

Cut Down, Consider, Phoenix Chick, etc.

But for myself, I saw 3 Phoenix Chick for the first time since I built the deck a few months ago.



#MagicTheGatheringArena

Sunday, January 29, 2023

Life: Problem Getting a Travel Visa to Save

I keep getting this error: "The passport or travel document number does not match"

(IV) By clicking the “Save” button found on the bottom of each page what you have completed up to that point will be saved for 30 days. To return to a partially completed application, please click the "Retrieve an Application" button on the homepage and enter your application ID and Passport/Travel Document Number.

I have done this twice already. There are like 10 steps and I have yet to pass step 7. Yet the system either cannot save or cannot load, and there is no way to see what the problem is. I was afraid this was going to happen the second time. So I left the browser open all night but it just went to the main home page again where it asks to create a new application or load.


NOTE (2023-02-26): Still does not work.

Thursday, January 26, 2023

Work Life: I Hate When Bosses Tell Me Orders For Other Subordinates

"Tell xyz that he needs to join the calls." On the other end, I do not join a call just because someone tells me to after I have already decided not to join the call. I also do not join a call because someone said my boss told me to. I go to my boss to confirm and basically have him tell me to which is only after he convinces me what I am getting out of the call.

"Have xyz help you with this." If they were going to help me, they would have already helped me. I help those who I think I can help and can be helped. If I don't help, there is a reason. And that reason is not going to be resolved by someone of the same level or below (I am the bottom rung so not sure if this holds between managers of the same level but I imagine it shouldn't)

This is even worse when person xyz is in their own team and not mine. What makes them think that I have any sway to tell his own subordinate to do something.

Still almost as bad is if we are in the same team.

These types of bosses or managers decreases a bit of respect from me. Too bad my respect seem to have little value. It is essentially their primary job as boss or manager. If you want me to manage other people, make me the manger.

Unfortunately, there is little that can be done about this because it is such a corporate norm. I file this personal problem right with project managers not knowing how to manage a project. [I mean seriously, every corporation I have worked for have terrible project managers (ie good PMs by far the minority and typically from my experience do not have the certificates like PMP, etc.). Like using spreadsheets and have someone else basically managing the project with no credit to the project success.] I guess while I am at it, I also file this next to technical certificates. The more someone has (or maybe publish), the more incompetent they are. It seems only those who cannot need to have certificates to pretend they can do it.