How to interpret result of a linear Mixed-effect Model based on species abundance and human density?

Question: I have trouble interpreting my result for my mixed-effect linear regression. I don't if the result are relevant, can someone help me?
After testing different formula for a mixed-effect linear regression using AIC, I choose this one.
M1<-lmer(A.Moveis~D.utilizador+(1|Zona),data=d). Where "A.Moveis" is the abundance of  mobile species ; "D.utilizador" is the density of humans ; and "Zona" is the factor of the different zones in the study area.
Summary M1 gave me :
Formula: A.Moveis ~ D.utilizador + (1 | Zona)
   Data: d

REML criterion at convergence: 234.9

Scaled residuals:
    Min      1Q  Median      3Q     Max
-1.3060 -0.7123 -0.2464  0.5910  2.5700

Random effects:
 Groups   Name        Variance Std.Dev.
 Zona     (Intercept)   8.565   2.927
 Residual             127.204  11.278
Number of obs: 32, groups:  Zona, 4

Fixed effects:
             Estimate Std. Error t value
(Intercept)    14.158      3.511   4.032
D.utilizador  -16.255     13.800  -1.178

Correlation of Fixed Effects:
            (Intr)
D.utilizadr -0.710

And this table :
                         Dependent variable:
                    -----------------------------
                              A.Moveis
-------------------------------------------------
D.utilizador                   -16.255
                              (13.800)

Constant                      14.158***
                               (3.511)

-------------------------------------------------
Observations                     32
Log Likelihood                -117.433
Akaike Inf. Crit.              242.865
Bayesian Inf. Crit.            248.728
=================================================
Note:               *p<0.05; **p<0.01; ***p<0.001

The graph showed a decreasing slope, but I don't know how to interpret the results here. Is the relation between species abundance and human density is significant? What does it mean that the constant is significant?
I also did an adonis test :
adonis(formula = A.Moveis ~ D.utilizador + (1/Zona), data = d,      permutations = 999, method = "gower")

Permutation: free
Number of permutations: 999

Terms added sequentially (first to last)

             Df   SumsOfSqs  MeanSqs  F.Model      R2        Pr(>F)
D.utilizador  1    0.16368   0.16368   2.3979   0.07401      0.142
Residuals    30    2.04779   0.06826            0.92599
Total        31   2.21147                       1.00000

The R2 residual is really high, I don't know if it means that my model is not good?
Here's the graph. the second one is a prediction plot.

Is there a more suitable method than a mixed-effect linear regression?
Thank you in advance for you help.

Thank you very much for your answer.
Indeed I don't have a lot of observation... In reality it is an analysis based on 10 years of data. But for the species data and the frequentation data to match I had to gather them by year and by area. So that makes only 32 observations...

You can interpret the effeect size as: each 1 unit change in D.utilizador is associated with a 16.255 change in A.Moveis, in the oppostie direction.

Thank you !!

It means that, if the intercept is atually zero, the probability of observing the data that you did observed (or data more extreme) is lower than some pre-defined threshold (often 0.05)

Ok, so it makes sense I think

I doubt it because 4 groups is insufficient for any mixed effects model fitted with lme4 or any other frequentist mixed model package. 32 is likely to be too small also as a total sample size.

Do you know if an other model could be more efficient? Maybe a signe linear regression?
Answer:
The graph showed a decreasing slope

This makes sense because the estimate for D.utilizador is negative (-16.255). Does the graph look approximately linear ? It would be a good idea to include the plot in your question.

Is the relation between species abundance and human density is significant?

No it is not. However, p-values are not computed by the lme4 package, because the denominator degrees of freedom can only be approximated for fixed effects in a mixed model. Thus the p-value computed from such an approximation, is itself is only an approximation, so any rule based on an arbitary cut-off, such as 0.05 is questionable.  Also, you have only 32 observations which is quite low, and is likely to be under-powered - did you do a power study prior to collecting the data so that you knew how many obserbations and groups you needed in order to detect the effect size you are interested in ? I doubt it because 4 groups is insufficient for any mixed effects model fitted with lme4 or any other frequentist mixed model package. 32 is likely to be too small also as a total sample size.
You can interpret the effeect size as: each 1 unit change in D.utilizador is associated with a 16.255 change in A.Moveis, in the oppostie direction.

What does it mean that the constant is significant?

It means that, if the intercept is atually zero, the probability of observing the data that you did observed (or data more extreme) is lower than some pre-defined threshold (often 0.05).

The R2 residual is really high

R2 is also not well-defined for mixed models and I would recommend not using it.
Comment: @Salome Does this answer your question ? If so please consider marking it as the accepted answer. If not, please let us know why. Also, if you haven't already, please consider upvoting it


Is the Borg Collective limited to bipeds?

Question: How does the Borg deal with non bipedal sentient lifeforms? Are there any who have been assimilated into the Borg Collective?
Comment: Species 8472 is not biped, but then again, assimilation failed for other reasons..
Comment: Not canon, but in William Shatner's novel The Return there is a Borg dog
Answer: Other than the Species 8472 comment I made, I've found 2 candidates and one interesting note:

Species 259 were "omnicordial lifeforms" that the Borg assimilated automatic regeneration sequencers from.  This species is from a transmaterial energy plane that the Borg called Galactic Cluster 3.  Nothing else about their physiology seems to be known.
Species 5973 are "multispectrum particle lifeforms".  No mention is made of them actually being assimilated.  The Kazon were likewise known to the Borg as Species 329, however, the Kazon were deemed unworthy and not assimilated - so simply having a designation does not indicate the Borg would assimilate that species.

The Greech are this thing:

In the Voyager novel Unworthy, they, along with the Neyser (humanoid), the Dulaph (sphere-shaped silicon-based species), the Irks (a bio-mimetic species), a moth-like species, and a noncorporeal species, created the Indign cooperative in an attempt to mimic the Borg, when the Borg considered them unworthy for assimilation.
So in the novels at least, it seems possible (although unlikely) for non-humanoids to be assimilated.  However, given that the Borg Queen is humanoid, it could well be that the Borg idea of perfection includes humanoids.  Their attempted assimilation of Species 8472 would then be explained as an attempt to gain knowledge of their biology in order to adapt it to the humanoid shape.
So, No, the Borg are not limited to bipeds if "omnicordial lifeforms" are not bipeds - and even if they are, it is unlikely they are limited since they did at least try to assimilate the 3-legged Species 8472
Comment: I assume its 6 legged species 8472.  But it is worth noting that species 8472 have the ability to morph into humanoid shape as noted in TNG Season 5, Episode 4 "In the Flesh"
Comment: @ Richard Vivian, You mean Voyager not TNG!
Answer: Assimilation will require fitting into the Borg structure.  I.e able to use regeneration alcoves etc, the assimilation process of non-bipedal life forms could just use the head and torso of the the individual assimilated and replace a quadrupedal or hexapedal limb system with a mechanical bi-pedal limb system.  As is the case with the Borg Queen.  Having not seen her original form, she may not have been a biped.
Comment: An old answer, but it's worth noting in *Q Who?* that Data observes each regeneration alcove is adapted to a specific individual. So, at least that particular Borg structure has some evidence that it would be uniquely built to allow for non-humanoid use if necessary.
Comment: If (the natural form of) a species contributed significantly toward the Borg's goal of perfection, I think they would be able to overlook the relatively minor inconvenience of adapting some of their technology to work for a non-bipedaled species. After all, I think it's safe to assume that e.g. the alcoves themselves have no intristic requirement that the regeneration cycle is performed standing upright. That said, surely not needing to adapt their technology would hardly be a downside.
Comment: @MichaelKjörling It's such a waste of time, standing up and sitting down..  ;)


Change keyboard layout in Wine?

Question: I've got some games running in Wine, but I can't figure out how to change the keyboard layout.  By default, I use the dvorak layout in Ubuntu, which isn't very friendly for most games.  I can change it back to QWERTY in Ubuntu, but when I fire up a game, it stays with my default dvorak.  How can I change to QWERTY inside my wine application?
Answer: A lot of wine programs use the X keyboard layout instead of the window manager's layout. You have to change it by running
setxkbmap us

Then change back with
setxkbmap us dvorak

Answer: In case someone has multiple keyboard layouts - this solution worked for me.
I have two keyboard layouts: English (us) and Ukrainian (uk). The first one was set as default in system settings. However, in Wine games the letter keys (q,w,e,r,t,y,etc.) didn't work at all.
Based on Alex's answer, I found the way to determine my current X keyboard layout settings:
setxkbmap -v

It showed me the following:
Trying to build keymap using the following components:
keycodes:   evdev+aliases(qwerty)
types:      complete+numpad(microsoft)
compat:     complete
symbols:    pc+ua+us:2+inet(evdev)+group(alt_shift_toggle)
geometry:   pc(pc101)

I noticed that the symbols line has ua (not us) on the first place. Assuming that Wine always uses the first specified layout, I just needed to change the layout precedence:
setxkbmap us,ua

And it worked. However, after reboot it was reset back to its default state. Thus, I have to do it each time after boot. I'll try to find a way to store those settings by default.
Comment: You can add it to your .profile or .bashrc
Answer: Who use different keyboard layouts just need open settings on ubuntu -> language settings and plase English layout top on list. P.S. I'm sorry, I did it on gui, dont know terminal command ;-)
Comment: If you have a new question, please ask it by clicking the [Ask Question](https://askubuntu.com/questions/ask) button. Include a link to this question if it helps provide context.
Answer: In the keyboard control panel, you can configure multiple keyboard layouts from the Layouts tab.  Click on Options... and expand the Key(s) to change layout section.  Pick the key combo you prefer and you should have an easy way to switch layouts.
If the Separate layout for each window checkbox is checked in the main keyboard control panel, then each window should remember which layout they are using separately rather than it being a global setting.
Comment: Oh.  Yeah, I've already got that down.  It doesn't apply within a Wine application though.  I guess I have to change my default entirely?  That's a bit annoying.
Comment: Crazy... yeah, it works for notepad, just not the game I'm playing ("Within a Deep Forest").  Odd.
Comment: Where do I find the keyboard control panel?  I tried "wine control" for the wine control panel, but it's not in there.
Comment: This isn't a Wine specific control panel.  Pick System -> Preferences -> Keyboard.
Comment: Really?  I just tried it with Wine's Notepad application.  I added both US and US Dvorak layouts and set the layout switch combo to ctrl+shift.  The ctrl+shift combo successfully changed how my input was interpreted by Notepad.
Comment: This may not work for older Windows applications.  I still haven't find a solution for a rather old dictionary application.

Change keyboard layout in Wine?


Magento 2.3.2 - Product customisable options reappear by themselves

Question: I've been experiencing a weird issue in my project where every now and then (once a month-two months), some of our products  (that once had customizable options, yet they were eventually removed) have all the customizable options back, despite no one going and consciously re-adding those options again.
Here are the options for example:

Has anyone ever experienced something like this? What could trigger re-adding old data to products a few months after its removed? We have an extension that logs any changes to products and there's simply nothing regarding this. I'm at a loss.
Appreciate any ideas.
Answer: The options could be added through an api user. Or a recurring data event.


SharePoint 2013 how to move promoted links to another site

Question: I do not have access to designer,  I tried content and structure and also saved as template which almost worked URLs didn't carry over.   Any OOB solutions for moving promoted links to another site in the same collection?
Answer: There is a workaround:

Export the Promoted Links list to Excel though List ribbon->Export to Excel.
In the Excel, copy the items with the relevant columns, and paste them to another list promoted links list in Quick Edit view.


How to silent (vibrate only) alarms?

Question: When I use silent mode, I expect no sound and hence I expect alarms to be silent as well but they are not; ring/silent switch has no effect on alarms!
On iOS 5 this used to work and in silent mode alarms did just vibrate.
How can i put alarms in silent mode without reconfiguring each of them one by one when I need silent mode?
Thanks
Comment: It's not in the spirit of alarms to be silent, and I sure am thankful they are not silenced in silent mode. What type of alarms are you setting where you prefer this behavior? Maybe calendar reminder are more appropriate?
Comment: Moreover I m used to wake up and get alarms notifications in vibration mode (ios 5) that is to wake me up but not my husband or my neighbours! That is even not possible with ios 6. I ll search for a different alarm app since default iphone alarm is not suitable anymore for me.
Comment: Well I have plenty of alarms with different days and times in the week and don t want to bother which one may ring or not when in silent mode!
Answer: Use a silent MP3
Here's the solution that worked for me:

Get silent audio clip. Search online (e.g. using Google) or create (using GarageBand, Audacity, etc.) a 20-25 second clip of silence.
Get clip into iTunes. Save it in your iTunes as a "song" (I just called it Silent Ringtone).
Get clip onto iPhone. Then sync your phone so it's now on your phone. (Make sure you check the Sync Music checkbox in iTunes.)
Use clip on iPhone. Now, when you create an alarm, use Pick a Song from your library, and select your "Ringtone" song.   If you have your settings elsewhere set to vibrate on silent or whatever, then you should now have a song that "plays" while your phone happily buzzes.

Hope that helps!
P.S. As someone who only recently switched to iPhone from a phone that could do the vibrate-only alarm thing easily, I would use these alarms to set myself private reminders for lots of things. Such as when I was in a lecture or meeting and needed to remember to leave 5 minutes early but didn't want to be watching the clock constantly. Or if I had to remember when to go back and put more money in the parking meter. Or basically a multitude of things to alert myself that I didn't need to whole world to know about! Just a simple buzz in the pocket was enough.
Further reading: HowToGeek has screenshots
Answer: When you make the alarm, go to the option where it says "sound" and go all the way to the bottom where it says "none" and click on it. I just tested it with my iPhone on silent and the alarm does not go off. Hope this helps.
Comment: Reinstated as of iOS 10
Comment: This fails on iOS 9 because it does not vibrate when "None" is selected in the sound settings.
Answer: Set "Sound" to "None"
Don't know if this will do but for me (iOS6), setting to silent and then turning the ringer down as far as it will go makes the alarm vibrate only. Just remember to turn your volume back up later.
Further reading: Apple Support: How to set and manage alarms on your iPhone
Comment: I know I'm wierd but since I keep my phone on my person, almost indefinitely, I hate having it ring.  I keep the volume all the way down, all the time.  This has caused my alarm to only vibrate in the mornings, which has the effect of waking me up but not my wife.  This solution is the answer.
Answer: In your situation where you would like the vibration, but just not the sound the solution may require a bit of an investment.  If you go into iTunes and search for "Silent iPhone" they have ringtones that you can set as the default for your alarms. I think that would give you your desired result of vibration with no sound. The only downside being if you are expecting more than just a vibration if you are out of silent mode.
Answer: I did a lot of searching, and most solutions were to download a free ringtone recorder to record a silent ringtone. However, there was still static in the recording just due to ambient noise. The best solution is to do the following:

Do a google search for blank MP3 (I used the following result: http://www.xamuel.com/blank-mp3s/)
Download a blank MP3 to your desktop (I think any length will work, as I tried the 5 Sec and 30 second files and both had the same result, so I went with the 5 second file)
Open iTunes → File → Add To Library
Select the blank MP3 file from your Desktop that downloaded in step #2
Either give the blank MP3 file it's own playlist and sync that playlist to your iPhone (I created a playlist called Silent) or add it to an existing playlist that is sync'd to your phone
Go to the alarm that you only want to vibrate, select the sound option, select pick a song and select the Silent MP3 file you just sync'd
The last thing you need to do is make sure your phone is set to vibrate when it rings; go to Settings → Sounds and make sure Vibrate On Ring and Vibrate On Silent are on
Answer: I tried the suggestion to search "silent iPhone" in iTunes ($1.29 & I chose the second option).  Then I sat that as the tone for my daily recurring alarm to take my Claritin (it goes off in the morning & when I'm sitting in lecture it's rude & annoying to have someone's phone go off & disrupt the entire class).  I made sure to flip the mute button on my iPhone 6 with "vibrate on ring" & "vibrate on silent" both turned on.  The alarm went off perfectly with only a vibration in my pocket so the world doesn't have to stop what they're doing- I can quietly take care of it & go about my day with everyone else none the wiser.
Answer: How to Set an iPhone Alarm to Vibrate Only

Open the Clock app.
Select Alarm at the bottom of the screen.
Touch Edit at the top-left corner of the screen.
Select the alarm that you wish to modify.
Tap the Sound button.
Scroll to the bottom of the screen and select None.
Scroll to the top and select Vibration.
Specify the type of vibration that you wish to use.

From here: https://www.live2tech.com/set-iphone-alarm-vibrate/
Answer: I think the best solution is, select any song as a ringtone, select a type of desired vibration(like Symphony or SOS), save the alarm , then reduce the phone ringtone volume(by pressing the external volume buttons), and bingo, job done.

How to silent (vibrate only) alarms?


Are 神 and 神 the same?

Question: My friend asked me if I know what 神仙 means so I tried to look it up and almost all the results I got were 神仙 instead of 神仙. Which appearently means something like a hermit or an immortal person that has divine powers.
But back to the question are 神 and 神 basically the same Kanji meaning wise? Maybe someone can help.
Comment: Then your friend is likely Korean. It's written with a single character in Chinese, leaving only two possibilities: it's either the Japanese word written the old-fashioned (or wrong) way, or the Korean word.
Answer: Yes, 神 and 神 are basically the same kanji with the same meaning. More precisely, 神 is a kyūjitai (historical form), and 神 is the shinjitai (modern form). 神 must be used almost everywhere now, but the old version may be used intentionally to add some flavor in a historical drama and such.
Note that Japanese people do not consider them exactly the same. Native speakers almost certainly notice if the old form (神) suddenly appears in a sentence. This cannot be compared to true allographs such as two modern forms of Latin "a" or "g", or two modern forms of そ, which are hardly noticeable to modern native speakers.
Comment: Your explanation is truly brilliant! I just wanted to augment your point by mentioning that, when it comes to a person's name, many Japanese families still opt to use traditional form letters in an effort to uphold their long-standing traditions. This can largely be attributed to the considerable sacred value that family names bear within Japanese culture.
Comment: I just wanted to add that both forms have long existed in China and in Japan, before any character simplification took place in either country. 神 is more of a print-font, used in the printing press where they carved characters onto wood blocked. The Kangxi dictionary uses this form. 神 on the other hand, was always how people wrote the character by hand. Nowadays Japan decided to unify the forms under 神, making the other "old and obsolete", but truth is that they coexisted for a long time.
Comment: Sorry it seems like in the comments, only the modern form gets displayed. In my comment, the print-form is the one with 示 on the left, the handwriting-form is the one with ネ
Answer: These are alternative forms of each other.
It's a bit hard to tease out the details due to the layout of the information, but the Wiktionary entry at https://en.wiktionary.org/wiki/%E7%A5%9E shows us that these are ultimately the same thing.
More specifically, the left-hand portion of these two characters (technically, its radical) differ only by a minor shift in shape caused by handwriting conventions.  It's a bit like the difference between these two common forms of the lower-case letter A:
a
ɑ
One has an extra half-loop on the top, commonly used in printed fonts, and the bottom is simpler without that extra embellishment, and tends to be more commonly seen in handwriting.
This kind of simplification is what we see in the "more traditional" version of the character 神, and the common "everyday use" version of the character 神.
For the kanji, the two versions of the radical are:
⺬
礻
The topmost horizontal bar in the "traditional" version on top is simplified to just the top tittle on the simpler version below.  The second horizontal bar and the left independent line in the top version are combined into the hooked フ second stroke in the simpler lower version.
I think just about all the kanji that include this radical come in similar pairs -- one with the older radical ⺬, and one with the simpler version 礻.  See also:

https://en.wiktionary.org/wiki/%E7%A5%9D
https://en.wiktionary.org/wiki/%E7%A4%BC
https://en.wiktionary.org/wiki/%E7%A4%BE

... etc.

Are 神 and 神 the same?


Selenium2 (WebDriver) using Java fails when browser window is not focused

Question: My Selenium Java Webdriver tests are failing when they start if I don't click on the browser page that is being opened.
The following crash is caused from an ElementNotVisibleException, obviously.
This was not a big issue until now that I have to put them in a Jenkins CI machine.
Can any body help by providing possible solution or suggestion?
Comment: Once you open the browser window, have you added the selenium command viz. selenium.windowFocus() to focus on the window?
Comment: are you using Selenium RC?
Answer: For Selenium RC:
selenium.windowFocus();
selenium.windowMaximize();

For WebDriver (Selenium 2):
driver.manage().window().maximize();


Invalid ELF file

Question: if I run my application on Android I always get this error and the application crashes immediately:
03-25 14:29:44.011  1833  7290 I ActivityManager: START u0 {flg=0x10000000 cmp=cz.jech.muzika/.Muzika} from uid 2000
03-25 14:29:44.093  1833  1998 I ActivityManager: Start proc 17399:cz.jech.muzika/u0a464 for activity cz.jech.muzika/.Muzika
03-25 14:29:44.098 17399 17399 E cz.jech.muzika: Not starting debugger since process cannot load the jdwp agent.
03-25 14:29:44.193  1833  2400 I WindowManager:   SURFACE show Surface(name=Splash Screen cz.jech.muzika)/@0xbe60fc9: Splash Screen cz.jech.muzika
03-25 14:29:44.298 14007 17395 D InstalledAppProviderSer: insertAppIntoDb cz.jech.muzika
03-25 14:29:44.302 17399 17414 E AndroidRuntime: Process: cz.jech.muzika, PID: 17399
03-25 14:29:44.302 17399 17414 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: invalid ELF file "/data/app/cz.jech.muzika-iMRmvRSnmwPpVhRlaZJJwg==/lib/arm64/libswscale.so" load segment[4]: p_offset (0x41000) + p_filesz (0x0) ( = 0x41000) past end of file (0x40910)
03-25 14:29:44.306  1833  9531 W ActivityManager:   Force finishing activity cz.jech.muzika/.Muzika
03-25 14:29:44.327  1833  4076 I ActivityManager: Process cz.jech.muzika (pid 17399) has died: vis  TOP
03-25 14:29:44.336  1140  1237 W SurfaceFlinger: Attempting to destroy on removed layer: AppWindowToken{485887d token=Token{1c63ed4 ActivityRecord{a8f0c27 u0 cz.jech.muzika/.Muzika t4527}}}#0

What could be the root cause of the error? The ffmpeg libraries I use are from here. What does the error "invalid ELF file" mean?
Answer: The file /lib/arm64/libswscale.so is corrupt. In particular, it has a PT_LOAD segment with offset that is past the end of the file (file size is 0x40910) and has 0 length.
One way the file may have become corrupt is if you did an FTP transfer and forgot to set binary mode. (Of course there are numerous other ways, such as decompressing the archive and running out of disk space.)
Your best bet is to re-extract the archive, check the length and md5sum of the file, and use scp or something other than ASCII FTP transfer, then verify that the md5sum is still the same on the target device.

Invalid ELF file


Is Qatar Airways part of any air miles alliance?

Question: I had flown Qatar Airways long-haul sometime back when and got some points for that. In few months, I will be flying again. I do not know if there are any other airways/airlines where I could use Qatar points, is there ?
Comment: I almost want to upvote this question for "point thing"
Comment: I think your question has not been well-received because it shows no research effort at all— not even a simple web search for *qatar airways alliance*. This is a basic question across all of StackExchange.
Comment: @choster - that's fine. I am not upset at that question being hammered, I'm more worried to figure out how to put the put the points I have into oneworld from qatar. I am guessing that will take quite a bit of research.
Comment: @shirish For the most part, you cannot transfer points from one program to another, except through some ruinous conversion schemes. Some explanation of what programs you are a member of and what you are trying to do would help.
Answer: It is part of the OneWorld alliance.
Have a looksie at
https://en.wikipedia.org/wiki/Oneworld
Answer: Not sure where you are going to recommend you a better FFP(frequent flyer program)
But like @Max said, Qatar is under oneWorld alliance, meaning that you can credit or redeem your Qatar miles to Qatar and most of the alliance partners.
While it's always more authentic to check the award travel information on the airline you are flying with. For Qatar, you can redeem your Qatar miles on its 17 airline partners (14 from OneWorld).
Click here for the list of partner airlines and miles required for traveling on them: http://www.qatarairways.com/PrivilegeClub/Partners.page?mid=7&sid=2
However, to find the best value for your Qatar miles, you will have to go through all the partner airlines for individual redeem programs for partners and this is the part which most points players like me find the most "fascinating" as lots of math and calculation involved.
If you are not fan of manual calculation, there're few tools such as Pointimize, Rewardstock, those tools will do all the math and help you to plan your miles earning and redeem strategy in a jiffy.


Impact of sharing my device MAC to access wifi?

Question: I shared my phone's MAC id to connect to my office wifi. Will the system administrator be able to see my whatsapp messages or internet activities in my phone ?
Comment: Cant' say I agree with the mark as duplicate, since the previously answered question doesn't mention the word "MAC" once.
Answer: The Media Access Control address is simply used to allow the wireless router to find your device across the radio frequency, and to identify your phone when you want to speak to the router's radio antenna. It is not used, or visible, outside the wireless network, so is not used as part of any secure connections to services outside that network.
Secure services like WhatsApp are not vulnerable to inspection by simply capturing the traffic, as they use end-to-end encryption. Websites and apps that do not use encryption can be inspected by the network operator.
The unique risk versus an open wireless network is that the network operator can now use that MAC address to correlate network traffic with your device. If they notice unwanted traffic, they can see the MAC address participating in that traffic and know that you are the owner/operator and probably responsible for that traffic.
Answer: There is generally a table on the router where IP addresses are matched to mac addresses anyway so any time you are using a network you are probably sharing a mac address. You want the router to route traffic to you and not me, so it has to know which traffic is yours and which is mine.
If you are using encryption (including https) the content of your traffic is not visible. Meta-data still can be very telling though; they might not see what you did at [site_that_gets_you_fired], but they might be able to see that you visited.
The difference between connecting to a totally open network and a mac address required network is you are giving a mac in person, so rather than note a device (or its clone) is connected they have at least a physical description of you to match to that device.


Why is it that 10 000 RPM hard disks never picked up?

Question: I just got a brand new Lenovo x230 with 7200 RPM hard drive. Now I understand SSD would've been better, but why hasn't 10k RPM become the standard by now?
Comment: Can anyone comment about angular momentum? Does a platter spinning at 10K vs 7.2K present a whole new raft of stability issues?
Comment: @Marin - Because SSD made them pointless.  10,000 RPM are normally smaller and cost more then 7200 RPM.  The market wouldn't sustain them at higher volumes.
Comment: I wouldn't blame it on SSDs alone though.
Answer: Found some reasons from a forum post;

and another:

Seem like good enough reasons!
Comment: @MDTGuy having shared my cube with a circa '99 computer with a pair of 10k drives in it at one point it was the noise volume that was the killer.  It could've been a free 10k computer vs $1k for a 7.2k one and after hearing the jet turbine10k drive I'd predict >99% of consumers would either open their wallet for the 7.2k one or decide they didn't need a computer afterall.  Among other things, the 10k drives made a high end GPU with the fan stuck at 100% or the high speed 60mm Delta fan that was my overclocking pride and joy a dozen years ago seem quiet.
Comment: Useful information, but using a screenshot to get around the "no link farming" rule is lame. If you didn't want to take the time to paraphrase the text, you should have let somebody else answer the question.
Comment: Yeah, noise is bad, and heat is bad, but at the end of the day, it was really all about price.
Answer: 10K and 15K drives are common in the SCSI/SAS hard disk (server) market, but as point #4 states - most users don't need much more performance considering the trade offs of drive noise and cooling.   Most regular computer users are not going to notice if a file transfer is running at 60 MB/s or 120 MB/s - but people responsible for maintaining enterprise storage sure do.   Every last MB/s you can squeeze out of a hard disk is required when you are talking about a large RAID array or a SAN.   In addition to the speed, most server rooms have large cooling systems that cover the entire data center, so cooling and/or noise are not a big issue.   If you have ever been in a data center, most of the background noise is coming from the cooling system anyways.
Comment: If I could you would get a +2 for the ", most of the background noise is coming from the cooling system anyways. "


Apart form tax and less regulation what are the benefits of registering a company offshore?

Question: Apart from tax and less regulation what are the benefits of registering a company offshore? I also mean why would one register a company offshore and the incorporate a subsidiary in the country where they operate what are the benefits of such? (Apart from tax and less regulation)
Comment: Regulations of any place a subsidiary actually operates will need to be followed regardless of the parent corporation's location.
Comment: Can the subsidiary and the holding company raise funds at the same time, each following their respective jurisdictions laws? So that the company can benefit from the laws of both countries at the same time?
Comment: This is not a forum but a Q and A site. You can edit your question. You might add this to your question after you work on it to clarify your question.
Comment: Okay, will do so. Thanks.
Comment: What else is there beyond tax and regulation which defined broadly enough pretty much includes all of the law?
Answer: Some reasons for using an offshore jurisdiction, presented hopefully without judgment -
Tax

As well as lower tax rates, there is the chance of ingenious schemes involving tax reliefs between different jurisdictions - the famous "Double Irish", "Dutch Sandwich", "Single Malt" are examples.
Tax can be simpler in some administrative respects. The Isle of Man, for example, wants you to file an annual tax return, and you have to have business accounts, but you don't have to file the accounts or have them audited. And when there are fewer categories of tax to deal with, with simpler rules, the tax return is easier to do.
When there are subsidiaries in many countries, having the hub in a low- or zero-tax jurisdiction can reduce the tax paid on complex multinational asset flows. The same applies to a joint venture between independent companies in different countries. This goes by the marketing name of "tax neutrality" (not the same as "tax neutrality" in setting tax policy, confusingly). The theory here is that taxes are still being paid in the appropriate places, when the revenue is generated, but aren't also being incurred artificially by essentially "internal" transfers.

Company structure and liability

Offshore jurisdictions can be looser on requirements for company formation (e.g. allowing a sole director who is the same person as the sole shareholder, or having no minimum share capital). They may be less strict about background or solvency checks, and can sometimes allow much faster registration, even within minutes. Winding up a company can also be easier. That can have some advantages in the use of special-purpose temporary companies, such as the "limited duration company" that's offered in Bermuda, the Cayman Islands, and elsewhere.
They may offer novel devices for limiting liability, such as a Guernsey "protected cell company". For example, if you are running a lot of different investment funds with different risk profiles, and one of them crashes into huge liabilities, its creditors might seek recompense from your other, more solvent, funds. But in a PCC model they are isolated: even though each cell is owned and operated by the same people, local law treats their assets as independent. The same applies for something like operating a fleet of vessels where each one can belong to a separate cell.
Likewise, insurance regulation may let a company establish a "captive", a special-purpose insurance company set up exclusively for the parent company's needs. This is comparable to self-insurance (a large wealthy organization acting as its own insurer) but has financial and regulatory differences.

Privacy

In the past, but less so these days, offshore companies could be used to shield the identity of the true owners of some asset. This is still relied upon in many cases, but the tide is against it in terms of international anti-money-laundering and anti-terrorism efforts. So it is harder to hide from a government, even though you can often still hide from an ordinary inquisitive person.

Cultural factors

Many offshore jurisdictions attempt to provide other aspects of a business-friendly environment, such as promoting access to financial services, legal services, dispute resolution, and so on. The comparative advantage can be large if you're coming from another country with less developed institutions.
Sometimes, for a joint venture between companies from different countries, they'll want to pick a neutral third place, and an offshore jurisdiction is a natural choice due to the other factors above.
Comment: Worth noting that most tax havens in the carribean do have the UK as there official law giver. Also the channel islands are part of the UK


positive not completely positive maps

Question: In extension to this question
Positive but not completely positive?
I'd like to know, for $k>1$, examples of $k$-positive linear maps of a matrix algebra into itself that are not $k+1$-positive. (I don't know a single one.) By M.D. Choi's theorem
the size of the matrices involved must grow with $k$, but how fast?
Comment: I took the liberty of fixing the link and retagging ("complete positivity" is a bit over-specialised as a tag, in my view.)
Answer: The "canonical" example of a map that is $k$-positive but not $(k+1)$-positive is the map defined by
$$
\Phi_k(X) = k\cdot\mathrm{Tr}(X)I_n - X.
$$
Above, $n$ denotes the size of $X$ (i.e., $X \in M_n$) and $I_n$ is the $n \times n$ identity matrix. This map was introduced in "J. Tomiyama. On the geometry of positive maps in matrix algebras II. Linear Algebra Appl., 69:169–177, 1985." (though it had been considered by Choi earlier in the special case when $k = n-1$).
It's not difficult to prove that this map is $k$-positive just by elementary linear algebra. I won't post details here since it's a bit long and messy, but it's almost exactly the same as the proof that starts at the bottom of page 4 of these notes.
To show that this map is not $(k+1)$-positive (when $k < n$), simply let $\mathbf{v} = \sum_{i=1}^{k+1} \mathbf{e}_i \otimes \mathbf{e}_i \in \mathbb{C}^{k+1} \otimes \mathbb{C}^n$ (here $\{\mathbf{e}_i\}$ is the standard basis of $\mathbb{C}^{k+1}$ on the first subsystem, and it's just embedded into $\mathbb{C}^n$ in the natural way on the second subsystem). Then compute that
$$
(id_{k+1} \otimes \Phi_k)(\mathbf{v}\mathbf{v}^*) = k(I_{k+1} \otimes I_n) - \mathbf{v}\mathbf{v}^*,
$$
which has $-1$ as an eigenvalue and is thus not positive.

A couple of side notes:

This map shows that Choi's theorem on complete positivity is optimal in some sense: if $k \geq n$ then $k$-positivity implies complete positivity, but if $k < n$ then $k$-positivity and $(k+1)$-positivity are indeed different sets.
In the $k = 1$ case this map comes up frequently in quantum information theory under the name of the "reduction map".
Comment: @walker - Yes, $k$ refers to the dimension of the space on which the identity transformation acts. So if $\Phi$ acts on n-by-n matrices, then $id_k \otimes \Phi$ acts on kn-by-kn matrices.
Comment: Hi Nathaniel, I just want to ask what does K positive map or in general K map means and I do not understand what SN means in your notes.
Comment: @walker - $k$-positive map means that $(id_k \otimes \Phi)(X)$ is a positive semidefinite matrix whenever $X$ is a positive semidefinite matrix. In my notes, SN means "Schmidt number".
Comment: does k here means the dimension is k?

positive not completely positive maps


How to fix session error in magento 2.3.0

Question: How to fix error "Your session has expired"
Comment: this problem remains in my case. the website is running not on localhost.
Comment: This does not really answer the question. If you have a different question, you can ask it by clicking [Ask Question](https://magento.stackexchange.com/questions/ask). You can also [add a bounty](https://magento.stackexchange.com/help/privileges/set-bounties) to draw more attention to this question once you have enough [reputation](https://magento.stackexchange.com/help/whats-reputation). - [From Review](/review/low-quality-posts/158018)
Comment: This does not provide an answer to the question. Once you have sufficient [reputation](https://magento.stackexchange.com/help/whats-reputation) you will be able to [comment on any post](https://magento.stackexchange.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/low-quality-posts/158018)
Answer:
Change your Baseurl and Baseurl secure to 127.0.0.1 instead of localhost
Then run cache:flush
Or delete all directories below  var/cache
Answer: I've searched for an answer to this error that just showed up on our production Magento 2 (2.3.4-p2) site today.  Every single one says the same thing, go here in core_config_data and change localhost to 127.0.0.1, but at least in 2.3.4, the record in that table with the base_url values does not have localhost, so there's nothing to change.
I don't know if an earlier version of 2.3 had these values in core_config_data, but they exist nowhere in 2.3.4-p2.  I also flushed the cache at the command line, deleted all the directories under var/cache, but still the error continued.
I found through trial and error that clearing the cache in my web browser fixed the problem.
Just pointing out that this exact error may come up not because of the server, but because of your web browser, for whatever reason.  It happened to me in the middle of troubleshooting a completely different problem.  I signed out and tried to sign back in, but that also gave a similar error -- even though I was fine 3 hours earlier.
The only thing that happened in those 3 hours was I came back to test the same problem I was working on before and was stopped by this error.  So, I didn't change anything on the server to start the problem, it just happened on my FireFox web browser, which I only use to work on Magento 2.
Answer: Use 127.0.0.1 instead of localhost for that execute below query.
UPDATE `core_config_data` SET `value` = 'http://127.0.0.1/magento/' WHERE `core_config_data`.`path` = 'web/unsecure/base_url';
UPDATE `core_config_data` SET `value` = 'https://127.0.0.1/magento/' WHERE `core_config_data`.`path` = 'web/secure/base_url';

then clear cache by the cli command
php bin/magento cache:flush

Answer: I had this problem too
I converted 127.0.0.1 to http://new.mys.com for ease of use in the httpd-vhost file
That's why my site on Localhost didn't work properly
If you have converted 127.0.0.1 to a domain in Windows, delete it
The error happens because Windows can't translate the localhost or youre domain URL to 127.0.0.1 in core_config_data table, thus the add to cart function does not work properly
As described above, the best solution for this issue is to set web/unsecure/base_url and web/secure/base_url to IP address 127.0.0.1.
UPDATE `core_config_data` SET `value` = 'http://127.0.0.1/yourwebsite/' WHERE `core_config_data`.`path` = 'web/unsecure/base_url';
UPDATE `core_config_data` SET `value` = 'http://127.0.0.1/yourwebsite/' WHERE `core_config_data`.`path` = 'web/secure/base_url';

Finally, clean cache
php bin/magento cache:clean


Implementing HMAC encryption algorithm in iPhone application

Question: I want to implement HMAC encryption algorithm for my iPhone application. Any sample code will really help. Also, please guide me with brief implementation of the same.
Answer: Use the Common Crypto functions. The documentation is in man pages, so you'll need to hunt for it a bit. They're in libSystem on iOS and Mac OS X, so no need to add another library or framework to your project. As you can see from the example below, the API is very similar to OpenSSL's.
If you are actually interested in encrypting, as opposed to authenticating data, Common Crypto has functions to perform AES and 3DES (and DES, but don't use it, it's far too weak for modern needs). Take a look at the CCCryptor man page for details.
The example below is equivalent to running openssl dgst -md5 -hmac secret < myfile.txt. Start by initializing the the CCHmacContext, and then call CCHmacUpdate as long as you have data to authenticate. When you've read all the bytes, call CCHmacFinal to get the HMAC into a buffer. I've provided a crude method to convert the HMAC bytes into printable hex.
#include <CommonCrypto/CommonHMAC.h>

#include <sys/types.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

extern int      errno;

    int
main( int ac, char *av[] )
{
    CCHmacContext    ctx;
    char             *key = "secret";
    char             buf[ 8192 ];
    unsigned char    mac[ CC_MD5_DIGEST_LENGTH ];
    char             hexmac[ 2 * CC_MD5_DIGEST_LENGTH + 1 ];
    char             *p;
    int              fd;
    int              rr, i;

    if ( ac != 2 ) {
        fprintf( stderr, "usage: %s path\n", av[ 0 ] );
        exit( 1 );
    }

    if (( fd = open( av[ 1 ], O_RDONLY )) < 0 ) {
        fprintf( stderr, "open %s: %s\n", av[ 1 ], strerror( errno ));
        exit( 2 );
    }

    CCHmacInit( &ctx, kCCHmacAlgMD5, key, strlen( key ));

    while (( rr = read( fd, buf, sizeof( buf ))) > 0 ) {
        CCHmacUpdate( &ctx, buf, rr );
    }
    if ( rr < 0 ) {
        perror( "read" );
        exit( 2 );
    }
    CCHmacFinal( &ctx, mac );

    (void)close( fd );

    p = hexmac;
    for ( i = 0; i < CC_MD5_DIGEST_LENGTH; i++ ) {
        snprintf( p, 3, "%02x", mac[ i ] );
        p += 2;
    }

    printf( "%s\n", hexmac );

    return( 0 );
}

Comment: Thanks for that! I summarized this on our blog and made a category for NSString for further usage. See it at http://blog.blackwhale.at/?p=801 . cheers,anka
Answer: HMAC is not an encryption mechanism, but an authentication digest.  It uses an underlying message digest function such as SHA-1, SHA-256, MD5 etc, with a secret key to generate a code that can be used to authenticate data.
Generating an HMAC digest is extremely simple. Here is the description from RFC2104 (via Wikipedia)
Let:

H(·) be a cryptographic hash function (ie. SHA-1, SHA-256, MD5 etc)
K be a secret key padded to the right with extra zeros to the input block size of the hash function, or the hash of the original key if it's longer than that block size
m be the message to be authenticated
| denote concatenation
⊕ denote exclusive or (XOR)
opad be the outer padding (0x5c5c5c…5c5c, one-block-long hexadecimal constant)
ipad be the inner padding (0x363636…3636, one-block-long hexadecimal constant)

Then HMAC(K,m) is mathematically defined by:
HMAC(K,m) = H((K ⊕ opad) | H((K ⊕ ipad) | m)).
For the underlying digest function you can help yourself to one of the C implementations from OpenSSL.  In fact it also has a C implementation of HMAC that you can probably just use as is.
Comment: Ahem http://www.opensource.apple.com/source/CommonCrypto/CommonCrypto-55010/CommonCrypto/CommonHMAC.h
Comment: Thank you Dean. Which API should use in IOS to utilize HMAC authentication digest? Do you have any sample code?
Comment: I don't think there are any built-in APIs in iOS, you will have to write your own.  You will need to get the source from OpenSSL and add it to your application manually.


Prove that if $\chi(G-u-v)=\chi(G)-2$ for every vertices $u, v$ ($u \ne v$) then G is complete graph.

Question: I'm trying to prove this by contradiction:
if $G$ isn't complete graph, there must exist vertices $u,v \in V(G)$ for which edge $uv \notin E(G)$. Then $u$ and $v$ must have the same color in proper coloring $C$ and now I'd like to prove that by removing $u, v$ we have $\chi(G-u-v) = \chi(G) - 1$ (that would be the contradiction), but I'm not sure whether it's true.
Answer: Consider the contrapositive of the statement instead:
If $G$ is not complete then $\exists u, v \neq u \text{ s.t. } \chi(G - u - v) \neq \chi(G) - 2 \quad \quad (1)$.
To prove (1), note that since $G$ is not complete, $\exists u, v \neq u$ with the same color in a proper minimal coloring of the graph; for such a pair of vertices we have that $\chi(G - u - v) \geq \chi(G) - 1$ and therefore $\chi(G - u - v) \neq \chi(G)-2$.
Answer: The accepted answer assumes a great deal about the existence of 2 vertices of the same color in the proper coloring of an incomplete graph $G$. It is better to assume less. Consider this proof by contradiction instead:
Assume $G$ is not a complete graph with $\chi(G)=n$ and that the statement holds. Then, $\exists$ vertices $u$, $v\neq w$ in $G$ s.t. $u$ is not adjacent to $v$. Remove these vertices and attain a graph $G-u-v$. By assumption, $\chi(G-u-v) = \chi(G) - 2 = n - 2$. Now, add back 2 vertices $u$, $v$ that are not adjacent to one another. This graph $G$ can clearly be colored in at most $(n-2) + 1 = n - 1$ colors since the maximum degree of any vertex is $\delta(G) = n - 1$, but this is a contradiction since $\chi(G) \leq n - 1 \implies n \leq n - 1$, a clear falsehood. Thus, $G$ is a complete graph if $\chi(G-u-v) = \chi(G) - 2$. $\Box$
Comment: Having them be the same color is equivalent to non-adjacency.
Comment: I agree that stating they are the same color $\implies$ they are not adjacent, but stating they are not adjacent, the clear result of assuming the graph $G$ is not complete, does not imply they are the same color in a given coloring. It may be true that you can prove this, but it's a hefty and unnecessary lemma to the proof. My professor tore my usage of this proof apart today on this point. I didn't state that your proof was wrong, it just makes more assumptions than the one I provided.


Applying Bohr's model for Helium atom

Question: Consider the following atomic model for Helium. Helium contains 2 electrons revolving in circular orbit around the nucleus,in such a way that there is minimum possible repulsion between them.Calculate the first ionisation energy of this Helium.Will there be any difference in the ionisation energies calculated and experimentally found?
Comment: Bohr's model is applicable only to monoelectron species. So it may work in He+ ion.
Comment: To be strict it doesn't mean the model is not applicable - it has just been applied after all. It means it is not very accurate.
Comment: Can you show some work on how you calculated the value? It's not very helpful to ask what is wrong when we don't know what you did.
Comment: Now that's an interesting question. Why don't you go and compare these two numbers?
Comment: @IvanNeretin I have calculated the value and I got 29.62 eV but the experimentally found value is 24.6 eV. Could you explain me why that difference occurs?
Comment: Yes. It means the model is not applicable.
Comment: Nothing is wrong. Even applying a more accurate model hardly will bring you to the experimental values. I personally known active researchers still calculating hydrogenoid systems :)
Answer: What this exercise suggests boils down to placing the two electrons on opposite sides of the nucleus. In this way, the repulsion is minimal because the distance between both electrons is maximal. We can safely assume there will be a difference between the energy calculated with this simplified extension to Bohr's model and the experimental value, otherwise Bohr or his peers would have adopted it. The inability to satisfactorily calculate the ionisation energy of Helium with any such model was a major driver for scientists in the early 20th century to adopt a new quantum mechanical description of the atom.
Bohr's theory tells us that the ionisation energy for one-electron atoms varies with the square of the nuclear charge, i.e. $E=Z^2$ in Rydberg units (1Ry = 13.6eV). So the ionisation energies of $\ce{H}$, $\ce{He+}$, $\ce{Li^2+}$ are respectively 1, 4, 9, ...
The two-electron model described here can be simplified to a one-electron problem because the particles are assumed to be neatly aligned at all times. To this end, we define an effective nuclear charge $Z_\rm{eff}$ which sums the charge of the protons in the nucleus (+2 for Helium) and that of the other electron (-1), weighed by the square of the distance : since the opposite electron is twice as far as the nucleus, its repulsive force is four times smaller than the attractive force of one proton in the nucleus. So we get $Z_\rm{eff} = 2-\frac{1}{2^2} = \frac{7}{4}$. The ionisation energy then becomes $E=Z_\rm{eff}^2 = \frac{49}{16}$ = 3.06 Ry (or 41.6 eV).
The experimental value is 1.81 (24.6 eV), which is significantly lower.
Apparently the electron-electron repulsion in the Helium atom is (much) stronger than this simple model suggests.
Comment: I think we should go by the Slater's rules?
Comment: The exercise at hand seems to be seeking a calculation for a thought experiment. Slater's empirical rules do not apply to that thought experiment.

Applying Bohr's model for Helium atom


Role based access control - correct MVC pattern

Question: I started using the MVC pattern a half year ago, and I still have some misunderstandings.
Now I want to implement a role based access control in my application. However, my question is not about RBAC, it is about MVC.
My implementation of RBAC is this:
user->role->permission
so every user (ex. userA) can have many roles (ex. reader, editor, admin), and every role can have many permissions (read, update, delete, etc.).
MySQL tables

users (list of users)
roles (list of roles)
permissions (list of permission)
roles_permissions (list of roles->permissions connections. ex. editor->update)
users_roles (list of users->roles connections. ex. userA->editor)

Now my question is
How should I implement this in MVC?
Have a separate model for: users, roles, permissions, roles_permissions, users_roles, than have an authManager class that creates users, roles, permission, roles_permissions, and user_roles?
Is this way correct? Is there a better, maybe more elegant way?
Answer: Basically I'd stick with one of many already existing Kohana ACL libraries instead of writing your own (or at least try them to see if they fit to your needs).
You may want to check this thread (Wouter A1, A2 and ACL modules) - http://forum.kohanaframework.org/discussion/1988/releases-a1-authentication-acl-acl-for-kohana-a2-object-level-authorization/p1
It's being constantly updated and maintained and it's available for 3.2 version as well.
If you feel Wouter modules are complicated, you can also check Vendo ACL module which is very simple and removes a lot of complications - https://github.com/vendo/acl
Examples how to use it - http://forum.kohanaframework.org/discussion/9517/getting-started-with-vendo-acl/p1
Answer: You'll typically want to use an ACL library/class for this since it's ACL you are describing. I don't know Kohana but from a quick google i've found this Kohana ACL library. https://github.com/synapsestudios/kohana-acl
But basically you'll indeed need models to manage your separate entities in the ACL libraries like users, roles and permissions. Then talk to the ACL-api in your controllers or other libraries to determine access to particular parts of your app.
Answer: I'm copy/pasting the code of KohanaPHP's main application controller assuming that we have Zend_ACL already included.
Please note I have user-based permissions, not group-based one... Though this can be easily edited.
<?php

defined('SYSPATH') OR exit('No direct script access.');

class Controller_Application extends Controller_Template
{

    protected static $acl;
    public $template = 'default';

    public function before()
    {
        parent::before();
        session_start();
        self::$acl = new Zend_Acl();
        $this->set_permissions($_SESSION['userid']);
    }

    protected function check_access($resource, $privilege, $redirect = TRUE)
    {
        $permission = (self::$acl->has($resource) AND self::$acl->isAllowed($_SESSION['userid'], $resource, $privilege));
        if (!$permission AND $redirect)
            $this->request->redirect('user/denied');
        elseif (!$permission AND !$redirect)
            return FALSE;
        elseif ($permission AND !$redirect)
            return TRUE;
    }

    protected function set_permissions($user_id)
    {
        $result = DB::select()
            ->from('permissions')
            ->where('user_id', '=', $user_id)
            ->execute()
            ->as_array();
        self::$acl->addRole(new Zend_Acl_Role($user_id));
        foreach ($result AS $permission)
        {
            if (!self::$acl->has($permission['resource']))
                self::$acl->add(new Zend_Acl_Resource($permission['resource']));
            self::$acl->allow($user_id, $permission['resource'], $permission['privilege']);
        }
    }
}

?>

Then I check access in controllers like this: $this->check_access('events', 'add');.
Answer: I know the trail is cold, but a new project has popped up :
PHP-RBAC is a PHP Hierarchical NIST Level 2 Standard Role Based Access Control and is pretty mature. It is also an OWASP project.
I hope you enjoy it at http://phprbac.net
it is used in jframework in a way that is the standard way of incorporating RBAC in a MVC pattern.


Is there a Google penalty for changing domain name?

Question: I am thinking of changing my primary domain name but redirect the existing domain name to a new primary name. Would there be a Google or search engine penalty for doing this?
Comment: Have you read [How do I rename a domain and preserve SEO?](https://webmasters.stackexchange.com/questions/3399/how-do-i-rename-a-domain-and-preserve-seo)
Comment: There is no "penalty", but there are certain steps that need to be taken in order to preserve SEO, as mentioned in the linked thread above.
Answer: There is no penalty for changing domain names.  There may be a temporary disruption in your indexing and ranking.  Then there is risk that SEO gets completely messed up during the process.
Google has a change of address tool built into search console.  You need to use this tool when you change domain names.  Doing so involves implementing "301 Permanant" redirects from the old URLs to the new URLs and then using the tool to inform Google that the domain name has changed.
When you use the change of address tool, search engine rankings and traffic may temporarily drop for a week or two, but then it should come back to original levels.
However, for a small percentage of sites, something goes wrong, even when using the tool.   There is a about a 10% chance that things go sideways and your SEO suffers dramatically.   90% of sites have no lasting issues, but a small number of sites have severe problems (for example).   Because of this risk, you should only move domains when the other benefits outweigh that risk.
Answer: If you map your entire site out and 301 redirect all pages to the new locations, it's likely to be mild at most. However if you just 301 the entire old domain to the new homepage it's likely to be bad.


Why magnetic field starts from north pole and ends in south pole?

Question: In magnets such as bar magnets the magnetic field lines are starting from North pole and ends in south pole..but I don't know what is the reason for it..why this happens.
Comment: The reason is "because it is defined that way".
Comment: For clarification, are you really asking about why magnetic field lines form loops, or are you just asking why they always have to "start" at the "north pole"?
Answer: There's a logical sequence of definitions, from which the answer to your question follows...
The North Pole of a magnet is short for 'North-seeking pole'. It is the pole that settles down to point roughly geographically North when the magnet is suspended so that it can turn freely about a vertical axis, and is well away from sources of magnetic fields other than the Earth.
The direction of a magnetic field at a point P due to any source, such as a magnet or a current-carrying wire, may now be defined as the direction in which the North Pole of a freely suspended magnet (basically a magnetic compass) points at P (having subtracted vectorially the effect of the Earth's field at P). [The magnet's or the wire's field at P may well be much stronger than the Earth's field, which served its purpose earlier in allowing us to name the poles of magnets, but may now be negligible compared with the field we're investigating.]
A magnetic field line is a line whose direction at any point along it is the direction of the magnetic field at that point.
We can now deduce that, outside a magnet, its magnet field lines will go from the North Pole of the magnet to the South. It's because (a) a field line tells us the direction of the field at each point along it, and (b) the direction of the field is the direction in which the North Pole of a compass points and (c) the North Pole of the compass will be repelled by the North Pole of the magnet and so points away from it!
[Magnetic field lines are closed loops, so inside the magnet, they will run from South to North. This doesn't contradict what we've said before, which applies on the assumption of being external to sources of magnetic fields.]
[All this stuff about suspended magnets and compasses may seem outdated. There are other ways to determine which pole of a magnet is which and to determine the direction of a magnetic field. They are based on conventions (right hand rules and suchlike), but these conventions were chosen to be consistent with the old-fashioned definitions above.]
Answer: Because the magnetic north pole is in reality a south pole !
To be more precise : in a magnet, the north pole is where magnetic lines field exit. If you imagine the earth magnetic field as created by a giant magnet, the magnetic north of this magnet is at the south magnetic pole of the earth.
Comment: Sorry. I used the french word ! I have changed.
Comment: That's obviouly wrong. North pole cannot be a South pole, by definition.
Comment: You can look at : https://en.wikipedia.org/wiki/North_Magnetic_Pole Polarity : "Pole is actually a magnetic south pole and the Earth's South Magnetic Pole is a magnetic north pole."
Comment: I know that, but that's not what you're saying in your answer. That's what I meant. You should clarify it carefully.
Comment: I have tried to be less concise !
Answer: Your question is like asking "why pi is the ratio of circumference to the diameter of the circle.
It is the very definition of pi.
It has been experimentally concluded that magnetic field lines surround a magnet, which are closed figures. They just named it that way. They could've used cat or dog too, but that would be great since most of the namings have some underlying meaning and cat and dog is meaningless other than the fact that it represents the same thing as north and south pole.
Comment: For now, it's unclear whether he is asking why magnetic field lines behave the way they do, or just why from n to s  and not s to n , outside of the Magent.
Comment: I think that the question has sense since for a magnet we already use the term north pole and south pole. It can be misleading when you look at the magnetic field line !
Comment: "It has been observed that magnetic field lines surround a magnet" no. Noone will ever observe field lines.
Comment: @Jasper I meant that experiments lead to that conclusion
Comment: @NightcoRohak -- of course you meant that.  I believe that most of us here assumed that you meant that.
Answer: In the question are some misunderstandings about magnetic fields.
In a permanent magnet the magnetic field is the result of the alignment of subatomic particles, mostly of electrons. In detail, subatomic particles have an intrinsic magnetic dipole and in permanent magnets these dipoles are aligned (frozen).
Any magnetic field is a closed loop. This holds for the magnetic field of the subatomic particles as well as for the macroscopic field in a permanent magnet, which is the superposition of the magnetic fields of the involved subatomic particles.
In a permanent magnet the aligned particles are aligned somehow in chains. But the magnet is of a limited length and at the beginning and the end of the body the magnetic field leave the body and are able to continue even in vacuum. Between the ends of a magnet the magnetic field is bend and connects this ends.

Because magnetic fields in parts are going through the empty space to form closed loops it is possible to align other magnets. Having named the "poles" of a first magnet, the alignment of other magnets in the magnetic field of this first magnet allows to mark their poles. This was done many centuries ago because the earth has a magnetic field and some materials were found on the earth, which are permanent magnets. The compass was invented and the earth's poles were named.

In magnets such as bar magnets the magnetic field lines are starting from North pole and ends in south pole.

So the field lines are not ending, they are loops. And some part of the loop is going through space. This is right for every magnet (if not closed in a donut). The magnetic fields of two magnets get in superposition thanks to the part of the field lines in empty space.
Answer: Because it is a fundamental property of nature. Magnetic field lines forms closed loops. Two bar magnets held over unlike poles (a north end and a south end) would attract. You can imagine a field line connecting the two ends. That is a loop by itself.
In fact, all about magnetic field lines that physicists know is about as much as you know yourself, that the field lines trace out closed loops between ends of the bar magnet.

(Field lines of a single bar magnet)
If you spread out iron fillings, they arrange themselves along this pattern of field lines. Magnetic fields are not really predictions of anything else. They were discovered in this fashion. That they always seem to form loops.
I am aware that there are theories on the existence of a single pole existing all by itself (monopole). It still waits to be confirmed.
Comment: I heard that there were magnetic filed configurations, in stellarators I guess, that did not form a loop of a finite length, but were winding infinitely.


Is the Shown location of your phone on find my friends accurate if the the phone is offline

Question: My daughter lost or had her phone stolen.  I do not believe she had her find my phone on.   She went on to find friends through the icloud and it is showing  a location for her phone.  We are wondering if this is actually where her phone is. Or what is the app basing this information on.
Answer: If she didn't have Find Friends turned on (it is on by default so she would've had to turn it off) then what you're seeing is the last location the iPhone reported whenever it reported it's location last.
If she's looking at it thru iCloud, perhaps she does have the Find My iPhone installed.  This is where a user can locate their own device.  The device needs to be on and online to report its location.  If she see's her iPhone and it has a green dot, that means it's currently online.  If it's a gray dot, the iPhone is offline.  If it last reported its location within 24 hours, you'll see the date/time.  If it's longer than 24 hours, you'll just see 'offline'.


Why is there no mention on labels especially IPAS of alcohol content?

Question: I don't understand how beer can be sold in a supermarket, yet not be required to have the alcohol content listed on the bottle. This can lead
to serious consequences, if the person drinking does not realize the amount. Triple IPAs up to 13%...Not good.
Answer: There is no requirement from the TTB at the federal level to include ABV% on beer labels. Individual states can mandate that. Washington state, where I live, mandates that any beer over 6% needs to put it on the label. So, what you end up having is a hodgepodge of different beer labels. Nationally distributed beers usually put it on the label since they don't want to have different labels for each state. Locally made beers in your state may not require it, so that's why you aren't seeing it.
Comment: Could you tell us what TTB stands for?
Comment: Alcohol and Tobacco Tax and Trade Bureau https://www.ttb.gov/


usage of attr_accessor in Rails

Question: When do you use attr_reader/attr_writer/attr_accessor in Rails models?
Comment: I guess you mean attr_accessor?
Answer: Never, unless you have specific need for it. Automatic database-backed accessors are created for you, so you don't need to worry.
Any attr_accessors you do create will change the relevant @attr on the rails object, but this will be lost when the object is destroyed, unless you stick it back in the database. Sometimes you do want this behavior, but it's unusual in a rails app.
Now in ruby, it's a different story, and you end up using these very frequently. But I'd be surprised if you need them in rails---especially initially.
Comment: perfect - thanks.

(I'd plus vote you, but I just got on here and I seem to need 15pts first... That mechanic seems unfriendly to new users.)
Comment: Note: as of Rails 3.x `attr_accessible` is required (by default) for each model whose attributes you want to allow writing to (e.g. via a form POST).  This can be changed in the `application.rb` for backward compatibility, but was added as a security measure to require you to explicitly whitelist attributes that _should_ be updateable by users.  As an added benefit, all of the attributes of a model (db columns) are visible right there in the model, so you don't have to remember what the heck that column was named :-)
Answer: attr_accessor can be used for values you don't want to store in the database directly and that will only exist for the life of the object (e.g. passwords).
attr_reader can be used as one of several alternatives to doing something like this:
def instance_value
  "my value"
end

Answer: Rails models are just ruby classes that inherit from ActiveRecord::Base. ActiveRecord employs attr_accessors to define getters and setters for the column names that refer to the ruby class's table. It's important to note that this is just for persistence; the models are still just ruby classes.
attr_accessor :foo is simply a shortcut for the following:
def foo=(var)
  @foo = var
end

def foo
  @foo
end

attr_reader :foo is simply a shortcut for the following:
def foo
  @foo
end

attr_writer :foo is a shortcut for the following:
def foo=(var)
  @foo = var
end

attr_accessor is a shortcut for the getter and setter while attr_reader is the shortcut for the getter and attr_writer is a shortcut for just the setter.
In rails, ActiveRecord uses these getters and setters in a convenient way to read and write values to the database. BUT, the database is just the persistence layer. You should be free to use attr_accessor and attr_reader as you would any other ruby class to properly compose your business logic. As you need to get and set attributes of your objects outside of what you need to persist to the database, use the attr_s accordingly.
More info:
http://apidock.com/ruby/Module/attr_accessor
http://www.rubyist.net/~slagell/ruby/accessors.html
What is attr_accessor in Ruby?
Comment: `attr_reader :foo` generates `foo` getter method, `attr_writer :foo` generates `foo=` setter method, `attr_accessor :foo` generates both `foo` and `foo=` methods.
Comment: +1 Fatih. Thanks for the editing. I've edited my response to include your comment
Answer: If you are using it to validate the acceptance of the terms_of_service, you should really consider using validates :terms_of_service, :acceptance => true. It will create a virtual attribute and is much more concise.
http://guides.rubyonrails.org/active_record_validations.html#acceptance.
Answer: One example is to have a number of options stored in one serialized column. Form builder would complain if you try to have a text field for one of these options. You can use attr_accessor to fake it, and then in the update action save it in the serialized column.

usage of attr_accessor in Rails


Is there any point in having layers in a neural network for regression problems?

Question: In my textbook I read that an MLP and linear activation functions for the hidden layers can be reduced to a simple input-output system, i.e. no hidden layers. This makes sense to me. Later on I read that for regression problems, the linear activation function is commonly used (along with MSE loss function). How does this work together? Is it reasonable to say that no layers are ever needed if using an MLP to solve a regression problem, or is any of the statements wrong (or compatible)?
Answer: Yes it does, because if the relation between target and training data is a very complex function we may not be able to capture it in one layer with limited units.
Increasing the number of hidden layers may help you model a highly complex function with limited units on each layer. Number of hidden layers varies from problem to problem and mostly is a hot and trial method
Comment: Did you read the text body of my question? So I'm assuming I'm misinterpreting my textbook, and that linear activation functions are typically **not** used for the hidden layers?
Comment: Yes..Linear activation functions are usually avoided as they cant model non linear function..but if you are sure target variable and training variable are linear you dont need non linear activation function
Answer: In regression, it makes perfect sense to have multiple hidden layers to model the complex relationships between inputs and outputs. However, those layers need to have non-linear activation functions, otherwise, they would be equivalent to a single layer.
When your textbook said that "linear activation function is commonly used (along with MSE loss function)", it refers only to the last layer, to allow the model to generate unbounded real numbers. The hidden layers must have non-linear activation functions.

P.D.: the equivalence of multiple layers with linear activations and a single layer can be proved easily:
$(xW_1 + b_1)W_2 + b_2 = xW_1W_2 + b_1W_2 + b_2 = x(W_1W_2) + (b_1W_2 + b_2)$).
Comment: "it refers only to the last layer" this was the key part that I didn't understand (and to be frank, my textbook didn't make very clear. Thank you.


Funding and anime diversity

Question: In this video, Digibro argues anime's international appeal is that, whereas Western TV including its animation is designed for financial reasons to meet a target demographic's existing interests, anime can be more diverse and give us "something that we never would've known we wanted". I'm sure I've simplified the argument (transcript here), but my understanding is that Digibro feels financial motives haven't homogenised anime as much as they have the animation of other nations. But why would that be so?
Comment: I'll have to watch the video to make a real argument, but my kneejerk reaction is to call BS on that line of reasoning. Anime is, if anything, even more beholden to finances than Western animation. It feels fresh and new and original at first because it's made for target demographics we don't have in the West, but when you watch anime long enough you start to see the same financially motivated homogeneity you see in Western TV. This may have been more true of older anime from the 70's and 80's, much of which has an art-house flavor, but it's certainly not been true at least since the mid 90's.
Comment: Thanks for your approval. The Skeptics comparison does make sense! Here are 2 links: http://goboiano.com/here-are-japans-top-100-favorite-anime-of-all-time-part-1 & http://goboiano.com/here-are-japans-top-100-favorite-anime-of-all-time-part-2
Comment: @Torisuda Thanks for that. Perhaps the question should instead be why pre-1990 anime was so "arthouse". Like you, I suspect anime's international appeal is more down to its fitting a foreign set of conventions, so it feels inventive. (A recent survey of Japanese fans' favourite anime suggests they don't assess them in remotely the same way Western fans do.)
Comment: Nah, I personally think the way you phrased the question is fine. Reminds me a bit of how questions on [Skeptics](https://skeptics.stackexchange.com/) are usually posed. It's also an oversimplification to claim that there's no art-house anime today or that all the anime in the 80's was art-house, or good for that matter. There was commercial stuff in the 80's, and there was art house stuff that was terrible, and we still have some art house stuff today. The whole claim is overly generalized IMO. I'd be interested to see that survey, if you have a link.
Answer: Anime is very homogenized and always has been. If you were a fan during the 1970s you could pick among a dozen flavors of different anime and that was it. In the following picture, each cover represents a different franchise.

Nothing much has changed since then. Only there are more flavors of anime now. But new anime are all derived from some older anime and the more you watch, the more you realize all the similarities.

Funding and anime diversity


What is a practical Catholic definition of conscience?

Question: What is a practical Catholic definition of conscience?
I have never found one.
Comment: are these [catechisms](http://www.vatican.va/archive/ccc_css/archive/catechism/p3s1c1a6.htm) specific/vague enough: catechisms
Comment: @depperm Reads like an answer to me.
Comment: The CCC is too poetic and very unpractical. It just tell us that we have a conscience but not have it works. Some likes a poetic language and some likes a practical language
Answer: Fr. John Hardon, S.J.'s Catholic Dictionary entry for "conscience":

The judgment of the practical intellect deciding, from general principles of faith and reason, the goodness or badness of a way of acting that a person now faces.
It is an operation of the intellect and not of the feelings or even of the will. An action is right or wrong because of objective principles to which the mind must subscribe, not because a person subjectively feels that way or because his will wants it that way.
Conscience, therefore, is a specific act of the mind applying its knowledge to a concrete moral situation. What the mind decides in a given case depends on principles already in the mind.
These principles are presupposed as known to the mind, either from the light of natural reason reflecting on the data of creation, or from divine faith responding to God's supernatural revelation. Conscience does not produce these principles; it accepts them. Nor does not conscience pass judgment on the truths of reason and divine faith; it uses them as the premises from which to conclude whether something should be done (or should have been done) because it is good, or should be omitted (or should have been omitted) because it is bad. Its conclusions also apply to situations where the mind decides that something is permissible or preferable but not obligatory.
Always the role of conscience is to decide subjectively on the ethical propriety of a specific action, here and now, for this person, in these circumstances. But always, too, the decision is a mental conclusion derived from objective norms that conscience does not determine on its own, receiving it as given by the Author of nature and divine grace.


How to quickly assess the legitimacy of a conference?

Question: Academics commonly get invitations to conferences. Some of these are legitimate, but many are simply scams or bogus. How can you tell at a glance which is which?
Comment: Default - it is bogus. Unless the invitation is from somebody I know, have met in real life, and trust.
Comment: Who is the sponsor? If it is a reputable and known organization, then it is probably ok. But if you just get a blind email from somewhere/someone you don't know, then beware. Lots of in-between cases, of course.
Comment: @Buffy there are very questionable conferences sponsored by reputable organizations. Thus I don't think the sponsor is a good guide. A better guide is to look at the papers that were presented in past years and to look at the organizers.
Answer: The fastest way possible is to use a policy of "don't call me, I'll call you" with venues (conferences, journals, etc.). If you don't already know them, discard correspondence from them. In most cases there are already too many options to chose from on where to go and where to submit, so there is little to lose from discarding unsolicited contact from people you don't already work with.
The next, more open, version is to ask a few sensible people you already know. "Hey, have you heard of XYZ conference?" Assuming the people you know and respect are not carbon copies of you, this should net you a very high percentage of recognition if the conference is worth bothering with. Asking people you know and respect, and who are not exactly like you, is a great way to broaden your horizons if you are not yet familiar with what the useful venues are already.
Note that I take a somewhat snobby view of venues here, in that I don't actually care about mere legitimacy, in the same way I don't care to eat at a restaurant because I won't immediately be robbed for going in. I want a way to spend my time, effort, and money that is much better than my existing options. Some conference I've only heard of because of some unrequested 'invitation' is vanishingly unlikely to provide an option better than the ones I'm already aware of.
If for some reason something new appears that really piques my interest, I would look to see who supposedly is on the organizing/editorial committee, and see if there are people I know and respect and would like to work with (and if so I might also contact them directly to ensure they actually are affiliated and approve). I would also read previous papers/proceedings/abstracts and see what they have to offer. If I am not impressed with the quality - really, genuinely impressed by how useful and applicable the papers are to my work - easy slam-dunk into the trash bin.
Answer: Is it a conference you've heard of? Do you know any of the organizers? Do you know any of the main speakers? If the answer to all 3 questions is no, it's probably not a worthwhile conference.
Academics are usually fairly aware of the main conferences and researchers in their field. Most of the scam conferences I get invites to are in far away locations, in fields that are at best tangentially related to mine (signal processing, education), or are hopelessly broad in scope. They are put on by Universities and organizers I've never heard of. There is very little chance of mistaking them for a legit conference.
Comment: @Ooker The new one starts by having established organizers who promote it in their own circles.
Comment: but a new one needs to start somewhere, right?


Why is trim for take off affected to Vmc(Speed maintain control)?

Question: I am studying in Vmc part, but I have hard time to understand that trim for take off is affected to Vmc. How and why does it make Vmc speed increase?
Comment: What aircraft? This isn't always the case.
Answer: The trim setting doesn't increase or decrease Vmc speed itself.  I suspect your question is actually "what is the take-off trim setting's relationship to Vmc".
The term "trim", more or less referring to a state of aerodynamic equilibrium in the balance of pitch related forces, and such equilibrium being achieved at a given speed for a given weight/power/thrust configuration, you trim to a speed.  Trim speed is the speed the airplane will seek without physical intervention by the pilot or autopilot, for a given all up weight, CofG location, and power setting (I've always called the trim wheel a "hands free speed setting dial").
Trim settings for takeoff in multi-engine airplanes can normally be expected to be something at or close to single engine climb speed (blue line) in a piston twin, or at or close to V2, or single engine safety speed, in a transport airplane.
The idea is to have the airplane configured so that it will naturally seek a desired speed, or reasonably close to it, without control input, and reduce the workload on the pilot during periods of excitement.  To the extent that the trim setting is related to Vmc, it's to achieve this speed margin as determined by the manufacturer.
Answer: Elevator Trim does not change the Minimum Control Speed(Vmc). It is variables such as engine power, weight and balance, and center of gravity that can cause changes to Vmc.
Those variables can also mean changes to the correct elevator trim settings for takeoff.


Does a 7200 vs 5400 RPM hard drive improve performance for photo editing?

Question: I have a dedicated RAID 1 (mirrored) volume for my photo library which is stored in Aperture 3 and one of the drives just died so I'm going to replace both.  Is there a noticeable performance improvement using 7200 RPM drives over 5400 RPM drives for photo editing?  I'm sure there is for video editing but don't know about photo.
Answer: Yes, there is a noticeable improvement if you're using a DAM tool like Lightroom or Aperture. The bottle neck in such programs is the disk drive. To see this for yourself, import a set of files and then watch the Activity Monitor. With Lightroom, you'll see that the disk activity will hit 100% while thumbnails get generated. CPU activity meanwhile will be nowhere near 100%, especially if you have a fairly modern machine.
Comment: Even though it's disk-bound, I'm skeptical that the improvement in going from 5400rpm to 7200rpm drives is going to produce a significant improvement in real-world use. You may notice it if you look carefully, but I'd be very surprised if it makes an impact big enough to really change anything practically.
Comment: Ah yea, thumbnail generation should be improved, especially helpful for batch edits.  I guess it does depend on what you're doing as rfusca says, in a straight PS workflow its probably not a big deal but in LR or Aperture it'd help more.
Comment: Say you have 1000 pictures in a directory and the worst-case-scenario, that neither OS nor HDD can optimize the search of the files on the disk. then you'll have 8 vs 12 *1000 = 8 vs 12 seconds for just touching the files. 4 seconds might not be much, but these 50% are noticable. Faster rotation speeds up random access - that is why fast platters (or SSDs) are to be preferred for compilation.

I'm not looking into transfer-rate, as it depends on other factors like density, layout, above mentioned optimization.
Answer: I work with 21MP photos and in an effort to speed up Lightroom on my desktop I looked at what I could improve and it seemed replacing the disks was the way to go. Unfortunately, I can't say about 5400 RPM vs. 7200 RPM but I replaced a pair of fairly zippy Hitachi SATA 15,000 RPM (!) drives by a pair of 160GB Intel X25G2 SSD. The improvement was noticeable, so my gut feeling is that anything faster does help. I don't edit photos on my laptop too much but I've had laptops in the past that I upgraded to 7200 RPM for work (compilation of apps), and I could also feel the difference.
My answer: yes, I think it will help. My advice: go for a SSD, besides memory this is one of the "cheapest" way to really improve your performances (short of buying a new computer). You don't need a big one, as long as you leave the Aperture/Lightroom database on this disk, and say, 6 months worth of latest RAW. If you don't have much memory, putting the OS page disk on the SSD can help as well.
Comment: How are those Intel SSD's? I do a lot of photo work in Lightroom, and I've been seriously considering some SSD raid for my work drive. I've noticed that there are some insanely fast SSD's these days, pushing 800mb/s throughput rates for the more expensive varieties...that would be a true dream.
Comment: Hah, yea going from anything to SSD would be a massive difference, when I put my OS on a SSD instead of a pair of RAID1 7200 drives the change was *dramatic*.  If I were spending > 2hrs/day editing photos I'd do it in a heartbeat, as is I don't value it that much.
Comment: SSD are great, no doubt about it, but it's not recommended to go RAID with them (though it has been done just for benchmarks kicks). The X25G2 was the one of the best that was humanly affordable (the X25E were faster I think), but I think there are certainly faster now. I'm patiently waiting to get a 512GB SSD for my laptop (I mean, for less than half a leg).
Answer: I'm going to speak from personal experience here and apparently contrary to popular opinion.  I recently (within the last 3 months) switched from a 5400 rpm drive in my laptop to a 7200 rpm drive.  While the difference in many things was quite significant - I didn't feel my photo editing experienced much of a bump up.  I'm not saying that there wasn't a difference, it just wasn't very noticeable - for me.  I suppose this could be highly dependent on your specific workflow though.
Answer: When I upgraded my laptop hdd from the slow drive apple shipped in it (4800?) to 7200 there was a noticable improvement in opening just about anything. Everything felt just a little bit zippier.
EDIT TO ADD: In hindsight, the huge difference was probably more because the old drive was dying and there were a lot of IO timeouts waiting for it.
Comment: well, yeah, the OS was faster... but once LR is open... image to image felt a bit faster too. Not a HUGE amount mind you... and depending on other factors, like the cost of the drives, the power and heat output... probably not worth it.
Comment: But thats the OS.  I've no doubt putting the OS on a faster drive helps but opening cold (not in cache) photos I'm not so sure about.


Feature importance in xgboost

Question: I've been reading that feature importance in xgboost is computed the same way as in random forests. However, the learning rate reduces the effect of downstream trees. Is the learning rate taken into consideration for the purposes of deriving feature importance?
Comment: There are multiple importance measures available in xgboost; which are you interested in?
Comment: @BenReiniger based on gini, for example, thank you.
Comment: I don't think gini is applicable in GBMs. xgboost offers gain, cover, and weight.
Answer: No, the learning rate is not taken into consideration when deriving feature importance in XGBoost. The feature importance is calculated based on the number of times a feature is used to split the data across all trees, regardless of the learning rate. The learning rate in XGBoost is used to control the contribution of each new tree added to the model, but it does not affect the calculation of feature importance.
Answer: Yes, the learning rate is taken into consideration for deriving feature importance. The learning rate in Xgboost is basically a weighting factor that is used when new trees are added to the model. What this means is that changing the learning rate results in an overall different structure of the model.
Feature importance in Xgboost, as you have mentioned, is calculated similar as in random forests. This is relatively straightforward, as features are simply ranked by their occurrence in the trees. Features that are used more often to make decisions have a higher feature importance.
Now lets go back to the learning rate. The whole structure of the model depends on the learning rate. This means that changing the learning rate will result in a change in how often the features are used. Therefore, a change in the learning rate results in a change in the feature importances.
This is something you can test. Create a Xgboost model, print the feature importance, change the learning rate and print it again. You will see how it changes.

Feature importance in xgboost


Windows Remote Desktop access modes and security/functionality?

Question: What are the security implications of running a Windows RDS farm vs. just using RDP for remote administration?
Comment: RDS is remote desktop server, which enables Remote Desktop through the Remote Desktop Protocol (RDP), I'm not sure what you're trying to figure out. Could you expand a little?
Comment: I was reading this article and the author said "The first thing to understand about enabling remote desktop for administrative purposes (i.e. when you don't require users to connect to your server to access applications) is that it's really easy to do. Sometimes I see people trying to enable the full Remote Desktop Services (RDS) role in Windows Server, a confusion taken from earlier editions of Windows Server where there was a special remote administration mode for Terminal Services. Note: Installing Remote Desktop Services is not necessary in Windows Server 2012, and enabling..."
Comment: "...remote desktop access for administration is the same process as enabling remote desktop access in Windows 8, except there is an extra entry point to the configuration via Server Manager."
Comment: and I got confused about the differences between the two operating modes !
Answer: Two ways to answer this question.  Since this is a Security forum let me answer security wise first.
RDP is the protocol used to connect to Windows, whether it is for administration purposes or to just run a remote desktop session, to access applications that you would not be able to run elsewhere.  Where the security footprint changes is between the administration usage and remote desktop usage.  Specifically administration usually means only administrators of the server log on to perform short tasks or to hop to another server, whereas an RDS installation intends to put non-administrators on the server and usually in much larger numbers.  Larger numbers of users, more applications and less IT experience usually creates security risks that would not occur in administration usage of the server.  Also, installing several RDS roles to enable "remote desktop server farm" functionality changes the security of the server.  On one hand more services mean more vulnerabilities to exploit, on the other hand it could mean a better security posture when exposing that RDS infrastructure to the internet.  What I mean here is, internet access to a single Windows server with just the RDP port (tcp 3389) exposed for administration is relatively unsafe, but when running a full RDS infrastructure of servers, you would only expose port 443 (SSL/TLS) of the infrastructure, which is what most servers on the internet expose already.
The other answer is as Nomad already posted - RDP is the protocol used for administration and in RDS farm access, and RDS is a suite of Windows roles you install on one or more Windows servers when you want to securely host a large number of users by providing them Windows based desktop and or/applications, in an RDP session.


Is there a way to grant raspberry pi that you have ssh'd into access to a VPN that you're currently connect to?

Question: If i'm connected to a VPN on my main machine, then ssh into my pi is there a way to share that VPN connection with the pi without having to literally install and set up said VPN on the pi?
Comment: ssh has features to tunnel/redirect ports.  you could connect to a stream and then pass it on to the pi - essentially the pi would host again as if it were a port on localhost and another application could connect to it.  a fairly common use is to tunnel vnc through ssh (although this is the reverse of what you'd be doing)
Comment: not Raspberry Pi specific ... the question is about linux, so it does not belong here
Answer: Yes you could either tunnel specific ports that you want to use or use the OpenSSH SOCK5 proxy which allows you to share all TCP networking with another machine over a SSH login.
However normally -D on openssh forwards a SOCKS proxy to the destination so if you wanted to do it in reverse then you'd need to share your local boxes port 22 (SSH server) then with a reverse tunnel and then you can login from the remote box to your local and create a SOCKS5 proxy..
For simplicity I'll assume that both are running Linux/RPIOS etc.
From your local box you need to forward that boxes sshd port (22) to the remote raspberry PI.
e.g. This creates a port 2222 on the localhost of raspberry.local which tunnels back to your local machine.
ssh -R 2222:localhost:22 firstname.lastname@example.com

This will also give you a login prompt on the raspberry.local on that session type the following command. Where  is a valid user on your local box.
e.g.
ssh -D 8888 -p 2222  <user>@localhost

Now if all the authentication worked etc.  You should now have a localhost:8888 on your raspberry pi which when used with SOCKS5 proxy capable tool will be able to access the network via your local boxes network.
Just remember that as soon as you logout either of the ssh sessions we've created above the proxy will fail to connect.
I can recommend tproxy (Transparent proxy) for using programs over SOCKS5 for CLI programs.  Firefox is very easy to configure for SOCKS5.