3rd year IT student in search of an internship
5th semester at school is pretty much over by now. Only one small assignment to do on upcoming
Tuesday Thursday. Hopefully, I will write about the semester at some point.
On Monday I am going to do PHP tests for the internship that I applied for. I am preparing for it at the moment by solving Testdome PHP exercises and PHP interview questions. If I succeed it would be a huge step for me to become a sufficient Magento developer one day.
Continue reading “How to prepare for the TestDome php assessment – my mistakes and tips”
Same question here but I find its answer a bit misleading. My answer would be YES. You need to loop through the whole array to find a specific element and the worst case complexity is O(n). Unless:
- you use associative array and ask the element by its key. Then the search takes constant time O(1).
- you ask element by its index (you know where the element is and you go there directly). Then the search takes constant time O(1).
As I sometimes lock myself out from Facebook I have no idea if any of my friends is having a birthday any time soon. I also already have difficulty remembering ages and birthdays of all my relatives (especially new ones). Before solving my personal CRM needs with Monica I decided to build something myself.
Today I worked on building a small web app using sqlite and php to save/edit/delete birthdays of my friends and family, calculate ages etc.
Most difficult was to figure out how to sort recurring (yearly) events starting from “next upcoming” with single SQL query. But I think I figured it out by using one SQL query followed small php loop (which has worst case complexity of O(n)) to find the place to split an array 🙂
SELECT id, firstname, lastname, birthday,
(current_date - birthday - 1) as age,
substr(birthday, 9, 100) as day,
substr(birthday, 6, 2) as month
ORDER BY month, day;
Hopefully I can get it ready enough at some point for sharing on Github. Something cool for the end: OpenAI has trained a model that can create new images – you just describe them in English. Mindblowing.