<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Altinet &#187; Uncategorized</title>
	<atom:link href="https://www.altinet.hr/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.altinet.hr</link>
	<description></description>
	<lastBuildDate>Sat, 08 Apr 2017 09:28:02 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.0.15</generator>
	<item>
		<title>Angular vs React: round 2</title>
		<link>https://www.altinet.hr/angular-vs-react-round-2/</link>
		<comments>https://www.altinet.hr/angular-vs-react-round-2/#comments</comments>
		<pubDate>Sun, 18 Sep 2016 12:14:13 +0000</pubDate>
		<dc:creator><![CDATA[Bruno Samardzic]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.altinet.hr/?p=920</guid>
		<description><![CDATA[As you&#8217;ve probably know by know, Angular 2 is out, and that got me interested in what they came up with in these 2+ years, and additionally, how much did they screw up. The talk around Angular 2 was pretty controversial during its development, and it left a lot of people hanging because of all [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>As you&#8217;ve probably know by know, Angular 2 is out, and that got me interested in what they came up with in these 2+ years, and additionally, how much did they screw up.<br />
The talk around Angular 2 was pretty controversial during its development, and it left a lot of people hanging because of all these clear cuts made in relation to Angular 1. </p>
<p>Meantime, there was this new kid on the block which was generating a lot of noise and doing some revolutionary things, especially in terms of performance and ease of development called React.</p>
<p>I was firmly in the React camp for the last year or so, and I knew it was the future. But what kept React back for me and probably most of the developers was all these unanswered questions: which build process to use, what data managing library, managing state, even which language to use (ES5, ES6, Typescript, Flow). There was also this story around mobile development which didn&#8217;t have the right answer: you could go React Native, which is great, but that&#8217;s a huge buy-in which doesn&#8217;t always really work-out for small and micro agencies and enterprise apps; Ionic is still king-of-the-hill when it comes to these types of apps, and React just doesn&#8217;t have a clear answer which goes well with Cordova.</p>
<p>But i feel that, after looking at some videos and trying out some code, Angular has exactly the right bases covered and it&#8217;s ready to put up a good fight for king of front-end hill.</p>
<p>I wrote a &#8220;vs&#8221; in the title, but it probably should state &#8220;inherits&#8221;. Angular2 is basically React, it inherits pretty much all of its best features (component tree, virtual dom, clear inputs and outputs) and builds upon it. Angular 2 adds all the infrastructure needed for building a complete web app (from data fetching to routers), with all the decisions premade, and it does so by using the most cutting edge language (TypeScript) and event management system (RxJs), and all the other batteries included. I&#8217;m so happy to see the adoption of these 2 technologies as a base for Angular, as both of these have been a favorite of  mine for some time already. RxJs has a long history, I&#8217;ve used it even before it had a Javascript version, and it&#8217;s been one of the best secret weapons in any developer&#8217;s arsenal. Typescript was one of my biggest gripes against React, because although you could use Typescript with React, it was not a default choice. Even the very popular create-react-app CLI is not using it and it doesn&#8217;t plan to do it in the near future. </p>
<p>Even the inline templating (which a lot of people complain about) does have its merits, because it&#8217;s a place where some brilliant folks from angular enabled a thing called Template Transform, which effectively enables you to have your own DSL for showing and fetching data, and creating your own nicer and shorter syntax.</p>
<p>The state management has also been blatantly copied from React, and then supercharged. Some smart folks took the Redux patterns and then they combined them with RxJs to create something that Redux should&#8217;ve been from the start.</p>
<p>As for the ecosystem, although React&#8217;s gain in popularity was stellar, the big component producers have been suspiciously quiet on the front of native React components. They did make some wrappers, and some new component producers emerged, but &#8220;Kendo and co&#8221; didn&#8217;t give out much else than that. Angular 2 already has native controls BEFORE the initial release! Enthusiasm is huge, and plenty of 3rd party library developers are rallying behind it. Ionic 2 is also just around the corner if you want to build power efficient, mobile hybrid apps. And if you&#8217;re big on Native, there&#8217;s this thing called NativeScript which sports native Angular 2 support. Angular 2 was built with mobile in mind from the start, so we are very excited to give it a spin on our next project. Stay tuned for some demo apps and proof-of-concepts from us, but in the meanwhile, take a look at following videos to wet your appetite:</p>
<p><iframe width="900" height="506" src="https://www.youtube.com/embed/IlawbLXJvxQ?feature=oembed" frameborder="0" allowfullscreen></iframe><br />
<iframe width="900" height="506" src="https://www.youtube.com/embed/mhA7zZ23Odw?feature=oembed" frameborder="0" allowfullscreen></iframe><br />
<iframe width="900" height="506" src="https://www.youtube.com/embed/bVI5gGTEQ_U?feature=oembed" frameborder="0" allowfullscreen></iframe></p>
]]></content:encoded>
			<wfw:commentRss>https://www.altinet.hr/angular-vs-react-round-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Why programming is hard</title>
		<link>https://www.altinet.hr/why-programming-is-hard/</link>
		<comments>https://www.altinet.hr/why-programming-is-hard/#comments</comments>
		<pubDate>Sat, 28 May 2016 16:21:28 +0000</pubDate>
		<dc:creator><![CDATA[Bruno Samardzic]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.altinet.hr/?p=917</guid>
		<description><![CDATA[True development, the right kind of development, comes down to having a debate with yourself about every line of code that you write. The choices are so rarely clear cut because of several different factors: the legacy, the current state of art, the communicated needs, the actual needs and the future potential needs. Lots of [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>True development, the right kind of development, comes down to having a debate with yourself about every line of code that you write. The choices are so rarely clear cut because of several different factors: the legacy, the current state of art, the communicated needs, the actual needs and the future potential needs. Lots of these factors are not specific to IT, but the churn, the dynamics, the pace are. Making a line of code is making a claim that can stand the test of argument. A good programmer will try and make a counterargument, have a debate with himself, attacking the claim from different angles. Simplicity and clear intentions are of utmost importance. And that&#8217;s why mantra &#8220;keep things simple&#8221; is deceiving: Doing things simple is the hardest. But when you nail it, the rewards are exponential, and so is the punishment if you don&#8217;t.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.altinet.hr/why-programming-is-hard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Orchard Workflows, undocumented gem</title>
		<link>https://www.altinet.hr/orchard-workflows-undocumented-gem/</link>
		<comments>https://www.altinet.hr/orchard-workflows-undocumented-gem/#comments</comments>
		<pubDate>Mon, 21 Mar 2016 17:07:35 +0000</pubDate>
		<dc:creator><![CDATA[Bruno Samardzic]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.altinet.hr/?p=912</guid>
		<description><![CDATA[I wanted to do a quick post about a feature in orchard which is extremely powerful, yet pretty badly documented, and that is Orchard workflows. The basic problem we had is how to sort a query by a taxonomy term. Orchard doesn&#8217;t provide that out of the box because the one taxonomy field can have [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I wanted to do a quick post about a feature in orchard which is extremely powerful, yet pretty badly documented, and that is Orchard workflows.</p>
<p>The basic problem we had is how to sort a query by a taxonomy term. Orchard doesn&#8217;t provide that out of the box because the one taxonomy field can have multiple values even though you can set a single value limit.</p>
<p>The workaround i thought of is creating a read-only field which would get updated on save. For that i planned to use the Orchard workflows.</p>
<p>There are a few nice-to-haves i&#8217;d like orchard to enable in future:<br />
1. Enable hidden fields<br />
2. Enable read-only fields<br />
3. Better documentation on workflow objects!!!</p>
<p>Current examples are pretty much a joke, especially for a feature this powerful!<br />
Ok, so how can you update a field on content save? Simple!</p>
<p>You need to create a workflow like this:<br />
<a href="http://www.altinet.hr/wp-content/uploads/2016/03/Capture.png"><img src="http://www.altinet.hr/wp-content/uploads/2016/03/Capture.png" alt="Capture" width="1172" height="609" class="alignnone size-full wp-image-913" /></a></p>
<p>The elements are &#8220;Content Updated&#8221; and &#8220;Decision&#8221;. Make sure to set &#8220;Content Updated&#8221; as start element.<br />
Now, the biggest trick is in the decision element; this is a screenshot from the edit of the element:<br />
<a href="http://www.altinet.hr/wp-content/uploads/2016/03/Capture1.png"><img src="http://www.altinet.hr/wp-content/uploads/2016/03/Capture1.png" alt="Capture" width="431" height="540" class="alignnone size-full wp-image-914" /></a></p>
<p>Or here&#8217;s the code:</p>
<pre class="brush: csharp; title: ; notranslate">
var ct=ContentItem.City;    
string state= &quot;N/A&quot;;
if(ct.State.Terms.Count&gt;0)
      state= ct.State.Terms[0].ContentItem.TitlePart.Title;

gd.StateName.Value = state;
SetOutcome(&quot;Done&quot;);
</pre>
<p>The most beatiful thing about this code is that IT&#8217;S JUST C#! And it works!<br />
There are a number of different syntactic things that are used when you are mixing up code with markup, but this part is as straightforward as it can get and it works perfectly.</p>
<p>Hope it helps!<br />
Bruno</p>
]]></content:encoded>
			<wfw:commentRss>https://www.altinet.hr/orchard-workflows-undocumented-gem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The React Redux</title>
		<link>https://www.altinet.hr/the-react-redux/</link>
		<comments>https://www.altinet.hr/the-react-redux/#comments</comments>
		<pubDate>Sun, 06 Sep 2015 22:20:28 +0000</pubDate>
		<dc:creator><![CDATA[Bruno Samardzic]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.altinet.hr/?p=908</guid>
		<description><![CDATA[It’s funny how things that make you cringe and yell at your screen at first, can also make you fall in love into them. I guess good ideas are pretty much like women. When I go back and think about the first time I saw React, it was pretty much like that: Inline html with [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>It’s funny how things that make you cringe and yell at your screen at first, can also make you fall in love into them. I guess good ideas are pretty much like women<img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none; border-left-style: none; border-bottom-style: none; border-right-style: none" alt="Smile" src="http://www.altinet.hr/wp-content/uploads/2015/09/wlEmoticon-smile.png">. When I go back and think about the first time I saw React, it was pretty much like that: Inline html with js? Are you kidding me?! Why would I go through the trouble?! Virtual DOM, properties, states? How is that stuff supposed to make development simpler?! What the hell is wrong with this world?! But then, that hunch of brilliance would just keep nagging you to further explore these crazy ideas and why they just might work. And the end result is that you not only learn to appreciate the tech, you start loving it. </p>
<p>Now, the one problem with React that people were trying to solve since they learned to love it is: now what? How do we connect it with our data and handle it with minimal boilerplate? I was skeptical about Flux from day one but see that’s the difference: I hated React when I saw it, but I was just kinda skeptical about Flux. It’s much harder to grow out of skepticism into a romance. You can have a sort of a steady relationship with no frills with that kind of start, but nothing close to real romance. There were too many questions lingering (how many stores, how do I organize and track them? Why so much code to connect them? Do I store anything on a component or not, what about change tracking? etc…) and you were pretty much left on your own to answer them. If you searched for an explanation or best practices, the general answer would be “it depends”. And I must admit, the whole ambiguity about “The right way”TM also cooled down my love for React. </p>
<p>A few days ago I ran into what seem to me as just-another-flux-also-ran called Redux. But after reading about it, I actually hated it. It seemed to simple and dumbed down, and introduced ideas like single state storage. This post started 2 weeks ago as a rant about sorry state of Flux and especially about Redux as a extremely stupid solution for the problem. But the same thing that happened with React, happened with Redux. The ideas clicked and love was born<img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none; border-left-style: none; border-bottom-style: none; border-right-style: none" alt="Smile" src="http://www.altinet.hr/wp-content/uploads/2015/09/wlEmoticon-smile.png">. Now there are a lot of good articles and videos about Redux, so I won’t go into explaining the details. It’s actually pretty simple pub-sub system but scalable. The boilerplate is minimized but flexibility is still there, and it delivers on one thing I had trouble with other Flux solutions: simple implementation of single source of truth (without huge amount of hooks and boilerplate). It’s so good that even some developers of competing solutions <a href="http://martyjs.org/blog/2015/08/02/marty-last.html">stopped developing their own and switched</a>. It’s also under development at break-neck speed (it changed from v1 to v2 in 2 weeks) and the support and documentation is awesome. It still needs some questions answered and stuff tweaked but I expect it to become a de-facto standard for development of React application. Check out Dan Abramov’s video about Redux:</p>
<p><a title="https://www.youtube.com/watch?v=xsSnOQynTHs" href="https://www.youtube.com/watch?v=xsSnOQynTHs">https://www.youtube.com/watch?v=xsSnOQynTHs</a></p>
<p>and the <a href="https://github.com/rackt/react-redux">Redux github</a>.&nbsp; Oh, and as an added plus, check out my sample application built with React and Redux</p>
<p><a title="https://github.com/brunoAltinet/react-redux-example" href="https://github.com/brunoAltinet/react-redux-example">https://github.com/brunoAltinet/react-redux-example</a></p>
<p>&nbsp;</p>
<p>Cheers!</p>
]]></content:encoded>
			<wfw:commentRss>https://www.altinet.hr/the-react-redux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>React.js invoicing CRUD application, part 2: Description</title>
		<link>https://www.altinet.hr/react-crud-application-part-2-description/</link>
		<comments>https://www.altinet.hr/react-crud-application-part-2-description/#comments</comments>
		<pubDate>Mon, 01 Jun 2015 05:25:47 +0000</pubDate>
		<dc:creator><![CDATA[Bruno Samardzic]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.altinet.hr/?p=897</guid>
		<description><![CDATA[&#160; What interested me most about React is how I can use it to solve some basic data input problems. So the application needed to consist of these basic features: 1. Easy form creation 2. Simple, cross-field and custom validation 3. Look-up tables and dropdowns 4. After input calculations (between properties and components) 5. Detail [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>&nbsp;</p>
<p>What interested me most about React is how I can use it to solve some basic data input problems. So the application needed to consist of these basic features:</p>
<p>1. Easy form creation <br />2. Simple, cross-field and custom validation <br />3. Look-up tables and dropdowns <br />4. After input calculations (between properties and components) <br />5. Detail input (invoice items) <br />6. Integration with server-side technologies</p>
<ol>
<li></li>
</ol>
<p>Honestly, I’m pretty frustrated with the current crop of Todo apps. They are completely useless. I think that a basic invoicing app does a much better job of presenting maturity and power of a certain framework, but I guess that would make too many frameworks and tools look ridiculous. To set up a basic invoicing app you need 3 tables: Partners, Invoice and InvoiceDetail. You need 2 forms, of which the invoicing form would be the one that holds most of the complexity. Actually, you could completely toss out the Partner form, and have it only as a look-up table. It’s a simple, yet very comprehensive demo app.</p>
<p>The invoice form contains partner dropdown, total fields for calculating netto, tax, and brutto values. Adding or subtracting invoice items should change calculated totals. Invoice items also contain calculations (multiplying quantity and unit price) that then have to trigger totals calculation. The validation should work on partner field, date and totals.</p>
<p>All of these features have to be easy to implement with minimal boilerplate and highly extensible (convention over configuration).</p>
<p>In the next post I’ll explain some libraries I used to achieve this, and some additions I had to do to make it all work.&nbsp; <br />You can already check out the source code on github, and a demo app (link in the description)</p>
<p><a title="https://github.com/brunoAltinet/ReactAspNetCrudExample" href="https://github.com/brunoAltinet/ReactAspNetCrudExample">https://github.com/brunoAltinet/ReactAspNetCrudExample</a></p>
<p>&nbsp;</p>
<ol>
<li>
<li></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>https://www.altinet.hr/react-crud-application-part-2-description/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Problem with installing Windows on a Hyper-V VM on Hetzner server</title>
		<link>https://www.altinet.hr/problem-with-installing-windows-on-a-hyper-v-vm-on-hetzner-server/</link>
		<comments>https://www.altinet.hr/problem-with-installing-windows-on-a-hyper-v-vm-on-hetzner-server/#comments</comments>
		<pubDate>Tue, 29 Jul 2014 09:46:15 +0000</pubDate>
		<dc:creator><![CDATA[Bruno Samardzic]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.altinet.hr/?p=886</guid>
		<description><![CDATA[I would get this strange error which i couldn&#8217;t Google out every time i would try to install Windows on additional IP: The unattend file Z:\unattend\169.254.69.148.xml was not found! You would probably get a different xml name, corresponding to some other IP, and the installation would abort. The solution is simple. You probably have 2 [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I would get this strange error which i couldn&#8217;t Google out every time i would try to install Windows on additional IP:</p>
<p>The unattend file Z:\unattend\169.254.69.148.xml was not found!</p>
<p>You would probably get a different xml name, corresponding to some other IP, and the installation would abort.<br />
The solution is simple. You probably have 2 network cards defined (i had legacy and a standard network card), so the system is trying to install via regular card instead of the legacy one. Remove the standard card and leave only the legacy one for the installation.<br />
And that&#8217;s it!</p>
]]></content:encoded>
			<wfw:commentRss>https://www.altinet.hr/problem-with-installing-windows-on-a-hyper-v-vm-on-hetzner-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My example of Angularjs directive</title>
		<link>https://www.altinet.hr/my-example-of-angularjs-directive/</link>
		<comments>https://www.altinet.hr/my-example-of-angularjs-directive/#comments</comments>
		<pubDate>Thu, 22 May 2014 18:39:55 +0000</pubDate>
		<dc:creator><![CDATA[Bruno Samardzic]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.altinet.hr/?p=878</guid>
		<description><![CDATA[One of the first things i wanted to do when i saw Angular UI directives like Datepicker is wrap them into my own. If you look at the example of Datepicker on their site, especially the one for datepicker popup with a button, you will notice it is extremely involving and spread all over your [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>One of the first things i wanted to do when i saw <a href="http://angular-ui.github.io/bootstrap/">Angular UI directives</a> like Datepicker is wrap them into my own. If you look at the example of Datepicker on their site, especially the one<br />
for datepicker popup with a button, you will notice it is extremely involving and spread all over your controller. </p>
<pre class="brush: jscript; title: ; notranslate">

var DatepickerDemoCtrl = function ($scope) {
  $scope.today = function() {
    $scope.dt = new Date();
  };
  $scope.today();

  $scope.clear = function () {
    $scope.dt = null;
  };

  // Disable weekend selection
  $scope.disabled = function(date, mode) {
    return ( mode === 'day' &amp;&amp; ( date.getDay() === 0 || date.getDay() === 6 ) );
  };

  $scope.toggleMin = function() {
    $scope.minDate = $scope.minDate ? null : new Date();
  };
  $scope.toggleMin();

  $scope.open = function($event) {
    $event.preventDefault();
    $event.stopPropagation();

    $scope.opened = true;
  };

  $scope.dateOptions = {
    formatYear: 'yy',
    startingDay: 1
  };

  $scope.initDate = new Date('2016-15-20');
  $scope.formats = ['dd-MMMM-yyyy', 'yyyy/MM/dd', 'dd.MM.yyyy', 'shortDate'];
  $scope.format = $scope.formats[0];
};
</pre>
<p>ALL that for just one date picker? Really? You can check out the HTML part on the UIs <a href="http://angular-ui.github.io/bootstrap/">page</a>, but it&#8217;s also pretty large. Granted, you can definitely delete a bunch of these functions and tags like initDate etc, but you still have a lot going on there just to hookup a datepicker with a button. So i decided to wrap those into my own directive and get rid of that code smell, and here&#8217;s what i ended up with:</p>
<pre class="brush: jscript; title: ; notranslate">

(function() {
    'use strict';

    var module = angular.module('altinet.directives', []);

    module.directive('altiDatepicker', [altiDatePicker]);

    function altiDatePicker() {
        var mprefix = 'altidatePicker1234';
        var linkFunc= function(scope, elem, attrs) {
            scope[mprefix+'open'] = function ($event) {
                $event.preventDefault();
                $event.stopPropagation();

                scope[mprefix+'opened'] = true;
            };
        };
        return {
            restrict: 'AE',
            replace: true,
            scope:true,
            compile: function (element, attrs) {
                var html = '&lt;p class=&quot;input-group&quot;&gt;'+
                        '&lt;input type=&quot;text&quot; class=&quot;form-control&quot; datepicker-popup=&quot;dd.MM.yyyy&quot; ng-model=&quot;'+attrs.ngModel+'&quot; is-open=&quot;'+mprefix+'opened&quot; ng-required=&quot;true&quot; date-disabled=&quot;disabled(date, mode)&quot; ng-required=&quot;true&quot; close-text=&quot;Close&quot; /&gt;'
                        +'&lt;span class=&quot;input-group-btn&quot;&gt;'
                        +    '&lt;button type=&quot;button&quot; class=&quot;btn btn-default&quot; ng-click=&quot;'+mprefix+'open($event)&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-calendar&quot;&gt;&lt;/i&gt;&lt;/button&gt;&lt;/span&gt;&lt;/p&gt;';
                var e = angular.element(html);
                element.replaceWith(e);
                return linkFunc;
            }
        }
    }

})();

</pre>
<p>Lets&#8217; go through it step by step:</p>
<p>1. first few lines is about declaring a directive, you can find a lot about that in the docs, but what you have to keep mind is that if you name your directive &#8216;altiDatepicker&#8217;, you will use it with a &#8216;data-alti-datepicker&#8217; tag (see what they did there?).</p>
<p>2. every directive function has to return an object which can contain properties like &#8220;restrict&#8221; (which tells how you use the directive), &#8220;replace&#8221; (does it replace the current code),<br />
&#8220;compile&#8221; (a function which will be executed and where you do all the magic), or &#8220;link&#8221; (a function used for hooking up). </p>
<p>3. Beware, if you already have &#8220;compile&#8221; defined, your &#8220;link&#8221; function WILL NOT BE EXECUTED unless you return it as a RESULT of your compile function (like in my example).</p>
<p>4. The compile function is the critical part, what i basically did there is took the html of a datepicker and of a button, i concatenated attribute value &#8220;ngModel&#8221;, i ran that html string through angular.element(html) function, and than replaced the directive with the resulting code. If you want, you can use the same principal and have some other attributes passed down to your custom datepicker.</p>
<p>5. At the end of the &#8220;compile&#8221; function, I return the linkFunc defined above. The linkFunc defines how i link this directive to scope. I use the linkFunc to add a popup opening function to the scope. Notice that i put a prefix on the functions name, the same way i do it in the html code. Why is that? No reason actually, it can also work without prefix. Actually there is one but i&#8217;ll explain later on.</p>
<p>6. The trickies part? The scope. It is defined scope:false by default, which means the directive uses the parent&#8217;s scope (which means all datepicker directives on the same controller (eg. form or page) share the same properties and methods). I won&#8217;t go deep into scope explanation, but what would happen when you would press any button on any picker, all popups would open.<br />
How did i solve that problem? I defined scope:true. What does that do? It defines that this directive has it&#8217;s own child scope and it&#8217;s own method &#8220;open&#8221; attached to that scope. But since it&#8217;s a child scope, it also has access to all the parent scope&#8217;s properties which are not defined in the child, so i can easily access the model on the parrent scope. But what if I had a property &#8220;open&#8221; and i wanted to access that in directive? That&#8217;s why i have the prefix, i can now have a property &#8220;open&#8221; on the parent scope and still be able to access it. The only property on parent scope i can&#8217;t access is altidatePicker123open, but i doubt i&#8217;m going to use that:). There are other ways of dealing with this problem (like isolated scope) but I honestly couldn&#8217;t bother right now to see how that works. This was quick, dirty and it works:).</p>
<p>7. Finally, my usage of the directive went from:</p>
<pre class="brush: xml; title: ; notranslate">

            &lt;p class=&quot;input-group&quot;&gt;
              &lt;input type=&quot;text&quot; class=&quot;form-control&quot; datepicker-popup=&quot;{{format}}&quot; ng-model=&quot;dt&quot; is-open=&quot;opened&quot; min-date=&quot;minDate&quot; max-date=&quot;'2015-06-22'&quot; datepicker-options=&quot;dateOptions&quot; date-disabled=&quot;disabled(date, mode)&quot; ng-required=&quot;true&quot; close-text=&quot;Close&quot; /&gt;
              &lt;span class=&quot;input-group-btn&quot;&gt;
                &lt;button type=&quot;button&quot; class=&quot;btn btn-default&quot; ng-click=&quot;open($event)&quot;&gt;&lt;i class=&quot;glyphicon glyphicon-calendar&quot;&gt;&lt;/i&gt;&lt;/button&gt;
              &lt;/span&gt;
            &lt;/p&gt;

</pre>
<p>and all that code in the controller (which would multiple with every datepicker used), to&#8230;.</p>
<pre class="brush: xml; title: ; notranslate">

&lt;input type=&quot;text&quot; data-alti-datepicker ng-model=&quot;vm.template.testDate&quot; /&gt;

</pre>
<p>With no extra methods on the controller whatsoever:). Now that is what i call a good encapsulation!</p>
]]></content:encoded>
			<wfw:commentRss>https://www.altinet.hr/my-example-of-angularjs-directive/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Angular and Breeze &#8211; story so far.</title>
		<link>https://www.altinet.hr/angular-js-and-breeze-js-story-so-far/</link>
		<comments>https://www.altinet.hr/angular-js-and-breeze-js-story-so-far/#comments</comments>
		<pubDate>Tue, 20 May 2014 12:16:16 +0000</pubDate>
		<dc:creator><![CDATA[Bruno Samardzic]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.altinet.hr/?p=873</guid>
		<description><![CDATA[As I&#8217;ve already stated in my previous post, i chose Angular as the default JS framework for my future projects. Angular leaves to your choosing the technology for data manipulation, and since i like robust solutions for my data needs, i went with Breeze. John Papa gives probably the best explanation on why Breeze is [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>As I&#8217;ve already stated in my previous post, i chose Angular as the default JS framework for my future projects. Angular leaves to your choosing the technology for data manipulation, and since i like robust solutions for my data needs, i went with Breeze.<br />
John Papa gives probably the best explanation on <a href="http://www.johnpapa.net/spajs04/">why Breeze is so powerful and practical</a></p>
<p>But one thing that really has me excited about breeze is the thing that some people hate about it and that is a &#8220;Metadata()&#8221; endpoint.<br />
What is metadata endpoint?<br />
Metadata endpoint is a service method that a Breeze client application calls to get all the info about entities it has to keep track off, including property names and types, validation, keys, references, object graph etc. The method is called once per app initialization, and the payload can be pretty heavy, but it saves a lot of coding.<br />
The reason i&#8217;m so interested in it is that it lets me share basic entity descriptions and validation between client and server, and what&#8217;s more, it also lets me save my own custom metadata to feed it, which i will definitely use when creating dynamic business entities in my future project. </p>
<p>Theoretically, Breeze should also be a good fit for Angular because of Angular&#8217;s notorious non-scalability when it comes to number of bindings. To keep the app snappy, you have to keep bindings in-check, so huge grids of control-bound data are out of the question. But then you run into a problem of dirty-checking and keeping data up-to-date when having multiple references to same data, and doing lots of manual work which you wanted to avoid by using Angular in the first place. Breeze keeps all those points covered, so i think i can get away with binding angular on just a few key properties and actions, and let Breeze handle the rest.<br />
This is all still IN-THEORY, but i will look into it pretty soon and get back to you with results. Other than that, Breeze is extremely flexible, it can consume literally ANYTHING you throw at it, from OData, Queryable endpoints, pojos, DTOS, from any source which uses HTTP. So you have all the flexiblity in the world to start fast and lean by leveraging tight integration with entity framework, and move gradually to using classic REST endpoints with perhaps MongoDb as persistence.</p>
<p><strong>Quick start</strong><br />
For a quick start with Angular and Breeze I warmly recommend Hot towel Angular Breeze nuget package. It&#8217;s a pretty neat layout for an SPA.<br />
After installing i made a few modifications:<br />
1. Instead of firing up SPA by calling index.html, i moved most of the logic to Index.cshtml</p>
<p>2. For my own needs, I moved top navigation bar to ASP.NET view (server-side) because i plan on having lots of smaller SPAs instead of one big one, and i will show links to those in my top bar.</p>
<p>3. For every SPA, you have to reference ALL the the .js files you plan to use in your index.html. That&#8217;s my conclusion so far but there&#8217;s probably some more elegant solution somewhere. </p>
<p>4. One HUGE pain in the neck i had is that I would get 500 errors from server with a completely blank page, just the header. Debuging didn&#8217;t help because all breakopioints would get hit, and no error i could see was thrown. On thing that finally helped me was IntelliTrace, a feature that i would regularly turn off in previous versions of Visual Studio. It showed that my server was throwing  &#8220;Entry point was not found.&#8221; error on Newtonsoft.Json assembly. I previously had to update Json.NET while setting up my environment so i suspected that could cause problems.<br />
It turns out that regardless of having a newer version of Json.NET packaged in the solution, some assemblies would target the older one stored in GAC, and then you would get a version mismatch.  A good explanation of the problem can be found <a href="http://blog.jongallant.com/2012/08/entry-point-was-not-found.html#.U3s_ZfmSxvA">here</a>. The solution of the problem is pretty simple, you have to update your Web.Config where you define which Json.NET minimum version to use:</p>
<pre class="brush: xml; title: ; notranslate">
      &lt;dependentAssembly&gt;
        &lt;assemblyIdentity name=&quot;Newtonsoft.Json&quot; publicKeyToken=&quot;30ad4fe6b2a6aeed&quot; culture=&quot;neutral&quot; /&gt;
        &lt;bindingRedirect oldVersion=&quot;0.0.0.0-4.5.0.0&quot; newVersion=&quot;4.5.0.0&quot; /&gt;
      &lt;/dependentAssembly&gt;
</pre>
<p>to&#8230;</p>
<pre class="brush: xml; title: ; notranslate">
      &lt;dependentAssembly&gt;
        &lt;assemblyIdentity name=&quot;Newtonsoft.Json&quot; publicKeyToken=&quot;30ad4fe6b2a6aeed&quot; culture=&quot;neutral&quot; /&gt;
        &lt;bindingRedirect oldVersion=&quot;0.0.0.0-6.0.0.0&quot; newVersion=&quot;6.0.0.0&quot; /&gt;
      &lt;/dependentAssembly&gt;
</pre>
<p>5. Breeze is not hooked up by default in this template, you have to modify a few files. First you have to modify datacontext.js and include entityManagerFactory. Something like this&#8230;</p>
<pre class="brush: jscript; title: ; notranslate">

(function () {
    'use strict';

    var serviceId = 'datacontext';
    angular.module('app').factory(serviceId, ['common','entityManagerFactory','breeze','logger', datacontext]);

    function datacontext(common, entityManagerFactory,breeze, logger) {
        var $q = common.$q;

        var mngr = entityManagerFactory.newManager();
        var service = {
            getPeople: getPeople,
            getMessageCount: getMessageCount,
            getPartners:getPartners
        };

        return service;

        function getMessageCount() { return $q.when(72); }

        function getPeople() {
            var people = [
                { name: 'John', lastName: 'Papa', age: 25, location: 'Florida' },
                { name: 'Ward', lastName: 'Bell', age: 31, location: 'California' },
                { name: 'Colleen', lastName: 'Jones', age: 21, location: 'New York' },
                { name: 'Madelyn', lastName: 'Green', age: 18, location: 'North Dakota' },
                { name: 'Ella', lastName: 'Jobs', age: 18, location: 'South Dakota' },
                { name: 'Landon', lastName: 'Gates', age: 11, location: 'South Carolina' },
                { name: 'Haley', lastName: 'Guthrie', age: 35, location: 'Wyoming' }
            ];
            return $q.when(people);
        }
        function getPartners() {
            var qry = breeze.EntityQuery.from(&quot;Partners&quot;).orderBy(&quot;name&quot;);
            var promise = mngr.executeQuery(qry).catch(queryFailed);
            return promise;
        }

        function queryFailed(error) {
            logger.logError(error.message, &quot;Query failed&quot;);
            throw error; // so downstream promise users know it failed
        }
    }
})();

</pre>
<p>This is the biggest difference from the regular samples you will find. Most of other samples don&#8217;t use entityManagerFactory.<br />
Notice how i use Angular&#8217;s dependency injection to reference entityManagerFactory. I use that factory to make an entityManager used for data retreival. What i&#8217;m very glad to see is the concepts from silverlight (like query objects in getPartners) making it into Breeze. Makes me feel right at home:). After you&#8217;ve done that you&#8217;ll start getting some excetpion about failing to resolve dependencies. You also have to hook up breeze itself into your application.<br />
You will also have to configure your endpoint and some other stuff in your config.js</p>
<pre class="brush: jscript; title: ; notranslate">
(function () {
    'use strict';

    var app = angular.module('app');

    // Configure Toastr
    toastr.options.timeOut = 4000;
    toastr.options.positionClass = 'toast-bottom-right';

    // For use with the HotTowel-Angular-Breeze add-on that uses Breeze
    var remoteServiceName = 'breeze/AppContext';
.
.
.

</pre>
<p>The remoteServiceName is the most important one for breeze, this is a relative URL To your breeze service.<br />
The last piece of the puzzle is hooking up breeze in your app.js, which is something already described in lots of sample apps, but here it is:</p>
<pre class="brush: jscript; title: ; notranslate">
(function () {
    'use strict';
    
    var app = angular.module('app', [
        'breeze.angular',
        // Angular modules 
        'ngAnimate',        // animations
        'ngRoute',          // routing
        'ngSanitize',       // sanitizes html bindings (ex: sidebar.js)

        // Custom modules 
        'common',           // common functions, logger, spinner
        'common.bootstrap', // bootstrap dialog wrapper functions

        // 3rd Party Modules
        'ui.bootstrap'      // ui-bootstrap (ex: carousel, pagination, dialog)
    ]);
    
    // Handle routing errors and success events
    app.run(['$route',  function ($route) {
            // Include $route to kick start the router.
        }]);        
})();
</pre>
<p>The first line, &#8220;breeze.angular&#8221;, is what&#8217;s important. You also have to reference all those files of your SPA in your index.html page. I use ForLoop.HtmlHelper for this, so that all the javascript references and blocks end up at the end of the page. The following is the complete reference for my sample app, you don&#8217;t need all of it.</p>
<pre class="brush: csharp; title: ; notranslate">
@using (@Html.BeginScriptContext())
{

    Html.AddScriptFile(&quot;~/scripts/angular.js&quot;);
    Html.AddScriptFile(&quot;~/scripts/angular-animate.js&quot;);
    Html.AddScriptFile(&quot;~/scripts/angular-route.js&quot;);
    Html.AddScriptFile(&quot;~/scripts/angular-sanitize.js&quot;);
    Html.AddScriptFile(&quot;~/scripts/breeze.debug.js&quot;);
    Html.AddScriptFile(&quot;~/scripts/breeze.angular.js&quot;);

    Html.AddScriptFile(&quot;~/scripts/toastr.js&quot;);
    Html.AddScriptFile(&quot;~/scripts/moment.js&quot;);
    Html.AddScriptFile(&quot;~/scripts/ui-bootstrap-tpls-0.10.0.js&quot;);
    Html.AddScriptFile(&quot;~/scripts/spin.js&quot;);

       // &lt;!-- Bootstrapping --&gt;
    Html.AddScriptFile(&quot;app/app.js&quot;);
    Html.AddScriptFile(&quot;app/config.js&quot;);
    Html.AddScriptFile(&quot;app/config.exceptionHandler.js&quot;);
    Html.AddScriptFile(&quot;app/config.route.js&quot;);

   // &lt;!-- common Modules --&gt;
    Html.AddScriptFile(&quot;app/common/common.js&quot;);
    Html.AddScriptFile(&quot;app/common/logger.js&quot;);
    Html.AddScriptFile(&quot;app/common/spinner.js&quot;);

    //&lt;!-- common.bootstrap Modules --&gt;
    Html.AddScriptFile(&quot;app/common/bootstrap/bootstrap.dialog.js&quot;);

    //&lt;!-- app --&gt;
    Html.AddScriptFile(&quot;app/admin/admin.js&quot;);
    Html.AddScriptFile(&quot;app/dashboard/dashboard.js&quot;);
    Html.AddScriptFile(&quot;app/templates/templates.js&quot;);
    Html.AddScriptFile(&quot;app/layout/shell.js&quot;);
    Html.AddScriptFile(&quot;app/layout/sidebar.js&quot;);

    //&lt;!-- app Services --&gt;
    Html.AddScriptFile(&quot;app/services/datacontext.js&quot;);
    Html.AddScriptFile(&quot;app/services/directives.js&quot;);
    Html.AddScriptFile(&quot;app/services/entityManagerFactory.js&quot;);
}
</pre>
<p>And that&#8217;s it! I managed to show my first table with this kind of setup. I just wanted to point out some relevant points i couldn&#8217;t find anywhere else to make the hook-up succesful, you should definitely have a look at other sampple applications like Todo-Angular on the Breeze site.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.altinet.hr/angular-js-and-breeze-js-story-so-far/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Reaction to Ember-forged Durandal Angularly Knocking out my Backbone, or my JS MVC framework research conclusion.</title>
		<link>https://www.altinet.hr/js-mvc-framework-comparison-2014/</link>
		<comments>https://www.altinet.hr/js-mvc-framework-comparison-2014/#comments</comments>
		<pubDate>Wed, 14 May 2014 18:35:18 +0000</pubDate>
		<dc:creator><![CDATA[Bruno Samardzic]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Mvc]]></category>

		<guid isPermaLink="false">http://www.altinet.hr/?p=864</guid>
		<description><![CDATA[As probably every other javascript developer wannabe in the last few years, i&#8217;ve been completely paralyzed in my analysis of different framework options for future JS development. There is so much going on and the landscape is changing so rapidly that it&#8217;s really hard to keep track. But after an exhaustive research I think I [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>As probably every other javascript developer wannabe in the last few years, i&#8217;ve been completely paralyzed in my analysis of different framework options for future JS development. There is so much going on and the landscape is changing so rapidly that it&#8217;s really hard to keep track. But after an exhaustive research I think I finally decided on the technology I am going to choose for my next project. Do note that this is not going to be a pure developer-side analysis, this should also be relevant to someone who wants to choose a solid career path or a product manager who is choosing the next team tech. I must say this is definitely the right time to get into JS MVC frameworks since we can finally see some consolidation going on, which i will explain shortly. The candidates i considered are the ones from the title: React.js, Ember.js, Durandal.js, Angular.js, Knockout.js, Backbone.js. First a few words and impressions about individual tools:</p>
<p><strong>Knockout.js</strong><br />
Binding library which is also a part of Durandal, i think it&#8217;s a good solution for basic binding needs, but not quite the type of solution i hoped for. Anyway on to the next&#8230;</p>
<p><strong>Backbone.js</strong><br />
The grandpa of JS mvc frameworks. I haven&#8217;t looked at it much since everyone says it&#8217;s pretty basic, you need plugins like marionette (good/bad), and from what i gathered everyone&#8217;s transitioning to play with the newer kids on the block. For a guy that came from Silverlight, using Caliburn.micro with conventions and MVVM, when i saw a lot of &#8220;boilerplate&#8221; written next to it&#8217;s name i hardly gave a serious thought to it any more. FINAL VERDICT: Oldie but goldie. Speaking of new kids on the block&#8230;</p>
<p><strong>React.js</strong><br />
Definitely the one i was most interested in, i really think it&#8217;s an amazing solution. It&#8217;s a paradigm shift and a way of thinking that really resonates with me. I love the tools, philosophies and extensions people are developing around it (like Om, Clojurescript support ). But it lacks battle proof. As a .NET guy, i don&#8217;t like the tooling story just yet. Altough you can get MVC5 supported nuget packages, JSX Visual studio support (judging from my Google search) is non-existant. If i was a sublime text guy, i would absolutely consider it. The other problem i have with it, i&#8217;m not quite sure how it would behave with data intensive applications with grids and forms, and i don&#8217;t see how to integrate it with some out-of-box components, like syncfusion or kendo. I absolutely love the principle of js-only components, doing away with templating etc. I just need to see more examples, better support, bigger community etc. FINAL VERDICT: Up and coming and very promising, something to keep an eye on, but more examples and support needed. Strong backing, and judging by how they treat ASP.NET, a very bright future is in it for a .NET guy. Speaking of support&#8230;.</p>
<p><strong>Durandal.js</strong><br />
Aaand we have our first JS MVC war victim (and as always, the innocent suffer first). Durandal.js was my favourite just a few months ago. It looked extremely solid, and it was built by a guy who was into UI frameworks for the last XY years, the father of Caliburn and Caliburn.Micro, Rob Eisenberg. I fell completely in love with Caliburn.Micro, it&#8217;s the best code i&#8217;ve ever seen and having a same guy do a JS framework&#8230; well, i was completely sold. Until 2 weeks ago that is. Turns out Rob is now in bed with the enemy.He joined the Angular 2.0 team and they are building the next generation of web. Which honestly is kind of relief because that leaves me with less to choose from. FINAL VERDICT: Silverlight-inspired framework going the way of silverlight:(. So now that would make Rob&#8217;s biggest &#8220;enemy&#8221;&#8230;.</p>
<p><strong>Ember.js</strong><br />
That would be my second favourite. I&#8217;m always keeping an eye on what&#8217;s going on over the fence, and since Ember is a brainchild of Rail-heads, I was very intrigued by a prospect of integrating Ember with my ASP.NET MVC app. The opinionated nature, the convention based development, the battle-proved worthiness, the genuine open-source nature of the project, the pit-of-success enforced structure resonated very much with my way of thinking. I still feel it&#8217;s the most complete solution, and the one that has the best feature set and performance, and it&#8217;s an ideal one&#8230;. for a rails developer. Or even for a python dev, or php. It&#8217;s just not that great for a .net dev. The main issue is the fact that Ember owns your data model and therefore it makes it harder to use data library like Breeze. And Ember-data doesn&#8217;t support OData, which i may or may not use (haven&#8217;t decided yet). Other than that, when searching for a kendo-ember integration, results came out pretty scarce. There are some Ember-specific girds and controls, but i really don&#8217;t want to be framework-bound when choosing my controls. FINAL VERDICT: Fantastic framework with the right idea, but without appropriate following, support and mindshare. And speaking of mind share&#8230;</p>
<p><strong>Angular.js</strong><br />
Takes the crown. Angular strikes me as a middle-of-the-road solution all-around. It&#8217;s opinionated but not completely, it has less then Ember but more than the rest, it&#8217;s somewhat structured but less than Ember. I don&#8217;t like it honestly, it has too many weird and angular-specific concepts (and i usually don&#8217;t like the middle-of-the road things). But I&#8217;m completely buying the future of Angular and the mind share. Every control vendor i googled has some kind of angular integration, and 3rd party libraries cannot afford to ignore it. If you want to use them, your best bet is Angular by far. Model is a simple Javascript object (Pojo) so it&#8217;s dead simple to integrate with breeze or similar. The 2.0 version will be also built and supported by a guy who did Durandal, so I have high hopes for that one. The visual studio integration is also very decent, the Microsoft team is also using it, PHP guys are using it, Angular guys are well connected to Chrome developers (not something you should ignore), basically everyone is using it. Oh and there&#8217;s also this&#8230;</p>
<p><iframe width="600" height="330" src="//www.google.com/trends/fetchComponent?hl=en-US&amp;q=Angular,+Backbone,+Ember,+React&amp;date=today+12-m&amp;cmpt=q&amp;content=1&amp;cid=TIMESERIES_GRAPH_0&amp;export=5&amp;w=500&amp;h=330" style="border: none;"></iframe></p>
<p>It&#8217;s a pretty safe bet your Angular skills will be in high demand, and learning the concepts and quirks should pay off in the long run. And to all the PMs, the Angular talent should be the easiest to find in the future.<br />
FINAL VERDICT: King of the hill, whatever you might think of that.</p>
<p>So that would be my recommendation for a JS MVC framework. Keep an eye on React, try out Ember to learn the proper way to structure a JS app, forget about Durandal, for widgets and smaller stuff try Backbone or Knockout, but keep your Angular strong.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.altinet.hr/js-mvc-framework-comparison-2014/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Divide by zero and how to elegantly avoid it</title>
		<link>https://www.altinet.hr/divide-by-zero-and-how-to-elegantly-avoid-it/</link>
		<comments>https://www.altinet.hr/divide-by-zero-and-how-to-elegantly-avoid-it/#comments</comments>
		<pubDate>Fri, 09 May 2014 12:39:59 +0000</pubDate>
		<dc:creator><![CDATA[Bruno Samardzic]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.altinet.hr/?p=861</guid>
		<description><![CDATA[One of those late-into-production problems i usually encounter is the dreaded DivideByZero exceptions, and it&#8217;s usually quite annoying since then you usually have to do some kind of &#8220;if&#8221; or &#8220;?&#8221; statement and it gets daunting pretty fast. It got to a point where i felt a bit guilty every time i used a division. [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>One of those late-into-production problems i usually encounter is the dreaded DivideByZero exceptions, and it&#8217;s usually quite annoying since then you usually have to do some kind of &#8220;if&#8221; or &#8220;?&#8221; statement and it gets daunting pretty fast. It got to a point where i felt a bit guilty every time i used a division. So i decided not to do divisions any more (well, atleast not directly).<br />
I made a small extension method:</p>
<pre class="brush: csharp; title: ; notranslate">

        public static decimal Inverse(this decimal d)
        {
            return d == 0 ? 0 : 1 / d;
        }

</pre>
<p>And instead of using divison, now you use multiplication. Much safer!</p>
<pre class="brush: csharp; title: ; notranslate">

a=b/c;

//same way
a=b*c.Inverse()

</pre>
<p>That&#8217;s it!</p>
]]></content:encoded>
			<wfw:commentRss>https://www.altinet.hr/divide-by-zero-and-how-to-elegantly-avoid-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
