Showing posts with label bug. Show all posts
Showing posts with label bug. Show all posts

Thursday, 25 January 2018

When Software Tries to be Cute

Developers of the world, unite, and stop listening to sales-folks who say that variety is the spice of life, that you need to make your programs do cute things, like vary the replies it gives.  You are only causing yourself more trouble testing, debugging and annoying your users.

Users of the world, unite, and stop wanting stupid cute differentiation replies from programs to make you feel special.  You are not special, you are one of very many using the same program, be like normal people and expect the action of something to have the general same reaction so you can see when things go wrong.

I bring this up, as I recently had the Ultimate Ears Blast App, and it was too busy being cute with "just a moment", "hang on in there", "be right with you" bullshit replies to actually work!  Yes, it looked to me they were trying too hard to be hip that actually hit the mark!

And YouTube has just done the same thing, check this out....


Same machine, same time, same browser, same YouTube account target... Two different replies... Just to be cute, and one is broken!... GG YouTube, GG Google...

Oh, and has anyone actually ever worked in the YouTube website?... It's a nightmare to navigate, with things hidden and changed, as a content creator, you go to try and get your own home channel, it's a nightmare, you have to view the whole site, select "Library" and then "Home"... You used to be able to press one thing "My Channel/My YouTube", so simple?  Why change it?.... To be evil of course.

Tuesday, 14 February 2017

Programming : Python MySQL Connector Debug

Today, I was asked to look at a server for a friend, their problem... "It just stops working after a few days"... A few days turned into "between three and five".  Doing some mathematics I found they had between 125 and 350 unique visits to the server, each unique visit represents one customer or one remote unit of their fleet.

They relay their data from these to individual database instances on one MySQL Server, so there is about 30 customers each with many unique databases.

The problem?... Well, I find this very distressing, as they open one connection for each arriving remote client, use it and then they closed it... Right... RIGHT?!??!!

import mysql.connector

l_total = 0
while (True):
    # Count
    l_total += 1
    l_res = l_total % 100
    if l_res == 0:
        print (l_total)

    # Open a connection
    con = mysql.connector.connect(user='root', password='***', host='localhost', database='Pickles')
    cursor = con.cursor()

    # Query
    query = ("SELECT * FROM VeggiePatch")
    cursor.execute(query)

    # Retrieve the data
    cursor.fetchall()

    # Close the query cursor
    cursor.close()

    # Close the Connection
    con.close()

This is my test code based on the way their production code works, as having read the error log I see the problem is in the connector constructor and delves down into the networking code.

This of course crashes after around 33,000 cycles.

They're not willing to change their script "willy-nilly", I in fact think they're petrified I've found this problem.  Googling around I don't find any official explanation of this error, only anecdotal forum posts about the MySQL Connector not cleaning up after itself and so reusing the sockets fails over time.



The better solution is to garbage collect the connection each cycle...

import mysql.connector
import gc

l_total = 0
while (True):
    # Count
    l_total += 1
    l_res = l_total % 100
    if l_res == 0:
        print (l_total)

    # Open a connection
    con = mysql.connector.connect(user='root', password='***', host='localhost', database='Pickles')
    cursor = con.cursor()

    # Query
    query = ("SELECT * FROM Tickets")
    cursor.execute(query)

    # Retrieve the data
    cursor.fetchall()

    # Close the query cursor
    cursor.close()

    # Close the Connection
    con.close()
    con = None

    gc.collect()



I also tried to garbage collect each time I printed the the "total", each 100 passes, but this still crashed, the fixed loop here has so far done just under half a million cycles without issue....


Wednesday, 2 December 2015

SDL - Bug or Problem with SDL_RenderFillRect

Got one of those annoying debugging problems going on, I'm not sure whether the problem is with the presentation buffer, or the data I'm drawing.


This code, draws a cross within a rectangle I've defined, and then it draws a hollow rectangle around them... Annoyingly, the calculation I've used for adding the width & height to the location makes sense, but it appears the rectangle is one pixel less in width... So the SDL call calculates or 
uses the rectangle to draw.


But, that's not the problem, below the code drawing this, I've asked it to actually fill in the whole rectangle...


However, the result does not fill in the rectangle...


I've tried this in both Visual Studio and Code::Blocks, neither seem to want to fill in.  I'm using the same colour, blend and settings, as you can see in the final code listing, just the call to the render fill rect function does not render a filled in rectangle.

Any ideas?

Wednesday, 4 June 2014

WarThunder - Battle Start Bug

I just ran into a bug in WarThunder, I had played my German Tanks, assigning a couple of aircraft too and flying out into a mission.

That ended and I returned to the menu, leaving my German selection as was, and selected my British Tree.

I selected my Beaufighter and selected to go to battle, but I had left the toggle set to "Tank Battles", so it told me I "That Nation is temporarily Unavailable".  This isn't the bug, the bug is that I just switched to Air battles and clicked to start battle...

The realistic battle starts for me, but instead of being British, I've been thrown in as German...

And for an Air Battle, I only have tanks available in the realistic slot I had selected... So, I can't spawn...


All I could do was quit the game, and it seems from my telling other players that this has happened to others.

I hope my posting comes to the attention of Gaijin & they fix this one.