nikolapavlica
nikolapavlica
Nikola Pavlica
19 posts
My personal IB CAS blog (May 2021)
Don't wanna be here? Send us removal request.
nikolapavlica · 4 years ago
Text
CAS Project
youtube
Title of project: Audiobook generator in Serbian
Focus of project: Using digital versions of books written in Serbian, attempt to provide the person with an audiobook version of it using TTS technology.
Risk assessment required: No
Super early background/Motivation
During my first year of IBDP I came to realize that in our Language A classes we read a lot of literature in order to provide enough “material” for the final exams. However, I have an issue with concentration when it comes any “physical” reading material. As a result, I much rather would prefer having audio any feedback when reading literature (or any text for that matter) as opposed to just reading it. Which is why I spent a few hours back in January 2020 researching about possible ways I could “assist” myself when reading for long periods of time. I found a command-line program called “eSpeak” that would convert any text given (specified by language) and it would produce a robotic sounding output.
This unfortunately wasn’t good enough for large texts like books and literature, so I had to find something more “useful”. Upon my own research, I’ve stumbled upon “mBrola” which is kind of a seperate TTS (text to speech) program, similar to eSpeak in use and which (thankfully) can be turned into a plugin for eSpeak.
Using this I was able to create AudioBook’s in the following (and tedious) manual fashion:     1. Download PDF version of that book (because “ahoy, matey!”)
    2. One of the two following things could occur: Either the PDF file is normal and has text contained within it or it’s an ancient library scan.
3.1. In case of the library scan, you split up the PDF file into images and by using a Python library called Tesseract, you could OCR the text out of the images
3.2. In case the PDF is just fine, you could then use one of the countless PDF to TXT converters and use the almighty Vim to clean the output.
    4. Then you combine the text into a large file that contains the entire book (if needed)
    5. Run eSpeak with the correct parameters
    6. Convert the resulting wav file into mp3 or opus (cause the resulting wav file is going to be gigantic)
Then I was successful in making a few AudioBooks for me and my colleagues (though I doubt they used them as much as I did as those books still sounded pretty robotic and incomprehensible at times)
The idea
I went through like a bajilion ideas for my CAS project around September and was brainstorming about possible things to do. Since my dumb brain wasn’t able to decide on it’s own, I asked for feedback of my CAS teacher, and she obliged.
The execution
She decided that this idea was the best of all the 6 I suggested her (I believe, I cannot recount things that occurred 10 months prior, sorry). And since then I’ve made plans for an applications that was successful. And one of my state curriculum teachers was closely monitoring what I was doing and suggested me that I enter a competition and I was like: “sure”. Ever since that happened, I’ve decided the best way to present my CAS project is through the competition.
The competition was the same one from the last year, INOST, where various competitiors from other high schools and colleges try to compete with ideas and the winners get to compete further in international/business affairs, which I found really cool.
Returning to our story, I worked on the app and methods of creating audio from books and was successful in making an app. This process, unfortunately, was a bit of trouble as I had to switch entire tech stacks as I realized the limitations late into development (from QT -> NODE.js -> GTK (the final)). Anyway, after that and a bit of messy code, I was able to get the thing running well enough for a demo, and, surprisingly, got awarded an award of “Best student work”.
The aftermath
As I was preparing for the finals of my IBDP education, I couldn’t find enough time to work on this idea further. However my state curriculum teacher is now trying to progress further with the idea on her own with a team from younger generations. I provided them with support whenever I could, but they work mostly independently.
Reflections
I feel this is the first “marketable” idea I had ever since I worked on many software projects on my own and has been extremely fun to work on. I sincerely hope something useful gets created at the end of this and I already have further plans for what might be done with this in the future. Ciao.
1 note · View note
nikolapavlica · 5 years ago
Text
Banija u srcu
Name of activity: Banija
Date(s) of activity: 31. 12. 2020. and 1. 1. 2021.
Approximate # of hours: 4 hours
This activity is: Creativity, Service
Learning outcomes:
Strength & growth
Challenges & skills
Working collaboratively with others
Global engagement
Recognize and consider the ethics of choices and actions
A series of earthquakes had hit Banja Luka, among other places at the end of the year. One of those places, which had been hit hard is Banija. Which is why “Krajiški Kulturni Centar” among other organizations had stepped in to offer help for those suffering. Since my father is one of the main figures working in the KKC he has been tasked with organizing and leading the entire event: promoting it on social media, having to talk to a lot of people, managing things and so on.
Since my father had been busy, he tasked me with making a video. He gave me instructions among other things to make the video, which I did.
Tumblr media
Reflection:
For me, I found that KDEnlive is much more of a flexible video editing suite than I though it was. It served me well for this task, and I enjoyed the editing process, unlike what I experienced before.
1 note · View note
nikolapavlica · 5 years ago
Text
Developing and maintaining an audio visualizer
Name of activity: XAVA
Date(s) of activity: Since the beginning of the semester and onwards
Approximate # of hours: 1 hour per week (on average)
This activity is: Creativity, Service
Learning outcomes: Strength & growth Challenge & skills Initiative & planning Working collaboratively with others Showing perseverance and commitment Recognize and consider the ethics of choices and actions
Tumblr media
Ever since 2016, I believe, I forked the https://github.com/karlstav/cava project, making my own version. That version added graphics which weren’t inside of a terminal, but rather a graphical window by itself. I wanted to include these changes into cava and be done with it. However, as luck would have it, the dude rejected on the premise of not fitting the original projects scope, which I agreed because it made sense.
So during this time I’ve developed my own fork adding more and more features that suited my more (graphical) needs. This is why Windows and macOS support had been added, since I no longer want (just) an Linux-only program. There were too many out there to begin with. Since I was a huge fan of the Monstercat visualizer I also added features that resembled it’s looks. So on and so forth, the project later got renamed twice, once to gava (which was a dumb name) and finally to the XAVA, which is it’s current name.
Not going to go into detail as to what happened during my time in IB, the gigantic changelog speaks for itself really. So if you really want to know what I did in the meantime you should check out the repository itself: https://github.com/nikp123/xava
Here’s a bunch of videos showing it in action:
youtube
youtube
Also I you find it interesting, why not try to use it yourself. It’s free :) Download: https://github.com/nikp123/xava/releases
Reflections:
I took on this project ever since I first attended High School, I believe. I used it as a testing ground for my own ideas and approaches, while in turn offering me a practical ground on which I could test those ideas on. This is why I’ve been so motivated to work on this even though it’s just a simple visualizer.
Instead of imagining what it would be to use this or that, I applied that practically through this project. Removed what doesn’t work and kept what does. You know, the usual programmer mentality.
0 notes
nikolapavlica · 5 years ago
Text
Porting an entire Android operating system
Name of activity: Android kernel and system development on the Redmi 7A
Date(s) of activity: June of 2020. all the way towards 23. 7. 2020.
Approximate # of hours: 100 hours (if not more)
This activity is: Creativity, Service
Learning outcomes: Strength & growth Challenge & skills Initiative & planning Working collaboratively with others Showing perseverance and commitment Global engagement Recognize and consider the ethics of choices and actions
Anyway the porting process came as I way playing around with the android kernel of the device, which I got from the official Xiaomi sources: https://github.com/MiCode/Xiaomi_Kernel_OpenSource
But immediately after that the struggles came. 
Firstly, you cannot JUST compile it using any old compiler, OH NO. You have to use exactly the compiler the orignal devs originally used, not your FOSS linaro toolchain (get rid of that ugliness, ugh), but rather a custom propriatery version of the clang toolchain used by Qualcomm internally. Oh yes, you also need to get a Qualcomm account approved before you start, great...
Enough of the compiler blaming, compile that thing already.
Fine, but wait there’s more. You cannot simply use the defconfig provided by the original developer. That’d be silly, instead what you need to know is the special quirk where you need to include DTBO (device tree files that basically describe the device in full detail so the OS actually works, in short) files into the kernel, otherwise you’re toast and will get nowhere.  - I’ve already bricked my phone here once, if it wasn’t stressful enough. And here I’ll go out and say f*** EDL mode and it’s hard to reach pins. This was required for me to unbrick it and put it into a functioning state.
What caused this brick? Basically avoid flashing the DTBO file (AT ALL COSTS), regardless of what people say. The bootloader will wuss out and won’t work anymore if you do, causing a brick.
After that’s been done you’d hopefully get a kernel that boots. Just without the Wi-Fi drivers, FUN. That requires you to properly include the Wi-Fi driver with the according version, you can’t just add any matching driver, you have to match the version as well. Funsies.
Alright already, enough. We’re not done yet :) You also need to make sure those drivers are signed or the android phone’s gonna think it’s been hacked and won’t launch them. This is thankfully easily overridden by changing a simple policy in the Linux kernel. Thank you, Linus.
Ok, finally we get a booting kernel with working Wi-Fi. But this is just for the same one your device manufacturer shipped. You need to actually port this now.
Before anything, you need to know that your CPU actually supports a 64-bit instruction set. Once you figured that out, you need to find (ideally) the most similar device to your own, which happened to be the phone that succeeded this one in it’s own series - the Redmi 8A.
Since the two devices were in the same kernel tree, I could just “git diff” the two kernels, revealing any changes. I’ve saved those changes to a single file that I could read later. vimdiff becomes your friend here. btw the diff file was 10 gosh darn megabytes
I started off of the 8A kernel, instead of the 7A, since it had a few missing entries regarding drivers and whatnot and I couldn’t been bothered to fix them myself.
The first thing you’d want to look at if you want to get a device to boot is the defconfig. It’s located within the arch folder of the linux kernel. There you’d find a file in the cpu_architecture/defconfigs folder that contains the name of your device. When you open that file, you see all the features and drivers that had been enabled in the kernel. You can compare it with the original in order to figure out what you need and what you don’t need. For example, you’d want to keep all of the ARM64 related stuff, but you’d want to disable USB-C since my device doesn’t have it and so on. After the mixing and matching you’d ideally get a kernel that perfectly works with your phone. But not so fast.. There are still issues to contend with.
For starters, bluetooth, screen rotation, audio, brightness control and even the touchscreen stopped to work. Here’s how I fixed each of those things:
Touchscreen
In the absolutely massive diff file I spotted a few binary files being changed. You guessed it, it’s the driver for the touchscreen controller, silly. Swapping it back where it belonged fixed the touchscreen, yupee.
Bluetooth
This involved changing out files within the /vendor partition, but overall was also simple to fix. There are policy files within /vendor/etc, you’d want to check them out and find any discrepancies and fix them.
Bluetooth audio was fixed by the community by doing the same thing, although better than me, I guess.
Audio
In the massive 10 megabyte diff the entire audio kernel driver was stripped. Reason? I don’t know, but just including it again seemed to fix the problem. I also struggled with this a lot since the driver took for ducking ever to build. Like imagine having to wait an hour each time you wanted to test something out, that’s how bad it was.
Brightness control and screen rotation
In the same vain as the bluetooth there are policy files for the brightness control and sensor information. Change this accordingly if you want them to work.
There are other things that should be listed here, such as FM Radio, audio jack problems and LTE calls. However I wasn’t able to fix everything on my own, which is why I left it to the community to finish what I couldn’t.
And the result speaks for itself:
https://nik.ex-booking.com/posts/2020/porting-kernels-between-architectures/ https://forum.xda-developers.com/t/64-bit-for-redmi-7a.4145225/ https://forum.xda-developers.com/t/redmi-7a-arm64-kernel.4134381/ https://github.com/nikp123/Xiaomi_Kernel_OpenSource/tree/pine64-p-oss
Thanks to all the awesome people that helped me along the way. I couldn’t have done this all by myself.
Reflection: Ever since I’ve got my Redmi 7A, I’ve gotten to admire the hardware I was using. The battery, screen, CPU, GPU, RAM... all great. However the software frustrated me and a lot of the people on the internet. By writing a 64-bit operating system I could relieve some of the annoyances, which, thankfully, DID happen.
The process wasn’t easy (like. at. ALL), but I got cheered (virtually) along the way, which was nice. Finally my efforts are paying off it seems. I’ve also gotten to meet a few people: some rude, some nice, some striving to do what I did and at the end I believe it was a fun journey.
Also congrats for having the nerve to read this whole mess from beginning towards the end. Hopefully this becomes less of a struggle in the future.
0 notes
nikolapavlica · 5 years ago
Text
Other contributions I’ve made in the meantime
Name of activity: Other FOSS contributions
Date(s) of activity: 2019: December 9th 2020: February 1st; March 11th and 14th; May 8th; August 6th and 8th; 9th of December
Approximate # of hours: 6 hours (approximately)
This activity is: Creativity, Service
Learning outcomes: Strength & growth Challenge & skills Initiative & planning Working collaboratively with others Showing perseverance and commitment
This is the 3rd and last list of small contributions I did over the years. Resources will be linked below with little explanations attached to each of them explaining what those contributions are and how are they used.
List of said contributions:
Chat-Destroyer (https://gist.github.com/nikp123/20ff3cc9e2c9b9c1014b5bb5c8734c48) - 30 minutes - Basically a small script that does what it’s named after - destroys chat boxes. It sends series of messages specified in size and it tries to send them as quickly as it can, you can also add an delay in case it doesn’t work out as intended.
Sway process assassin (https://gist.github.com/nikp123/605a0711251013a0949a0511ea8a0ef5) - 30 minutes - A small script that is stupidly simple. When launched it looks for a window matching the query you specified it and it waits for it. Once it appears it closes (kills) said program.
monitor_config (https://gist.github.com/nikp123/de97260620146b8f41d0134ee1f90127) - 30 minutes - A small script that sets up monitors and displays
Wattage reader (https://gist.github.com/nikp123/258ecf7182640a06794a69b49c9d96d6) - 30 minutes - Reads and displays much watts your Linux system consumes. That’s it.
Hearts of Darkness (engine) port for PSP - https://github.com/nikp123/heart-of-darkness-psp-port - 2 hours - My failed attempt at trying to run HOD on the PSP. Some Twitter dude was already beat me to it, so I gave up.
Serbian translation for the Phosh shell - https://source.puri.sm/Librem5/phosh/-/merge_requests/581 - 1 hour - Phosh is one of the mobile interfaces for current Linux phones, this is just a Serbian translation of said interface
Excalibar MPD improvement - https://github.com/nullgemm/excalibar/pull/3 - 1 hour - This is just a small change I wanted to add to excalibar since many MPD implementations do not feature this out of the box.
Reflection:
The chat destroyer one was fun, although I highly warn you: You are responsible for whatever you do.
Sway process assassin and monitor_config are just utilities I’ve developed for use with swayWM because it’s lack of features (by default)
Wattage reader was made because my brother wanted a utility for reading how much power a certain device consumes.
HoD(e) PSP port was initially motivated by the fact that porting games to the Sony PSP was easy and fun due to the availability of system libraries used commonly to develop games on the PC platform. However I’ve roadblocked myself due to the lack of available system memory (only 32MB) which forced me to give up on that project. Besides, as mentioned before, some dude on the internet already did what I wanted to do, so what’s the point of making the same software twice.
As Linux phones are becoming more and more popular, I wanted to translate the UI just because. I found it fun and as a method to kill boredom.
MPD clients often try to display the Author or the Album of a track even if there isn’t one. Such as music which is direct rips of the internet or such. Either way I wanted the UI to look nicer when such information is not specified.
1 note · View note
nikolapavlica · 5 years ago
Text
Bug-catching adventures (not literally) (so far)
Name of activity: FOSS bug hunting and reporting
Date(s) of activity: 2020: April: 10 and 14th July: 10th September: 7th, 17th and 19th October: 14th
Approximate # of hours: 7 hours and 15 minutes (approximately)
This activity is: Service
Learning outcomes: Strength & growth Initiative & planning Working collaboratively with others Showing perseverance and commitment Global engagement
Those reports divided per project:
Quibble (https://github.com/maharmstone/quibble) - A BTRFS bootloader for Windows. Basically boots your Windows off of a BTRFS partition.
When compiling for AMD64 there was a bug where the CPU might not be properly detected: https://github.com/maharmstone/quibble/issues/30 - 30 minutes -
Bug where the countdown was broken due to EFI timers being broken themselves on HP laptops - https://github.com/maharmstone/quibble/issues/28 - 30 minutes
Confirming a boot issue that happened to someone else - https://github.com/maharmstone/quibble/issues/25 - 15 minutes
WinBTRFS (https://github.com/maharmstone/btrfs/) - A BTRFS driver for Windows
Sharing my experience with a broken drive, thinking it might’ve helped the developer, when in actuality it did not - https://github.com/maharmstone/btrfs/issues/267 - 1h - Due to the troubleshooting steps I took in the process
foot (https://codeberg.org/dnkl/foot/) - A lightweight terminal for systems that run Wayland compositors as their desktops
https://codeberg.org/dnkl/foot/issues/3, https://codeberg.org/dnkl/foot/issues/8 and https://codeberg.org/dnkl/foot/issues/9 - Where the two of us discuss how to fix scaling issues that occurred during my use of the terminal - 2 hours - Due to me constantly having to provide input for the dev to help him resolve my problem
GVT-g kernel (https://github.com/intel/gvt-linux/) - The Linux kernel tree for people that use the GVT-g virtualization technology by Intel.
https://github.com/intel/gvt-linux/issues/170 - Where I along with a few other people discuss the potential cause of the bug - 1 hour
mate-panel and mate-settings-daemon (https://github.com/mate-desktop/mate-panel and https://github.com/mate-desktop/mate-settings-daemon/) - Basically the individual components of the Linux desktop called MATE
https://github.com/mate-desktop/mate-panel/issues/1136 - Where I report a bug about the wallpaper not updating and subsequently offering a workaround found here: https://github.com/mate-desktop/mate-settings-daemon/issues/335 - 2 hours in total
Reflection:
These are the annoying deeds that someone needs to do in order to get their software working. Nobody likes bug, but there has to be someone reporting them and others fixing them. Much of the time shown was spent on finding the root cause of the above mentioned issues, helping the developer notice the problem, if there is any.
1 note · View note
nikolapavlica · 5 years ago
Text
What code I’ve contributed towards other projects since beginning of my IBDP
Name of activity: FOSS project code contributions (so far)
Date(s) of activity:
2019: December: 30, 31
2020: January: 6, 8 March: 21, 29, 30 April: 8, 30 June: 19 August: 17 September: 3, 20 October: 4 December: 10, 13, 14, 20
2021: January: 11
Approximate # of hours: 11 hours and 45 minutes
This activity is: Creativity, Service
Learning outcomes: Strength & growth Challenge & skills Initiative & planning Work collaboratively with others Showing perseverance and commitment Global engagement Recognize and consider the ethics of choices and actions
This list includes only code that I’ve directly contributed to other projects, be it because I wanted it to be there or because I’ve been frustrated with something like a bug or lack of a feature.
The list of said contributions, divided per project:
Kanshi (https://github.com/emersion/kanshi) - A utility used that sets up displays as described per config file (used mainly in SwayWM and alike sessions)
Since video games often tend to break due to kanshi, I wanted to add a feature where one could load different config files by specifying it in the command line. However the dev found a better way to fix said issue (using include directives), which is why he rejected my request (https://github.com/emersion/kanshi/pull/74) - About 30 minutes was spent on this one
Kitty (https://github.com/kovidgoyal/kitty) - A GPU accelerated terminal emulator for Windows/macOS and Linux
Some guy I knew was having trouble running this terminal on his machine, and since I immediately recognized the problem, I offered a solution which I used in my own project (XAVA) - 15 minutes - https://github.com/kovidgoyal/kitty/issues/3154
Xst (https://github.com/gnotclub/xst) - An unimaginably lightweight terminal for systems with Xorg/X11
https://github.com/gnotclub/xst/issues/114 - Basically when resizing a font within the terminal it reset to default, which basically broke my use-case. It took an hour to detect from where the issue stemmed.
https://github.com/gnotclub/xst/pull/116 - When setting a custom “scroll rate” it broke some code down the line, causing over-scrolling issues - this also took an hour to find and fix
QEMU (https://www.qemu.org/) - A piece of software that either emulates or visualizes a virtual system (or computer, in layman’s terms)
A whole series of back and fourth communications trying to achieve the goal of having custom refresh rates on systems with GPU acceleration (Can be found here: https://www.mail-archive.com/search?q=Nikola+Pavlica&l=qemu-devel%40nongnu.org). This was especially difficult since the project had a release schedule you had to meet and building QEMU took for ‘effin ever. Not gonna lie, this was too much code to process since the project is so huge. Approximately 8 or more hours spent on this alone. Not to mention having to wait a year and still not having the darn issue fixed. For an detailed explanation I recommend looking at this: https://www.mail-archive.com/[email protected]/msg670335.html
AUR (ArchLinux User Repository) - https://aur.archlinux.org/packages/?SeB=m&K=nik123true - On ArchLinux (and alike) programs are installed using packages, which are files that you install on your Linux PC in order to get a certain program running. Just like regular installers on Windows although a bit more abstract. On my AUR account, linked above, I maintain a series of packages making it easy for other people to download said packages/programs and to save them the hassle of installing those programs manually (be it through compiling or otherwise)
discordlogin-git (https://aur.archlinux.org/packages/discordlogin-git/) - Basically a program that emulates a normal discord web login so that 3rd party clients can obtain a login session key (a unique password required for discord to work)
Creating it took me an hour
15 minutes to add and test the missing webkit2-git dependency
gtkcord3 (https://aur.archlinux.org/packages/gtkcord3/) - Basically a discord client written in Go using the GTK UI libraries
Creating it took me an hour
The whole libhandy0 debacle costed me an additional 30 minutes
Resolving the ``-git`` conflict with the other packages - an additional 15 minutes
gimp-plugin-deskew-git (https://aur.archlinux.org/packages/gimp-plugin-deskew-git/) - A plugin for the popular image manipulation program GIMP. What this plugin did was when you had multiple images in a single image, such as a digital photo scan using your own scanner, it separated them and saved the accordingly. This is extremely useful when you have thousands upon thousands of family photos back up from their physical to an digital format.
Since somebody already took the hassle of creating this package, my job was to fix it and renew it for newer Arch-based systems. That job took me about an hour.
Reflection:
Written above per project.
2 notes · View notes
nikolapavlica · 5 years ago
Text
Teaching C++
Name of activity: Mentoring C++
Date(s) of activity: 8th of December 2020.
Approximate # of hours: 4 hours
This activity is: Service
Learning outcomes:
Showing perseverance and commitment Working collaboratively with others
This time I took an opportunity to teach my own methods and skills to others. I find this kind of fun since the methods I employ save me so much time when working on my own.
Reflection:
I learned that teaching others the way that you yourself approach problems is much more effective than to having them explained each and every time. I hope I helped her, not only with her homework and study, but in the general approach to programming overall.
2 notes · View notes
nikolapavlica · 5 years ago
Text
A poor man’s big.LITTLE server architecture
Name of activity : Wake-on-ARP
Date(s) of activity : 5th, 6th and 16th of August 2020.
Approximate # of hours : 8 hours + time spent bug fixing (probs additional 3-5 hours)
This activity is : Service, Creativity
Learning outcomes :
Identify your own strengths and develop areas for personal growth.
Demonstrate that challenges have been undertaken, developing new skills in the process.
Demonstrate how to initiate and plan a CAS experience.
Show commitment to and perseverance in CAS experiences.
This is one of the programming projects that was motivated by pure frustration and hate for server technology (or lack thereof, I should say).
Anyway to cut a long story short. You have a big disk array that is a power hungry bastard sucking juice from the wall faster than a thirsty kid with a milkshake. Your homeowner complains about the power bill, what DO you do?
Well, just turn on the server when needed, easy? Right?
Stop being so naive and learn a thing or two about technology, alright?
The setup that I’ve enabled allows a network client (your computer or an low-power manager server in this case) to wake up the BIG AND HEAVY server when needed, this is done using what are called WOL packets.
Anyway, this program essentially sends WOL (Wake-on-LAN) packets each time an ARP request is made to an specific IP address. Wew, much technology. Can you explain what the thing does?
I did, it just requires a person who knows his/her craft to understand this.
If nobody understands this, then why bother?
GitHub stars say otherwise
Anyway tl;dr: Thing allows small servers to wake up big servers when needed in order to save power. The end.
Project link: https://github.com/nikp123/wake-on-arp
Reddit thread where I showcased this: https://www.reddit.com/r/selfhosted/comments/i49xnd/oc_tool_for_automatically_waking_a_device_on_lan/
Stackoverflow link where I knew it wasn’t ONLY me who was experiencing the same problem: https://stackoverflow.com/questions/10911825/automatically-wake-nas-on-access
1 note · View note
nikolapavlica · 5 years ago
Text
An another space shooter game
Name of activity : Spaceboopers
Date(s) of activity : 17th, 19th and 20th of August 2019, 17th and 18th of September 2019 and 15th of January 2020.
Approximate # of hours : 10 hours initially, indeterminate amount of hours later
This activity is : Creativity
Learning outcomes :
Identify your own strengths and develop areas for personal growth.
Demonstrate that challenges have been undertaken, developing new skills in the process.
Demonstrate how to initiate and plan a CAS experience.
Show commitment to and perseverance in CAS experiences.
This is one of the first adventures I had during my time in CAS. I was just too lazy to properly publish this in time, my apologies.
At the time, I was interested in practicing and learning C++. And what better way to practice C++ and it’s many capabilities then by programming an entire video game as an exercise. I already had experience in SDL2 through MANY of my old projects and this one is just an another one that would fit into my portfolio.
The game was initially inspired by Spacewar! - one of the first (if not, the first) video games ever made. You have a spaceship and you’re controlling it. But instead of dodging meteorites like in Spacewar! you’re dodging the other players bullets while trying to hit the other player yourself.
During the development I was practicing OOP and game AI development. I’d say the experience was quite actually fun, although something like unique_ptr was a bit weird to use.
The initial version can be found here (in source code form): https://gist.github.com/nikp123/24e6e22ec66618fdfb85762b89796dea
This initial version did not feature any kind of AI, just pure multiplayer gameplay. Whilst the physics model as well as the core gameplay was finalized at this point.
Tumblr media
After this point, I’ve tweaked the bullet speed and as well introduced AI to the game, which is easier said than done, I might add.
The AI is basically just a mathematical prediction bot watching your moves. But this model seemed to perfect and kind of irritating to play with, so I’ve added randomly generated behavior to make the bot more “human-like”
Among those changes I’ve also added a “bullethell” mode suggested by an another friend. Inspired by the Japanese 2D shooter game practice of having as many bullets on the screen as humanly possible and trying to avoid them. In this mode players automatically shoot a full ray bullets, like in a burst mode, which can bounce around to make more interesting gameplay.
Another fun side-project is porting this game to the Sony PlayStation Portable. Since the toolchain was neatly packed as well as my libraries, this wasn’t too hard of an job. I had to lower the AI math a bit for the PSP, since the CPU wasn’t that powerful.
Code repository can be found here: https://github.com/nikp123/spaceboopers/
Game download: https://github.com/nikp123/spaceboopers/releases/
youtube
youtube
1 note · View note
nikolapavlica · 5 years ago
Text
Microscopic Minesweeper
Name of activity : Microsweeper
Date(s) of activity : 28th of August 2020. with updates on the 29th and 16th of September
Approximate # of hours : 3-4 hours of programming (initially) and 2-3 hours spent on updates (bugfixes and improvements)
This activity is : Creativity
Learning outcomes :
Identify your own strengths and develop areas for personal growth.
Demonstrate that challenges have been undertaken, developing new skills in the process.
Demonstrate how to initiate and plan a CAS experience.
Show commitment to and perseverance in CAS experiences.
Demonstrate the skills and recognize the benefits of working collaboratively.
Watching a video about fitting the entirety of an video game into a QR code made by MattKC, I knew that the challenge that the YouTuber imposed on himself could be done in a much better fashion.
tl;dw: The guy basically tried to fit the game of snake within the boundaries of an QR code, that is around 3.something kilobytes.
In my opinion this challenge is extremely fun as it is really creatively and mentally demanding, like a game of chess, but on steroids. What I’m disappointed about, is the result that the YouTuber got out of the challenge. While I admire his efforts and the method he approached the challenge, I knew this could be done better, so during a night of chatting with a friend - the same one who helped me with the Galaksija emulator, I’ve decided to do this.
Few days beforehand however, I was researching methods to shrink compiled code. Everything from basic compression to optimized linkers and assemblers.
The game I’ve opted to shrink was more complex - a game of minesweeper.
Minesweeper has a few basic rules:
You have a grid on which mines are randomly placed. Those mines must each have different spots on the grid. Once the mines are placed, the rest of the grid is filled with boxes with a number or without one, depending on the number of mines surrounding that point in the grid.
The boxes are promptly hidden for the player and it is the players job to uncover them, WITHOUT hitting the mines. Once the player has uncovered all of the mines he/she’s successful and wins the game.
The result can be found here: https://github.com/nikp123/microsweeper
To say I managed to go under the target of 3 kb would be an understatement.
I managed to fit the basic functionality described above in just under 2kb (1900 bytes to be specific). Although I wanted to know how much more of the game could be fitted if I let myself use more space, hence I made it a Makefile (build) option.
There are a few targets, namely:
minimal - the smallest one (1900 bytes)
2k - what fits inside 2048 bytes
qt - what fits inside of a QR code (undetermined)
full - just make the game as fully featured as possible
Tumblr media
1900 byte version screenshot
Tumblr media
2k version screenshot
Tumblr media
qr or full version - pretty much the same at the moment
1 note · View note
nikolapavlica · 5 years ago
Text
Galaksija lives again
Name of activity : Galaksija emulator
Date(s) of activity : 26th > 27th of October 2020. and some other later times I did unpublished work (mostly due to it being unsuccessful and leading to nowhere)
Approximate # of hours : Around 8-10 hours (aka. An all-nighter due to plain interest)
This activity is : Creativity
Learning outcomes :
Identify your own strengths and develop areas for personal growth.
Demonstrate that challenges have been undertaken, developing new skills in the process.
Demonstrate how to initiate and plan a CAS experience.
Show commitment to and perseverance in CAS experiences.
Demonstrate the skills and recognize the benefits of working collaboratively.
Demonstrate engagement with issues of global significance.
Recognize and consider the ethics of choices and actions.
One day I was watching YouTube videos about old computer systems. I’ve stumbled upon a video called “The ultimate C64 talk” where a guy talks about everything there is to know (that is relevant) about the hardware and software of the Commodore 64 system.
In the same vain, an student (at the time) from the University of Ljubljana made a presentation called “The ultimate Galaksija talk”. Watching the video for a while I found out that the system in question was a homemade effin’ Yugoslav machine. To say I was positively surprised would be an understatement. I usually love to talk about these things and this information made my day. This made me research about Yugoslav computing in general and I’ve learned a lot. But seeing how this seemingly is never going to be repeated again, at least for a while, in a historical context, I felt the moral need and obligation to preserve this thing and keep it from dying as just some novelty from the time.
Checking many resources I found out that emulators for it DO exist, but honestly the code aged badly. What do I mean by badly? Well, let’s say that it took me literal 30 minutes to try to run the emulator before giving up, IT WAS THAT BAD!
So, I’ve decided to do what any person with interest to preserve software and history would do: Write an emulator for the thing so it ACTUALLY WORKS!!!
For the base, I’ve used an emulator written by some Serbian dude back in the 90s that I couldn’t compile nor run. Luckily, the code was written in C using the Allegro game library, something, not to brag, but I have so much experience in. This was due to a failed game project called Association that I did not publish.
I found the issues, however, the code was entirely a mess so I’ve opted for rewriting everything instead to make it much cleaner.
While I was writing the code I also collaborated with my fellow friend on suggestions and improvements. His help and contribution came extremely useful here, I cannot deny that. He helped me reverse the character ROM of the Galaksija.
I’ve used SDL2 as it runs on pretty much everything you’d realistically want it to run on. I’ve read and figured out every part of the darn emulator and rewrote it entirely. One part I was struggling with was keyboard emulation, which I eventually got figured out. Anyway the project can be found here.
Tumblr media
One thing I must say is that it was easy to get running since the emulator is so basic. However, as Tomaž alluded in the Ultimate Galaksija talk, no emulator is perfect and mine certainly isn’t. The flaw that was mentioned during that part of the presentation is that rendered graphics are indeed fake. The picture shown is not of what the Galaksija would show, it’s a bitbanger that sort of simulates the output by reading the appropriate memory addresses. While this works in principle, this method fires completely backwards when we consider games that were written for the Galaksija. Galaksija, for those who do not know, does NOT have a graphics chip or GPU of any kind. It instead generates a composite RCA signal using the CPU and a few logic elements. This signal is entirely analogue and therefore the output image completely depends on the state of the CPU. If your CPU, let’s say, gets stuck doing something, you’d just lose the image since the CPU was tasked with maintaining the literal signal going to your television set of the time. Games, instead of using the logic provided by the “Operating System” would rather render graphics in their own terms, this changes everything about how the graphics are displayed if we were to read memory addresses. This is why the bitbanging method is invalid for accurately portraying what the Galaksija actually does and leads to said games breaking the emulator.
I’ve currently invested some effort in trying to reverse the video signal, but it was all in vain. I did not succeed. Hopefully someone with a bit more of the smarts could figure this one out.
1 note · View note
nikolapavlica · 5 years ago
Text
Maintaining a stand
Name of activity : Maintaining a stand
Date(s) of activity : Sometime in late 2019. - My mistake for not keeping track of what I do and when I do them
Approximate # of hours : 1 hour and 15 minutes
This activity is : Service
Learning outcomes :
Literally none.
Anyway, this activity unlike others was just plain simple and boring. After speaking with some colleagues and professors about this activity I chose it because there was a genuine need for help. Enough rambling, let’s explain how this went down.
After enough discussion and planning, I volunteered to put myself in place of a girl that was supposed to maintain a stand, which was just advertising a bank and it’s new credit/debit system. This was because the girl was unable to fit into the schedule and I took her place (at least, that what I remember was the issue). Anyway boring details aside, I literally stood there for an hour and explained the new system to passerbys’ who were interested about it. Genuinely, nothing interesting. Also no pictures as I was the only one there.
You might this was just a pointless task, but it did help the school. The advertising budget was donated straight towards the school to hopefully improve it and help the professors working there (although I can’t exactly pinpoint this information).
1 note · View note
nikolapavlica · 5 years ago
Text
Converting documents into databases
Name of activity : Excel database repair and organization
Date(s) of activity : 8. and 9. of December 2019
Approximate # of hours : 10 hours in total - most of the time was spent in repairing errors and formatting issues
This activity is : Creativity, Service
Learning outcomes :
- Identify your own strengths and develop areas for personal growth.
- Demonstrate that challenges have been undertaken, developing new skills in the process.
This CAS activity came suddenly because a colleague of my father was about to commit to doing mundane work which when taken straight on would cause him to waste hours upon hours of his own time and as a result be less productive that week. However, upon hearing his issue and him asking me for help or advice, I decided that I’ll do his job as a favor (and for this CAS activity as well, obviously)
The task sounded simple. Oh, how naive I was :)
You have this absolutely gigantic database of forest land owners within Bosnia and Herzegovina and not just companies, but private owners as well. This information was written down as a table in a Microsoft Word .DOC file (not .DOCX, but .DOC). This is the main reason why I’m not sharing any information or screenshots, as it legally might put me into unnecessary trouble. Anyway...
The task was to convert this information to a more workable format, be it a SQL, Excel or just a plain CSV database.
You’d think that merely copy pasting the entire file would do the trick. Look at the time required, IT WAS 10 HOURS OF RESEARCHING THIS **ARGGHHHHH**
Anyway before any further yelling at my computer, I’d rather explain everything.
So first off, I’d try the intuitional method (that is copy pasting for like an hour - yeah, that was NEVER going to work). When you have tables that have more than 20000 entries, your computer is just going to give up, IT CANNOT HANDLE this much information without crashing or freezing all over the place during the process.
So anyway, because I was already the Linux guy(TM) in my community, I knew it was time to pull out the spell book and do some *NIX magic.
Okay, just to number things that failed.
1. Writing my own program - I don’t have time to do that either way
2. Using a library to do this (Python and other scripting languages)
3. Using a chain of pipe commands (aka. BASH/Shell magic in a nutshell)
...among other things (It was a year ago when I did this, you can’t blame me for not remembering)
So, what was the magic trick? Tell me already.
Amidst of my research I’ve stumbled upon what are commonly referred to as “Vim macros”. Anyone with experience in Vim or any of it’s derivatives (namely NeoVim) know that macros are stupidly powerful in the text editing world.
But before I can explain where that came in useful, I’ve managed to convert the .DOC files containing the tables into a plain .TXT or just text file using a utility called docx2txt, it is easily available and therefore was easy to get working.
One thing that I had to do was to convert (as the program kindly suggested) the .DOC files .DOCX. While this process was smooth, it did leave a few marks, namely in how slavic latin letters were translated. The text, was, let’s say, a bit messed up. The document used a proprietary 90s text format, which while can be worked with DOES leave marks and causes unnecessary pain and dread. This will be dealt with later, it wasn’t important at the moment.
The conversion to .TXT, just like the one to .DOCX, was successful, however it still had issues regarding how slavic latin characters were treated, but as said above, it wasn’t my concern at the moment.
Use your imagination here. The file had a table containing the database, as well as some basic info regarding the information shown, such as row and column labels where necessary, as well as page labels, database labels among other information. This information had to be manually removed, but importantly, after the conversion.
Why and why again?
Because it was unnecessary, I’m going to add those labels myself or the database program itself. But not ONLY because the information was useless, but also because the information was interfering with the “Vim macros”. Vim macros basically work by having a repeating chain of commands that are executed within the editor to perform certain tasks. I’m NOT GOING to go into detain, because most people have a headache when they hear Vim, or GOD FORBID REGEX COMMANDS (OMFG, SO SCARY, I’VE BEEN SCARED OUT OF MY SOUL).
And for the other why - The Vim macros only work with plain text, duh.
Turing this mess into a usable database (FINALLY)
So anyway, I’ve decided I should hand my fathers friend an excel file (.XLS or .XLSX, it doesn’t really matter, although I prefer the latter). The easiest way, I’ve figured out was by first creating a .CSV file than saving it as .XLSX within Microsoft Excel
CSV files are stupidly simple. Each line is a row, while semicolons ; separate each of the columns within that row. A bit of Vim magic, and that was done successfully.
Issues
Oh yeah, the dumb latin character thing. I’ve forgot about this until the last step. The way I’ve solved those is by using by regex, feel scared yet?
s/your_problem/my_solution/g
Anyway, hopefully it was worth it, as it was indeed literal megabytes of information that was converted those two nights. And besides, now that I know how to do this properly, I can perform the same task within minutes.
IT is sometimes this insane.
3 notes · View notes
nikolapavlica · 5 years ago
Text
Christmas Fair 2019
Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media
Christmas Fair 2019
Name of activity : Christmas Fair 2019
Date(s) of activity : 23.12.2019.
Approximate # of hours : 6 hrs preparing, 9 hrs hosting - 15 total
This activity is : Creativity, Activity, Service
Learning outcomes :
- Demonstrated and improved the skills and I worked collaboratively.
- Showed commitment and perseverance in CAS experiences.
Hi people,
This was an yearly event that was organized in our school by IB students.
In this event we baked cookies, made cards, sold books, done photography, played Just Dance... and donated all the money towards students who needed it the most.
This was a fun event and I hope to be able to do it this year as well. It was an opportunity to be able to have fun with my school colleagues and friends. As the “Just Dance host” I got to set up everything in advance - the games, the hardware and everything in between. But it was worth it in the end since I was able to have one big dance-off. Just one issue I encountered along the way: The sensor bar took 3 AAA batteries - which was not only inconvenient, but also expensive. So to combat this I’ve soldered it so that you can use your computers USB port for power. No wasted batteries for me it seems :) (Pictured above)
1 note · View note
nikolapavlica · 5 years ago
Text
Continuation of field work
Tumblr media Tumblr media Tumblr media
Name of activity : Field work
Date(s) of activity : Some days in late July of 2020.
Approximate # of hours : 20 hours across four or more days
This activity is : Action, Service
Learning outcomes :
Showing perseverance and commitment while working on the field
Working collaboratively with others - assisting each other, bringing needed supplies to others, continuing other’s work when they are unable to continue or are plain too tired to continue working on something (like mowing down a filed or such), helping come up with solutions on certain problems...
Initiative & planning - Time and resources are partitioned so that as much gets done in at little time as possible - my father holds this role
Strength, growth, challenge & skills - Field work is a combination of both past experience, knowledge and physical ability. It requires a person who can withstand multiple hours of field work, that can easily find and fix upcoming issues such as disease and fxp. recognize the appropriate time for harvesting/watering and such and to what amount.
Hello, this post is just the continuation of the previous experiences I’ve had during my days on the field. Unfortunately, I wasn’t able to record what happened in a day-by-day basis, since I wasn’t interested (at the time) in documenting this event. This has also led me to not picture a lot of what happened - the image shown shows the time when grass and parasites started to grow across the field (we had to remove them)
This time we weren’t as worried for the food supply since the measures were lifted during this time and there weren’t any curfews or traffic restrictions. We used this to our advantage - Working early/late hours, getting supplies that were previously hard to get (such as certain chemicals) and others.
However my contribution came in the form of doing work such as watering plants, harvesting them, informing others (mostly my father) about the situation on the field and helping or replacing others work (in case they could’ve not gotten to the field and such)
Other interesting contributions came in the form of helping eradicate pests that have attacked our potatoes (Ireland all over again, although it wasn’t as deadly. thankfully)
That wasn’t the only issue we faced:
For starters, there was a storm that tore up a row of corn (thankfully most of them were fine)
Secondly, there were animals running across the field - however they don’t do any significant amount of damage.
Thirdly, there was a disease that ruined about 60-70% of all tomatoes. This was the *truly* devastating one.
Fourth, grass and other parasite plants were starting to grow on the field. This limited their growth and a process of removal by hand was done to eradicate them.
This time, it wasn’t as physically demanding to work on the field, because most of the work was spent maintaining and managing the field.
Reflection: This time I got more involved in working on the field than last time. While most of the work was mundane and exhausting, I enjoyed chatting with others. And when I wasn’t able to do that, I just fell back to listening to music, just like last time.
1 note · View note
nikolapavlica · 5 years ago
Text
Field work
Tumblr media Tumblr media Tumblr media
Name of activity : Field work
Date(s) of activity : some day in early May (havent managed to remeber exactly) and 22.5.2020.
Approximate # of hours : 16 hours across two days
This activity is : Action, Service
Learning outcomes :
Showing perservance and commitment while working on the field
Working collaboratively with others - assisting eachother, briging eachother needed supplies... etc.
Initiative & planning - since farms have to be partitioned and organized as to not pointlessly waste resources and time
Strenght, growth, challenge & skills - doing fielwork is hard and requires a person to gather experience and will in order to be productive and efficient
Hello, it's me once again!
This time I'm posting about the days I've spent on the field. Ever since the pandemic set loose, people were scared whether or not they will be able to feed themselves (since the borders have been closed) and local food production was weak to say the least. So, a group of people took it upon themselves to produce food for themselves, should they need it.
Obviously this was a tremendous task, requiring many hands and many hours.
On the first that, that I couldn't remember, I was digging the soil to make it softer, which would allow many plants to be grown on them. This was a 3 stage process:
1) breaking up the soil by shovel (since it has been pressed down for about 10 years)
2) using a garden hoe to make the dirt chunks smaller so that plants can be grown
3) and finally using the finer garden hoe to fix the shape of the soil and make canals through which water would flow
Once the soil had been prepared, for the next half of the first day my duty was to prepare and water the newly planted plants.
On the second day, we investigated the plants, making sure nothing had gone wrong and watering them as necessary. This day compared to the first one was way less physically demanding.
Reflection: While this type of activity is particularely demading to anyone, it has proven to be a important event. As it showed how much enjoyable otherwise mundane tasks can be. You can also bring your favorite music along with you and enjoy it while you’re working
Tumblr media
1 note · View note