I am experimenting with the Discord API and trying to create some fun bots. As long as it is meant to be present on more than one server, you need to include DB in your script to handle combinations of servers, rooms and users to post and respond to correct channels and correct servers.
Because i do not expect the bot to grow so much, i have chosen the SQLite which would be more than enough for these purposes.
However, in some phase i started to face weir behavior of my bot. I was handling some commands, storing some info about the user evoked that command and iteracting with a database a little bit.
The script worked for me, and worked for some more testers. However some testers were facing really unexpected behavior, getting random data, not saving their progress and so.
I was really confused, as the functions were working for most users, but not all of them.
The informations about users were stored in SQLite based to their discord ID. Which is maximally 18 digits in all cases we tried. The SQLite, according its documentation, supports integer values up to 8bytes (signed/unsigned) so it should be enough. But...
After many attempts to debug the ...
Continue reading →
I went through the whole box of mobile phones and unfortunately only found one that worked.
There are also many interesting phones, such as the Galaxy S4 Zoom, or a Kodak Photo-mobile, but unfortunately they do not work...
But the Nokia X ..... is really interesting:
It looks like a kids try to remake GUI of Windows mobile/Phone just with MS-paint and basic knowledge of CSS and HTML.
The basic idea of the Nokia X operating system was, probably, to make cheap replacement of Windows, based on Android Open Source Project. And.. it really looks cheap.
I will try to install some Android apps, the standard Android .apks for Android 4.2 and lower should work, so I will see. But the system is one of the weirdest pieces of OS I have ever seen, so it is great to have some bizarre pieces in my collection, but I cannot imagine using it seriously for a second.
Continue reading →
Just arrived. The box full of mobile phones. Most of them are... not complete, but there seem to be some that would work.
Unfortunately, most of them have no batteries, and those that do seem to be completely dead. I keep hoping that I can at least pick out a few that will work.
I also see a huge amount of parts for iPhones.
I will go through all the phones and do my best to fix at least some of them.
Continue reading →
Yup... it is awesome. My friend fixed it after I broke it. First time he got Windows to work with all the drivers. He found out that he needed drivers from some other notebook, which made the missing devices that were not working visible. And then made some adjustments and had Windows working.
Then I persuaded him to install Linux for me. And again, he did it!
Installing Ubuntu was relatively straightforward for me, but then it refused to boot. It was harder for him for some reason, as he got stuck in the middle of the installation. I discovered that it was running out of RAM and decided to do the installation on another PC and then copy it to the internal eMMC and run the setup from there. And it worked. It went through the installation process and got to the same point as me.
Then the magic began. The trick is that the machine has a 64bit processor but only a 32bit BIOS. So the trick is to chroot into the installed OS from Live OS and do some magic with implanting 32bit GRUB to 64bit Ubuntu. I do not really understand the details and ...
Continue reading →
I had a bit of time, so I installed a few more games on my Sony Ericson W800i. I tried to remember some of the games I played on my k310i almost twenty years ago (yes, I was poor and this was the best I could get). I remembered a lot of games, but also some that I really liked.
First of all, I liked the Cars movie game. Unfortunately, I did not find it in a resolution suitable for my w800i (for younger readers - yes, you really did need to download the game with the exact resolution for your screen to run it properly). Another game I really liked (I was a kid) was Sven... the purpose of this top-down game is to control black sheep with the task of mating with all the white sheep around, and avoiding the farmer. This game is not presentable on serious web...
So... the first one I can show you is .... Gravity Defied:
It was a game that everyone had on their phone. The absolute must-have for all of us. We competed with each other to beat the time of each level and were proud of beating the ...
Continue reading →
As I really like programming in Javascript, sometimes it makes me really angry. And one of the things is that the typing can (or cannot in some areas) make a real mess.
I do not really care about the ability to use numbers wrapped as string, as it is really easy to make numbers from string just by multiplying it by one, but the typing also has some big disadvantages.
The biggest problem, for me, are arrays.
Which can be arrays, but without any casting they can be also strings, which is sometimes really mess. And the biggest problem, is some kind of auto-casting on background, which is really mysterious, if you are not able to go really deep and discover the reason, whi that happens.
This is one of the really weird examples:
[] * [] // -> returns 0
This is weird..
[8] * [8] // returns 64
This is even more weird..
[8,1] * [8,1] // return NaN
And this is then the peak of weirdness
And the reason?
Yup.. it really has a reason
And the reason?
Yes... there is a reason.
Before multiplication, the variables (arrays) are passed internally through ...
Continue reading →
I have been tinkering with a new media centre box for my living room for ages. Now I finally have the hardware to do it. It is a micro case DELL computer, I hoped it would fit under my TV but it is 2mm higher than the space under the TV.
I am now temporarily using a RaspberryPi 4 running RecallBOX. I have it for retro gaming and emulation, but it has an old version of KODI, so I use it for multimedia purposes. However, it has many disadvantages, such as problematic cooling and, above all, the lack of a power button. So to turn it on I have to flip the switch on the power socket, and to turn it off I have to wait for it to shut down, go to the TV and flip the switch on the power socket behind the TV again.
So the plan is to install a Linux distribution (still to be chosen), make KODI autorun and set up a samba server to copy downloaded films to drives.
As a sideline to this piece of hardware, would some custom services, maybe some bots for my projects? I will see...
Continue reading →
New toy arrived!
My friend sent me his PDA, which he used to use for geocaching. It runs Windows Mobile and is in perfect condition. He took care of the battery, so even though he hasn't used it in years, he still charges it from time to time to keep it alive. All the plastics are perfect and it looks brand new. Such a beautiful piece of electronics.
So I did some research, downloaded a few things and prepared a set of games I wanted to try running.
Firstly, I checked that the machine was still able to connect to WiFi, as it knows relatively new protocols, so its ok. However, it is unable to open almost any web page as it does not trust the certificates. However, this should be solved by downloading Opera Mini and using its VPN service... I will see later.
So I downloaded some archives of .cab installer files for games, Opera Mini and Total Commander and prepared an SD card. Fortunately, the device is able to read SDHC cards, so I can use the 4GB one I have. As I went through the installation of the games, deciding just by their names, I stopped ...
Continue reading →
I finally won something, even though it was not a competition. I was the first to respond to a free Lenovo 80NR offer on an IT forum. I replied within 10 minutes of the offer being posted. Second post was one minute after me. So... I got it
At first I wanted it for collection purposes, but when it arrived and I tried it, everything changed. It only has 2GB of RAM and an Atom processor, but it is a great piece of hardware.
It is a tablet and a netbook in one. The screen can be detached from the keyboard, so it can work as a tablet, or you can attach the keyboard and use it as a terminal, for programming or writing.
And it is addictive. I never liked the Android tablets because they are completely useless. The phone screens are big enough to have another touch device, and it is useless for any kind of productive work. But this is an absolute game changer. I can surf the web, gather ideas and resources in tablet mode only, and then switch to productive mode by attaching a keyboard. I really love ...
Continue reading →
I got a micro arcade machine for Christmas. It is based on a NES emulation and it looks cool. It contains around 240 NES games.
Looking more closely at the list of games, I thought it contained mostly unknown NES games, just with different names. The only game I have successfully recognised is Lunar Pool, but only called "Super Pool".
However, it contains simple games from various genres. Some car and boat races, bomber games, platformers etc.
The controls are not very intuitive and ergonomic. The priority is the design and not the ergonomics. However, it looks really cool and you can play it for tens of minutes before your hand starts to hurt, which is enough.
Some of the games are really crap, some are good, so maybe I would take some time to go through them all and try to find some that are worth playing in depth.
Continue reading →