81
I Use This!
Activity Not Available

News

Analyzed over 3 years ago.
Posted about 2 months ago by Valério Valério
Memilih permainan taruhan memang harus dipikirkan dengan baik dan benar dan tidak boleh dilakukan dengan sembarangan. Kalaupun ada banyak koleksi permainan yang tersedia tetap kita harus bisa selektif memutuskan dan memilih salah satu pilihan yang ... [More] paling tepat. Dengan cara demikian inilah yang kemudian akan memungkinkan dan memudahkan kita untuk bisa memperoleh kemenangan. Kita bisa mendapatkan dan memperoleh kemenangan lebih mudah dari permainan yang kita lakukan jika kita bisa bermain dengan cara yang tepat. Kenapa membutuhkan strategi? Permainan casino sebetulnya bukan sepenuhnya permainan yang harus mengandalkan yang namanya keberuntungan, akan tetapi kita harus bisa menguasai beragam strategi bermain agar bisa menang mudah dalam permainan itu. Makin banyak strategi bermain yang kita kuasai maka semakin besar pula peluang keuntungan yang bisa kita peroleh dan dapatkan. Oleh karena itu sebisa mungkin kita harus pelajari strategi bermain seperti apa yang harus kita gunakan. Dengan cara demikian ini bisa memungkinkan dan memudahkan kita untuk menang lebih mudah dan lebih seru. Bermain dengan strategi juga bisa memudahkan kita untuk bisa menggapai target yang ingin kita capai. Strategi Bermain Judi Online Menang Terus Bermain game judi online agar supaya bisa menang terus terkadang memang membutuhkan beberapa trik dan juga strategi yang jitu. Kita bisa coba pelajari dan cari tahu bagaimana sebetulnya trik yang bisa digunakan bergantung pada pilihan permainan. Misalnya Anda mau bermain permainan seperti slot pragmatic, joker 123 dan lain sebagainya, sebaiknya gunakan teknik dan strategi yang benar. Jika anda sudah bisa memilih salah satu pilihan permen yang yang tepat, anda tinggal mainkan saja permainan itu dan kemudian Anda rasakan keseruan dari permainan tersebut. Pilih game yang punya potensi menang tinggi Cara yang paling mudah pertama sebetulnya adalah memilih game yang memiliki potensi kemenangan yang tinggi. Oleh karena itu anda perlu lakukan beberapa pencarian untuk bisa menemukan pilihan game tersebut. Saat ini banyak sekali pilihan yang tersedia dan bisa dipilih namun juga harus disadari bahwa tidak semua pilihan game memiliki tingkat RTP tinggi. Menyiapkan modal yang besar Setiap pemain yang mau menang dan untung banyak di dalam permainan game maju di online judi pasti disarankan untuk bisa memilih untuk menyiapkan modal yang cukup. Persiapan modal yang cukup akan mempengaruhi banyak hal termasuk juga mempengaruhi tingkat kemenangan dan besar keuntungan yang bisa didapatkan. Jadi sebisa mungkin Anda harus bisa siapkan modal yang cukup agar bisa memiliki kesempatan untuk bisa bermain dengan lebih banyak keuntungan besar di dalamnya. Mempelajari celah kemenangan Setiap permainan apapun itu juga pasti akan selalu ada celah kemenangan yang bisa kita pelajari. Jadi pastikan supaya Anda bisa belajar dan cari tahu apa saja dan bagaimana saja sebetulnya cara kemenangan yang bisa kita gunakan agar bisa mendapatkan keuntungan yang besar dan berkali Lipat. Bahkan Anda juga bisa coba belajar dari beberapa sumber di beberapa media untuk bisa mendapatkannya informasinya. Akan tetapi bagi Anda yang memang masih pemula sangat disarankan untuk bisa mengetahui dengan baik bahwa memang ada beberapa cara dan strategi tertentu yang bisa anda gunakan. Ada beberapa panduan khusus mendasar dan Advance yang memang harus dipahami dengan baik. Hal itu bertujuan agar Kemudian Anda bisa memperoleh dan mendapatkan keuntungan besar dari permainan tersebut. Ini juga yang memudahkan anda untuk bisa berjalan dengan lancar dan mendapatkan potensi atau peluang kemenangan yang lebih besar lagi dari permainan tersebut. The post Strategi Bermain Judi Online Agar Mudah Menang appeared first on VALERIOVALERIO. 0 0 [Less]
Posted 2 months ago by Alberto Mardegan
New year, new job. After leaving Canonical I'm back to working on the same software platform on which I started working back in 2006: Maemo. Well, not exactly the vanilla Maemo, but rather its evolution known as Aurora OS, which is based on Sailfish ... [More] OS. This means I'm actually back to fixing the very same bugs I introduced back then when I was working in Nokia, since a lot of the middleware has remained the same. At the moment OMP (the company developing Aurora OS) is mostly (or even exclusively, AFAIK) targeting business customers, meaning corporations such as the Russian posts and the railway company, whereas the consumer market is seen as something in the far away future. Just in case you were curious whether there were any devices on sale with Aurora OS. I should also explain why I've refused several very well paying job opportunities from Western companies: it's actually for a reason that has been bothering me since last March, and it's a very simple one. The fact is that because of the sanctions against Russia I already had to change bank once (as the one I was using fell under sanctions), and in these months I've always been working with the fear of not being able to receive my salary, since new sanctions are introduced every month and more and more banks are being added to the blacklist. That's why I've restricted my job search to companies having an official presence in Russia; and to my surprise (and from some point of view, I could even say disappointment) the selection and hiring processes were so quick that I received three concrete offers while I was still working my last weeks at Canonical, and I joined OMP on that very Monday after my last Friday at Canonical. I mean, I could have rested a bit, at least until the Christmas holidays, but no. ☺ Anyway, I'm so far very happy with my new job, and speaking Russian at work is something totally new for me, both challenging and rewarding at the same time.0 0 [Less]
Posted 3 months ago by Enrique Ocaña González
It’s been 8 years since the last time I wrote a videogame just for personal fun. As it’s now become a tradition, I took advantage of the extra focused personal time I usually have on the Christmas season and gave a try to Processing to do my own ... [More] “advent of code”. It’s a programming environment based on Java that offers a similar visual, canvas-based experience to the one I enjoyed as a child in 8 bit computers. I certainly found coding there to be a pleasant and fun experience. So, what I coded is called Cat’s Panic, my own version of a known arcade game with a similar name. In this version, the player has to unveil the outline of a hidden cute cat on each stage. The player uses the arrow keys to control a cursor that can freely move inside a border line. When pressing space, the cursor can start an excursion to try to cover a new area of the image to be unveiled. If any of the enemies touches the excursion path, the player loses a life. The excursion can be canceled at any time by releasing the space key. Enemies can be killed by trapping them in a released area. A stage is completed when 85% of the outline is unveiled. Although this game is released under GPLv2, I don’t recommend anybody to look at its source code. It breaks all principles of good software design, it’s messy, ugly, and it’s only purpose was to make the developing process entertaining for me. You’ve been warned. I’m open to contributions in the way of new cat pictures that add more stages to the already existing ones, though. You can get the source code in the GitHub repository and a binary release for Linux here (with all the Java dependencies, which weight a lot). Meow, enjoy! 0 0 [Less]
Posted 3 months ago by Enrique Ocaña González
It’s been 8 years since the last time I wrote a videogame just for personal fun. As it’s now become a tradition, I took advantage of the extra focused personal time I usually have on the Christmas season and gave a try to Processing to do my own ... [More] “advent of code”. It’s a programming environment based on Java that offers a similar visual, canvas-based experience to the one I enjoyed as a child in 8 bit computers. I certainly found coding there to be a pleasant and fun experience. So, what I coded is called Cat’s Panic, my own version of a known arcade game with a similar name. In this version, the player has to unveil the outline of a hidden cute cat on each stage. The player uses the arrow keys to control a cursor that can freely move inside a border line. When pressing space, the cursor can start an excursion to try to cover a new area of the image to be unveiled. If any of the enemies touches the excursion path, the player loses a life. The excursion can be canceled at any time by releasing the space key. Enemies can be killed by trapping them in a released area. A stage is completed when 85% of the outline is unveiled. Although this game is released under GPLv2, I don’t recommend anybody to look at its source code. It breaks all principles of good software design, it’s messy, ugly, and it’s only purpose was to make the developing process entertaining for me. You’ve been warned. I’m open to contributions in the way of new cat pictures that add more stages to the already existing ones, though. You can get the source code in the GitHub repository and a binary release for Linux here (with all the Java dependencies, which weight a lot). Meow, enjoy! 0 0 [Less]
Posted 4 months ago by Pavel Rojtberg
In this post I want to take a look at the Logitech M720 mouse after having used it for 2.5 years. Specs and durability The specs are pretty common for a mouse you get today, so lets start with the special features: There are side ... [More] buttons, which I find pretty handy for navigating front/ back in the browser or a file manager It can be paired with up to 3 devices at the same time, which makes it easy to use with your PC, Laptop and Tablet It supports both Bluetooth LE and the Logitech Wireless Receiver It is powered by a single, replaceable AA battery Especially the last two points make this seem to be future-proof product that you can use for a long time. Logitech is currently replacing their Wireless Receiver dongles by Logitech Bolt, so in the near future the Wireless Receivers will go away. But thanks to the Bluetooth support you will still be able to use the mouse without having to occupy a USB port just for using it. Then, using standard AA batteries means that you just use some nice rechargeable ones. This means that you will never have to wait for the mouse to charge and that the mouse can out-live the battery. As you are probably aware from using your phone, rechargeable batteries wear-out over time until the device cannot be properly used any more. So we finally got a mouse for the years to come? Well.. Built-in obsolescence Unfortunately, Logitech made some design decision that drastically shorten the life-span of the device, even though they must have known better. Rubber coating The most obvious one is likely the rubber coating of the mouse. Note how the plastic buttons look still perfectly fine in comparison I took the images for this post after cleaning the mouse. So the dirt you see there is not the skin from my greasy hands, but rather said rubber coating disintegrating.This is caused by your sweat which is slightly acidic and thus takes hold of the rubber.There is a reason that Gamepads do not have such coating, even though having good grip is even more important there.Also, the way the coating is used here, all it does is making the mouse look greasy after some time. Bad switches The less obvious issue are the used switches i.e. the things that perform the clicks.Did you ever notice that after some time your mouse does incorrect double clicks or releases the click while drag and dropping on its own? Well, that means the switch starts wearing out. The mouse uses OMRON D2FC-F-7N micro-switches in a cheap variant that is only rated for 10 million clicks (10M). While this sounds a lot, it yields to 6850 clicks/ per day for 4 years, which is not all that much if you think about playing a shooter or using photoshop.The crazy part is that going for the 20M rated variant (2x the durability) only costs 50 ct more (pack of 5 on amazon). This would make the mouse merely 1€ more expensive – probably way less even as Logitech can negotiate bulk discounts on these things.Given that the mouse is priced at 50€, I do not think we can pass this off as cost optimization. 0 0 [Less]
Posted 4 months ago by Pavel Rojtberg
In this post I want to take a look at the Logitech M720 mouse after having used it for 2.5 years. Specs and durability The specs are pretty common for a mouse you get today, so lets start with the special features: There are side ... [More] buttons, which I find pretty handy for navigating front/ back in the browser or a file manager It can be paired with up to 3 devices at the same time, which makes it easy to use with your PC, Laptop and Tablet It supports both Bluetooth LE and the Logitech Wireless Receiver It is powered by a single, replaceable AA battery Especially the last two points make this seem to be future-proof product that you can use for a long time. Logitech is currently replacing their Wireless Receiver dongles by Logitech Bolt, so in the near future the Wireless Receivers will go away. But thanks to the Bluetooth support you will still be able to use the mouse without having to occupy a USB port just for using it. Then, using standard AA batteries means that you just use some nice rechargeable ones. This means that you will never have to wait for the mouse to charge and that the mouse can out-live the battery. As you are probably aware from using your phone, rechargeable batteries wear-out over time until the device cannot be properly used any more. So we finally got a mouse for the years to come? Well.. Built-in obsolescence Unfortunately, Logitech made some design decision that drastically shorten the life-span of the device, even though they must have known better. Rubber coating The most obvious one is likely the rubber coating of the mouse. Note how the plastic buttons look still perfectly fine in comparison I took the images for this post after cleaning the mouse. So the dirt you see there is not the skin from my greasy hands, but rather said rubber coating disintegrating.This is caused by your sweat which is slightly acidic and thus takes hold of the rubber.There is a reason that Gamepads do not have such coating, even though having good grip is even more important there.Also, the way the coating is used here, all it does is making the mouse look greasy after some time. Bad switches The less obvious issue are the used switches i.e. the things that perform the clicks.Did you ever notice that after some time your mouse does incorrect double clicks or releases the click while drag and dropping on its own? Well, that means the switch starts wearing out. The mouse uses OMRON D2FC-F-7N micro-switches in a cheap variant that is only rated for 10 million clicks (10M). While this sounds a lot, it yields to 6850 clicks/ per day for 4 years, which is not all that much if you think about playing a shooter or using photoshop.The crazy part is that going for the 20M rated variant (2x the durability) only costs 50 ct more (pack of 5 on amazon). This would make the mouse merely 1€ more expensive – probably way less even as Logitech can negotiate bulk discounts on these things.Given that the mouse is priced at 50€, I do not think we can pass this off as cost optimization. Note, that even more expensive Logitech Mice, like the MX Master have the rubber coating issue and use the same cheap 10M rated switches. 0 0 [Less]
Posted 4 months ago by Pavel Rojtberg
GNOME Open Desktop Ratings is the service that enables user ratings in various Linux app stores like the Snap-Store, Gnome Software and KDE Discover. While it nowadays works for users by providing a mostly useful star rating, from a application ... [More] developer perspective the story is very grim. Basically one only gets the users view, which provides an average rating and some reviews in the current locale.This means you might see something like “2 Stars from 80 Reviews” – but the 3 reviews in your current locale are all 4-5 Star.To see something else you have to change the locale and restart the app store – which is inconvenient and confusing.As a developer, seeing the negative reviews is crucial, as people often just post bug reports there and this is the only way to find out why the app did not work for them. Therefore I quickly hacked together a web-based browser for the ODRS service, skillfully named ODRS Browser This allows accessing the ODRS service from the web and shows the reviews from multiple locales at once. The idea here is that often people write reviews in english – regardless of their current locale. Currently, ODRS has no logic to detect that. Also, if your app is packaged in different formats like snap and flatpack and deb, you can see the reviews of all variants in the overview. Unfortunately, ODRS currently does not set the CORS header which prevents browsers from accessing it directly. The data that you see right now was scraped with python script. But once this issue is fixed, the ODRS Browser will be able to use live data. 0 0 [Less]
Posted 4 months ago by Pavel Rojtberg
Lets say you want to debug a python process that is either already running or crashing in native code. Pythons PDB is of no help here and you will have to use low-level GDB debugger. Fortunately, it comes with support for debugging high level ... [More] python scripts. However, while the actual python-gdb commands are nicely described here, that page lacks important details on how to get python-gdb in the first place. We are merely told that a python-gdb.py is needed. On Ubuntu/ Debian, this file is included in the python3-dbg package: sudo apt install python3.10-dbg Installing that is sufficient, if you use the matching python3 package. You can go ahead and connect to some running python process via: gdb -p # verify that the script is loaded (gdb) info auto-load # get a python backtrace (gdb) py-bt Traceback (most recent call first): File "/usr/lib/python3.10/selectors.py", line 416, in select fd_event_list = self._selector.poll(timeout) File "/usr/lib/python3.10/socketserver.py", line 232, in serve_forever ... In case Ubuntu is merely a host and you use coda, you can still use the host python-gdb.py – even if the python versions dont match. You will have to load the script manually though like: (gdb) source /usr/share/gdb/auto-load/usr/bin/python3.10-gdb.py 0 0 [Less]
Posted 4 months ago by Alberto Mardegan
Before you get angry at me for this title, please let me state that I count myself in the number of the “idiots” and, secondly, that what I mean by “idiotism” here is not to be intended as an offence, but as some traits of mindset which are typical ... [More] of very logical brains. Some months ago I finished reading Dostoevskiy's “The Idiot”, a book about an exceedingly good-hearted man, prince Lev Mishkin, whose behaviour was puzzling the people around him so much that they thought of him as an idiot. Sure, the fact that he was suffering from epilepsy didn't help, but it was far from being the primary reason for their thinking, since his epileptic seizures were very rare (if I remember correctly, only two occurred during the time of the story) and everybody's opinion had already formed well ahead of witnessing him in such a state. He was an idiot because he was open, trustful, and especially because he could not “read between the lines” of what was been said to him: his social conduct was straight, and although he was following at his best the customs that he had been taught, he was supposedly awkward and unable to perceive and parse all the messages that are implicitly conveyed by social behaviours and human interactions. I added the word “supposedly” because, as a matter of fact, his behaviours were all perfectly normal for me: I only noticed their awkwardness when it was pointed out by the other characters, at which point I couldn't help smiling and acknowledging that, indeed, that thing he did was weird. However, he was a good and caring person, and not without talents: he had an interest in calligraphy, and everybody liked to listen to him, as his speech was insightful and his thoughts were original. I wonder how many of my readers can identify themselves in such a character? I definitely can. I won't get into the details, but I've felt many times on me the amused or puzzled glance of people (like that time in high school when I could not open a door in front of dozens of people, and I heard them say “So, that guy is the genius of mathematics?” — I'll never forget that!), often without understanding the reason for their reactions. Still, generally people seem to like my company and be genuinely interested in talking to me. So, what's wrong with prince Lev Mishkin, me, and maybe with you too? Well, a few things, I would say. I'm not going to claim any scientific truth on what I'm going to say, these are just my own impressions and deductions, which seem to be shared by other people in the interwebs too, judging from a quick search I did; take them for what they are. The first thing I notice is some common traits between us and autistic people: we tend to work better with things, rather than with people; we can to focus on a certain thing (work, a mathematical problem, a game) and forget about the world around us; we have our unique hobbies, like solving puzzles, arguing about a specific and very narrow topic, learning artificial (both human and programming) languages; it's as if we needed to build a small, better world where we would feel safe and at ease. The other thing, which I actually consider harmful and which I put efforts to change in my own life, is the fact that it's extremely easy to get us interested into a specific aspect of a problem, and make us forget (or just not notice) the big picture. That small part that we are looking at is stimulating and challenging, and we are led to think that it's core of the issue, and maybe of all the issues that affect our world. What is often missing is the ability to take one step back and try to look at the issue from a different angle, and especially the ability to listen for counter arguments; I mean, we do listen to them, but since we have, in a way, “gamified” the issue, even when we think that we are open to listen for the other side, we are in reality trying to win the counter-arguments, rather than genuinely trying to understanding them. Another thing which we have, is faith. Yes, you read it right: even though the IT world is probably the one with the highest percentage of atheists, men always need something to believe in. We just don't realize it, but we do hold a blind trust in certain persons and authorities. This does not mean that this trust lives forever and cannot be broken, but this generally does not occur because of a conscious realization of ours. Much more often than we'd like to admit, the reason why we lose faith in a certain person or authority is because the rest of the persons and authorities that we trust has told us so. In other words, even if there's undoubtedly a reasoning of our own, the full realisation and conviction occurs after having collected and compared the opinions (or statements) of those we trust. The net result is that the IT population is the one most trustful of the mainstream media, because it's the mainstream media who has more “voice”: that's where the most reputable journalists, scientists, activists are (and “reputable” is the key word here, since this reputation is recursively created by the mainstream media themselves or by their sponsors). I might be biased by my own experience here, but it seems to me that there isn't a group of people more homogenous in their political (and generally, world) views than that of IT workers. When, in 2018, I saw the leaked video of Google's co-founder Sergei Brin and other executives' reaction at Trump's presidential victory, what I found most surprising was not the contents of the speech, as they were mostly mainstream opinions, but rather the fact that all this could be said in a company meeting. Something like this, I though, could never happen in an European company, as political matters are a conventional tabu in the work environment. But the point is that Brin and others could say those words only because they knew that the overwhelming majority of the audience shared the same opinion. I don't think you could find the same homogeneity of thought among shop assistants or philosophy professors. Assuming that you have followed me this far into my rambling, and that you recognize that there might be some truth in what I wrote, you might now be wondering if there's a way to counterbalance our “idiotic” traits. Unfortunately I don't have a full answer, as myself am only halfway there (but maybe I'm too optimistic here? and does this road even ever end?), but there are a few things that I think are absolutely worth trying: Talk with people. Better if face to face, or at least in a video call; just 1-on-1, avoid groups, or you'll get on the defensive and try to defend your position for the sake of not losing the argument in front of an audience. But it's not a fight. Your goal when talking should not be that of convincing or getting convinced, but rather just to understand the other points of view. Read both sides of the narrative. Try to see the other party's argument as they themselves present it, and not how it is presented in the media you usually read. Media often use this trick, to either invite “clown representatives” of the other point of view just to ridicule it, or they give them too little time, or extrapolate their answer out of context, just to make them appear unsensible. Always assume that other people are smart, and that no one is bad. Whatever the argument, try to answer the key question: “Cui bono?” (who profits?) to be at least aware of all the hidden interests behind this and that. They don't necessarily invalidate a position, but they must be considered. Lose faith. The only faith you are allowed to keep is the faith in God (or Gods), if you have it: but men, theories, institutions, authorities (including religious ones!), these must always be assumed to be imperfect and not blindly trusted. People serve their interests or can be manipulated. Try always to start from a clean table and an empty mind, and see if they have enough arguments to convince you. Do never assume “They can not all be wrong” or “If this were wrong, at least some media would report it”. It just doesn't work this way, this is again a matter of having faith in the majority. Think of how many times in (recent) history you were presented an unambiguous truth, which later came out to be a scam (Iraq war being a famous one). Defocus. You might be spending a lot of energy into something that's not worth it. I mean, feel free to pursue whatever hobbies you like, as long as they make you feel better. But if you think you have a mission, think twice about it. Think about the world you'd like to live in, and whether/how this mission contributes to it.2 Ask questions. Be curious. Be challenging. For any topic, there are questions that have not been answered in mainstream media1. Find the answer, then find explanations, never stopping at the first satisfactory one, but always get at least two competing answers. From here, ask more questions, rinse and repeat. And at every step ask yourself this: why didn't I know about this? Is someone trying to hide the truth from me? Aim at improving. Whenever you read something or talk to people, keep a humble attitude and try to be challenged. Your goal should be that every reading and every dialog should make you wiser, even if what you initially read and heard sounded like garbage. There are always reasons for all these thoughts you disagree with. Reach out to the people nearby. Try not just to be sympathetic to the needs of some population living far away from you, which the media has singled out as being those needing your compassion, and try instead (or in addition to that) to be sympathetic and helpful to the people around you. To your neighbours, to those you see in the public transport and, first and foremost, to your relatives. Summing up, what I want you to realize is that we IT workers are easily exploitable. All those thought manipulation techniques represent a problem to everyone, but it's particularly with us that they tend to be especially effective; as a matter of fact, I've found that awareness of how the power controls us is higher among uneducated people, because they are more distrustful of the media and just tend to consume less of it. We, on the other hand, are not only well educated to respect the authority (see Noam Chomsky on education), but our logical, detail-focused mind can be easily externally controlled by continuously stimulating it to focus on specific things and not others. How would Dostoevskiy call us? My favourite one is: which country hosts more refugees from Ukraine? ↩ I was recently surprised when I read people in a forum who were discussing avoiding doing business with Saudi Arabia because of their human rights record. Seriously? We are talking about a government who has indirectly caused the death of more than 300 thousands people in Yemen, and your main reason to criticize them is human rights? It's like asking the police to arrest a killer because before the assassination he misgendered his victim! Yet the elephant in the room continues to go unseen. ↩ 0 0 [Less]
Posted 5 months ago by Alberto Mardegan
If you have been writing C++ classes for mocking out your C or C++ dependencies, you know how tedious it is. I generally write small classes with just a handful of methods, so it's generally bearable, but when using third-party code I'm usually not ... [More] that lucky. If the dependency is a C library this becomes especially tricky, both because they might be larger than what you can handle, and both because the lack of an object-oriented design might not offer you an easy solution to store the mock object data. But fear no more, Deride is here! I won't spend too many words describing it, since you can read its description from the link above, where you will also find some example code. More examples, by the way, can be found in the example/ folder in the code repository, where you can see how it can be used to mock both pure C++ and QObject-based classes, and C libraries. What is most important for me to say now, is that the project is in alpha state, meaning that I've tried it on a handful of header files only; it's highly likely that it will not work on many real-life scenarios, and if that happens I warmly invite you to inform me by filing a bug report providing the include file that was not properly processed. I leave you with a short example of a unit test, written using Deride. The class under test is called Stable, and internally it uses objects of type Horse, that we decided to mock. We used Deride to generate the mocked implementation and a MockHorse class which can be used to control the mocked objects. When building the test, we won't link against the original horse.cpp, but we'll only use the original horse.h; the implementation will be found in mock_horse.cpp, generated by Deride. And in the corresponding mock_horse.h file we'll find the MockHorse class with all the onCalled() hooks which we can use to install our callbacks (either to reimplement the object behaviour, or to just be notified on when its methods are called). /* This MockHorse is the object created by Deride * | * | * \|/ * V */ using Mock = Animals::MockHorse; std::list<std::string> horseNames = { "Tom", "Dick", "Harry", }; /* We could use a vector, but let's be explicit */ Mock *mockTom; Mock *mockDick; Mock *mockHarry; int createdHorses = 0; // onConstructorCalled() is created by Deride and called when the mocked // Horse object is created Animals::MockHorse::onConstructorCalled([&](const std::string &name) { std::cout << "Horse instantiated: " << name << std::endl; createdHorses++; if (name == "Tom") { mockTom = Mock::latestInstance(); } else if (name == "Dick") { mockDick = Mock::latestInstance(); } else if (name == "Harry") { mockHarry = Mock::latestInstance(); } else { assert(false); // should not be reached } }); Stable stable; stable.createHorses(horseNames); /* It's at this point that the contructor callbacks we defined above will * have been called. Let's double-check that indeed that's the case. */ assert(createdHorses == 3); assert(stable.count() == 3); assert(mockTom != nullptr); assert(mockDick != nullptr); assert(mockHarry != nullptr); /* Prepare for mocking the jump; these methods are generated by Deride and * allow setting the return value for the corresponding jumpHeight() method * from the original Horse class. */ mockTom->setJumpHeightResult(1.5); mockDick->setJumpHeightResult(1.7); mockHarry->setJumpHeightResult(1.3); std::string highestJumper = stable.findHighestJumper(); assert(highestJumper == "Dick"); In my closing words I'd like to thank the Clang project, which Deride is using to parse and interpret the input files, and Jinja2, the templating engine used to generate the mock code.0 0 [Less]