Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
B

Brian L Hughes

@Brian L Hughes
About
Posts
18
Topics
4
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Not OK
    B Brian L Hughes

    I recently worked on an inventory system and I started out trying to capture all the input from a rather complex dialog with several fields. Some of the data was encapsulated in classes displayed in ListViews. I had to provide current database values of those classes along with a set changed values that the user had made to the items in the list. This dialog had 3 different lists on it, each list was editable, they could add remove and change each one! I came to the conclusion it was easier just to remove the Cancel button and change OK to "Close". I had to add "Save" button to the top area of the dialog that contained several text fields that were actual candidates for an OK Cancel scenario. I suppose one solution would be to provide two dialogs for this particular item, one for editing it's directly attached fields, those that are in it's table and another set of dialogs editing items that are in other tables, but to access those other dialogs it would have to be done at a higher level, not from the dialog containing the direct fields! So see what a mess it becomes, now you have to go all over the place to change a thing's properties and still adhere to the absolute rule that everything must allow a cancel feature! I liked the way it turned out, it was all in one place, you got to it from one place, easier to use. That OK Cancel design, man, it's old. Yeah, once I realized I had to somehow come up with this row needs to be removed, this item added, this one edited... The user could have worked for hours on the thing adding and removing stuff, taking a break, then the computer crashes or they lose power and all the changes held in the complicated "cancellable" classes would evaporate!

    The Lounge design question

  • Form Cancel Property paired up with Button DialogResult Property is Diabolical!
    B Brian L Hughes

    I decided to "upgrade" my dialog box forms with Accept and Cancel buttons properties! Now my dialog boxes were more user friendly. A week later I began testing on one of these dialog forms which contained a lot of buttons and content, but I ran into a bit of a pickle. One of the many buttons had a click event coded to open a 2nd level modal dialog and when this 2nd dialog box closed the parent dialog it was invoked from closed as well. I couldn't figure out why for the longest time but luckily found the answer on the www. When you set a form's "Cancel" property to a button the genius behind VS sets that button's "DialogResult" property to DialogResult.Cancel. When the button is clicked no matter what happens inside the buttons click handler the parent form will close with a DialogResult.Cancel. If you copy a Cancel button with DialogResult property set to DialogResult.Cancel and paste it on a form the genius behind VS copies the DialogResult property as well, you now have two buttons with DialogResult.Cancel on your form, no warnings of course, it's what you intended to do! I didn't even know buttons had the "DialogResult" property and that it could be used to automatically close a form, obviously it was there all along but I skimmed past it and never tried to experiment with it. Funny thing is the form's Accept property does not change the OK button's DialogResult property to OK when that button is selected. I suppose this feature helps eliminate the need to code Cancel button click events, but I'm so used to doing it anyway I probably won't bother using it in the future. Any idea when this feature was added? Was it there all along?

    .NET (Core and Framework) visual-studio testing beta-testing question learning

  • Do you have a language you're kind of ashamed that you like(d)?
    B Brian L Hughes

    The beauty of a cobol program, designed to replace assembler, all the memory usage statements at the top followed by the procedural code. PERFORM 4000-Do-Something VARYING fd-counter FROM 1 BY 1 UNTIL fd-counter = 10 Don't forget to include your flow chart of the program! Yeah, I kind of liked working cobol.

    The Lounge design perl com graphics

  • Glasses, 2 factor authorization and me
    B Brian L Hughes

    I tried to do it as described in a search and it didn't zoom in our out on my Motorola android phone. I can zoom in and out on pictures though.

    The Lounge security android mobile help question

  • Glasses, 2 factor authorization and me
    B Brian L Hughes

    I guess I'd need glasses that are neutral up close, I can see fine from 1 foot out or so.

    The Lounge security android mobile help question

  • Glasses, 2 factor authorization and me
    B Brian L Hughes

    Now I want the text message app to be changed so that I can set the font for specific incoming phone messages so only those numbers that send codes uses the larger font.

    The Lounge security android mobile help question

  • Glasses, 2 factor authorization and me
    B Brian L Hughes

    Is anyone suffering from the problem of trying to get 2 factor auth codes from the text messages on their smart phone? I have to take off my glasses to use my phone, the screen is so small, then I can't see to type in the numbers on my computer monitor! I usually memorize 3 digits of numbers at a time taking off my glasses and putting them back on. No way am I getting bi-focals just for my dumb phone. But it's really a pain and more web sites are going 2 factor authentication, my bank, GitHub, etc. Having my phone announce the numbers on speaker is probably not a good idea. I could get a tablet and setup a 2nd phone number on it just so I could read the numbers, expensive! I really can't think of cheap elegant way to solve this. I could install a 3rd party app that allows the smart phone to mirror it's screen to a tablet across wifi but that seems risky. I could allow Microsoft Windows to sync to my smart phone but that seems like the worst solution of all, if my PC is in a compromised state all my accounts could be wide open to hackers. The idea is to get the authentication out of the PC loop right? OK folks, I think I found a solution, for android at least. In the text messaging app, click on the menu icon, upper left, 3 horizontal lines, choose "customize", then "Font" and slide the font size all the way to the right, I can read the codes with my glasses on. Unfortunately it makes reading other messages in the app kind of crazy.

    The Lounge security android mobile help question

  • SQL where clause variability up against coding standards
    B Brian L Hughes

    Where I either don't want this column included or the column matches param, then AND them across the where clause and presto! I tested it on mysql and it worked! It's kind of funny that I couldn't come up with a solution for this after years of sql coding. I will admit that sometimes I can't figure out multiple combinations of AND and OR tags in code. Is the sql engine is smart enough not to include any actual column testing at runtime if the "include this column" param is 0?

    Database database question css algorithms help

  • SQL where clause variability up against coding standards
    B Brian L Hughes

    I'm retired but when I was working I had a major problem. I had an app that users could query tables. The app form contained many text boxes which could be filled with values if they wanted to see the result. If the user typed in a box I'd concat a parameterized condition to the final SQL statement where clause including that column. Then we were hit with new coding standards. I could no longer concat SQL and had to use stored procedures. No exceptions. What I decided to do was create a stored procedure for every possible combination of search boxes on the form. The only impact and drawback that I saw to this method was having to code and maintain many stored procedures. This was quite a few years ago. At the time I tried searching the www for some kind of SQL solution, but I couldn't describe what I was looking for into a www search, it was too complicated, too many words. At the time I didn't ask the question on this forum. Basically I was looking for a way in a stored procedure not to include a particular column in a where clause. It couldn't test the actual parameter variable for null because the app form allowed the user to specifically request that they wanted to see results if the column were null in any of the rows as well. I didn't want the stored procedure to be a giant mess of if statements and multiple SQL statements with varying where clauses because that wouldn't very efficient. What I thought I wanted was a new kind of SQL operator that could be used to specify that the column should only be included in the final query plan if a smart parameter property were triggered from the app that it should be acted upon. something like this select * from people where if @fNameActive then fname like @fNameParam and if @dobActive then dob = @dobParam Otherwise name and dob should not be evaluated. I think the proper solution would be to allow exceptions to the mandatory stored procedure rule. I think SQL was designed to allow programmers to build the where clause as needed in this specific case. Allowing for parameterized concatenation would enable even more powerful searches where the user can specify less than or greater than as well. Our rules makers meant well. They were trying to close the loop on web sites that concatenated login credentials. So was there ever a feature added to SQL that allowed us to fiddle with a where clause in a stored procedure in this manner? I can't be the only developer to run up against this wall. But it's so complicated that

    Database database question css algorithms help

  • Computer Graphics Convolutions
    B Brian L Hughes

    I made my own MFC, without CView

    The Lounge graphics c++ game-dev hosting cloud

  • Computer Graphics Convolutions
    B Brian L Hughes

    Books, I used to shop at Barnes and Noble all the time. Atari ST Books[^] I had several of the books shown in the link.

    The Lounge graphics c++ game-dev hosting cloud

  • Computer Graphics Convolutions
    B Brian L Hughes

    I use C# a lot, quite a few non-graphical utilities. I like how easy it is to code classes and methods for complicated stuff without the hassle of dealing with c++'s single pass compiler. For the life me I can't understand why Microsoft won't wire in, expose direct X to C#. I actually started my DirectX experience with the defunct SharpDX and decided to move to c++ since it was no longer supported. It's kind of weird, you think they'd want to expose DX to help move along it's takeover of c++. I like using c++ as well, but the single pass compiler restraint is a pain. I was thinking of trying Unity but I think that would box me in even further.

    The Lounge graphics c++ game-dev hosting cloud

  • Computer Graphics Convolutions
    B Brian L Hughes

    I went through a OpenGL 3D tutorial start to finish. I haven't applied myself to try to adapt my current DX library to it. My library consists of handmade controls and dialog box panels to house them as well as the main surface to display a game. I was going to try make a 2D game out of it all, but it got stalled when I couldn't figure out why characters were glitching. I have text editor box, listview box, drop downs, RGB color picker, buttons, labels, BMP display, check and radio boxes. All of them rendered by hand. I tried my best to enable interface scaling on everything. Got it all working. Even made a match 3 game like Bejeweled where you slide blocks around and they disappear and the other blocks slide down to fill their place. But the printed text sometimes appears garbled on the screen the edges look funny. I could gut the DX, it's all in one c++ class and replace it with OpenGL, it'd take some time but it's doable.

    The Lounge graphics c++ game-dev hosting cloud

  • Computer Graphics Convolutions
    B Brian L Hughes

    Years ago I bought an Atari ST and had fun programming in Assembler making graphics utilities and stuff. The entire graphics interface consisted of single byte address of your buffer in memory that was passed to the OS. Coding was like the freedom of running naked on a tropical island. If you wanted to draw a line across the screen based on one of the 3 modes you'd have to figure out which exact byte and bit of the buffer to turn on and off to make it happen, it was challenging and fun. It was all up to you. Now today I still have fun coding but I have to admit that things are a bit daunting. To draw that same line using an interface such as DirectX 2D RenderTarget you just call the DrawLine function. Ok, that's easy enough but it takes some serious research just to get the RenderTarget ComPtr initialized. Plus we are stuck with the methods of RenderTarget. Gone are the days where every pixel of the screen was at your code's disposal. DirectX is so complicated it's nearly impossible to figure out every nook and cranny. I'll probably never know why some of my printed characters in DirectX end up a bit garbled despite hours and hours of "googling" for the answer. Of course if I want that same freedom of yesteryear I can write directly to a bitmap's buffer and bitblt it to a DC, just not as fast as directX. Yes I realize that every graphics card is different and without the drivers I'd be stuck handling graphics modes for every known graphics card on the market. I don't know, it seems like the finer details DirectX is kind of hidden behind wall of complexity that is hard to breach. If I could figure out how to make a line march across a screen by turning bits on and off in a buffer 35 years ago one would think that I'd be able to code up and down the 3d pipe line and create complex shaders and stuff, but no, it's all just too complicated to even want to figure out anymore. The www seriously lacks examples of all directX features. I guess I'm just a cranky old man now complaining about how things aren't as easy as it used to be. It's like today's machine isn't really a computer anymore, it's more a service with complicated contracts and laws that you have to sign off on to use. Soon I suppose it will just be a monitor connected to the cloud. Yeah, I'll admit alpha channels and transparency are pretty cool. I suppose one day I'll have to post my entire RenderTarget .h and .cpp class files to the board and ask why my characters sometimes appear garbled, but not today. I think for now I'll just rem

    The Lounge graphics c++ game-dev hosting cloud

  • Stereo vinyl records
    B Brian L Hughes

    I had the Heavy Weather album, hat with lightning on the sleeve. Favorite tune, "Birdland". Just looked it up, it's the Indiana Jones Fedora!

    The Lounge question

  • Game building
    B Brian L Hughes

    See Factorio, you can grow your factory until you run out of memory, but it does get progressively slower after a awhile.

    The Lounge game-dev help question

  • So... Is Visual Basic officially dead?
    B Brian L Hughes

    Public Sub btnOK_Click(s as Object, e as EventArgs) handles btnOK.Click End Sub versus btnOK.Click +=new eventhandler(btnOK_Click); // always miles away from the code, if you hand code it and accidentally make VS handle it for you in the GUI you can break your form until you fix it by hand in designer.cs You can even declare this in VB Public m_OK as Button WithEvents ' and the above vb code still works fine. So I think in general VB.Net handles events much more elegant than C#. I've got a huge c# app that has only hand coded "+= new eventhandlers, none were established with the crazy c# GUI. I think it's just too much of a PITA to maintain the code base with the GUI because I have both GUI drag drop controls on forms and many, quite a few, of the embedded form controls where in VB I used to get to say "withevents" with ease. This app was originally written in VB.Net and it was a PITA to convert it! Most of my other c# apps use a combination of hand written events and GUI maintained ones. I coded in VB for the Navy starting in 1995 up until 2017 and only after retiring did I start using C#. I absolutely depend now on C# syntax being close to my old friend c && c++ which I have been using since 1987. VB requires so much typing... Coding in Assembler was like running naked on a tropical island! We can only dream about such unbound less freedom.

    The Lounge csharp asp-net javascript wpf cloud

  • Back to the Beginning
    B Brian L Hughes

    I retired after 35 years of programming using both VS and MSS the last 20 years, proud of my career. But sadly I was forced to use MySQL since the free MSS can't be used on a home network, only standalone on a single PC. I think both TCP/IP and Named Pipes cannot be configured on the free version, leaving only the memory access client available. So far the only thing I've missed is real time backups.

    The Lounge csharp visual-studio design question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups