Drush and Composer installed but I'm getting errors

Question: Trying to use any drush command I get an error saying autoload.php won't load. It's in the vendor folder which is in the web root where I'm pretty sure it's supposed to be. It also has chmod +x permissions. If I put in php composer.phar I get the version and all that so yes it is there. If I run composer drupal-update (which composer manager would like for me to do) bash says composer: command not found. Is composer the only way to do this library thing in drupal 8? It seems a lot more problematic and less user friendly than just putting a library directory in the sites folder.
Comment: I think that a common use case is to install drush outside of the Drupal webroot (for instance in ~/ or globally).
Answer: If you are getting the error -bash: composer: command not found, that means Composer is not in the PATH Bash is using.
To use the Composer Manager module, you don't necessarily need Drush. I use it without Drush, but I run the following commands after I install the module.
cd <root directory of Drupal 8>
php modules/composer_manager/scripts/init.php

If all works fine, you will see the following output:

Composer Manager has been successfully initialized.

In this way, the Composer Manager module adds a new command inside the composer.json file used by Drupal. In fact, after running those command, you will notice the following lines inside the composer.json file.
"drupal-rebuild": "Drupal\\composer_manager\\Composer\\Command::rebuild",
"drupal-update": "Drupal\\composer_manager\\Composer\\Command::update"

In the case you didn't execute those commands, or they failed for any reason, running composer drupal-update would return the following error:

[Symfony\Component\Console\Exception\CommandNotFoundException]
    Command "drupal-update" is not defined.

If you are downloading modules using Drush, just do as you normally do. The Composer Manager module will hook into Drush and do its task when a new module is downloaded.
Comment: Composer is definitely not installed. Refer to the instructions at https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx.
Comment: well I actually already did that but ok I'll do it again. Yeah, same thing. it says composer manager has been successfully initialized but then when i run composer drupal-update it still says -bash: composer: command not found.
Comment: Are you sure composer is in the bash PATH?
Comment: After running `php modules/composer_manager/scripts/init.php` I had to run `composer update` before running `composer drupal-update`. If I skipped the second step, I got the Symfony error reported by kiamlaluno.


How to get this abstract blurry effect on my picture?

Question: I really like the blurry effect on the tunnel walls and ceiling in this photograph by Joko on 500px. I get disappointed with my pictures when I see something like that. Can someone explain me how he did that? Is this kind of Photoshop effect, or some kind of technique?
Comment: Can you describe the image in words, and particularly the aspect you are interested in?
Comment: Picture is taken by Nikon, that's why I used Nikon tag.
Comment: What I like in the picture is this blurry effect on right and left side of the picture. Also, this effect on ceiling is so modern and abstract. What kind of effect did he used?
Comment: Ok, thnx, I will try to change it ;)
Comment: I'm not saying all this to attack you or the question, by the way. Editing it to include this info will both get better answers for you (I would have focused on the silhouette rather than the blur of the tunnel), and also increases the chance that someone with the _same_ interest will ever find the question later. Right now, even if this gets a great answer, someone else might wonder the exact some title ("How to get this type of picture?") but be wondering about a crisp and colorful flower photograph.
Comment: No, your comments are very helpful and true, and you are right I didn't think when I put my question. Thx!
Answer: It looks like the photographer used the zoom effect. It consists in zooming in (or out, but mostly in) while you are taking the picture. Not before, not after, but while you are taking the picture. You can read more about this particular effect here.
It's pretty difficult to achieve, and takes a lot of practice. You'd want to use a tripod and long exposure time, as well as a small aperture to have a higher depth of field with your subject in focus.
Comment: I think this is it. Well done! I totally forgot on my zoom! Well done!
Comment: maybe he did this for one exposure and another sharp fast exposure and overlayed them?
Comment: why do that when you can just fire the flash, as per my answer?
Answer: I think it's a combination of zooming during a long exposure, with flash so that there is a sharp exposure of the figure.


Where do I find the Weight Variants of an Airbus aircraft?

Question: Where do I find the Weight Variants (WV) of an Airbus aircraft?
Answer: The weight variants for each model are listed in the aircraft's type certificate which describes the type's compliance with airworthiness regulations. You can look up the type certificates from regulators such as EASA and FAA.
As an example you can look at the document for the A330. Each of the minor models (-300, -200, and -200 freighter) has its own section, and the weights are listed in the "Technical Characteristics and Operational Limitations" subsection. Below is the table showing some of the A330-200 weight variants. The maximum takeoff (MTOW), landing (MLW), and zero-fuel (MZFW) weights are defined for each variant.


Should we chair a session in which we present?

Question: In a prestigious conference in my field, I am asked to chair a session. However,  in the same session, I have my own paper, should I chair this session?
Answer: If the conference has asked you, there is no reason not to. Of course, chairing can mean different things depending on the conference. It may be just introducing speakers or keeping them to a schedule, or it may be actually chairing a discussion. There are other possibilities, I suppose.
I don't foresee any conflicts in such a situation, though you may want to accept or defer any responsibility for it depending on your comfort level.
Comment: In my case, it is introducing speakers and keeping them on time (including me in case I accept). And yes, the conf. has asked me for it.
Comment: Good idea to turn the stopwatch over to another while you speak. Speaking last might also be easier to manage.


Schedule an alarm's array in Android

Question: I am making a personal organizer. From the calendar the user can choose the day and then can make a date with a specific hour. At this date and hour the application should show an other activity, which is the notification. User can make just one note for day. So the pk of each note is YYYYMMDD.
So, I wants to know that what I've done is right or not.
I've a service which is started with application. The onStartCommand of the service checks if in the current date there is a note in the db and, if there is, he calls the Activity Notification. I've a runnable thread which is looping each minute and it update the date if the service, because the date of the onStartCommand is static. If the date getted by the runnable is equal to onStartCommand's date then keep cycling, else I start the service again with:
Intent myIntent = new Intent(Receiver.this, NotificaSuoneria.class);
startActivity(myIntent);

In this way I haven't any troubles, but I want to know if the runnable thread could be killed by android, because if killed I can't check the alarms of the others days.
And, when I restart the service each time update the date, the old runnable thread will be killed or will were a lot of threads?
P.S.
I don't use the AlarmManager for schedule the alarm. If the datenow have some engagement with alarms I calculate the time left and sleep for this time, then I'll start the notification activity. Sorry for my poor english.
Answer: You should use AlarmManager for this with a loop like following edited
try {
            cntxt = createPackageContext("your.app.package",CONTEXT_IGNORE_SECURITY);
           } catch (NameNotFoundException e) {
              // handle exception here
              e.printStackTrace();
           }

Intent myIntent = new Intent(cntxt , yourreciever.class);
    PendingIntent pi;
    AlarmManager alarmManager;
        for(int i=0;i<=timesinday;i++)
        {
        pi=PendingIntent.getBroadcast(cntxt, i,myIntent, 0);

        alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
                                        alarmManager.set(AlarmManager.RTC_WAKEUP, currentcal.getTimeInMillis(),pi);

        }

Do not forget to add NotificaSuoneria in Android Menifest as a Reciever. If you you want alarm to goes off every day you should use
alarmManager.setRepeating(AlarmManager.RTC_WAKEUP,todaycal.getTimeInMillis(),AlarmManager.INTERVAL_DAY,pendingIntent);

@Meesta I am editing the answer you do not have to mention activity here Intent myIntent = new Intent(Receiver.this, here.class); here will be the reciever class from wher you can start your activity also see http://androidword.blogspot.in/2010/10/how-to-use-broadcast-receiver.html and try to add flag_new_activitywhen starting the activity from broadcast reciever
Comment: In the above code if you put the array of timesinmillis where there is currentcal.getTimeInMillis().Like times[i] you can get what you required
Comment: Thanks for the answer.. I done what u told me, but if the PendingIntent is getBroadcast, I get nothing.
and if I change to getActivity (notificaSuoneria is an activity) the alarm will instant start

Schedule an alarm's array in Android


Saturn Aura 07 help

Question: Had starter replaced,went out to drive the vehicle and about 30 minutes after i left the radio went off and all the dash warning lights came on then the car stopped and will not start. This morning i went out to the car and turned the key to the run position radio played for about 30 seconds. dashlights worked for about a minute and 30 seconds then the only light that were on was the security light and check engine. Any ideas what the problem could be
Comment: Welcome to Motor Vehicle Maintenance & Repair!
Answer: It sounds as though the battery is dead. Two things to check.
First, check to see that the power wire going from the battery to the alternator is in place. When changing out the starter, the technician my have inadvertently disconnected it or broke it lose without replacing it. If this has happened, the battery would not have been recharged after startup, which means the battery would be drained down to the point of not being able to keep the engine running. Restoring the wire and connection, along with charging the battery would solve your issue. NOTE: This would be the same result as if the alternator had died and is no longer charging the battery. I wouldn't rule out the alternator, but I think this scenario is more likely.
Second, your battery may just have died. Check the voltage at the battery. If the battery is at 10vdc or lower, you can try and charge it. If charging it works (brings it up to a 12+vdc steady state), you'll need to check the first situation above. IF it doesn't help, you can take it somewhere and have it load tested. Anywhere which sells batteries should be able to test it for you.

Saturn Aura 07 help


Ubuntu 18.04.4 LTS 64 bit on Raspberry Pi 4 + RealVNC server, how?

Question: I installed the official Ubuntu 18.04.4 LTS 64bit image on my Raspberry Pi 4. On Raspian Buster I used RealVNC server to connect remotely to Raspberry so I want to use the same with Ubuntu but on official RealVNC server page is available .deb package for armhf architecture;
how can I user that .deb package on my arm64 system?
Comment: you need to install VNC viewer on the system you want to control from, and VNC server on the aystem you want to control. to install .deb package on Ubuntu system read https://askubuntu.com/q/40779/283843
Answer: ARM32 is optional on ARM64. You can enable it through:
dpkg --add-architecture armhf

Afterwards, you can install the .deb file.
Be sure to run afterwards
sudo apt-get update;
sudo apt-get upgrade;
sudo apt --fix-broken install;

if needed. (Was the case for me)
Comment: I tried many times adding armhf architecture and installing the .deb manually... Installation works, but it's impossibile to connect to RealVNC server.
Comment: hi martin, i have worked on that problem half a year before, the issue is the wrong ELF class you work on 64bit Userland and the realvnc client is 32bit, there are several files to patch, i gonna restore my image tonight and continue my work on it, i let you know if i was successfull :-)


See bookmark and URL at same time

Question: In FF when I look at my bookmarks I see the bookmark name. I would like to be able to see the bookmark name and the URL at the same time.  I can see the URL in the tooltip when I hover over and I can see it when I pull up the edit bookmakrs planel but would like to see it properly when I just selecting bookmarks if that's possible
Answer: Open the menu Boomarks, Show all Bookmarks, right-click on the header above the bookmarks, select Location. That should add the Location to the list on the right-hand side.

See bookmark and URL at same time


How do I build a friendship?

Question: How can I build a realistic friendship that utilizes emotion? One of the main problems in my writing is characters not seeming to be as emotional or have real seeming connections to family or friends.
Comment: *Characters making sacrifices for one another is a usual way* Just don't interpret that advice too literally, the times I've slaughtered a chicken in summoning a friend from the world beneath have not ended well ...
Comment: Characters making sacrifices for one another is a usual way.
Comment: She said she wanted a religious experience. So I sacrificed her puppy to Zarquon the Space God.
Answer: My favourite piece of advice with which I stalk beginner writers everywhere is:
Try your hand at acting.
I mean it. Join a school drama club or an amateur theatre group and dampen your feet at performing a role on the stage. You're going to learn two things:
The first is, Louder! Can't hear you! YELL!
Well, this is not really applicable to writing. It's just the first lesson you're guaranteed to get.
But the second thing you learn is, you need to incarnate in your character. You have to become them, find yourself in the situation they're in, feel what they're feeling. And this is something that's not only useful for writing, it's necessary to do there too. Appearing in a play or two gives you some training for the moment you go and incarnate in the characters of your own creation to understand how they're really feeling and how it makes them behave.
When writing characters, you need to do just what an actor does - wear their shoes. Only you have it more complicated because there isn't only one role for you to star in. Incarnate in each of your characters in turn and live through the scene from their point of view. (Generally mentally, but feel free to act it out physically if that works for you.) Feel their emotions. Notice what it does to their face expressions or unconscious gestures, the way they move, the tone of their voice, the words they choose. And most of all, notice what they would do at the given moment. What choice they'd make. What they'd give their attention.
Then describe what you saw.
Answer: Friendship is a combination of similarities, and differences that create synergy.
We become friends with those that share our interests; because that is rewarding to both. For example, when we watch a funny movie, studies find that people will laugh 3 or 4 times as often if they watch it with a friend, than if they watch it alone. The same is true for eating out alone, it is more fun to go to a restaurant with somebody that enjoys the same food as you do, than to go alone, or to go with somebody that doesn't like anything on the menu. Even if you try a new restaurant and it isn't very good, it is better to be with somebody that agrees with you it isn't very good!
In general, it is both easy and good to be with people that like the same things you do; have a similar sense of humor, a similar understanding of the world and their place in it, like the same kinds of food, the same sports (for watching or participating in), music, politics, books, movies, and other forms of entertainment -- including bars and drinking, drug use, or sex.
Even believing in the same religion, or share their lack belief in a religion: It is why we have church clubs, atheist clubs, bowling leagues, dart leagues, pickle ball leagues, chess clubs, sex clubs, and so on.
The synergy comes from disparity in skills or knowledge. Synergy occurs when two (or more) people can accomplish more together than the sum of what they can accomplish individually.
Basically one has skills the other doesn't have, and vice versa, so as a team they have fewer skill deficits than if they work together. A great example of this is Steve Jobs and Steve Wozniak, in the founding of Apple. Jobs was natural salesman, outgoing and excellent at sales. He was not an engineer by any stretch of the imagination, but he could sell.
Wozniak was the son of an Electrical Engineer and quite accomplished in the art himself, he could build devices from scratch, by himself, and get them working. But he was not a salesman, by any stretch of the imagination.
There is the synergy: Together, they have both the technical and social skills to build a multi-billion dollar company that neither could ever have built on their own. Jobs did not have the capital to hire a technical genius like Wozniak, and Wozniak did not have the capital to hire a sales and marketing genius like Jobs.
In fiction, you should create similar commonalities and synergies, the more you have, the closer the friendship. (Add in sexual attraction, you may have true love.)
A chance meeting at some event that is not a common "like" for most people can spark a friendship; they have something in common to talk about. And as they do, they discover other commonalities, and then some synergies.
The measure of friendship is in the commonalities (and their rarity in the general population, the more rare the closer the bond), and in the synergies, and their rarity.
That is real life, in fiction you need to create the same thing. There must be reasons character-A likes to spend time with character-B, shared likes and dislikes, and complementary (synergistic) differences in strength and weakness, so they make a better team together than they would alone.

How do I build a friendship?


Postgres: any traps when adding tables with `timestamptz` fields, when existing tables all use `timestamp`?

Question: Similarly as in Convert Postgres TIMESTAMP to TIMESTAMPTZ, but with the difference that I don't plan to modify existing table's timestamp columns. Are there any gotchas when using timestamptz for new tables, when all the existing ones use timestamp? Presuming that the existing clients will continue to use the DB as thus far (by always converting timestamps to UTC on their end), is there anything else one should consider?
Comment: Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer.
Comment: There are only two sane ways to handle time zone management: 1. use `timestamp with time zone` everywhere in the database and have the application set `timezone` correctly 2. use `timestamp without time zone` everywhere in the database and let the application do time zone conversions. So yes, using `timestamp with time zone` may be a bad idea. I don't know enough about your application to say more.
Answer: timestamptz columns will be converted to the client's locale for display )and converted from it if no zone is specified on the input).  so if you have several different users you will need be prepared for that.
If you existing clients are all configured to use UTC The only impact will be a '+00' at the end of the timestamptzs when they are returned as strings.
See also SQL ALTER DATABASE foo SET TIME ZONE 'UTC'; which can be used to set the default time zone for new connections from clients who don't explicitly set a time zone.


In Philippians 4:5, what does Paul mean when he states, "Let your moderation be known unto all men"?

Question: While analyzing this particular verse, the word used for moderation in the Koine Greek is "epieikies" meaning equitable, fair, and/or fitting.  How does that translate to moderation or in some other translations gentle?
Answer: The operative adjective in Phil 4:5 is ἐπιεικής which occurs just five times in the NT - Phil 4:5, 1 Tim 3:3, Titus 3:2, James 3:17, 1 Peter 2:18.  The cognate noun occurs in Acts 24:4, 2 Cor 10:1.
According to BDAG, this word means:

not insisting on every right of letter of law or custom, yielding,
gentle, kind, courteous, tolerant

According to Phil 4:5, this characteristic of the Christian must be a conspicuous one; that is, Christians must be well-known for their gentle, kind, courteous and tolerant ways with others.  Put another way, behave as Jesus would because this was one thing Jesus was known for.
Ellicott describes it this way:

(5) Your moderation.—The word here rendered "moderation," properly
denotes a sense of what is seemly, or equitable, as distinct from what
is required by strict duty or formal law. Such distinction the world
recognises when it speaks of what is enjoined, not so much by duty as
by "good taste, or "right feeling," or (with some peculiarity of
application) by "chivalrous" feeling, or the "spirit of a gentleman."
Here it denotes the general sense of what is seemly in a Christian
tone of character. In 2Corinthians 10:1 (where it is translated
"gentleness") it is ascribed emphatically to our Lord Himself. But the
usage of the New Testament appropriates it especially to the "sweet
reasonableness" which "gentleness" may well designate. Thus, in Acts
24:4 it clearly signifies patience, or forbearance; in 2Corinthians
10:1 it is associated with meekness; in 1Timothy 3:3, Titus 3:2, with
peaceableness; in 1Peter 2:8, with kindness; in James 3:17 the word
"gentle" is placed between "peaceable" and "easy to be entreated" (or
rather, persuaded). This spirit is, no doubt, "moderation;" but it is
something more. It may refer here both to the exhortation to unity in
Philippians 4:1-3, and to the exhortation to joy immediately
preceding. It would help the one and chasten the other.

Barnes suggests this:

Let your moderation be known unto all men - That is, let it be such
that others may see it. This does not mean that they were to make an
ostentatious display of it, but that it should be such a
characteristic of their lives that it would be constantly visible to
others. The word "moderation" - ἐπιεικὲς epieikes - refers to
restraint on the passions, general soberness of living, being free
from all excesses. The word properly means that which is fit or
suitable, and then propriety, gentleness, mildness - They were to
indulge in no excess of passion, or dress, or eating, or drinking.
They were to govern their appetites, restrain their temper, and to be
examples of what was proper for people in view of the expectation that
the Lord would soon appear.
Comment: I appreciate the response beloved.  I see how some of the commentators try to make the connection but it still baffles me how translators went from "equitable/fair" to "gentleness/moderation".
Answer: https://biblehub.com/greek/1933.htm
Strong's Concordance

Definition: seemly, equitable, yielding
Usage: gentle, mild, forbearing, fair, reasonable, moderate.

Note that Strong distinguishes between definition and usage. Definition is the lexical/dictionary meaning. Usage is the pragmatic range of meanings found in actual sentences.
Where does the sense of "gentle" and "moderate" come from?
HELPS Word-studies

1933 epieikḗs(an adjective, derived from 1909 /epí, "on, fitting" and eikos, "equitable, fair"; also see the noun-form, 1932 /epieíkeia, "equity-justice") – properly, equitable; "gentle" in the sense of truly fair by relaxing overly strict standards in order to keep the "spirit of the law."
1933 /epieikḗs ("justice beyond ordinary justice") builds on the real intent (purpose) of what is really at stake (note the epi, "upon") – and hence, is true equity that appropriately fulfills the spirit (not just the letter) of the law.

In https://biblehub.com/philippians/4-5.htm, only King James Bible translates it as "moderation":

Let your moderation be known unto all men.

12 versions translate it as "gentle" or "gentlemess":
New International Version

Let your gentleness be evident to all.

4 versions use "reasonable": English Standard Version

Let your reasonableness be known to everyone.

In anycase, Paul's idea is that don't be so strict and extreme about the letter of the law; be fair minded, reasonable, and gentle. This is a good lesson for us all today.

In Philippians 4:5, what does Paul mean when he states, “Let your moderation be known unto all men”?


The difference between accumulator-based and register-based CPU architecture?

Question: I don't understand the difference between an accumulator-based CPU architecture and a register-based CPU architecture. I know x86 is register-based but it has an accumulator-like register. I only ever hear people asking the difference between stack-based and register-based, but not register-based and accumulator-based. What are the advantages and disadvantages of each? And can I get some example assembly codes from each, where they differ, as well?
Comment: see [What is the problem with "Pros and Cons"?](http://meta.softwareengineering.stackexchange.com/q/6758/31260) and [Why do 'some examples' and 'list of things' questions get closed?](http://meta.softwareengineering.stackexchange.com/a/7538/31260)
Answer: A register-based CPU architecture has one or more general purpose registers (where "general purpose register" excludes special purpose registers, like stack pointer and instruction pointer).
An accumulator-based CPU architecture is a register-based CPU architecture that only has one general purpose register (the accumulator).
The main advantage/s of "more that one general purpose register" is that the compiler doesn't have to "spill" as many temporary values onto the stack; and it's easier for the CPU to do more independent instruction in parallel.
For an example imagine you want to do a = (b - c) + (d - f) + 123. For an "apples vs apples comparision" I'll use Intel syntax 32-bit 80x86 assembly for both examples (but only use EAX for the accumulator-based CPU architecture).
For accumulator-based CPU architecture this may be:
    mov eax,[b]     ;Group 1

    sub eax,[c]     ;Group 2

    add eax,123     ;Group 3

    mov [a],eax     ;Group 4
    mov eax,[d]

    sub eax,[e]     ;Group 5

    add [a],eax     ;Group 6

Note that most of these instructions depend on the result from the previous instruction, and therefore can't be done in parallel. The ";Group N" comments are there to indicate which groups of instructions can be done in parallel (and show that, assuming some form of internal "register renaming" ability,  "group 4" is the only group where 2 instructions are likely to be done in parallel).
Using multiple registers might give you:
    mov eax,[b]           ;Group 1
    mov ebx,[d]

    sub eax,[c]           ;Group 2
    sub ebx,[e]

    lea eax,[eax+ebx+123] ;Group 3

    mov [a],eax           ;Group 4

In this case, there's one less instruction, and 2 less groups of instructions (more instructions likely to by done in parallel). That might mean "25% faster" in practice.
Of course in practice code does more than a relatively simple calculation; so there's even more chance of "more instructions in parallel". For example; with only 2 more registers (e.g. ECX and EDX) it should be easy to see that you could do a = (b - c) + (d - f) + 123 and g = (h - i) + (j - k) + 456 in the same amount of time (by doing both calculations in parallel with different registers); and it should also be easy to see that for accumulator-based CPU architecture you can't do the calculations in parallel (two calculations would take twice as long as one calculation).
Note: There is at least one "potential technical inaccuracy" in what I've written here (mostly involving the theoretical capabilities of register renaming and it's application on accumulator-based CPU architectures). This is deliberate. I find that going into too much detail (in an attempt to be "100% technically correct" and cover all the little corner cases) makes it significantly harder for people to understand the relevant parts.
Answer: Beyond the obvious difference of one register vs. many registers, a significant difference is in the way that operands are specified.
An architecture with many registers may specify a binary operator with three registers: one target and two sources — so can do something like: r0 = r1 + r2.  Program variables can live in the registers when appropriate.
Accumulator instructions sets implicitly source and target the accumulator so need only to specify one explicit operand to make a binary operation, and, that other operand is going to have to come from memory since there is only one register (an accumulator), so something like: acc = acc + memoryOperand.  An accumulator architecture necessarily uses memory to store program variables; the accumulator is in such high demand that it generally has to be used for every little operation, so doesn't usually store longer-lived program variables.
Architectures with registers vary, some are strict load/store architectures and others allow memory operands with arithmetic operators.  Some restrict operands to two, so a binary operator will both source and target one of the two operands.
Answer: In the accumulator based, operations are done via interaction with the accumulator register at each step of the way. For example, (a + b) - d is Done as, put a in the accum, add b to the accum, value in the accumulator now contains the sum of a and b. Subsequently subtract d from accum gives final result. For complex operations there is a significant time sacrifice. Whereas register based can store values in individual registers and operations can be between registers. Hence (a+b)-d involves put a in reg x, put b in reg y, put d in reg Z. Add X and y. Subtract Z. This is more convenient and generates shorter code in complex programs. Saves time.
Answer: The practical differences between accumulator and register based architectures are the following:
accumulator based:  the code is smaller and runs slower.
register based:  the code is larger and runs faster.
Comment: Do you have anything to back up these statements? Text books? Articles? Wikipedia? Examples?


Can't change network settings nor modify/delete preferences.plist, absolutely locked down

Question: I'm struggling with this since some months. I don't know if it is a third-party software I installed (been trying to debug with ps aux + lsof on /Library/Preferences/SystemConfiguration/preferences.plist/ but no luck finding out), but I'm completely unable to change any Wi-Fi settings, from the System Preferences GUI or the terminal using networksetup. The problem summary/behaviour is as follows:

Can't disable Wi-Fi (it gets re-enabled straight away)
Can't change any configuration (create/delete/change new locations, IP, DNS, etc...) they get reverted as soon as I click "Apply". Interestingly, the "recovery point" (the configuration it is reverted to) is not the default one, as for example I have a location created named "wyndham" that I cannot delete. The DNS get back always to 188.8.131.52.
Same behaviour in the terminal with networksetup, e.g.

# sudo networksetup -setdnsservers Wi-Fi 192.168.1.100
Password:
** Error: Unable to commit changes to network database.

I tried deleting files in /Library/Preferences/SystemConfiguration/ and interestingly, the only file that can't be changed is preferences.plist, which is the file that has this stuck, frozen network config.

I tried rebooting to recovery mode, doing csrutil disable, reboot and tried to delete preferences.plist but it says "operation not permitted", even in recovery mode with csrutil disabled, and in normal mode happens the same. After trying that I enabled csrutil again, because it wasn't making any difference.

I had ExpressVPN software installed before, I removed it, removed all suspicious services and processes running, and tried to see if there's any process monitoring preferences.plist but no luck, tried using some logging techniques I found for debugging misterious DNS changes, but again, no luck, as any change to network config I submit apparently it doesn't even get to write any file, so doesn't appear in the logs as I saw. I'm thinking that is a low-level lock, it's quite weird that a third party sofware could enable this to my taste. Anyway is very annoying because basically the only thing I can do is change the Wi-Fi network I'm connecting to, nothing else, and even the DHCP tell the computer some DNS, they get automatically reverted to 22.214.171.124...
Any suggestions on how to keep debugging this annoying and weird problem would be appreciated.
Thanks so much in advance.
Answer: Did you ever resolve this? I have the same but the other way around and can't enable WiFi


jQuery: Save an array of elements to cookie

Question: I'm making a jquery plugin to create 'spindowns', you can locate the project at http://github.com/c00lryguy/jquery.spindown.js
The plugin works perfectly, but the only way I could figure out how to save which elements were expanded was to save an array filled with the expanded elements inner text.
Now, there are obvious downfalls to this. For instance, if two elements have the same text and one is expanded and the other wasn't, when it loads it from a cookie, it will think both of them were expanded.
Is there a good way to save an array of elements to a cookie?
Edit

No no, you guys don't seem to understand. Saving to a cookie works perfectly fine. And not all of the elements have IDs. Take this example:
$('.expandable').spindown();

First spindown

Content

Second spindown

Now, when a user clicks the div containing "First spindown", the div containing "Content" would slide down. And when a user clicks the li containing "Second spindown", the img element underneath it would slide down, kinda like an accordion.
This is because it finds the element with the "expandable" class and makes it clickable, toggling the slide effect for the next logical element.
Now, I have the code finding which elements were expanded, adding the elements inner text to an array, and saving that array to a cookie. Then when a user goes back to the page, it just expands the ones in that array stored in the cookie since that was the only way I could figure out how to save which elements were expanded in the cookie.
Answer: There is a jQuery cookie plugin.
And a while ago I made some tests for a subcookie plugin. I hope you will find it useful, even is not a full grown plugin.


Breakers tripping when power returns.

Question: Nearly all of the GFCI and ARC Fault breakers trip when power returns after an outage .  This is a home setting, 200 amp main with a 100 amp generator main.  This has been wired with no problems since 2006.  It has happened twice in a row in two weeks.  Since we are gone alot, it posses a refrigeration concern.  Any ideas?
Comment: Are you saying that when the generator picks up everything is ok but after transferring back to Grid power all the GFCI & Arc fault breakers trip? How is your grounding set up? Is your generator in cool down mode (still running but on grid power). Answers to these 2 questions may point us in the correct direction.
Comment: No the generator was not used in either incident
Answer: It is possible that the electric utility has a problem in their wiring. Specifically if the neutral or ground are not well connected, reconnecting the power from upstream could cause lopsided voltages due to a wandering ground.
The easiest diagnostic would be to request the utility to verify their wiring which they ought to do for free.  If they won't or can't, you can rent a power quality analyzer and see for yourself.

Be sure to test nominal power and during switching "off" and then "on" your main breaker.  If the analyzer shows electrical problems, provide the details to your utility and they should fix it pronto.
If the test shows a ground problem, it might be on your end.  Then it will be up to you to fix your grounding system
Answer: Some times when they recharge the lines there can be large spikes that will cause GFCI's and AFCI's to trip a "house" surge suppressor at your main panel may reduce the tripping like this the more expensive ones last longer as they are larger and can withstand more hits. This may solve your problem. Other than this type of protection there is not much that can be done.
Comment: Ok.  I do have a surge protector that still shows it is working correctly. Could a surge still occur that would cause the tripping?  I probably should cotact the power company to see why the power went out.  No storms in the area.
Comment: I would contact them, they have been doing maintenance on switch gear and swapped feeds at a sub station. The switching causes big spikes and hammers most everything except UPS systems.
Comment: Thank you all.  I will contact provider.  It makes sense based on all the answers.

Breakers tripping when power returns.


relay switch selection

Question: I know almost nothing about electronics, but I'd like to intercept the power going to a small speaker and use a relay switch to close a speaker connection on a completely different, but more powerful device (a home outdoor sound system).  I used a multi meter to discover that the original speaker works with a voltage of 1.4 VDC but I can't figure out how to get the amperage.  Is there a generic relay switch that would work in a situation like this?
Answer: This isn't really an answer for the question, but the comment field is too small.
Speakers don't actually use DC currents. Instead they use AC currents, so it could be that your measurement is incorrect. Sometimes some multimeters will detect some AC voltages as DC, so it's best to be sure when measuring.
So a good way to test this would be to generate a signal which would be easier for multimeter to read. A nice program is Two channels frequency generator  which can be obtained here.
Next check the output characteristics of your speaker. If it can make 50 Hz or 60 Hz sounds, open the generator, set left and right frequency to 50 Hz or 60 Hz and click start (or if you can't connect the system to a computer, record the sound and then play it on the speaker) and be sure to set the volume to maximum both on the device and in program and on computer output.
So why 50 Hz or 60 Hz? Well those frequencies are commonly used for mains power and most multimeters are made so that they can easy and correctly read voltages at those frequencies. A good quality multimeter should be able to read voltages at other frequencies too, but this way you'll be sure that you get the correct reading.
If the speaker can't produce those frequencies, then try with whole number multiples of them.
Next, why frequency generator? Well, normal music produces complicated waveforms which change very quickly and are quite complicated. A single tone which is made by the frequency generator will be much easier for multimeter to read.
In the end check available settings on your multimeter. Good meters will have AC+DC voltage measurement option which will give you the real voltage at the speaker. If yours doesn't have such setting, try measuring both AC and DC voltage. Somewhere I read that you should calculate the actual voltage using following formula: \$V_r=\sqrt{V_{DC}^2+V_{AC}^2}\$. That should give you the real effective voltage.
Answer: I'm not sure what your proposing to switch here, but I can address the speaker current question.
Suppose you have 8 ohm speakers, and want to drive 100W into them. Power is impedance times the square of the current, so the current will be the square root of power over impedance.
\$P = I^2 * R\$
\$I = \sqrt{\frac{P}{R}}\$
So in the example, current would be \$\sqrt{\frac{100}{8}}\$ = 3.5A . Similarly, power is voltage squared over impedance,
\$P = \frac{V^2}{R}\$
\$V = \sqrt{P * R}\$
so in this example, the voltage is \$\sqrt{100*8}\$ = 28.3V .
However, these would be RMS values; the peaks would be \$\sqrt{2}\$ times as great, so you'd want to size your relay accordingly. A relay that could handle 5A and 50V would just suffice for the example.
You would actually want a safety margin, so using these example numbers, 10A and 100V would be a better choice. Finally, you might want to size the relay in anticipation of future upgrades. If you thought you might replace the 100W source with say, 500W, you'd definitely want a heavier device.
Comment: @JustJeff, what do you think of my edits? I put mathjax in, if you do not like it roll it back, but I thought you might enjoy the improved reading quality.
Comment: @Kortuk - yeah, I tried to invoke the LaTex thing to no avail. Not to go all meta, but does the text in the main answer use different formatting rules than the text in comments?
Comment: @JustJeff, I think it does, but does \$2^2\$ show up as tex here in a comment? If you type something you need to click out of the edit box and watch the preview for just a little before it will show the result(can be 10 or 20 seconds). This does not work in all situations, but it works for me in FF.
Comment: @JustJeff, I spent forever trying to figure out how to make a nice Square root, and then @Andrejako pulls it off right below. Thanks for the help @andrejako.
Comment: @Kortuk - well, thanks for the free radical =P seriously though, the formatting behaves oddly. I figured out how to escape \$ signs, so as to put two of them in a comment. On the 1st refresh, I saw the dollar signs as anticipated. Then less than 1 minute later, and I don't know if there was a 2nd refresh, the comment apparently got evaluated a *second* time, and the dollars disappeared but everything between them went italic.
Comment: @justjeff, a dollar sign is a $ all alone, you must escape the dollar sign for it to go to mathjax now.
Comment: testing .. x = \${\sqrt{2}}/{y_0^{2}}\$    how about \$\frac{1}{3}\$
Comment: @JustJeff, pretty awesome in my opinion.
Comment: @JustJeff, 1 dollar sign now just gives a dollar sign.

relay switch selection


"stop off" vs. "stop in" vs. "stop by"

Question: According to Cambridge Dictionary, I found that "stop off", "stop in", "stop by" all mean "stop to visit someone/ somewhere for a short time while you are going to somewhere else" in general. I feel confused. Can you tell me what are the differences between these phrases? Thanks in advance.
Comment: I'd only use 'stop in at ...' or 'stop in to see ...' with 'stop in'. Also, 'stop off at (Bristol, say)'. 'Stop by' can be used intransitively or (with a location, say 'the office') transitively. You need to show examples from CD.
Answer: They may be somewhat the same but beyond any regional differences, they can also mean something different.

If you are going on a trip somewhere, you can:

stop off at someone's house or office or shop or whatever and visit them.

It does not matter if that is for ten minutes or ten days. "stop off" [the route you are taking to a place.]

If you are driving or cycling or even walking to a place where you live,  you can:

stop by someone's house, workplace, shop or whatever. Generally speaking, if you are going a long distance, you stop off at: They flew to Sydney from London but stopped off in Dubai. In these cases, you cannot "stop by". And yes, stopping by for a chat (for example) does imply a short time.

If you are going somewhere locally (as with stop by), you can:

stop in (on someone or to see someone or at a place). The preposition "in" implies a place but it does not need to be named necessarily. It is definitely local also.

On  my way to work, I stopped in to see him at his pet store.

Now, the hard part, I have tried to provide the prepositions or nouns that one might use with these expressions as this can be the source of confusion to non-English speakers. But here's the sticky wicket, the idea of going to see someone in English can be very complicated indeed as it is associated with a number of verbs and prepositions. Some other ones are:

come/go over [to a place. usual AmE usage]
stop round [a place, mostly British]
come round/go round [mostly but not exclusively British]
pop over/round/in/and even down or up [most definitely British and ever so charming]. "Ah, he's in the attic office. I'll just pop up and see him." Also, as an understated way of saying something: ""We'll just pop over to Auckland [from Sydney] on our way to Saigon".

Please note: These are the most usual as I think of them right now. There are surely many others that just have not come to mind.
[It thought this question was fine for ELU. I guess that thought was not shared by the honchos.]
Answer: I think the real difference here is mostly regional. They're all equivalent phrases, but they are preferred differently in different parts of the UK (I don't know if/how these are used in the US).
I would say 'stop by'. I am from the Midlands. I wouldn't use the others, but I have friends who do, and it never confuses or sounds strange at all.
Answer: In the US (northeast), I believe "stop off" and "stop by" are more common than "stop in". All used (as described) to mean stopping somewhere while en route to a primary destination. It could be just me, but I feel as if "stop by" connotes a briefer visit.

“stop off” vs. “stop in” vs. “stop by”


What is the difference between Impression Management and Signaling Theory?

Question: I'm interested in theories on how organisations shape their stakeholders' (especially consumers' and investors') perceptions and decisions. I read about Impression Management and Signaling Theory. They seam to be quite similar and I'm unsure when to apply which of them and where they differ. I could not find an article comparing both theories. Signaling Theory is especially for cases with information asymmetry but it seams like Impression Management is also more common in cases with scare information on one side.
Answer: I don't believe those two terms are used in the same spheres.
To me, an economic theorist, signaling plays a role in models with asymmetric information when the informed party moves first and the uninformed player reacts, treating the first action as a signal about the private information. This idea goes back to Spence, and also plays a role in biology with non-human interaction.
In contrast, impression management is (maybe just to me) an umbrella term for all kinds of behavior aiming at improving the perception ("image") of something. I would use it loosely like "public relations" and not with a formal definition in context of a mathematical model in mind (as opposed to signaling). Because the history of thought is so different, both terms are difficult to compare. The idea goes back to the sociological book "The Presentation of Self in Everyday Life" and there is no mathematical model. Impression management is essentially his "self-presentation theory, which suggests that people have the desire to control the impressions that other people form about them." (from the Wikipedia entry)
Comment: Just to note, the two concepts can be related in practice. For example, an advertisement may serve for "impression management", while also serving a "traditional" signaling purpose. For example, there is a whole literature on advertising serving as signaling.
Comment: Fair enough. While I believe it makes sense to discuss signaling here, a discussion of "impression management" would be out of scope for an economics board (as in I would vote to close such a question).
Comment: (I also intended this more as a comment, but it got too long.)
Comment: thanks for your answer! So where would you ask the question?


What is a good newbie-friendly graphical Git client for Windows?

Question: Personally I'd just install Cygwin and proceed with the usual *nix shell tools, but I need to make a software recommendation to some clients that need something a bit more newbie friendly.
The situation is that several clients have developed website(s) of the mostly static HTML sort, but the server they need to deploy to doesn't have the usual collection of 1990s protocols available (for example, no FTP). In fact, there is no access to any graphical interface. Deployment is handled through Git. Changes need to be pushed to a a remote repository that is accessible only via SSH key login. Any commits to the master branch pushed by the authorized key trigger a hook script that deploys the site to the production servers.
I am looking to suggest a Git client for Windows that:

makes it relatively simple to setup and initialize…

…one or more local repositories.
…a single git+ssh remote.
…authentication using an RSA key pair (generation of this would be a bonus).

has a simple interface where a basic workflow of committing and pushing is easy to accomplish without understanding the intricacies of distributed version control.

There is a GitLab instance available for each client that has one project per domain and makes adding their public key fairly easy. It also gives the clone/remote URLs for each project and makes it fairly easy to check what the status of the remote repository is.
Open source would be preferred, but any reputable freeware would be acceptable. What client software should I point them to?
Edit: Most suggestions to date seem to focus on full blown front ends to all of Git's functionality. I'm looking for something more pared down that only covers the basics and is better suited for a specific task than at running with the big dogs. I'm thinking the KISS principle here for people that do not use version control for anything else and just want to "upload" their websites.
Comment: Just joined this SO site, so I can't answer yet, but here's a fairly new offering from Axosoft: http://www.gitkraken.com/ It seems to be one of those modern Node-built apps, and doesn't yet support submodules, but so far it blows the doors off SourceTree for offering powerful features in a simple manner.
Comment: Please note I asked a [similar question for OSX](http://softwarerecs.stackexchange.com/q/1307/429), but I specifically want tools that are familiar and easy te get the hang of. Cross platform would be OK, but I have and idea the best newbie solution for newbies will be something native to each platform so please keep that in mind when answering.
Comment: Not sure this is full-fledged enough for an answer: I've only ever used [PortableGit](http://goo.gl/A8w06J) on Windows. It was my first use of Git (I "migrated" from SVN) and it worked very well: a doddle to install. Full suite info from [Git for Windows](http://msysgit.github.io/). FWIW.
Comment: I really would like to see the up and downvotes :D
Comment: @ManuelSchneid3r +74/-0 at the time of this posting. Answers are +58/-2, +48/-3, +34/-0, +12/-0, +8/-1, +2/-0, order by votes.
Comment: Also just joined this SO site, I could add that for all people who like IDEs Visual Studio 2015 (even free edition) has awesome support for Git. It has easy to manage added/edited/removed files; integrated merge tool; simple setup. It does not support SSH but other than that is one of the best tools for Git on Windows.
Answer: There is nothing like TortoiseGit for beginners.

It integrates with Windows Explorer (no new UI to learn)
Open source (GPL)
Setup/initialize new local repo:

Basic functions are in the top of context menu (Sync, Commit, Push and Pull):
Comment: Delete the only relevant and good answer?! That's amazing tip. This site is going places with this attitude, that's for sure.
Comment: TortoiseGit is about as simple as Git gets.  If someone else sets it up for you, all you need to do to commit changes is right click on the file (or folder) in Explorer and select "Git Commit."
Comment: @Jbaruch how easy it is to initialize new local repository? A single git+ssh remote? authentication? Is it open source? There's specific requirements set in the question that you don't address.
Comment: I still don't think it qualifies as high-quality answer. It's starting to fit the most basic requirements, though. More citations from that linked meta post: "You should also talk about any potential quirks that you can think of, and even things that you found to be a down side of the product. In short, share your experience with something, not simply your knowledge that it exists."
Comment: If you don't have any relevant experience with it, *maybe you should not recommend* it? In my opinion, you should either improve this answer or delete it and add a comment to the question instead.
Comment: This is highly recommended.
Comment: @Jbaruch please read [this meta post](http://meta.softwarerecs.stackexchange.com/questions/86/youre-doing-it-all-wrong), and edit your answer accordingly.
Comment: Here we go again. I don't use that tool ATM. So I am not aware of any quirks, problems, downsides, etc. I don't have any relevant experience with it. Should I delete my answer now (good answer, well explained, providing valuable and relevant information)? NP, really. If you only expect no less than perfect, count me out. I prefer existing good over non-existing perfection.
Comment: I tried this after reading this recommendation but personally I found it too frustrating to learn in 5 minutes so I downloaded SourceTree and found that much easier to use... mainly because there is an Interface. I agree with T.T.'s comment
Comment: While TortoiseGit is a powerfull tool and the shell integration is nice, it won't win any awards for usability. It's not like you have one streamlined interface for most git commands, there are different windows and tools for everything and some are made for sadists, I'm sure. In my opinion, it doesn't meet the criteria for a 'good newbie friendly graphical Git client for Windows' like the OP asks for...
Comment: I personally prefer not to use Tortoise GIT. While Tortoise SVN is a wonderful SVN tool, Tortoise GIT borrows a little too much from Tortoise SVN, retains a lot of SVN terminology and workflow alike. It kind of hard or unclear to do things "the GIT way". For example, one would never know what "Synchronize" in Tortoise GIT mean - because there's no such native command. On the other hand, if doing things "the GIT way" doesn't matter and most of the devs com from the SVN realm, but decided to use GIT for whatever reason. Tortoise GIT works.
Comment: Having spent years using TortoiseHg, I thought TortoiseGit would offer a similar experience. Wrong. While you could do basically anything for Mercurial under "Hg Workbench" through a single unified UI, TortoiseGit is totally fragmented. There's no "central window", just lots of disjointed panels which feel incomplete, inconsistent with each other, and confusing. Put simply, you need to already know git commands before you can use TortoiseGit, while you can use TortoiseHG for years and never touch the command line. For that reason, I consider TortoiseGit to be a bad tool.
Comment: @Olli, I find my answer pretty much inline with the instructions in that post. I explicitly state why this product match the request, highlight the relevant features and express my opinion about it. What's missing?
Comment: @Olli let's take it to [meta](http://meta.softwarerecs.stackexchange.com/questions/582/is-the-perfect-enemy-of-the-good), I have some thoughts about how this site works.
Comment: @Olli added some stuff.
Comment: let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/13128/discussion-between-olli-and-jbaruch)
Comment: I would not recommend the Tortoise tools to a beginner because they're too bare-bones. There is no GUI that tells them what's going on. I think this tool is rather for advanced users who know what to expect when they issue a git command.
Comment: *"It integrates with Windows Explorer"* Yucks, yucks, yucks. Is there a standalone portable version?
Comment: @RogerSanders - This is great feedback. I am in a similar situation - used TortoiseHg fairly productively for a long time, yet I'm still a total noob regarding raw Mercurial, or command-line version control in general. I can accept that Git has "won" (see Bitbucket, for example) and so am looking for whatever the Git equivalent of TortoiseHg is. Disappointing that TortoiseGit doesn't live up to the "Tortoise franchise" standards.
Answer: I moved from Github For Windows and then Git Extensions to SmartGit and recommend it. Here's why-

Cross-Platform (made in Java)
Very easy to setup and use. If you have experience with any git clients before, you won't take a minute getting on business.
Portable
Simple Clean UI. The main interface only shows the changed files and the big Commit, Merge, Push and Pull buttons.

Commercial software but free for private use.
For git beginners or non-git users, the only pain will be setting up the SSH keys. Once you have done that and cloned your first repository, it will be straight-forward and you will never have to open the console.
Comment: but JAVA. No. No. No.
Comment: Java?  Is this a joke?  Write once devastate everywhere!
Comment: I strongly agree. SmartGit is probably the best simple version control client around. It has pretty much every functionality you could ever want in a GUI, but is still pretty easy to use if you don't need any of the advanced features. Also, Java software is great as long as you're not the one writing it. Except for that Swing business. It's just so ugly.
Comment: This question is very specifically for people who **do not have any git (or vcs) experience** and don't plan to have any. Could you comment on how this would work for that use case? It almost sounds like something earlier in your chain might be better. What is "Git Extensions"?
Comment: I used SmartGit as my first git client and it is easy to use with only a slight learning curve. I would recommend it to anyone.
Comment: SmartGit is really good, both for newbies but also for more experienced users. You can get a good visual sense of what goes on and simplify most everyday tasks.
Comment: @Caleb I have edited the answer. **Git Extensions** may be easy to set up first-up because of the integrated plugins for many services but for the latter "managing the repo" part I prefer SmartGit because it is more simple. +it is portable
Comment: I have also used SmartGit as my first Git GUI, when I had absolutely no understanding of Git and still managed to use it. That being said, I consider myself more of a power user.
Comment: The only problem it supports BitBucket by SSH only. I wish it could support BitBucket over HTTPS. Any other portable client?
Comment: @Drazick They have recently added support for HTTPS transport :)
Comment: @RamRachum, In what version?
Comment: I'm not sure, possibly 6 or 6.5. Their changelog is incomplete.
Comment: This software contains virus as detected by virutstotal https://www.virustotal.com/en/file/ce116edb5b1e4913a9402ba18a464fef5123a824f2b1a2f5a364e4f80502016e/analysis/1422037393/
Comment: it's not free, it's trial version
Answer: I am using Atlassian SourceTree and like it a lot.
Here's the drill:

Free (not open-source thought AFAIK)
Feature rich - Almost all the features of Git is there (not of GitHub, though, e.g. I didn't find a way to rebase a GitHub fork. It's doable using ordinary Git commands - adding remote etc, but not out of the box)
Supports GitFlow
Nice UI:

NOTE - This screenshot is from a much older version. The UI of the newer version is simpler.
Bottom line - I find it almost perfect and use it for all the needs not covered inside my IDE.
Comment: That looks WAY too complex—too many buttons. I don't want "feature rich" so much as "feature sparse". This may be great for somebody who understood branching and diff trees and all that good stuff, but not for a newbie that does't actually plan on learning git. I need something that glosses over the complexities of even doing basic staging before a commit.
Comment: SourceTree is by far the best, but they don't have a Linux version. It looks intimidating at first, but it's really not at all. Very simple to use.
Comment: They just updated the SourceTree interface, which made it a bit less bulky.  I personally enjoy it very much.  I was a total beginner with the whole Git thing and it took me only a few hours to get comfortable enough thanks to this client.
Comment: Finally, somebody else who uses Sourcetree!
Comment: If you go with SourceTree, stick with version 1.7. 1.8 is horrible. Download link for 1.7: https://downloads.atlassian.com/software/sourcetree/windows/SourceTreeSetup_22.214.171.124509.exe
Comment: SourceTree is buggy and doesn't really add any layer of abstraction.
Comment: I can see some point in letting it stand as a warning to others about what _isn't_ a good fit for this question, but it's just (hopfully) going to end up low on the stack and I can see wanting to have it removed later. I guess that would depend on whether you thought it was a good/valid answer to this question (your other entry seems to have understood the problem better).
Comment: I used SourceTree but moved to SmartGit. SourceTress was nice but I found the interface to be cumbersome. Personal preference for sure but I just find the interface more powerful on SmartGit. SourceTree is still pretty good but not my preference.
Comment: @Caleb it looks  more complicated in that screenshot that your use case will be. I highly recommend at least delving into a bit of git if you are a contributor. Ignorance is no excuse. Sourcetree 'just works' and looks good while it is doing it.
Comment: I always have some performence issues. It's really slow tool. My entire team have the same opinion.
Comment: It's not complex at all... I learned it in a few minutes, after having frustrating experiences with other clients. Smart Git actually crashed on me right after it asked if it's ok to send crash information, lol. This is a crash on run, so couldn't get to the main screen even. SourceTree is great except for some slight freezing when doing things with the repo of mine that has many files.
Comment: Got it. Should I add another one or delete this one to put one instead?
Comment: I wish they had a portable version.
Comment: GIT itself comes with features that any user should learn and understand. "sparse" and "simple" are good characteristics to have but in the case of SourceTree you need to know what you are doing. The comments on "slow" are echoed by me. If you understand what is going on then you know why and when to expect it to be slow, however I find it almost unacceptable along with the constant "oh how embarrassing SourceTree crashed" messages. Once a crash actually messed up a merge and seriously messed up my commit wasting quite a bit of time. Looking into other GUIs...
Comment: SourceTree at this time is an incredible piece of garbage (1.9.x). It's _very_ slow, crashes left and right, the UI is buggy and non-responsive and development mostly centers around updating the icons. My blood pressure goes up every time I have to use it.
Answer: I very much like Git for Windows (msysGit).
It has three 'modes' - Bash (where you can do everything), Windows Context Menu, and GUI (where you can do a lot less but it is I would say very user friendly).

makes it relatively simple to setup and initialize: Very easy

one or more local repos: Initialization is very simple and you can have as many as you want with no conflicts.
a single git+ssh remote: Easy - pretty easy to add more remotes if desired at some point in the future as well. (see screenshot below which is accessed by GitGUI->remote->add)
authentication using an RSA key pair (generation of this would be a bonus): Yes, you can also generate it although that is only via cmd line (see this tutorial)
has a simple interface where a basic workflow of committing and pushing is easy to accomplish without understanding the intricacies of distributed version control: Yes, see screenshot, it was much easier to learn for me when I first started playing with code than RapidSVN or TortoiseSVN.

From the cmdline you can do EVERYTHING (pretty much); the GUI does have quite a few features but nothing complicated is shown on the front screen (only commit related), everything else is hidden in the menus.
Comment: I'm not exactly noob, but I don't use Git in daily basis and I had many problems with it - couldnt find merge window. adding files and undoing changes was really difficult and interface is tricky.
Answer: The most simplistic and easy I have ever seen is GitHub for Windows:

But there is one caveat: using with non-github repositories isn't intuitive (feels like a hack TBH).
Comment: IMO, the omission of fetch and push from the vocabulary damages its utility as a non-github tool.
Comment: It's too simplistic. Very quick you will find that it doesn't have enough fuctionality. E.g I didn't find, does it support stash.
Comment: It's not too simplistic for newbies, which is what the OP was about.
Answer: You may consider using GitKraken. Some features:

Free for non-commercial use
Cross-platform (Windows, Mac, Linux)
Multiple profile support
One-click undo & redo
Built-in merge tool
Drag and drop to merge, rebase, reset, push and more
Resizable, easy-to-understand commit graph
View image diffs in app
Submodules and Gitflow support
Integrate with GitHub or Bitbucket account
Answer: ungit has a strong ease of use and understandability focus (as the name suggests)
https://github.com/FredrikNoren/ungit
Install:
<code>npm install -g ungit
</code>
It is Node.js based and runs a server that users can view on the browser, so it is cross platform.
Not sure if it manages SSH for users, but it is definitely something that I can see them doing.
Comment: This GUI intrigues me. I am not thrilled that it is built on javascript (personal bias, not the end of the world) but the visual interface looks about as idiot-proof as anything possible for Git. There is a terrific [tutorial for Ungit](https://www.youtube.com/watch?v=DrQQyEEqmwI) but unfortunately it is in French, still it is worth watching just to visually see Ungit in action.
Comment: I didn't like that it puts a "node_modules" directory **inside my repo** with thousands of files in it. Why?
Comment: @TamásSzelei don't tell anyone, but I haven't actually tried it ;-) But does it treat `node_modules` specially? Doesn't the same happen with other directories? Isn't it a `.gitignore` problem?
Comment: That depends on how you look at it. You can `gitignore` it, sure, but I'm reluctant to push a change to every user of this repo just because my git client puts (parts of?) its source code in the repo. Surely someone would ask what the hell am I doing with "node_modules" in a C++ project.
Comment: @TamásSzelei ah, OK, It actually creates files, I thought it was just showing them. Bug report then, and link to it ;-)
Answer: I am surprised hardly anyone mentioned about Git Extensions. I am using it for many years and I find it more user friendly than Tortoise Git.
Answer: Git Cola

crossplatform (Linux, Windows, OSX)
FOSS
GitKraken advertise itself as better that Git Cola

I use it as main git interface on Linux. Very easy to do everyday operations

Commit
Revert last local commit (change description, add missing changes)
Commit changes for selected lines (isolate not related changes)
View Log (included DAG tool)
Answer: I've just released Glint. The aim is to have a client that runs fast with a nice, simple, and intuitive UI whilst still having access to more powerful features.
Runs on Windows, macOS, and Linux. Free to use, with a paid subscription for bonus features (but 99% of the app is totally free).
Answer: https://git-fork.com/
I recently moved from Sourcetree to Fork. The name is very hard to Google for but it's great software. The killer feature for me was being able to stash and apply certain files and not just all local changes. It's not free software ($50) but it just shames you like WinZip does every now and then.
Comment: I recommended Fork a lot before the price went up and it is nice software, but it does not meat the specific requirements of this question.
Answer: For the record, I've never found anything that really fulfilled everything I was looking for in this question.
My current go-to to recommendation when a beginner needs a free GUI is GitAhead. It has a few rough edges but is about the simplest cleanest implementation I've run across that is open source. It's very similar to Fork — it lacks a little bit of Fork's polish, but also doesn't come with a price tag.


Configuring Always On Availability Groups sql Server 2019 and log backup

Question: We want migrate to sql 2019 and I did the test and  set up Hight availability with twho 2 nodes,but and the set up of  AG I have four option,
I gave that option a shared path for the transaction log but I saw that a transaction log was generated, which increased space in the same transaction log every time they made updates and uploads to the database.
Which one would be recommended for a production environment and at the same time how to manage the transaction log?
Should I implement a log shipping strategy with always high availability Group 2019? which is the best option?
Answer: As with most things SQL, best is variable and highly dependent on your environment.
If all of my databases were small, then I would choose Automatic Seeding.
Otherwise, I would use Join Only or Skip Initial Data Synchronization (they are really the same, it's if you have done the prep work PRIOR to this step or if yo u want to do it later.
For medium to largish databases, my steps would be:

Restore a FULL database to the secondary
Continually restore LOG files to the secondary.
STOP new log backups on primary (temporary)
Restore last log backup to secondary (with NORECOVERY)
Join to Availability Group
Resume log backups on primary


Clean Architecture Dependencies

Question: I'm thinking about adopting the clean architecture.
The main thing in this architecture, as I understand it, is the dependency flow from top to bottom. So the first thing that I asked myself is: what would be the cost to change the bottom layers (i.e Entities)? This layer will have lots of dependencies, and by changing it I will have to change all the layers up to the top.
Am I right or am I missing something?
Comment: Recommend you this blog post for a good read: http://blog.ploeh.dk/2012/02/09/IsLayeringWorththeMapping/
Answer: Think in the clean architecture neither of layers nor of positions like top or bottom. It is fundamental to think of (maybe) rings or shells that can be used by outer rings and protect inner rings.
The most inner ring should always be your domain and therefore is not able to have dependencies to any other ring surrounding it. In rough terms this means, your domain is free of technical or application specific aspects. Hence your entities are done right, if they only depend on other components in your domain.
You will maybe ask yourself now, how on earth do I communicate with infrastructure, let's say a database, if I cannot have a dependency on that. And here, as the bard tells, lies the rub. You simply define an interface in your domain that describes a concept of an behaviour that you need. In this case how to store your entity. But you do not have a concrete implementation in your domain. And you don't need it, because interfaces are abstractions for general concepts. How exactly your entity is stored, is not a concern of your domain.
The implementation lies in an outer ring. Mostly in the outest ring, sometimes called infrastructure ring.
With your main method (the application) you then can create a suitable implementation and give it to your domain. This is often done by some dependency injection mechanism.
So in the end there is nothing mystical. Your domain defines what it needs from outer layers in a business like way and your outer rings implement and wire them.
For further reading I would recommend Uncle Bob Martin's article on the clean architecture on one of the many sites which have published it:
The clean architecture
Comment: Thanks for the answer tough it's realy inforamtive your answer doesn't give information about the question, which can be simplified to "what are the costs to change the entities in the domain layer?"
Comment: There is something I still can't understand about this approach.
Suppose we want to make the repository component into a service on its own (Uncle bob says in theory every component can potentially be a service on it's own).

How in this case the service implements Interfaces it doesn't know about?
Answer: You are right!
If you change any of the "business objects", you are in for a lot of secondary changes throughout the code, most probably in different packages as well.
In this article I do exactly this experiment with Uncle Bob's own Clean Architecture / Clean Code case study github project: https://javadevguy.wordpress.com/2017/11/15/screaming-architect/
Result: In this extremely trivial project, I had to change 5 classes (50% of application) to add a single independent data field. This would get much worse (even potentially exponentially) in a bigger application.
Here is another article analyzing, among other things, this seemingly unmaintainable nature of this architecture style: https://javadevguy.wordpress.com/2017/07/27/a-detailed-analysis-of-the-clean-architecture-from-an-object-oriented-perspective/
Conclusion: The "Clean Architecture" may fit projects in which the "business" part never or rarely changes while technologies change a lot. It is optimized for changing technology stacks. I'm unsure what project want that instead of business features.
Comment: Thanks for the precise answer. It's the only answer which gives information about the question. answer accepted :)

Clean Architecture Dependencies


Understanding PAC (probably approximately correct) bounds on the realizable case (and finite hypothesis class)

Question: I was trying to understand PAC bounds on the realizable case (i.e. when there is some perfect $h^* \in \mathcal{H}$ and its generalization error is zero).

Notation:
Training data:
$$S_n$$
Training error on training data $S_n$
$$\mathcal{E_{n}(h)}$$
Generalization error
$$\mathcal{E(h)}$$
Hypothesis class
$$\mathcal{H}$$
Size of hypothesis class:
$$|\mathcal{H}| = K$$
Probability over the choice of training set that the PAC bound fails:
$$\delta$$

I would like to derive how $\epsilon$ relates to other PAC variables, n, $K$ and $\delta$.
Attempted derivation:
Let $h_{bad}$ be any classifier that generalizes poorly $\mathcal{E(h)} > \epsilon$ . What is the probability that we would choose it after seeing the training set? If we choose it then given the current $S_n$ then we would choose it, if it has zero training error. Then, what is the probability that this bad classifier makes no training error?
$$P[h_{bad} \text{makes no error on } S_n] = (1 - \mathcal{E(h)})^n < (1-\epsilon)^n$$
this number is an upper bound on the "fraction/precentage of classifiers" that are bad and are chosen with the current training data.
From this I was trying to relate that upper bound to $\delta$ and was trying to figure out if the following statement was true:
$$(1 - \mathcal{E(h)})^n = \delta$$
If its true then one can conclude that:
$$\delta < (1-\epsilon)^n$$
Which is the bound that makes sense to me, but it seems that I am missing one important variable $|\mathcal{H}| = k$. For some reason the correct bound is suppose to be $\delta \leq |\mathcal{H}|(1-\epsilon)^n|$ but I can't figure out why. I think my problem is that I can't seem to understand what the difference of $\delta$ and $1 - \mathcal{E(h)})^n$ is, or the relation between them. I believe I got the correct relation but I am not sure.
Answer: $P[h_{bad} \text{makes no error on } S_n]$ is the probability that a particular bad classifier would work on the training data. To get a bound on the probability that any bad classifier would work on the training data, we need to multiply by the number of potentially bad classifiers, $K$.


Why don't databases intelligently create the indexes they need?

Question: I just heard that you should create an index on any column you're joining or querying on. If the criterion is this simple, why can't databases automatically create the indexes they need?
Comment: because generally, it's not that simple!
Comment: as with most things, there are trade-offs involved.
Answer: Well, they do; to some extent at least...
See SQL Server Database Engine Tuning Advisor, for instance.
However, creating optimal indexes is not as simple as you mentioned. An even simpler rule could be to create indexes on every column (which is far from optimal)!
Indexes are not free. You create indexes at the cost of storage and update performance among other things. They should be carefully thought about to be optimal.
Answer: Every index you add may increase the speed of your queries. It will decrease the speed of your updates, inserts and deletes and it will increase disk space usage.
I, for one, would rather keep the control to myself, using tools such as DB Visualizer and explain statements to provide the information I need to evaluate what should be done. I do not want a DBMS unilaterally deciding what's best.
It's far better, in my opinion, that a truly intelligent entity be making decisions re database tuning. The DBMS can suggest all it wants but the final decision should be left up to the DBAs.
What happens when the database usage patterns change for one week? Do you really want the DBMS creating indexes and destroying them a week later? That sounds like a management nightmare scenario right up alongside Skynet :-)
Answer: This is a good question. Databases could create the indexes they need based on data usage patterns, but this means that the database would be slow the first time certain queries were executed and then get faster as time goes on. For example if there is a table like this:

ID     USERNAME
--     --------

: then the username would be used to look up the users very often. After some time the database could see that say 50% of queries did this, in which case it could add an index on the username.
However the reason that this hasn't been implemented in great detail is simply because it is not a killer feature. Adding indexes is performed relatively few times by the DBA, and by automating this (which is a very big task) is probably just not worth it for the database vendors. Remember that every query will have to be analyzed to enable auto indexes, and also the query response time, and result set size as well, so it is non-trivial to implement.
Answer: Because databases simply store and retrieve data - the database engine has no clue how you intend to retrieve that data until you actually do it, in which case it is too late to create an index. And the column you are joining on may not be suitable for an efficient index.
Comment: Why is it too late? I assume you aren't just going to run one query on this database, ever. It could potentially watch for patterns and update itself accordingly. Of course, that means the DB has to make assumptions that you're going to continue to use it this way and such, but it's feasible.
Comment: This isn't necessarily true.  The RDMS knows the types of the fields and their constraints so it would be more than capable of creating new indices as needed.  While this is possible it doesn't lend itself to scalability as the RDBMS would have to do extensive analysis of existing indices prior to creating new ones in order to avoid fragmentation and other problems.
Answer: An RDBMS could easily self-tune and create indices as it saw fit but this would only work for simple cases with queries that do not have demanding execution plans.  Most indices are created to optimize for specific purposes and these kinds of optimizations are better handled manually.
Comment: There's also the potential for disk space usage to go through the roof, if that's something people still care about when indexing things.
Answer: It's a non-trivial problem to solve, and in many cases a sub-optimal automatic solution might actually make things worse. Imagine a database whose read operations were sped up by automatic index creation but whose inserts and updates got hosed as a result of the overhead of managing the index? Whether that's good or bad depends on the nature of your database and the application it's serving.
If there were a one-size-fits-all solution, databases would certainly do this already (and there are tools to suggest exactly this sort of optimization). But tuning database performance is largely an app-specific function and is best accomplished manually, at least for now.


How much power does it take to maintain the high vacuums in advanced physics experiments?

Question: The LIGO Gravitational-Wave Observatory and CERNs Large Hadron Collider both have some impressive ultra-high vacuum systems. For my project proposal I need to demonstrate some understanding of how much power it takes (in practice) to maintain an ultra-high vacuum. This could be Watts as a function of vacuum level and volume (or surface area) of the evacuated system.
Comment: CERN has a nice presentation on vacuum available: https://indico.cern.ch/event/173359/contributions/276007/attachments/218832/306479/Vacuum_Systems_by_J.M._Jimenez_-_CERN_v1.pdf
Comment: Consider that an off-the-shelf vacuum flask (e.g. Thermos/Dewar) is vacuumed *once*, sealed, and then requires no maintenance or upkeep. It's *not* an extreme vacuum, but it's evidence that it's not the *maintenance* of the vacuum that requires the energy; it's mostly keeping it cold, and keeping it cold is an easy way to make your vacuum slightly better.
Answer: As someone who has worked on an experiment with an ultra-high vacuum, I can tell you an order of magnitude. However, the real answer is that asking how much power it takes isn't really the right way to think about how a vacuum is maintained.
To my knowledge, the "strongest vacuum" (the experiment which has measured the lowest upper bound on how many molecules are in their vacuum) is BASE's. They phrase this as a limit on the lifetime of the antiproton, but assuming that the antiproton lasts forever, this is a really strong bound on how much ordinary matter is in their vacuum system.
Improved limit on the directly measured antiproton lifetime
BASE doesn't have any vacuum pumps pumping air out of their experiment. They "bake" their experiment (heat it to a reasonably high temperature) with pumps running about once a year. Then they pinch off a copper tube, sealing the experiment closed for the rest of the year. Then they immerse the experiment in liquid helium, and most of the lingering air is stuck to the walls of the experiment. However, it takes a lot of energy to produce liquid helium. IIRC from working in that building that BASE uses a $500\,\mathrm{l}$ tank of liquid helium once every two weeks, which probably takes about $10,000\,\mathrm{kWh}$ to produce. However however, BASE doesn't expend liquid helium because somehow the maintenance of the vacuum evaporates it, their loss of liquid helium just comes from thermal conduction from the outside world. It wouldn't be fair to call this "energy used to maintain a vacuum."
The experiment I work for, ALPHA, also uses cold pumping. We use a lot more helium, about $2000\,\mathrm{l}$/week. But we also run pumps because the experiment isn't closed off like Base's is. This is... idk... a thousand watts total. Maybe ten total pieces of equipment (ion pumps, turbomolecular pumps, roughing pumps), 30ish if you include things like controllers and vacuum gauges, all which can run on ordinary mains power. But it's not like the energy used to run those pumps comes from some kind of thermodynamic rule about how much energy it takes to remove gas from a vacuum. Indeed it does fundamentally require some energy to move gas from a low pressure system to a high pressure one, but mechanical resistance and the simple operation of electronics is really what requires power on those pumps. Once the vacuum is reasonably good their power draw just to remove the gas produced by off-gassing metals in the vacuum is extremely minimal. It only takes a few minutes of the pumps "straining" before they are no longer using significant power. Worth noting also that a lot of our experiment works on cryocoolers operating at $4-6\,\mathrm{K}$ instead of liquid helium, and when this is specifically for vacuum it's called a cryopump. This is essentially a fridge that uses high pressure helium as the working fluid. There's a thermodynamic limit on how much work it takes to take a certain amount of heat out of the low temperature system and put it into the rest of the room at $300\,\mathrm{K}$ (given by the Carnot efficiency). But again this is entirely limited by heat flux from the lab to the cold region; nothing to do with maintaining the vacuum, even if that's the goal of the cryopump.
The LHC is more like ALPHA, but at a much bigger scale and everything is done much better cern website on the LHC's vacuum. They bake at 300 celsius (which requires energy to keep something that hot for a few weeks); most of their beamline is immersed in liquid helium at $1.7\,\mathrm{K}$. They also have non-evaporable getter coating (which is just a coating on a wall; no energy needed).
The LHC interior parts are also all vacuum fired (heated to many hundreds of degrees celsius in a specialized vacuum chamber), which definitely takes A LOT of energy.
Again, lots of equipment that uses plenty of energy. But none of that energy usage is really fundamentally necessary. It's just how the technology works at the moment.
And in all three cases the cryogenics serve more purposes than maintaining the vacuum. ALPHA and the LHC also use the liquid helium to operate superconducting magnets. ALPHA and BASE also rely on the helium to maintain low particle temperatures.
Comment: In order to get from the (*very* interesting -- thanks for the insider account!) engineering back to physics: As far as thermodynamics go, the bulk of the work is done when "most of the air" is pumped out, after a few minutes; everything else is, so to speak, upkeep of infrastructure not directly related to the underlying thermodynamic physics (i.e., to get the remaining few molecules out requires only negligible work as such).
Comment: Yes, I really appreciated gaining that perspective. It is obvious in hindsight, but somehow I got it in my head that "more vacuum" meant "more power" and that there would be some kind of unfavorable power-law relationship between the two.
Comment: @Peter-ReinstateMonica This site has an large majority of theorists and people who have only been exposed to physics in a classroom (ex. undergrad students) and as such it has a theory bias. The vast majority of physics departments in the world include experimental physics under the umbrella of physics. I think vacuums, cryogens, lasers, beams, magnets, etc (the main tools of experimental physics) _are physics_. They are typically built, characterized, studied, and optimized by people with the job title "physicist" not "engineer." My physics undergrad didnt teach me much about them though.


Among IELTS and TOEFL test, which is more suitable for applying in US for PhD programme?

Question: I have completed by masters  with good grades from University of Calcutta, India. I wish to pursue doctoral research in USA in the subject of Geography. But, I am in a state of uncertainty as to which exam will be more suitable for me to give, IELTS or TOEFL. Which test do most of US universities gives weightage to while going through CV of shortlisted and/or interested candidates.
And also, if I do give IELTS, will it give me an edge if I do wish to apply for universities in Europe, Canada and/or Australia?
Answer: Please read the requirements for the programs you are interested in applying. I know a few universities used to strictly require applicants to take TOEFL IBT in the past. However, nowadays, IELTS, TOEFL IBT or other popular English proficiency tests are accepted at almost any university in the world. As long as you pass a certain threshold that they require for the English test you choose, you meet the English requirement. For some universities, this threshold will be high (e.g. 7.5 with no skill below 7.0). Furthermore, the test you take will not give you any advantage/disadvantage.
I personally chose the easiest one to take just because I was confident with my English skills, and I did not want to spend any minute on preparing for the test. Furthermore, your ability to communicate in English matters much more than the score you get in a proficiency test as it will be shown during PhD interview (if there is any).


Google Hangouts v Hangouts Dialer v Voice : Which to download to call outbound?

Question: If I desire only to make outgoing telephone calls from my Android, which must I download?
Answer: Google Voice gives you a second phone number linked to your original. You can use it to call outbound from the app. Google voice can also recieve calls as well as send and receive texts.
Google Hangouts is a messaging app. On the web version, you can call outbound. I'm not sure about the app version. You can also use it to video call, both single person and group calls.
^^My Google Hangouts menu^^
Google Dialer (If I have the correct product) seems to be just a phone management app, just like the typical "Phone" app that comes preinstalled on most phones. It gives you a dialer screen and a Google Duos video call screen as well as spam protection and caller ID. However, it doesn't look like it comes with a phone number, it uses the one from your SIM. So it'll make outbound calls, but only if you have a SIM card installed.
EDIT: Hangouts Dialer (Not Google Phone, sorry, got that wrong the first time) is a dialer for Google Hangouts (hence the name). It's a way of making phone calls without using minutes. You can call any phone number, and it shows on the receiving end the verified number connected with your device. I believe it can also be used in combination with Google Voice, using that number as your verified number.


Why do classification trees tend to perform better on large data sets and logistic regression on smaller ones?

Question: Is this simply because if we have a lot of data, there is a bigger chance that a more complicated decision boundary (boundaries) is required to separate the observations?  Does someone know researches who published papers about the performance of these techniques depending on the data size?
Comment: I suppose classification "tress" means "trees", edited. Check.
Answer: Thinking of "decision boundaries" and dichotomization in general is not the best way to think about data.  And trees do not usually perform better than regression on large datasets, because trees (e.g., recursive partitioning; CART) do not handle continuous variables well and because they give equal belief to high-order interactions as to main effects.  Trees require much larger datasets than regression (typically 200 events per candidate variable whereas logistic regression requires 20 events per candidate variable) in order to be reliable.  So trees are disasters on small datasets, and are nothing to be excited about for large ones.
This is the related to the reason people use combinations of trees such as random forests.  Individual trees just don't work well.  But combining trees loses the only advantage (interpretability) that trees ever offered.


Is it possible to 'install' an operating system by putting the EFI/boot & system files in the right place?

Question: If I were to partition a /dev/sdb1, place all the needed root/home files, then go to my own /boot/efi folder and put the files there with whatever UUID I need, would it then be bootable?
Comment: No, because you'll also need a bootloader like grub or uboot.
Comment: I suspected it was yes, so tried & failed.  I suspected I hadn't got it right, but decided it wasn't worth the effort & installed normally (so I defer to mikewhatever's prior comment)
Comment: Well I've got rEFInd, a USB with recovery, an empty NTFS partition and a lot of frustration. Noted on needing a bootloader, I think I can try taking it from a VM or the USB.
Answer: Yes, the "right place" being an EFI FAT partition for the shimx64.efi and grubx64.efi bootloaders, along with the grub.cfg (all in EFI/ubuntu, and copies in /EFI/Boot with shimx64.efi renamed to bootx64.efi.  Your root should be on an ext4 partition.  The only UUID change needed is in the EFI partition's grub.cfg file to use the root of your system (assuming you just copied the whole EFI from another system.  It's really pretty simple, and will even boot a legacy install of the root this way (not secure boot, but UEFI). Surprisingly, even the legacy /boot/grub/grub.cfg will work for a UEFI boot.  You can add the /boot/efi and fstab entry for mounting the EFI, but that would only be needed if you tried to update shim/grub, (assuming you have the efi versions of the packages).  I've been running a disk set up this way (legacy install, UEFI files added from another system) for years without issue.  I did add the /boot/efi and fstab entry, but never bothered with the shi9m/grub efi package change.
Comment: Awesome. I have Linux root as ext4 and its separate boot partition as FAT32. I'm going to run a VM with NTLite, remove junk and copy it over network share to the empty partition, then copy the needed files to my /boot as well. I'll comment again if I run into any errors, thank you.


Personalized, Weighted Recommendations - Rank All Content

Question: I'm building a social site for musicians. I would like to take the whole list of songs from the database and rank each one based on its relevancy to the logged in user. One reason for this is that I'd like there to always be 10 songs recommended, even if the user signed up 45 seconds ago.
The factors I'm using are:

The band members of songs (all would be members of the site, might have all quit the song)
The logged in user's member connections (may be none)
The most recent update in the song (will at least be the day the song was "created")
The (sub)genre of the song (will always be set)
The (sub)genre of the user (will always be set)

The (sub)genres belong to more general genres, so I figure I can either weight a song higher if the logged in user and the song's (sub)genre are the same, or a little less higher if they at least belong to the same general genre.
I'm not sure if I should be aiming for an Apriori or Bayesian algorithm... It seems to be somewhere in between. I have a couple of lines borrowed from explanations of the Hacker News algorithm that I've tweaked. I'm not quite sure how to put the final results together to get my ranking.
Here's the code I've written so far (for all intents and purposes, a studio is a song). I know queries in loops like this are never a good idea, but I've done it this way because there's some memcaching schemes I use and this will probably also be batched:
<code>function studio_relevance($user_id, $user_genre) {
    global $cxn;

$query = "SELECT * FROM studio WHERE project_status='active'";
$result = mysqli_query($cxn, $query) or die($query.': '.mysqli_error($cxn));

$data = array();

while ($studio = mysqli_fetch_object($result)) {
    //Find similarities in social connections and band
    $query_b = "SELECT * FROM band WHERE studio_id=".$studio->studio_id;
    $result_b = mysqli_query($cxn, $query_b) or die($query_b.': '.mysqli_error($cxn));

    $the_band = array();
    while ($people = mysqli_fetch_array($result_b, MYSQLI_ASSOC)) {
        $the_band[] = $people['user_id'];
    }

    $studio_band_count = count($the_band);

    $query = "SELECT * FROM idols WHERE friend_id=".$user_id;
    $result_b = mysqli_query($cxn, $query_b) or die($query_b.': '.mysqli_error($cxn));

    $idol = array();
    while ($people = mysqli_fetch_array($result_b, MYSQLI_ASSOC)) {
        $idol[] = $people['artist_id'];
    }

    $same_band = array_intersect($the_band, $idol);
    $same_band_count = count($same_band);

    ########
    $similar_band = $same_band_count / $studio_band_count;
    ########

    //Find the most recent activity
    $query_b = "SELECT * FROM studio_feed WHERE studio_id=".$studio->studio_id." ORDER BY feed_id DESC LIMIT 1";
    $result_b = mysqli_query($cxn, $query_b) or die($query_b.': '.mysqli_error($cxn));
    $tab = mysqli_fetch_object($result_b);

    $time_diff = strtotime('now') - strtotime($tab->timestamp);
    $hours = $time_diff / 3600;

    ########
    $last_activity = pow(($hours+2), 1.8);
    ########

    //Compare genres
    $genre_weight = 1;

    if ($studio->songGenre == $user_genre) {
        $genre_weight = 3;
    }
    else {
        $query_b = "SELECT * FROM genres";
        $result_b = mysqli_query($cxn, $query_b) or die($query_b.': '.mysqli_error($cxn));

        $genres = array();
        $user_genre_cat = 0;

        while ($genre = mysqli_fetch_object($result_b)) {
            $genres[$genre->genre_cat][] = $genre->genre_id;

            if ($genre->genre_id == $user_genre) {
                $user_genre_cat = $genre->genre_cat;
            }
        }

        if (in_array($studio->songGenre, $genres[$celeb_cat])) {
            $genre_weight = 2;
        }
    }

    //Find final result
    //$final = $similar_band + $last_activity + $genre_weight;
    //$hours / pow(($similar_band+2), $genre_weight);
}

return $data;
}
</code>
Any suggestions would be greatly appreciated! Am I on the right track or going about this all wrong?
Answer: tl;dr. I'd advise you to rewrite your question from scratch, or check out the CodeReview site. https://codereview.stackexchange.com/