Friday, October 09, 2015

OriginThinSetup.exe won't run (A solution)

So - my girl wanted to buy "The Sims 4" from EA.

so I headed to the EA site and after reading a bit about all the expansions etc purchased the basic game for her.

I was then told that I should go and download "Origin" which will have my game  in the "My Games" tab.

So I went to and downloaded origin - a file named OriginThinSetup.exe was downloaded but just refused to do anything...

Tried to turn off my firewall & Anti Virus & Searching the net - nothing...

I was already on a phone call to EA Support waiting for someone to answer, when I decided to do a right-click, Properies on said file - My original intention was to see what was its exact size in case I will be asked, but then I saw at the bottom:

I pressed the "Unblock" button and then executed the file successfully.

P.S. - You might also need to properly setup your firewall / AntiVirus & make sure you "Run As Administrator" but I am guesssing you already know about that...

Monday, September 07, 2015

Angular directives - what happens when - execution order of compile prelink and poslink

A few days ago I stumbled upon the following to articles:

I think they are great and recommend that before you continue reading here you go and read them.

The reason I am writing this is because I think that although they are great they have a methodological problem that might leave with some wrong ideas on how things work.

The problem is that the example that Jurgen Van de Moere chose to use.

The DOM structure he used has a root node, a child node and a grandchild node.

This leads to some sort of a "serial" thinking about what is happening at the "nitty-gritty" level.

It is why he end up with statements like:

"After AngularJS travels down the DOM and has run all the compile functions, it traverses back up again and runs all associated post-link functions. 
The DOM is now traversed in the opposite direction and thus the post-link functions are called in reverse order. So while the reversed order looked strange a few minutes ago, it is now starting to make perfect sense."

"A pre-link function of an element is guaranteed to run before any pre-link or post-link function of any of its child elements."

Now lets choose to use a slightly different DOM that looks more like a real tree.
Say one that has a root with 2 children that each has 2 children of their own as in the following Plunker (derived from the original by Jurgen Van de Moere).

You will then see that the order of execution of the compile, pre-link and pos-link functions would be much better described like this:

Do a pre-order scan of the DOM tree, and run compile on each node you reach . Then, starting from the root, recursively scan  the DOM tree where on each node you run pre-link, then recursively process the child nodes and then run post link.

If you open the debugger on the above plunker, It will look like this:
2015-09-07 17:46:01.357 app.js:8 root: compile
2015-09-07 17:46:01.364 app.js:8 child1: compile
2015-09-07 17:46:01.364 app.js:8 grandchild1: compile
2015-09-07 17:46:01.365 app.js:8 grandchild2: compile
2015-09-07 17:46:01.365 app.js:8 child2: compile
2015-09-07 17:46:01.366 app.js:8 grandchild3: compile
2015-09-07 17:46:01.367 app.js:8 grandchild4: compile
2015-09-07 17:46:01.367 app.js:11 root: pre link
2015-09-07 17:46:01.368 app.js:11 child1: pre link
2015-09-07 17:46:01.368 app.js:11 grandchild1: pre link
2015-09-07 17:46:01.369 app.js:14 grandchild1: post link
2015-09-07 17:46:01.369 app.js:11 grandchild2: pre link
2015-09-07 17:46:01.370 app.js:14 grandchild2: post link
2015-09-07 17:46:01.370 app.js:14 child1: post link
2015-09-07 17:46:01.370 app.js:11 child2: pre link
2015-09-07 17:46:01.371 app.js:11 grandchild3: pre link
2015-09-07 17:46:01.371 app.js:14 grandchild3: post link
2015-09-07 17:46:01.372 app.js:11 grandchild4: pre link
2015-09-07 17:46:01.372 app.js:14 grandchild4: post link
2015-09-07 17:46:01.373 app.js:14 child2: post link
2015-09-07 17:46:01.373 app.js:14 root: post link

So to summarize what we have seen so far -
1. Compile parent before all children and before any linking.
2. Prelink any node before prelinking or postlinking any of its child nodes.
3. Postlink any node After prelinking AND POSTLINKING all its child nodes.

Note: Looking at the entire tree some nodes can be post-linked before some others get pre-linked.

but WAIT this does not end here,
because directives that use transclude:true must get their content as a compiled DOM on their own COMPILE we get the following:

Have a look at this plunker in which I changed the root and child 2 to be directives that use transclude
and we now get the following order:

2015-09-07 18:20:04.917 app.js:8 child1: compile
2015-09-07 18:20:04.917 app.js:8 grandchild1: compile
2015-09-07 18:20:04.918 app.js:8 grandchild2: compile
2015-09-07 18:20:04.919 app.js:8 grandchild3: compile
2015-09-07 18:20:04.919 app.js:8 grandchild4: compile
2015-09-07 18:20:04.920 app.js:29 Transcludingchild2: compile
2015-09-07 18:20:04.921 app.js:29 Transcludingroot: compile
2015-09-07 18:20:04.922 app.js:32 Transcludingroot: pre link
2015-09-07 18:20:04.923 app.js:11 child1: pre link
2015-09-07 18:20:04.923 app.js:11 grandchild1: pre link
2015-09-07 18:20:04.924 app.js:14 grandchild1: post link
2015-09-07 18:20:04.924 app.js:11 grandchild2: pre link
2015-09-07 18:20:04.925 app.js:14 grandchild2: post link
2015-09-07 18:20:04.925 app.js:14 child1: post link
2015-09-07 18:20:04.926 app.js:32 Transcludingchild2: pre link
2015-09-07 18:20:04.927 app.js:11 grandchild3: pre link
2015-09-07 18:20:04.927 app.js:14 grandchild3: post link
2015-09-07 18:20:04.928 app.js:11 grandchild4: pre link
2015-09-07 18:20:04.929 app.js:14 grandchild4: post link
2015-09-07 18:20:04.929 app.js:35 Transcludingchild2: post link
2015-09-07 18:20:04.930 app.js:35 Transcludingroot: post link

What do we see?
The root can not compile before its children so child1 and grandchild1 & grandchild2 get compiled, then it should be child2's turn but since he is transcluding now he can not be complied before grandchild3 and grandchild4 (maybe they should have been called grandchild21 and grandchild22...) and only when they are complied can child2 and then the root be finally complied.

In a sense we could think of pre-compile and and post-compile that are called on a node before it children are compiled and after it where the pre-complie is called on non transcluding directives and the pos-compile is called on the ones that ARE using transclusion.

that said we can see that the order of linking remains unaffected by the added transclusion.

Write and tell me what you think.

Monday, December 29, 2014

android App installation failure "Installation error code: -25" on Galaxy S4

I had problems when I was trying to install a new version of our app.

There was no problem installing the app on its own,
but if the previous version of the app (from google play) was installed it just refused to install the new version over it.

The installation would just say "App not installed" and logcat would say  "Installation error code: -25".

Eventually it turned out that some changes I made to our build process change the versionCode to a lower number then that of the version that was available on google play.

Bumping the version code up resolved the issue.

Monday, August 04, 2014

Capacity calculation and planning using X-RAID2 with Dual redundancy

I have a RedayNAS Ultra 6 Plus that I initially configured with 6 2TB drives X-RAID2 and Dual redundancy. This gave me 8TB of space (which I never took the time to even try and understand why).

Recently I started getting SMART+ warnings about one of those drives and decided to replace it.
I remembered this animation of extending X-RAID2 and because My drive was already at 87% I decided to buy not one but two new 3TB drives expecting my capacity to grow by an additional 1TB.

As it turns out this was not the case.

At first I thought there was an issue with the expansion process not being triggered triggering so I tried to check the check the box titled "Check and fix quotas on next boot. This process can take several minutes to more than an hour depending on disk capacity and the number of files on your volume." as was recommended somewhere but this also did not work.

finally reading through the forums I found the following explanation:

X-RAID2 dual-redundancy uses RAID-6 layers. RAID-6 layers require a minimum of four disks.

So how do you calculate capacity for a given set of hard drives configured for X-RAID2 DR (Dual redundency) ?

first of all - you MUST have 4 drives to use Dual redundancy.
now, look at the smallest drive and suppose it has size S1.
count how many drives have at least S1 (lets call this N1).
if N1>=4 then add to expected total capacity S1*(N1-2).
now repeat with "un-accounted-for space" on all drives.

Suppose you have the following drives 1TB , 1TB , 2TB , 2TB, 3TB , 4TB
The smallest one would be 1TB and we have 6 drives with that "un-accounted-for" space on them,
so 1TB*(6-2) yields 4TB and leaves you with 0TB,0TB,1TB,1TB,2TB,3TB "un-accounted-for" space.
next we consider another 1TB layer on the last 4 drives  that yields 1TB*(4-2) = 2TB more and leaves you with 0TB,0TB,0TB,0TB,1TB,2TB "un-accounted-for" space.

So what if you now want to get more space? the first layer is "full" (i.e. it uses 1TB of all 6 drives) but the second layer can be expanded in several different ways with the minimal one being just expanding one of the first two drives by an additional 1TB  and thuse getting 1TB*(5-2) = 3TB for that layer.

This was about calculating... you should now be able to do some planning by your self.

As for me, after understanding the situation I am at 2TBx4+3TBx2 yielding  8TB I thing the future expansion path would be by first replacing two more of the 2TB drives to 4TB each, this will give me an additional 2TB (try to calculate it yourself - 2TB,2TB,3TB,3TB,4TB,4TB) - then continue like this to each time replace the small pair to become the new largest pair.

The advantage is that from now on I will only need to replace two HDs each time to get additional space.
The disadvantage is that I some of the additional space I pay for will only be used when I buy the next pair of HDs.

Tuesday, March 04, 2014

"TypeError: Object has no method 'match'" using angularJs

I was getting the following error:

TypeError: Object 4 has no method 'match'

In some angular code I have written.
took some time to debug but it turns out the isolated scope of one of my directives had a property that was not a string. somewhere inside angular it seems that it is expected that the properties of the isolated scope would all be strings and thus have a .match method....

      function() {
return {
restrict: "E",
replace: false,
scope: {

resulted in the said error.

just so that you will know...

Clicky Web Analytics