developmenthttps://dev.my-gate.net
Everything on C++, SFML & MoreSat, 06 Oct 2018 18:55:58 +0000en-UShourly1https://wordpress.org/?v=4.9.8https://dev.my-gate.net/wp-content/uploads/2018/01/avatar500-150x150.pngdevelopmenthttps://dev.my-gate.net
3232Your Windows is a Hypervisorhttps://dev.my-gate.net/2018/08/17/your-windows-is-a-hypervisor/
https://dev.my-gate.net/2018/08/17/your-windows-is-a-hypervisor/#respondFri, 17 Aug 2018 06:06:59 +0000https://dev.my-gate.net/?p=964]]>For the longest time I’ve either picked VirtualBox or less often VMware whenever I needed a virtual machine. Only a few months ago I learned at work that Windows 10 comes with its own Hypervisor called Hyper-V. Usually you have to enable Hyper-V, but then it’s really easy to use.

As a bonus note, if you have Docker installed, you may see it running a Linux VM in Hyper-V.

]]>https://dev.my-gate.net/2018/08/17/your-windows-is-a-hypervisor/feed/0Fetch GitHub Pull Requests Locallyhttps://dev.my-gate.net/2018/08/14/fetch-github-pull-requests-locally/
https://dev.my-gate.net/2018/08/14/fetch-github-pull-requests-locally/#respondTue, 14 Aug 2018 19:13:50 +0000https://dev.my-gate.net/?p=961]]>It’s by no means a secret thing and Google will be the first to tell you, but by the off chance that someone hasn’t thought about it, here’s just the command how to do it.

git fetch origin pull/<id>/head:<branch>

<id> refers to the pull request id on GitHub<branch> refers to a custom branch name of your choosingNote: You can’t push back changes, but you can push them to your repository and create a new pull request.

Since we’re merging pull requests manually at SFML, it’s a command I’m using very frequently.

]]>https://dev.my-gate.net/2018/08/14/fetch-github-pull-requests-locally/feed/0Visual Studio Tip: Save Layoutshttps://dev.my-gate.net/2018/08/06/visual-studio-tip-save-layouts/
https://dev.my-gate.net/2018/08/06/visual-studio-tip-save-layouts/#respondMon, 06 Aug 2018 15:12:01 +0000https://dev.my-gate.net/?p=955]]>When working a lot with Visual Studio, you’ll run into the issue of managing your windows properly. You may spend quite some time figuring out the perfect layout, only to have Visual Studio randomly move a window around again, when you have to restart Visual Studio. Or you keep rearranging your windows depending on what you’re currently working on. Either way, you spend too much time fighting the IDE, instead of getting work done.

The other day I ran into a mention of being able to save window layouts, demonstrated also in this Channel 9 video among other useful tips and one of the first things at work today, was to seek and try out said feature.

It’s as easy as:

Setup your windows

Navigate to Windows > Save Layouts

Give your layout a name

You can now reset to that layout at anytime by pressing Ctrl + Alt + [Num]

Hope this tip could save your time as well.

]]>https://dev.my-gate.net/2018/08/06/visual-studio-tip-save-layouts/feed/0Kirby CMS & Pluginshttps://dev.my-gate.net/2018/07/26/kirby-cms-plugins/
https://dev.my-gate.net/2018/07/26/kirby-cms-plugins/#respondThu, 26 Jul 2018 06:39:57 +0000https://dev.my-gate.net/?p=908]]>For many years I’ve been playing around with various PHP-based content management systems (CMS). From self-made to well-known ones like Drupal, I’ve seen quite a range and yet they all never really could provide enough flexibility for the developer and easy of use for the website maintainer at the same time. I don’t want to go into much details here, but the goal should simply be, that as a developer you want to create a site and as a website maintainer you want to edit all parts of the websites without developer involvement. Getting to that goal while not having to invest huge amounts of time into learning all ins and outs of a CMS is hard to reach.

Customize

I got the chance to work on a project that introduced me to Kirby CMS. At first, it looked nearly to simplistic, but once I spent some more time with the setup and checked the very good documentation, I started to see that this might just fit the bill of being very customizable and yet easy to use for a maintainer. What stands out to me the most is that you write simple YAML files, which define the administration form layout. As such, with very few lines of code you can create powerful, custom-made administration panels and then with a simple HTML/PHP mixed template you can very easily pull in the various fields into the final site. The customer question of “can we have field X on the website that I can edit” will become a 5min job instead spending hours adjusting custom plugins or learning how to write “content blocks” and then having to teach the customer how to edit these content blocks.

Left: Simple YAML – Right: Automatically generated admin form

Maintenance Cost

Back in the days I probably would have ignored Kirby for the sole reason that you have to get a license even for personal use. Having seen many abandoned or barely maintained open source project, I think it makes a lot more sense to invest a fair fee into a project, but in return get an actively maintained project. And who says commercial products can’t also be open source? Because you can find everything Kirby on GitHub.

Extend

But what’s the point of a CMS without a good (third-party) plugin system? This is where Kirby impresses me again with the sheer amount of different plugins. It may not be as well organized as with other CMS communities, but with a bit of searching, you’ll most likely find a plugin for whatever you want to achieve. Here’s a non-exhaustive list of plugins, I find useful or interesting.

Future

I really like it and have moved multiple sites to Kirby with little to no effort, while giving me the flexibility to extend at a much faster rate. If you’re looking for a CMS, then I definitely recommend you evaluate Kirby CMS and see if it may fit your use-case. And behind the scene the developers of Kirby aren’t sleeping, but they’re actively working on Kirby 3 which again will bring a lot of useful new things and a core built on top of PHP 7.

]]>https://dev.my-gate.net/2018/07/26/kirby-cms-plugins/feed/0Top 5 Podcast I Listen Tohttps://dev.my-gate.net/2018/06/03/top-5-podcasts-i-listen-to/
https://dev.my-gate.net/2018/06/03/top-5-podcasts-i-listen-to/#respondSun, 03 Jun 2018 10:30:30 +0000https://dev.my-gate.net/?p=890]]>It’s interesting how things develop. I remember quite well how my brother used to download and listen to interesting podcasts 10 or so years ago, yet it felt like podcasts lost on popularity over the past years and only now is again gaining some major uplift. There are many YouTubers out there who noticed the medium and given its potential with ad placements, it has turn out to be more profitable that just creating YouTube videos.

It’s no surprise then that mainly two YouTubers brought me to discover and listen to podcasts myself.

Hello Internet

Hello Internet can best be described as a “Two Dudes Talking” podcast. It’s purely entertainment and only builds on top of the two peoples personality: CGP Grey and Brady Haren.

If you’ve watched some science videos on YouTube chances are, that Brady Haren was involved. Okay maybe I’m selling this a bit too much, there are a lot of other edutainment YouTubers, but Brady is interviewer, editor and producer behind 12 different YouTube channels, most famous among them Numberphile and Computerphile. CGP Grey on the other hand, you may know from his viral edutainment videos, with animated stick figures and one guy talking really fast while explaining things.

I really enjoy listening to each episode and having been there from the start, I understand most of the in-jokes connected to previous episodes. This podcast is really best listen to inorder as pretty much all episodes have some references to previous episodes.

Cortex

Not surprisingly falling into a similar category as Hello Internet, but this time with a bit focus on productivity and things needed to run a business. Cortex‘s host is again CGP Grey, but this time with Myke Hurley.

Myke has founded the podcast company Relay FM not too long ago and being a podcast company, he’s part of quite a few podcasts. As additional creative outlet he has started a YouTube channel, but currently the project is on hold.

I find the podcast quite enjoyable because CGP Grey has an interesting personality; sometimes a bit awkward, but often also relatable. While it took me a while to get used to Myke’s fanboyism, he is quite a good interviewer and brings a lot of energy to the conversation. I enjoy listening to them discussing methods to run their business, productivity tips and every so often random thoughts on games or the tech world.

No Dumb Questions

And again no surprise, another pair of YouTubers turned podcasters with No Dumb Questions. Destine runs a channel called SmarterEveryDay, where he does all sorts of sciencey things, most of the time by make use of his high-speed camera. He’s also literally a rocket scientist at NASA and as such has a imense passion for science and attention to detail, yet he always seems to find something new and exciting. Matt on the other hand is a pastor with deep interest in humanitarian things, as well as history, while generally being a skeptical person.

Both hosts are believers, yet the two views of science and humanitarian brings forth a lot of very interesting discussions. Definitely recommend checking out this podcast, it’s currently probably my favorite one! Plus it feels a lot more alive than other podcasts, as they don’t stick to a specific format, but one time they may discuss a book, the next episode they might meetup and check something out together or just nerd over some topic either or both of them got excited about.

Writing Excuses

For a change we get away from YouTubers and away from the Two-Dudes-talking genre. Writing Excuses is a weekly 15-30min long podcast featuring various writers discussing different writing techniques.

While I’m not a writer myself, I do enjoy the podcast quite a bit. It gives a look into another field that I find fascinating and it does make you think differently about books you read. And who knows, maybe it will one day become useful, if I ever try to write some story for a game or so…

CppCast

“The only C++ podcast, from C++ developers to C++ developers” is the tag line of CppCast and so far I haven’t seen any other C++ podcasts. Jason Turner and Rob Irving always bring on interesting guests from a wide selection of different fields and nicely mix in industry news as well as user feedback.

If you’re a C++ developer I highly recommend to listen to this podcast. Not only might you just learn about a new library or some new development tool, but it also gives you a sense of the active C++ online community.

Let me know what your favorite podcasts are, maybe there’s one I could pick up as well!

]]>https://dev.my-gate.net/2018/06/03/top-5-podcasts-i-listen-to/feed/0Generate a DEF file from a DLLhttps://dev.my-gate.net/2018/06/02/generate-a-def-file-from-a-dll/
https://dev.my-gate.net/2018/06/02/generate-a-def-file-from-a-dll/#respondSat, 02 Jun 2018 09:48:10 +0000https://dev.my-gate.net/?p=918]]>Last night I spend multiple hours trying to get a non-broken CSFML build ready, which requires to have import libraries for MSVC and GCC that both depend on the same DLL. This works because the import library only points to the symbols that are in the DLL, thus acts as sort of instruction how to use the DLL.

Now in the past, I’ve been using an ancient tool called LIB2A which was written in Visual Basic and you can find it on some archived Google Code site. The tool still works, but as was pointed out quite a while ago on the SFML forum, the generated DEF files do not contain “typedef-ed” types, such as specific blend modes or specific colors. For CSFML this would mean that if you used the GCC import library, you would be able to use sfBlue or sfBlendNone despite the DLL having these symbols.

So the broken step was generating a DEF file from a LIB or DLL file. Unfortunately the internet wasn’t very helpful for once and I kept running into weird solutions that didn’t work or tools (e.g. EXPDEF) that were only supporting x86 architecture, I even tried some commercial tool from RAD Studio (MKEXP), but that didn’t work either. I tried different versions of the reimp.exe which is part of MinGW-Utils, but it turns out that was last updated in 2009 (!) and the latest version doesn’t even work.

Only after multiple hours of searching I finally stumbled up on the mentioning of gendef.exe which is shipped with MinGW-w64 distributions and oh look, it’s sole purpose is to generate DEF files from DLLs. With gendef and dlltool, both part of any MinGW-w64 distribution, you can now quite easily generate GCC import libraries from any DLL.

gendef generates a DEF file in the working directory and dlltool generates a GCC A import library.

I’m mainly putting this information out here, in hopes Google will pick it up and people looking for similar solutions won’t have to spend the same amount of time finding gendef.

]]>https://dev.my-gate.net/2018/06/02/generate-a-def-file-from-a-dll/feed/0When fitness tracking reveal baseshttps://dev.my-gate.net/2018/01/29/when-fitness-tracking-reveal-bases/
https://dev.my-gate.net/2018/01/29/when-fitness-tracking-reveal-bases/#respondMon, 29 Jan 2018 08:42:37 +0000https://dev.my-gate.net/?p=895]]>The other day I stumbled up on a thread in my Twitter feed, where people have located army bases based on fitness tracking heat maps released by Strava. Here’s an example of what the data looks like: Drone base in Djibouti

Soldiers running around the perimeter or just a simple patrol?

Nice drones!

While the base apparently isn’t secret or unknown, it’s still quite a bit problematic when such data is leaked to everyone and who knows if you can find secret bases if you search long enough!

On the other hand, the data is pretty neat and made me randomly browse some places on Earth and incidentally realize again how big Earth really is!

Update: Turns out this is part of the Union Glacier Camp. While Google maps doesn’t show anything (except maybe this satellite image), on Open Street Map you can actually see the name and there seems to even be an airport. Thanks to Tank for providing the hint!

Or then there are other pictures that look quite amazing with the coloring and the random traffic on shore.

Out of interest I took a look at North Korea and to my surprise they actually have some tracking data from there too. My guess would be that this data is from tourists visiting North Korea, especially since most traffic is around the big stadiums which I’ve read is where visitors are often given a show. I was also surprised to see that Google maps knew quite a few places in North Korea and even some train stations are marked. At the same time you’ll also find concentration camps marked, which is very sad that this is still a thing.

Obviously I don’t speak or read Korean, so I didn’t know what it meant, but it got me very curious. I took the image to Twitter and Reddit, within minutes I got a response back from someone and then over the night two more similar translations came in.

Dedicate your heart to the motherland Korea.

Where dedicate can apparently also be translated as offer up/sacrifice.

Crazy discoveries!

]]>https://dev.my-gate.net/2018/01/29/when-fitness-tracking-reveal-bases/feed/0Rule of Thumb – Linking Orderhttps://dev.my-gate.net/2018/01/10/rule-of-thumb-linking-order/
https://dev.my-gate.net/2018/01/10/rule-of-thumb-linking-order/#respondTue, 09 Jan 2018 22:00:48 +0000https://dev.my-gate.net/?p=879]]>Those newer to programming in C++ often fail to understand that compilers like GCC or Clang require a specific link order for the libraries in use or they don’t know what order to pick. Working on SFML and helping out in its community, I’ve had the pleasure to help people fix their linker errors many times and every now and then I’d explain a short rule of thumb one can keep in mind when specifying libraries to be linked. As such I wanted to share it here with you too.

If library X depends on library Y, then X must come before Y.

It’s quite simple and can help immensely in figuring out the required order. For an example let’s take SFML:

SFML has five modules: system, audio, graphics, window and network. All modules depend on the system module, which means the system module needs to be at the end of list. Additionally the graphics module depends on the window module – how else would you draw something when there’s no window? As such, you’ll end up with a list similar to this: audio, network, graphics, window and system. It’s however not important where you place the audio or network module as long as it’s before the system module.

I hope this will help someone! As for SFML, if you try to link statically, don’t forget to link SFML’s dependencies too!

]]>https://dev.my-gate.net/2018/01/10/rule-of-thumb-linking-order/feed/0Blocking Ads in Skype and Viberhttps://dev.my-gate.net/2018/01/05/blocking-ads-in-skype-and-viber/
https://dev.my-gate.net/2018/01/05/blocking-ads-in-skype-and-viber/#respondFri, 05 Jan 2018 19:09:21 +0000https://dev.my-gate.net/?p=873]]>I’m not a fan of advertisement, be it on a website or in some application. For websites, we have quite a few options by now – I currently use uBlock Origin. But when companies include ads in an application itself, the options to block it, get a bit more complicated.

I’m still one of those people that end up using Skype on a near daily basis and for our family chats we tend to use Viber, mostly because it offers a nice desktop client and I guess because of the stickers… Both of those applications show ads from time to time within their clients. The easiest trick to block said ads, is to simply deny the loading of the advertisment. This can be done with making the domain name not resolve properly.

Start Notepad as administrator

Open the hosts file: %SystemRoot%\System32\drivers\etc\hosts

Add the follow line and save it

0.0.0.0 ads.viber.com
0.0.0.0 rad.msn.com
0.0.0.0 apps.skype.com

These two tips and various other things, can be found on my website on the Power User page.

]]>https://dev.my-gate.net/2018/01/05/blocking-ads-in-skype-and-viber/feed/0Theme Updatehttps://dev.my-gate.net/2018/01/05/theme-update/
https://dev.my-gate.net/2018/01/05/theme-update/#respondFri, 05 Jan 2018 13:50:10 +0000https://dev.my-gate.net/?p=831]]>Every now and then I decide to update my blog’s theme. It’s not that there was anything really wrong with the old theme, but I just like the change from time to time.

I think it’s the first time however that the blog is running a bright/white theme instead of the dark one. While I do like dark themes, the ones I’ve used in the past always made it feel like the theme itself is blending too much with the content. Maybe increasing the font color and adjusting some styling would have helped, but in some strange way, brighter themes also seem a bit more professional or more mature. I’m not trying to make this blog anything special, I just want to try something new.