Does chaining higher order functions mean worse performance?

For clarification, let’s review the following example:

Consider that we have the following array of Ints:

let array = [1, 2, 3, 4, 5] 

and we’ve been asked to generate a new array from array corresponding to the following two conditions:

  • The element in array should be > 3.
  • The new generated element should be a string instead of int, as: “this is (element * 2)”.

By following the approach of chaining higher order functions, we could achieve it like this:

let newArray = array.filter { $  0 > 3 }.map { "This is \($  0 * 2)" } 

At this point, it should iterate through all elements for filter and then reiterate once again through the filtered elements for the map.

However, when doing it using standard for-loop:

var transformed = [String]() for i in 0..<array.count {     if array[i] > 3 {         transformed.append("This is \(array[i] * 2)")     } } 

it should iterate through array elements for only one time.

AFAIK, on the other hand, using higher order functions leads to get rid of mutability (we declared newArray as let instead of var).

In such a case, what would be better for dealing with performance?

What does the intersection symbol (∩) mean when applied to two non-set elements?

I came across a piece of literature in which I saw the intersection symbol (∩) being used on two non-set elements in the definition of an equivalence relation; I have posted it below for reference. The elements in question are meant to represent different files on a computer. What could that intersection symbol mean in this context?

Definition of a equivalence relation

solr search displayview did you mean?

Currently I have setup the whole solr search and everything is working great! When you begin to type your search string the solr search block, it “displays did you mean?” This is great except for the fact that when the user hits enter and makes a typo it will display the “same did you mean?”, but with results in a view (like a normal successful search).

i tried to follow this tutorial: http://fuseinteractive.ca/blog/how-make-your-search-show-spellcheck-suggestion#.VNn92_mG-fh But couldn’t find the Search:Spellcheck field. (I did correctly install the required modules)

Could someone help me out with this?

Will installing OS X Sierra mean my Mac can receive two factor authentication codes?

I managed to get myself in a two-factor authentication pickle. My Apple id is associated with a Mac (currently running OS X Yosemite), an iPhone and an iPad.

The iPad just came back from repair and I needed to restore it from the cloud. Unfortunately before doing that I lost my iPhone! I now have nothing that can receive the two-factor authentication codes. (Didn’t see that one coming!)

My Mac is tied to my iCloud account and Apple Id, and I see that Sierra can receive these codes and that I can upgrade from Yosemite which is what’s currently running on the Macbook Pro.

If I upgrade to Sierra will that mean my Mac can then also receive the two factor codes (allowing me then to get my iPad back up and running)?

Or will I be out of luck as I may need to use two-factor to get the laptop properly set up with Sierra? If that’s the case then I do not want to upgrade as it means I may lose the limited iCloud access that I have via the Mac.

Help!

N.B. Yes, have a full trustworthy backup of the Mac on Time Machine.

Does “Not Found” error always mean the app is unpublished or not active on Play Store?

I am having difficulty finding some apps in Play Store. A lot of times, when I come across a link on the older posts of this website and I load it, I get “Not Found” error on Google Play. I explicitly get:

We’re sorry, the requested URL was not found on this server.

I do double check with the app on AppBrain and usually, it shows that XYZ app unpublished on some ABC date in the past, so I end up believing that the app is really dead on Play Store. However, sometimes, a user, whose post I deleted because of dead link tells me that the app is live on Play Store.

I do a check using Opera browser’s free VPN service (regions: Europe, Americas, and Asia), and also with a Chrome Extension for American/British VPN service. I again and again get the same dead link. I also ensure using Private Browsing to rule out browser caching.

Recently, a fellow moderator notified me that while I was not able to load the link, he could easily load the app Google Goggles on Play Store. AppBrain still shows the app is no more active on Google Play though.

Similarly, I came across the app MyAndroidTools which does not load in Google Play Store, also seems inactive on AppBrain, but had a fresh beta version, as seen on APKMirror.

How do I truly believe that the app is really dead for everyone? Alternatively, how do I know to whom the app is not dead, and how can I load at least the app’s page, let alone download it from Play Store?

what does “Memory access to address 00000030 looks like unallocated stack space.” warning mean? [on hold]

/nios 2 assembly language/

ADDR_SSEGNUMS: .word 0x4F5B063F, 0x077D6D66, 0x6F7F Arr: .hword 0x00000006 .hword 0x0000005B .hword 0x0000004F .hword 0x00000066 .hword 0x0000006D .hword 0x0000007D .hword 0x00000007 .hword 0x0000007F .hword 0x00000067

.global _start _start: /* initialize base addresses of parallel ports / movia r18, 0x10000000 / red LED base address / movia r19, 0x10000010 / green LED base address / movia r20, 0x10000020 / HEX3_HEX0 base address / movia r21, 0x10000030 / HEX4_HEX7 base address / movia r22, 0x10000050 / pushbutton KEY base address / movia r23, 0x10002000 / interval timer (onboard 50 MHz clock) base address */ movia r17, ADDR_SSEGNUMS movui r10, 10 movia r24, Arr movi r25, 9 movi r26, 0

/* load timer countdown value / movui r3, 0x02af / upper 16-bits of 500000 countdown value / sthio r3, 12(r23) / write to timer start value (high) register / movui r3, 0xf080 / lower 16-bits of 500000 countdown value / sthio r3, 8(r23) / write to timer start value (low) register */ movi r8, 0x4

/* start and continue timer countdown with no interrupts / movui r3, 0x6 / load timer control value / sthio r3, 4(r23) / write to timer control register */

PRESS_A_KEY_TO_START: /* press a pushbutton to start counter / ldwio r2, 0(r22) / load input from pushbuttons / stwio r2, 0(r19) / write to green LEDs */ ble r2, r8, PRESS_A_KEY_TO_START

/* monitor timeout signal to identify when the timer countdown ends (reach 0) / WAIT_FOR_TO_SIGNAL: ldhio r3, 0(r23) / load status register / andi r3, r3, 1 / load timeout (TO) bit / beq r3, r0, WAIT_FOR_TO_SIGNAL / wait until timer timeout (TO is set to 1) */

add r4, r4, r3 /* count number of timeouts */ divu r5, r4, r10 mul r5, r5, r10 sub r5, r4, r5 stwio r5, 0(r18) ble r5,r10, loop1

loop1: bge r26,r25,_start /* compare the size of the array with the counter / ldb r7,0(r24) / load the least significant bit / addi r24,r24,2 / increment / addi r26,r26,1
display: add r27, r7, r0
add r9, r7, r0 stwio r27, 0(r20) /
display the contents of r8 in the first four segment*/
loop3:
movia r29, 1000000
DELAY: subi r29, r29, 4
bne r29, r0, DELAY /* shift the values of the register by 8 bits*/ stwio r27,0(r20)

        bne r29, r0, loop3          /* if register values are not equal go to loop3*/           

stwio r28, 0(r20) /* display count of timeouts on LEDR / stwio r0, 0(r23) / reset TO bit in status register */ br WAIT_FOR_TO_SIGNAL

What does “Other Languages” item in iPhone settings mean?

What does the Other Languages… item found below iPhone Language under Settings app → General → Language & Region mean?

Tapping on the item shows me two sections, namely:

  • IPHONE LANGUAGES

and

  • OTHER LANGUAGES

The second section seems to have some overlapping items with those languages listed in first one.

A follow up: When I develop an app or website for iOS, languages of which list should I be aware of?

I am using an iPhone 6 running iOS 12.