Today I had my second and last day of an Angular2 training. Originally a 3-day training cramped into 2 long days. And it was worth it. The course was aimed at “no Angular2 knowledge” but most of us already sniffed it, tried it, used it, so the pace was high. At the end of today, we had a very competitive quiz via Kahoot, which adds a lot of fun to testing your knowledge. Thanks Peter Kassenaar for a top-notch training.
I’m using node.js on Windows. Not ideal, I know. Installing node modules globally means something else than you might expect. Globally means “not in the project folder”. It does not mean “for all users on this computer”, like you’re used to when installing applications.
Node itself is installed in the “Program Files” folder by default. To enable a Windows-like “global” install, try using:
npm config set prefix "%ProgramFiles%\nodejs"
That way the “–global” directive will install the module in the node folder itself, making it available globally in the node way of thinking and in the Windows way of thinking.
Of course, if you didn’t install node.js in the default folder, just replace the “%ProgramFiles%\nodejs” with yours.
If for some reason you want things back to what it was, remove the prefix by issuing the following command:
npm config rm prefix
My colleague needed to use a function in the database in a query, but found that the function was not defined/reachable in his schema. So the solution is to ask for the function to be granted to you, or to create the function in your schema, or…
…use the new WITH enhancement available from Oracle 12c.
Here is a very simple example, that squares a number and returns it. The function is used in the query. How nice :-p
with function s(x in integer) return integer is begin return x*x; end; q as (select 1 n from dual union all select 2 from dual) select q.n,s(q.n) from q /
Gaming is a way to relief stress and not think about daily life. Lately, even gaming can’t keep me interested. But my mind is busy all day long with all kinds of stuff, so yesterday I gave mindmapping a try. A mindmap for what is needed to create a gameserver. A server that keeps track of the users, their progress, serves the game itself to the clients, etc. One thing a gameserver needs is a way to store all that data, so a proper database is needed. So I looked at several candidates and in the process I came across Redis. Maybe not the easiest backend database when you need graphing for social features, but absolutely the perfect toy to keep my mind occupied for some time.
Redis has enough client APIs, like most databases. Let’s see if we can use the C#/.Net API from within Unity. Touch/collect this item and increase a value in the Redis database: the XP of the user playing the game.
I will probably create nothing for real, but it’s nice to be not bored for some time.
The game looks simple, but it’s not. As I mentioned before, it is only as good as the code you put into it. You can spawn creeps with certain properties, so they can harvest, or attack, or heal. But unless you run a “program” that actually uses these properties, the creep is not going to do a thing and will die without being of any use to you.
You will make mistakes. And I don’t mean mistakes in your code, since the code will only run (of course) when it’s syntactically correct. No, I mean mistakes about how to play the game. A stupidly placed spawnpoint. Choosing a room full of swamp. Forgetting that other creeps will attack you, and you didn’t think of defending your base. Creeps will die (of old age), and you forgot to respawn them. That kind of mistakes. And with each mistake you solve, your code gets better. And meanwhile……you get better at coding!
The WordPress plugin Broken Links Detector reported over 900 links on my blog that have some sort of problem. Meaning an URL can’t be reached or even the linked server doesn’t exist anymore. I started blogging about 12 years ago. Websites come and go, domain names change, blogs are moved to different locations. The internet changes constantly.
My server was dead. Not even a little blink from one of the many LEDs in the system or some other sign of life when putting the power on it. So I figured that replacing parts would be like a puzzle. Is it the power supply? The motherboard? The CPU? Or a combination of any of the parts? Replacing one of them would easily cost me about 100 euro. So I did some math, and figured that hosting was not only a relatively cheap solution, it also has many advantages (that all of you IT people can list better than me).
I went with DirectNIC, since I have been using their services for over 15 years now.
And as you can see, it just works. I had to do some work to restore the WordPress database, since the last backup I had on my NAS disks was from the end of 2015. But with some diskswapping, file copying, MySql-dumping+importing and WP-CONFIG changing it now works.
I was looking for icons to use in MenuItems in a WPF menu and found that there are a lot of questions on how to do that. It’s not very difficult, so maybe the documentation is not too clear about it.
Create a folder in your project, for example “res” or “resources” or “images”. Put some graphics files in there by right-clicking on the folder, choosing Add and then choosing Add existing items.
To use these images in your XAML, follow this example:
<MenuItem Header="E_xit" Click="btnCancel_Click"> <MenuItem.Icon> <Image Source="Resources/Exit.png" Width="20" /> </MenuItem.Icon> </MenuItem>
In my project, the images are in the Resources folder. And that’s all there is to it.
Happy new year, people. It’s 2016 now. Make it a successful, loving, caring, and meaningful one.