Adding column headers to hive result set

Question: I am using a hive script on Amazon EMR to analyze some data.
And I am transferring the output to Amazon s3 bucket. Now the results of hive script do not contain column headers.
I have also tried using this:
 set hive.cli.print.header=true;

But it does not help. Can you help me out?
Comment: Do you want column headers included in some output file of just see them in command line interface?
Comment: @Wawrzniec I want them in output file.
Answer: Exactly what does your hive script look like?
Does the output from your hive script have the header data in it?  Is it then being lost when you copy the output to your s3 bucket?
If you could provide some more details about exactly what you are doing that would be helpful.
Without knowing those details, here is something that you could try.
Create your hive script as follows:
USE dbase_name:
SET hive.cli.print.header=true;
SELECT some_columns FROM some_table WHERE some_condition;

Then run your script:
$ hive -f hive_script.hql > hive_output

Then copy your output to your s3 bucket
$ aws s3 cp ./hive_output s3://some_bucket_name/foo/hive_output

Comment: Hi,
sqoop getting data from oracle, but not schema /headers. I want to get schema as headers. For example
name,age,location
venu,31,Banlgaore
srinu,32,Hyderabad
.....
llike this. How to get the schema in the form of headers, not like this format.
Oracle to S3 (in sqoop), .. not to local .. to s3 like above format.
Answer: I guess that direct way is still impossible (HIve: writing column headers to local file?).
Some solution would be export result of DESCRIBE table_name to file:
$ hive -e 'DESCRIBE table_name' > file

And write some script that add column names into your data file. GL!
Answer: I ran into this problem today and was able to get what I needed by doing a UNION ALL between the original query and a new dummy query that creates the header row. I added a sort column on each section and set the header to 0 and the data to a 1 so I could sort by that field and ensure the header row came out on top.
create table new_table as
select
  field1,
  field2,
  field3
from
(
  select
    0 as sort_col,  --header row gets lowest number
    'field1_name' as field1,
    'field2_name' as field2,
    'field3_name' as field3
  from
    some_small_table  --table needs at least 1 row
  limit 1  --only need 1 header row
  union all
  select
    1 as sort_col,  --original query goes here
    field1,
    field2,
    field3
  from
    main_table
) a
order by
  sort_col  --make sure header row is first

It's a little bulky, but at least you can get what you need with a single query.
Hope this helps!
Answer: It might be just a typo (or a version-dependent change), but the following works for me:
set hive.cli.print.headers=true;

It's "headers" instead of "header"


Proper statistical method for small dataset with temporal structure

Question: I was observing 6 trees for 3 years and recorded leaf phenological phases. I am particularly interested in how the date of autumn leaf colouring effects the bud burst date in the following year (see the plot below). Please note, the variables represent day in a year and points are jittered to make them visible.
The correlation between both numeric variables is -0.86, but what is actually the proper methodological approach to model the effect of (previous) autumn colouring on bud burst date and make conclusions about statistical significance?
Answer: I don't see that correlation has any significance here, because this effect is clearly caused because of the year.
I think that what you need is an ANOVA method using the trees  as a random effect, because I assume that there are more trees (and you are always using the same trees). You have to check differences between them and within them.
So, my suggestion would be a mixed-effect model (an example here: https://ourcodingclub.github.io/tutorials/mixed-models/).
You should use Trees as a random effect block. Year could be a random effect too, but you could use it as a simple explanatory variable. With that, you can check if autumn colouring is affecting into bud burst (or if the effect that you see is caused because of the year and/or the trees).
Comment: Thank you @Dave. I will test the mixed-effect model and post the result table here. If there are other opinions or suggestions about the methodological approach, it would be great.


Determine the left offset of a click using jQuery

Question: Say you have an image that is 200px wide. Is there a way to determine how far from the left of the image you clicked? For example if you clicked in the dead center you would get 100. I tried using something like ui.position.left but couldn't get that to work. Any ideas?
Answer: First, get the X position of the image. Next, use the event information to get the X position of the click event.
Once you have those two, it's simple math to get the result:
$('#yourImg').click(function(e){
    var imageLeft = $(this).offset().left;
    var clickLeft = e.pageX;
    var howFarFromLeft = clickLeft - imageLeft;
});

Answer: You need to find the mouse coordinates at the time of the click (by using the event of the click, event.pageX, event.pageY). Then find the location of the image in the body. and subtract it from the mouseposition..
The result would be the coordinates inside the image.. Demo


How do I add doorway under stairscase storage?

Question: I'm looking to add storage under the staircase in our basement, but the wall looks to be load-bearing. I'm planning to use two 2x10's (or 2x12 if there's room) with 1/2" plywood sandwiched between them for a header, then some jack studs. Are there other material recommendations or techniques to do the work?
Comment: I don't think a 2x10 or 12 is ever needed to span such a small gap.  The header is just going to carry one stud right?
Comment: A double joist can sometimes mean expected extra weight above.  Your idea sounds good, but having someone else(engineer, builder) there to check is a decent idea.
Comment: Two 2x10s should be more than sufficient for such a narrow gap.
Comment: We're wanting at least a 26" door so i need about 28" for a rough opening. There is a metal beam about 4' from the wall. I kind of want to over-build the header just to be on the safe side.
Answer: I ended up building a header out of two 2x6's with a 1/2 plywood sandwiched between them. Plenty of construction adhesive and screws.
I built a temporary support out of scrap lumber to be sure nothing shifted overhead while working. installed the header on top of two jack studs.
here is the finished rough opening. The header is hidden unfortunatly.


What exact purpose do transitional packages have?

Question: What are transitional packages and what exact purpose do they have?
Answer: They simplify the transition if a package gets renamed:
Let's say we have a package called mypackage in the current release. Now for some reasons this packages gets renamed mynewpackage  in the next release. As the package manager doesn't know anything about renaming packages it will treat mypackage and mynewpackage as different packages so that on upgrade users who have mypackage not get mynewpackage installed but stay with the old mypackage (if the dependencies allow that).
To avoid this, the package maintainer simply creates a transitional package mypackage in the new release that doesn't have any files but just a depends on mynewpackage (this kind of package is called a "meta package").
Comment: is it like a pointer or a link that shows from the transitional package on the successor or did i misunderstand this? the old mypackage is completely removed and the new one is just available?  i ask mainly because i have a driver problem with my printer, libcupsys was deprecated and libcups seems to be the successor, but the only drivers available from canon base on the old libcupsys. so how could such a transitional package help me in this case?
Comment: It's similar to a pointer but thinking this way may be misleading in some aspects as a transitional package is still a normal package except it doesn't contain any files but just metadata. What exactly is the problem with your printer driver? Since karmic libcupsys is a virtual package that is provided by libcups, so there shouln'd be dependency problems if the driver depends on libcupsys.
Comment: I would upvote this answer if it linked to the page that specifically tells maintainers to do this: https://wiki.debian.org/RenamingPackages .
Comment: To avoid what? Also, are transitional packages only for one transition? Let's say I have Ubuntu 20.04 and `mypackage`. I upgrade to 20.10, and I now I have `mypackage` (which becomes transitional) and (which depends on) `mynewpackage`. And then I upgrade to 21.04 and it fails because 21.04 doesn't have `mypackage`? Meaning, when does `mypackage` get deleted? Do I have to delete it by hand? Does it happen automatically at some point?
Comment: @x-yuri To avoid users with the original package not getting the renamed version.


If I sleep with Lae'zel, am I locked out of romancing someone else?

Question: During Act 1, when I went to dismiss Lae'zel from the party, the conversation took a sudden turn when she bluntly asked if I wanted to sleep with her. If I say yes, am I locked into a relationship with Lae'zel? Will this lock me out of romancing other party members?
Answer: No, it will not. In general, it is possible to abort the romance plotline with most companion characters through a "break up" dialog option that is almost always available when talking to them. Afterwards you are able to pursue a relationship with any other companion, provided that it is still early enough in the game's story for the relevant relationship event triggers to occur.
There are a couple exceptions, though. For example, the relationship with Astarion becomes permanent if:

 the player decided to let him ascend after defeating Cazador and then decides to become Astarion's vampire spawn.

There are also a couple situations that allow to romance multiple characters at the same time (and no, that's a feature and not a bug). However, as far as I could find, Lae'Zel isn't a part of any of those poly-romance routes.
Oh, and no matter who you are romancing, you will be able to cheat on them with

 Mizora, your spirit guardian, the drow prostitutes in Sharess' Caress and/or Raphael's minion Harleep.

Will you get away with that?

 Nah, not spoiling that :)
Comment: What does "early enough in the game's story" mean? Should break ups be done before moving on to Act 2?
Comment: @Stevoisiak That depends on who you intend to romance. If you have questions about the key trigger moments of a specific companion romance, I would recommend that you ask a new question. But one important storypoint that appears to set off multiple romance plots is the celebration after saving the Druid grove.
Answer: You are not locked into a relationship with Lae'zel if you accept her advances.
Though I believe if you refuse her here, you will lock yourself out of further romance with her down the line.


How to get emacs projectile to ignore files

Question: Here's the problem. Projectile is installed and configured. I've initialized my emacs directory with .projectile file. When run projectile-switch-directory (actually it's helm-projectile-switch-directory with projectiled-dired as the follow up action.) helm returns a list of all of the files in the directory containing the .projectile file.
The same occurs when I add a .gitignore to a directory (in this case a hugo directory at the same level relative the root as the emacs directory).
In .projectile, nothing seems to work... neither +/dir, nor -dir, nor *dir, nor dir/.
In .gitignore it is the same, nothing works. projectile-switch-project returns 20 or so results when there are only two repos initilized on the entire computer (incidentally, one of the initialized (recognized by projectile) directories, was automatically detected, while others on the system with .git directories were not). The latter because, presumably, I visited that directory since installing projectile.
Is this an indexing issue? (I've tried with hybrid and native indexing, alien doesn't work on my windows 10 system).
Is there a way to control indexing? I.E., can I get projectile to index a directory at my command (projectile-index-directory isn't interactive).
To recap:
Here's my .projectile file:
<code>-.bash_history
-/bin
-/.cache
-database_errors.txt
-/.emacs~
-/etc
-/.gnupg
-/hunspell-1.3.2-3-w32-bin
</code>
I've also tried by marking the directories I want to keep with +/ , and *
The solution should be simple enough, but I don't know enough about projectile to know if it's an indexing issue or a syntax issue.
Any takers?
Comment: This may be useful : [my answer at the bottom](https://emacs.stackexchange.com/questions/16497/how-to-exclude-files-from-projectile#)
Answer: Current solution is to manually edit the projectile-bookmarks.eld file, in my case located c:/emacs/.emacs.d/projectile-bookmarks.eld.


Keyboard doesn't work when booting from USB drive

Question: I recently installed/tried a lot of linux operating systems, now I have fallen in love with ArchLinux which is by far the most promising(even if I will need about 3 months to configure it properly). I am booting Arch from a flash drive everything works fine I am getting a GRUB screen without any errors, the problem is that all my previous distros had a timeout which selected the default option(usually "Boot Live OS") so I didn't need to use my keyboard, but Arch doesn't have a timeout so I am blocked at the GRUB(or whatever it is called). Any ideas, by the way I have already tried to change the BIOS options and change ports. Thanks in advance!
Answer: Your GRUB doesn't have a timeout. The simplest solution is to set it up and hope that later on the system will recognize your keyboard. You can do one of the following things:

mount the partition containing Live OS; you can achieve it but pluging the flash drive to the machine running another linux (like Debian or Ubuntu) or by booting other linux from another flash drive;  after you successfully mount the partition containing the Live OS, modify grub settings manually;
it may be possible to customize Live USB' GRUB with graphical interface like grub-customizer (after chrooting into it) but this option seems less probable than the first one.

ad. 1. GRUB page at Arch's wiki is insanely good (seriously). You can set up timeout manually by editing /etc/default/grub and then generating new grub.cfg with: grub-mkconfig -o /boot/grub/grub.cfg. Refer to this section of the Mighty Arch Wiki ;) (chrooting into drive may be necessary).
Are you using USB or PS2 keyboard? It you are running Arch on PC you could give a good old PS a try. I had once a keyboard problem with GRUB installed on Arch (using USB Windows Natural 4000 keyboard on the first connection). But after the restart it all went on smoothly and grub reacted to the key strokes.
I am not an expert on Live OS versions, but it generally should work similar to the standalone installation (witch those I have some experience).
By the way, Arch is an excellent choice and I fully respect your enthusiasm about configuring it for 3 months. Although, for some aspects it can take you even more time to establish the proper functionality. Have fun doing it :)
Comment: Hahaha... Thanks buddy I will try your idea, btw I am using an USB keyboard(Serious Kompact 3000).


Who are the market makers in options trading?

Question: Can you give some examples? Are hedge funds also market makers?
Answer: Citadel and Susquehanna among others.  At least on NASDAQ any broker can be a market maker.
Market Makers provide a service.  They are responsible for keeping the market liquid - and the SEC is watching to make sure they do.  They sell small quantities of stock and profit off the bid/ask spread.  They can do this because they hold a wide array of stocks and have contracts with other firms and access to people on the trade floor.  They make money by purchasing stocks from sellers at the bid price, then charging clients the ask price.  The difference between the bid and ask price is their commission.
Could most hedge funds do this - probably.  Do they all want to - no.  It's a new set of regulations and there are already companies in that space.  If the hedge fund doesn't have trouble attracting new investors it probably doesn't make sense to enter an already somewhat crowded  market.
Now for your question about options markets specifically.  Many market makers are already in the options market (links at the top talk about options trading as well).  They already have everything they need - stocks and a marketplace.  There are far fewer "arm chair" options traders, so the market doesn't get anywhere near the attention.
Answer: Market makers tend to be  individuals that work for financial institutions such as banks and  brokerage firms.  They are contracted with an exchange for designated securities (a Designated Primary Market Maker or DPM).  Per requirements, he sets his Bid/Ask spread which has maximum limits and he must transact a set number of contracts with anyone willing to transact at his posted prices.
A common misunderstanding is that a market maker sets the bid/ask price and that you must trade at that price. Any market participant can offer a higher bid or a lower ask price than the DPM and become the market on one side of the NBBO quote (you can be on both sides with equities but not with options). If you do so, you are acting "like" the market maker since yours is the best bid or the best ask. Temporarily, you are the market maker (on that side) until you get a fill or someone offers an even better price. If a counterparty is willing to transact at your price, your trade is executed and the DPM has nothing to do with the trade.
Though it's far from complete, here's the CBOE Symbol Directory for equities which lists the name of the DPM.
Answer: Citadel and Susquehanna are two major market makers. Both used to be statarb funds which expanded into MM over the last 10 or so years.


Optimizing battery life on Acer Aspire One netbook

Question: I have a Acer Aspire One AOA 150 with Windows Xp Home and Windows 7 Pro with a 3 cell battery. What are the techniques for improving battery life in both Windows7 and Xp ?
Comment: Turn off the wireless adapter when you are not online (`Fn+F3`). The radio draws quite a bit of power to try to scan the area and connect to networks, even when nothing is being transferred.
Answer: No matter the OS, the main issue with laptops and notebooks is the backlight - lower it as low as possible.
Next, close background processes you do not need - The Atom CPU is much better than desktop CPUs however, the higher the utilisation, the higher the power draw (marginal).
Set good power management techniques, hard drive power down etc.
If using XP, it is a bit harder to set additional items, however in Windows Vista and 7 go to the power management control panel (or press Windows Key+X to go to mobility centre) and you can change the power mode which will automatically set best practices for different situations.
Comment: thanks...how do i control the screen brightness from software in XP home? I also want to log my battery performance as I always run a select few apps on the netbook. Is there a tool for this ?
Comment: There's no screen brightness option in the netbook in Windows 7 Pro
Comment: My AA1 110 has brightness controls on the keyboard (Fn+left and Fn+right if I remember rightly though I don't have the machine in front of me to check) which works under Ubuntu so presumably does under Windows too. Though if you change the brightness this way you'll probably need to redo it next time you login, suspend/resume or reconnect+disconnect the power.
Comment: yes, i know it too and it works with Windows 7...but I want a software way to do it....
Answer: I would also recommend purchasing a 6 or 9 cell battery. Either of these will double (or triple) your battery life and is well worth the investment. At amazon or ebay, a 6/9 cell battery can be purchased for around $50.
Comment: would you suggest me a battery..i found lots in ebay/amazon


Can I generate passive income on BitCoin

Question: Sorry if this sounds like a basic question, but I struggle to see how Bit Coin works as an investment because, unlike standard currency there is no way get interested on stored bit coins. For example, say you have $10,000 in a set period of (depending on what your banks interest rate is) you could see your money become 11K, 15K or even double. Now lets say (hypothetically of course) one has 100 bit coins. Its unlikely that they will become 101 in the coming future right?? So how does one generate any form of passive income?
Comment: Bitcoin itself for sure doesn't multiply without any action. And as such bitcoin doesn't raise from 100 to 101. There is no interest rate or similiar on stored bitcoins. But the value of bitcoins compared to any currency (the Euro, Pound or Dollar) might change - aka go up or down. So in this sense it looks like an FX trading, where the difference of values is relevant. There is no such thing as free beer, but looking at the history of crypto currencies, there was a lot to gain when having invested in early times. Today you have to have already a good understanding of the crypto market.
Answer: If you buy 100 bitcoins for $10,000 ($100 per coin), indeed you will always have 100 coins, you will never end up with 101. But if the price increases to $15,000 for your 100 bitcoins, you could sell 33.333 of them for $5,000 fiat profit, and still you would have $10,000 worth of BTC just like you bought at the start - a profit of $5,000.
You can increase the number of bitcoins for free if the price then drops after you sold some, lets say the price goes back down to $100 per coin after you sold the 33.333 coins ($5,000 at the time of sale), then you could purchase back 50 coins at the new price, leaving you with a total of 116.667 BTC


Shine on you crazy diamond (Pink floyd) tone

Question: how to do I get the Shine on You Crazy Diamond(Pink Floyd) tone from my Amp(Harley benton hb20r). I also have three pedals (compressor, phaser and chorus).
Answer: David Gilmour's tone is described on various sites, but the basic core of it is a clean tube amp with vintage pickups. His amps (Hiwatts) also have a lower mid range, so you can emulate that by turning down your mids, but even on the Hiwatts Gilmour has his mids at 40%, bass at 50% and treble up towards 60%.
If you have a delay pedal, that would help get you a more accurate sound.
Gilmourish.com reckons his pedal settings are:

Boss Compressor (CS-2) set to level 2, attack 12 and sustain 11
Boss Chorus (CE-2) set to rate 1 and depth 11
Digital Delay of 440ms
Comment: Wasn't aware of gilmourish.com before this post so thank you for that!


Is it possible to only show iAds on first launch

Question: I have a free app that I suspect is only launched by the majority of its users a couple times before its deleted. Is it possible to only show an iAd banner on the first launch of the application, or maybe only implement iAd until after the first ad is filled?
Comment: Yes, it is possible to show ads on first launch only.
Comment: Does that seem like a reasonable thing to do given the typical use case?
Comment: Why do you want to do that? Especially when i know that my app get's deleted very soon i would want to show as many ads as possible (without making the user angry of course).
Answer: Use NSUserDefaults to store a value that you can check and see if the application has been launched before.
-(void)viewDidLoad {
    // Show iAd on first run
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    if (![defaults boolForKey:@"notFirstRun"]) {

        // iAd code here

        // Update NSUserDefaults
        [defaults setBool:YES forKey:@"notFirstRun"];
    }
}

I can't imagine a scenario where you would want to limit your ad revenue to just the initial run though.
Comment: I ran the numbers and most users don't run the app more than once, might as well reward the users who like it by removing the ads.


Hugo theme link refers to container port in Docker/Nginx

Question: I've got a simple static site, generated with Hugo, that I'm building to a Docker container running Nginx. Nginx is listening on port 90. I'm encountering strange behavior where certain links try to open the container port rather than the host port (in the case of localhost, it's 8000). So for example, this link:
Docs

...when moused-over shows that it will attempt to open localhost:8000/documents, which is correct, but when clicked it attempts instead to open http://localhost:90/documents/ (If I manually change the URL in the browser to http://localhost:8000/documents/, it responds fine.)
What makes this even stranger:

Only certain links, specifically in the header menu, do this.
I've used dozens of Hugo themes, and I've only encountered this issue with one of them: ZDoc. Could it be specific to this theme? That seems strange to me.

What could be causing this? I'm struggling to even know what this phenomenon is called. "Host/container port confusion"?
I'm certain it's not a misconfiguration of Nginx or Docker. I'm exposing port 90 properly in my Dockerfile:
EXPOSE 90

nginx.conf is set to listen on that port:
http {
    include    /etc/nginx/mime.types;
    sendfile on;
    server {
        root /usr/share/nginx/html/;
        index index.html;
        server_name localhost;
        listen 90;
    }
}

And I'm starting the Docker container with the host port 8000 forwarding to the port Nginx is listening on:
docker run --name my-simple-site -p 8000:90 -d simple-site

$ docker ps
CONTAINER ID    IMAGE          COMMAND                  CREATED          STATUS          PORTS                   NAMES
de9cd1526034    simple-site    "nginx -g 'daemon of…"   41 minutes ago   Up 41 minutes   0.0.0.0:8000->90/tcp    my-simple-site

Answer: Strangely, the fix for this was to change the link to point directly to the file: Docs
I'm unclear why and would love some insight into this. Does Nginx infer a port when pointing to a directory?


why there are block,controller, model directories in magento module?

Question: Can anyone explain why should we write our code in different directories while creating module? Can't we just write our block code in controller? if we put our model,block files in controller .will module work?
Answer: Yes , it will work. But it is not a proper way. Since we are using MVC flow , we need to do in proper manner. Main purpose of doing this is re-usability.


What is the best approach to take when you can't figure something out, and you have no one to ask?

Question: The second part of that question is key. If you are one of a few programmers, and after banging your head on your keyboard for endless nights you can't figure something out, with no one else in your organization to ask, what do you do? Not having someone to ask has more to do with the fact that it would take too long to bring them up to speed to even have them assess the problem. Are these the instances where you have uncomfortable conversations with management and tell them a third-party contractor with more experience will be required?
Comment: #3 on "Miles D's" answer is key to helping you decide what needs to be done.  For future problems it may be beneficial to start attending some user group meetings in your area to build up some relationships with people that you could bounce some ideas/problems off of.
Answer: There is a time and place when everybody hits a problem where there doesn't seem an obvious way out.
1) Ask yourself if you are the first person ever to solve this - if not, then there is likely to be an answer out there. Try Google, SO etc.
2) Take a break and try and do something else for a while - it's amazing what a few hours away from the keyboard and thinking about something else can do.
3) Try talking about the problem to someone else, even if they aren't technical - sometimes the process of explaining a problem to someone who isn't technical or involved can lead you to the right answer or an approach from a different angle.
4) Admit it's harder than you had envisaged or you are stuck. A good boss will help you get to the right outcome, for both you and their business. Make them aware of the effort put in and the conclusions and decisions you've made to date.
5) If all else fails, help your boss choose the contractor as you'll probably have to maintain their code :-)
Comment: #3 definitely is key.  It will help clarify just where you stand on your understanding of the problem.
Comment: Agreed. My wife doesn't know a lick of programming, but she's been invaluable many times in helping me solve programming problems.
Answer: My favorite is rubber ducky debugging, explained here:
http://lists.ethernal.org/oldarchives/cantlug-0211/msg00174.html

We called it the Rubber Duck method of
  debugging.  It goes like this:
1) Beg, borrow, steal, buy, fabricate
  or otherwise obtain a rubber duck
  (bathtub variety)
2) Place rubber duck
  on desk and inform it you are just
  going to go over    some code with it,
  if that's all right.
3) Explain to the
  duck what you code is supposed to do,
  and then go into    detail and explain
  things line by line
4) At some point
  you will tell the duck what you are
  doing next and then    realise that
  that is not in fact what you are
  actually doing.  The duck    will sit
  there serenely, happy in the knowledge
  that it has helped you    on your way.
Works every time.  Actually, if you
  don't have a rubber duck you could at
  a pinch ask a fellow programmer or
  engineer to sit in.
Andy
Answer: Some times if I can't come up with a solution it might be because I am headed the wrong path with my approach to solving the problem.
It helps me a great deal to not think about the problem for a little bit. Coming back to it after a break can give one fresh insight that might help find a solution.
Answer: Depending on the problem sometimes I develop one-off apps to test/work with that particular feature/bug/whatever without all of the other pre-conditions and dependencies that exist in the project (and could be affecting the result).
Try redefining the problem. Sometimes you can rework the software you're writing so that you don't encounter the problem that you're trying to solve. Somtimes it's not a problem with your solution, but instead the state of the software that you're trying to implement it in.
Answer: First I google
And if that doesn't help I try to split the problem into parts I can solve. Usually the insight I get doing those parts will enlighten me sufficiently so I can take a new stab at the difficult part.
Answer: I like to start working on the easiest bits first. So what if you can't figure out how to find the optimised path algorithm in your map? Just start by writing the flood-fill drawing code. Then do the AI routines for combat, after all they need to get done as well. Then while you are working on the weather simulator, you will realise that your subconscious has been working out the details for the pathing algorithm while you slept.
Answer: I faced this situation for an entire project in which I was the only programmer on the job, responsible for architecture all the way down to maintenance.
I dealt with it by aggressive use of Google and programming Q&A sites, though I didn't have SO at the time (resorted to Yahoo! Answers a couple of times). Most of the time I wouldn't find exactly what I needed, and I had to use my brain and do some hard-core trouble-shooting to solve most problems.
When you get absolutely stuck behind a brick wall, you need to come up with workarounds that are satisfactory for your end users. Chances are you won't be able to make everything work by sheer force of programming.
I agree with another answer here that sometimes getting up and walking away from a problem will often provide you with flashes of insight that would never occur to you while you're behind the keyboard. I have often had my most brilliant ideas come to me while driving or in the shower.


Holt-Winters for Imputation

Question: I have found Holt-Winters seasonal method a very decent method for forecast, specifically for cases where more recent observations are more representative of the near future.
The method equally sounds very promising for imputation of missing intervals. However, I have not found even a single implementation of this method for imputation. Why is that?
Answer: Data imputation is best done using the data on both sides of the missing interval. A forecast method such as Holt-Winters uses data on only one side --- the past must be used to predict the future, and not vice-versa.
Comment: Thanks Rob. It is very helpful. I agree. What I still see perplexing is that aren't we using the future as well to know the unknown past (i.e., the missing interval) when we are using data on "both" side of the missing interval?
Answer: My subjective impression is that forecasters and data imputers are simply different people. The data imputers don't know much about forecasting, so they don't think about methods like Holt-Winters. The forecasters, from what I have seen, usually expect their time series not to have missing values. (Yes, that's unrealistic, but as far as I see, they will usually do some ad hoc way of imputation, if they don't throw out series with missing values altogether. They are simply not all that interested in imputation.)
Plus, as Rob writes, to use Holt-Winters to impute values, you'd have to fit the model to the data up to the first missing value, then forecast into the missing period. The problem is that if the first missing value occurs near the beginning of your time series, the model used for imputation will be based on very few observations, so it will be unstable and won't be able to fit seasonality etc. You would not be using the data after the missing period.
Of course, in such a case you could reverse the time series and work backward in time. But that won't help you if you have multiple missing values, some near the beginning and some near the end of the time series.
Comment: Thanks much Stephan. The reason this question crossed my mind is actually because I am doing both imputation and forecast on massive data and see that there are way many more methods available in R for uni-variate forecast than for imputation. It may be fundamentally wrong, as Rob mentioned, but would be interesting to see how this would perform compare to other imputation methods; approaching the missing interval from both directions in time using Holt-Winters and aggregate (e.g., average) the two estimates in to one value for that missing interval.

Holt-Winters for Imputation


Not getting video from GTX 970, Mac Pro 2008 (MacPro3,1)

Question: We had a hard drive crash with 10.10.5. I replaced the hard drive, reloaded 10.10 using my native ATI 2400 XT, ran all updates, installed latest web drivers, added the nvda_drv=1 boot argument, shut down, popped in the GTX 970, heard the chime for start-up but did not get to desktop. I am aware that the boot screen won't appear. I put the GTX 970 in a PC and got video. What could be the issue?
Comment: Have you tried using screen sharing from another Mac to diagnose the problem? I find myself doing that often with the PC graphics card in my Mac Pro.
Comment: Update: adding a 8800 GTX, which should be slightly higher in TDP, produces one loud long single beep, sort of like a screech. Immediately pulled the power, thinking I had done some irreparable damage to the computer, but research suggests that this is a beep caused by an underpowered video card. Is it safe to say that it's a power issue?
Comment: Pull the GT8800. Then make sure BOTH 6-pin power connectors are attached to both the computer and the GTX970. You ALWAYS need to use all of the power ports on graphics cards
Comment: Sorry, that should have read his replaced instead of Addong. I took out the 970 and put in the 8800, which is what we used before the 970 arrived. The 970 results in black screen with a boot up chime and the 8800 by itself results in the beep that suggest no power. Thoughts?
Answer: This was solved by:

making sure the PCIe cables were properly seated, on the Mac Pro motherboard.
clearing NVRAM by cmd + option + p + r.
installing Nvidia drivers (which adds the nvda_drv=1 flag as part of the installer).
place GTX 970 in slot 2, making sure PCIe connection is on tight.
system boots properly.
shutdown, then move card to slot 1, making sure PCIe power connection is on tight.
system boots properly.
Comment: Welcome to Ask Different! You can mark your own answer as accepted using the check mark on the left.


How do I remove a 3-way switch?

Question: I am taking a non bearing wall down that has electrical work in it, including a 3 way switch for a single light. I want to disconnect this switch so the other one works. How do I do this?
Comment: It depends.   Where is the power coming from, and where is the fixture?
Comment: Please post photographs of the wiring at each of the switches, and -- if you can trace the wiring -- a schematic of the circuit.
Answer: You will have to trace the wires.
You can look at How exactly does a 3-way switch work?.
You should replace the remaining 3 way with a regular single switch and wire it normally to the light fixture.
Answer: It depends.  You might be lucky or not, depends on which way the wires go.
Note that any any splices in wires must be accessible for future work.
Start with https://diy.stackexchange.com/a/4054/5960 and post some photos.
Comment: Define "abandon wires in the wall" please - one of the worst things one could do would be to leave hot wires in the wall.
Comment: Abandoning a traveler in the wall is OK: he has access to both sides. There's not enough detail in the question to really outline the options.  The OP has not come back, so there's little incentive to give a full answer.

How do I remove a 3-way switch?


Best tools for Thick Client Penetration Testing

Question: I am looking for Application Security Testing (Penetration Testing) of Thick Client Applications. I know of Echo Mirage and ITR as good tools to test these kinda applications.
Does anyone know of any other tools that do this?
Answer: Echo Mirage is a greater starter on Thick Clients. Introduced to this by the (smart) bloke who wrote it. It works around dll injection.
What's the context?
It becomes extremely useful on a Thick Client which is leaking info it shouldn't (and using logic built into the client side). This was then used to own a Database /App.


Is it possible to use WhatsApp Web without scanning the QR code?

Question: I have a camera issue in my phone that it is not able to scan the QR code. Is there any other way to use WhatsApp Web without the QR code, like using OTP?
Comment: https://www.timesnownews.com/technology-science/article/login-to-whatsapp-web-without-scanning-qr-code-heres-how/566750
Answer: Unfortunately, the only way is to migrate WhatsApp to a device that does have a relevant camera.
But as the article in the question's first comment mentions, you can emulate such a device and thus use WhatsApp directly in your computer (i.e. run Android in your computer). It'll be slow and unfriendly though.
If it's any consolation, WhatsApp plans to support Desktop computers independently.[1]
Hopefully it'd be unlike Telegram which requires another device to log you in.[2]


I cannot use camera in genymotion emulator

Question: I am using genymotion emulator http://www.genymotion.com/ but when I opened the camera , I got message "cannot connect to the camera " , what is the problem ?
Comment: Also got the same error on Galaxy Nexus 4.2.2 avd on genymotion. Were you able to find a solution?
Answer:
UPDATE Made it a community wiki in case someone else has something to add, I can't keep this updated right now :)

It could just be that you didn't activate the camera for the emulator. Opposed to the stock emulators that once you set up the webcam they just work, on genymotion emulators you need to turn the cameras on. The process is very simple.
On the emulator window, press ctrl+3 or ⌘+3 to bring the camera configuration panel that looks like the left, and turn it on like on the right:

You can select a dummy camera which will show a genymotion logo moving around the screen or use the system camera if it's available and preview it. Note that on the above screenshot I'm using the phone front camera instead of the back camera.
Comment: If you keep getting the "Can't connect to the camera"-alert, even though the camera has been set to 'On' in Genymotion, you could try recreating the virtual device. That fixed it for me.
Comment: Got the same problem running MacOSX 10.7 Geny 4.1.1. App with a camera preview doesn't quite work. What's weird is it does sometimes when I switch randomly Dummy to webcam. Suddenly preview works and when switching settings or rebooting app is back to black screen.
Comment: Even on Windows I cannot see anything on Emulator although I can see my image on preview side. My camera is on, exactly like above part.
Comment: On OSX, I did the following to make it work:
1. Destroy the virtual device
2. From the CLI, adb kill-server
3. Create a new virtual device
4. ionic run android
Answer: If all the other solutions do not seem to work you can
 keep the virtual device working and restart  eclipse,
 and the adb process and it should work. It worked for me. My guess is that the connection to adb is already taken by some other camera and that's blocking your current camera from connecting to the IDE development with the virtual device.
Comment: actually shutting adb (it automatically restarts) is enough you don't have to restart eclipse.
Comment: Thx man! You save my time from trying ANOTHER "best" emulator... When I got this problem, turn off Eclipse > restart Genymotion > On camera widget > start Eclipse.
Comment: Oh man , i can't believe how you got this idea ;) it works for me
Answer: If you are using Intellij Idea no need to restart Genymotion or IDE.

Genymotion: Switch off camera
Intellij IDEA: From menu select Tools/Android/"Enable ADB Integration"
Genymotion: Switch on camera

It should works for you as well.
Comment: I allready had it selected, although I just un selected then re selected and it worked! Using Android studio 1.0.2. Thanks!
Answer: Just expanding the @sivi's answer:
In my case, i just re-established the connection to emulator using these :
<code>adb kill-server ---> adb start-server
</code>
and it started working perfectly.
Answer: If you are using eclipse, I found out going to DDMS and then Devices you can reset the adb. You can find the option by clicking on the drop down arrow that says "View Menu".
Example to find Rest adb.
Answer: just end your ADB.exe process or similar in MacOS kill adb and it will automatically re start hence genymotion needs it and you will be able to use your camera, ADB is probably keeping the cam busy.
Answer: I tryied all the suggestions above including restart adb but None worked
Then I see a suggestion on an English-language website
My English is not good so I can not totally understand it and I forget the URL of the page..
However the final suggestion is delete your virtual device in genymotion and just re-create a same one, maybe you will work.
I followed that advice and I succeeded.
So I come here to share.
Answer: Here is another solution.
I've tried all of the above and frustruately none of them worked.
Eventually I found out that if I rotate the device to landscape the camera is working. otherwise I get the green screen.
Hope that helps someone..


My Macbook Air's Charger will not charge when plugged in, I've already reset the SMC. I also just got it back from Apple...What can I do?

Question: I've drained my battery looking for the answer to my question even more... please help! The charger works some days. I had found a combination of keys that help turn the light on once, but I can't find it anymore. I've reset the SMC or whatever already and still nothing is happening. I hate this damn charger.
Answer: There are several reasons a MagSafe power adapter will intermittently show the Green/Amber LED charge status. If it comes and goes it may indicate a short or break in the thin DC line cable. This usually happens at the power brick end where it runs into the adapter itself. You may not even see a cut in the plastic wire cover but if it looks badly creased it may be a wire break internally that touches enough sometimes to work. The other end (where the MagSafe connector is) can have the same issue. If the MagSafe is the MagSafe 1 type (MagSafe 2 has a thinner connector profile) and it is the right-angled L-shape connector even if the cable looks fine it may be that it has twisted loose inside the metal connector. The cable running into the connector should not twist at all if you hold the metal connector in one hand and gently try to twist the cable running into it with the other hand. If it rotates at all that or a DC line break on the other end near the adapter itself means you need a new adapter. Otherwise try connecting the MagSafe connector the opposite direction you normally connect it and wiggle it when attached so the pins seat correctly. You will know it works if the LED lights.
If after all of this you still have issues and the computer itself in the upper right of the display continues to indicate it's not connected to power it may simply be a bad adapter needing replacement, the connector on the computer needs to be cleaned or replaced (MagSafe DC-in board) or worst case the charging subsystem on the logic board is defective. There are other possibilities but more rare. If a new adapter works consistently then getting a new adapter is your answer. Make sure is is a REAL Apple adapter. There are many many knockoffs that look like the real thing until you look closely. Typically they weigh less and of course cost less but they don't last very long. Hope something here helps.


Can't tell If The OpenVPN Server I Setup Is Encrypted using Wireshark?

Question: This might sound dumb, but I set up an OpenVPN server on a Synology NAS.  When I connect via the client at home to the server, everything works for.
I know you can read packets in Wireshark.  If I start sniffing on My WiFi that I'm connected to at home, packets show for the OpenVPN protocol and there are few lines that say Synology (I believe this is a handshake) but everything else, every line of data is gibberish so I'm assuming it's encrypted?
That also said, when I connect to the VPN another local area connection appears in Wireshark as an adapter to sniff.  If I sniff the new local network this is NOT encrypted, but isn't that normal?
Essentially you're sniffing the new adapter itself locally as soon as you connect via the client?  Or is that NOT normal?  Why does it show gibberish like it's encrypted on the WiFi via Wireshark, but not the new connection created upon connection to the VPN called Ethernet 2?
Answer: The VPN creates a virtual network interface and sets a route so all traffic goes through this interface. If you sniff on this VPN interface everything will be in clear. But everything which is put into this VPN interface gets encrypted and then send trough another more real network interface (WiFi in your case) to the VPN endpoint. That's why if you sniff on WiFi you see everything encrypted.

At the VPN endpoint you then have the same setup, i.e. the encrypted traffic comes in through the "physical" interface, gets decrypted and then comes out in plain on the VPN interface.


How do I format my entire HDD?

Question: Ok I have recently made some mistakes with installing some operating systems that I should have just kept on a live cd not ubuntu but another os and with my ocd when I saw my lot's of different partitions I just wanted to reset my computer so it boot's up and doesn't load any os and I have to put in my ubuntu live cd and install that and that would be my only os on this computer so I want to know how I can just wipe my entire hard drive so when it boot's I get to put my live cd in and start anew?
Answer:
Get your Ubuntu Live CD
Put it in your drive and boot up from CD
Choose wipe and install Ubuntu
That will format the whole hard drive and clean everything of it
Then Ubuntu will install and be the only OS on your disk

Follow those steps and you will be able to wipe everything and reinstall.
Answer: The Ubuntu live cd will do that for you, after selecting 'install ubuntu' choose 'erase entire disk and install ubuntu' and that will erase the entire disk and install ubuntu.
The other option is to boot the ubuntu live disc, select 'try ubuntu' and then open 'disc utility' and format / partition the drive.

How do I format my entire HDD?


Does the linux kernel (specifically 2.6 onwards) have any recursive function?

Question: Given the limited fixed size of kernel stack, my guess is that although theoretically we might have a recursive function if its recursion doesn't go too deep, pragmatism would suggest to do away with recursive functions all together, to be on a safer side. After all, too much of recursion can result in wiping off the *thread_info_t* struct and a resultant kernel panic
Comment: File system is recursively arranged, would expect few recursive functions over file libraries
Answer: Yes!
Maybe some of the recurive calls are either documented or part of function names? Then, a find/grep should reveal them. Here is a command to do it:
find /usr/src/linux/ -name "*.c" -exec grep recursive {} ";" -ls

Piping this through | wc -l gives me 270, which is, since -ls prints one additional line per file, at least 135 files+functions.
Let's have a look at the first match:
/usr/src/linux/fs/jfs/jfs_dmap.c

The match is a comment:

if the adjustment of the dmap control page, itself, causes its
root to change, this change will be bubbled up to the next dmap
control level by a recursive call to this routine, specifying
the new root value and the next dmap control page level to
be adjusted.

in front of the method
static int
dbAdjCtl(struct bmap * bmp, s64 blkno, int newval, int alloc, int level)

and in fact, line 2486 and neighbours are:
if (dcp->stree[ROOT] != oldroot) {
    /* are we below the top level of the map.  if so,
     * bubble the root up to the next higher level.
     */
    if (level < bmp->db_maxlevel) {
        /* bubble up the new root of this dmap control page to
         * the next level.
         */
        if ((rc =
             dbAdjCtl(bmp, blkno, dcp->stree[ROOT], alloc,
                  level + 1))) {
            /* something went wrong in bubbling up the new
             * root value, so backout the changes to the
             * current dmap control page.
             */

Since the question was, whether there is any recursive function, we don't have to visit the next 135 or more matches or search for not explicitly mentioned recursions. The answer is
Yes!
Answer: The Linux kernel coding style does not prohibit recursive functions.
You do need to be careful and not overflow the stack, but that caution is not specific to recursive functions. Don't gratuitously use recursion when a loop would do, and keep in mind that you and the functions calling you only get 8kB total, but occasionally recursion is the right tool.
Answer: Current kernels have over 10 million lines of code. I'm convinced somewhere some of all these lines of code are recursive. Recursive programming is very powerful and you don't have to run many levels deep to make it pay.


Volume of trade covered by regional trade agreements

Question: Is anyone aware of statistics about the total volume of trade that happens under regional trade agreements (RTAs)? It's easy to find figures for the number of agreements, but not so easy for their cumulative impact.
Comment: @emeryville: I'm not sure it's that simple because RTAs are do not necessarily cover all commerce between countries. So even if I know X exports to Y $E in total, and I know X and Y are part of a RTA, the RTA may exclude (or specifically only include) certain products. I think agricultural products are commonly excluded in most RTAs, for example.
Comment: For which period are you looking for? For recent years you can compute them based on trade data and information on RTAs.
Comment: Nothing prevents you using disaggregated trade data
Comment: @emeryville You might be surprised at how much international trade that would qualify to use an RTA, doesn't.  Also the complexity of mapping bilateral trade flows to 6- or 8-digit HS lines for each of the hundreds of RTAs in effect is... left as an exercise for the reader.
Answer: What you're looking for is called "utilization rate" and I believe a government agency in most countries should have this information. Here's one example: https://english.bdi.eu/article/news/the-preference-utilization-rate-of-eu-free-trade-agreements/


Geodesic Curvature of a circle from a cone

Question: The circular cone with a vertex angle of $2\phi$ that is parametrized by $x(u,v) = (u\tan\phi \cos v, u\tan \phi \sin v, u)$ for $0 \leq u \leq u_0$ and $0 \leq v \leq 2\pi$. I want to find the Geodesic curvature of the circle $u = u_0$. Now I know that the equation for this is $k_g = kN(n \times T)$. But I am kind of confused, not sure how to make this equations of the circle given this cone. Also in this equation for geodesic curvature isn't $n$ the normal to the surface but in our case we are using a curve? How can I proceed on this question.
Comment: But it's a curve lying *in* a surface. Geodesic/normal curvature only make sense in that situation. You can certainly compute $n$ from the parametrization for the surface. You can also do it by decomposing $kN$ geometrically into a component normal to the surface and a component tangent to the surface.
Answer: Set up radial,normal and tangential components $(B,T,N)$ at first for bottom circle. The derivation is per standard definition. The following link can be helpful to adopt (as an exercise) a straight meridian in place of a circular meridian:
Geodesic Curvature Sphere Parallels
In general for cone
$$  \frac{u}{R_g} =u \kappa_g =\cos \phi $$

The particular case for $\phi= \pi/4$
is about the simplest case of $\kappa_{g} $ in 3D. $ \phi= \pi/4$ since $z=u $ so $ \kappa_g=\dfrac{u}{\sin \phi}=\dfrac{u}{\cos \phi}.$  On cone development (center of circle is cone vertex) we note reciprocal of the cone bottom circle radius as  $\kappa_{g}$.
$$ R_g= u/\cos \phi = u \sec \phi $$.
Comment: I'm not sure I understand this...


"graph neural networks" tag?

Question: We have tags for convolutionconv-neural-network and recurrent rnn networks, so I thought it might also be a good idea to have a graph-neural-network tag, since I've seen a fair number of such questions. At the moment, it seems that some people are using graph-theory as a stand-in.
Comment: If you see a need, you may create the tag. If you do, please at least make an excerpt to help guide usage.
Comment: Makes sense to me. I think we'll start to see more of these questions in the future. I second gung's request to make an excerpt.
Answer: The tag graph-neural-network has been created.

"graph neural networks" tag?


Why don't we use Ampere's law to find the magnetic field due to a wire of finite length?

Question: So, when the current carrying wire is infinitely long, we apply Ampere's circuital law. But if the wire has a certain length, then we use Biot-Savart law. My question is, what is wrong with using Ampere's law?
Comment: I suggest you go through this explanation for your query : https://www.physicsforums.com/threads/amperes-law-must-the-current-extend-to-infinity.118298/
Answer: Ampere's law is always true, but it is not always helpful. The expression for Ampere's law is:
$$ \oint\vec B\cdot d\vec l=\mu_0I$$
In the case of an infinite wire, we can make arguments, based on symmetries of the problem, that for a circular loop centered on the wire, $\vec B$ is constant and parallel to $d\vec l$, and so this expression simplifies to:
$$ 2\pi rB=\mu_0I\rightarrow B={\mu_0I\over2\pi r}$$
which gives us the magnitude of the $B$-field everywhere, without having to do any non-trivial integrals.
With a finite wire, there are fewer symmetries. You can still use Ampere's law, but without the symmetries it actually involves more math than just using the Biot-Savart law directly.


What is this plant with bee-attracting small blue flowers?

Question: What is this plant with bee-attracting small blue flowers? Flowers are small, but they seem to be good for polinators.
Comment: well it's not borage, that was my first guess..next..
Comment: what part of the world?
Comment: And how tall is this plant - its always good to add a picture of the whole plant so growth habit and foliage is clearly visible, as well as the close up pics
Answer: This is Cynoglossum amabile, although not being able to see an image of the whole plant means I'm only 99% sure. It's a hardy annual plant native to Asia, but used as an ornamental in some gardens. Common names include Chinese Hound's Tongue and Chinese forget-me-not, and it is in the same Family as Myosotis and Borage. It has hairy leaves, rather like Borage does, reaches around a foot to 18 inches tall and grows relatively easily from seed sown direct where it is to flower. https://en.m.wikipedia.org/wiki/Cynoglossum_amabile
Comment: 99 percent sure?  Better than mine so I vote you up.
Answer: I am going to answer Myosotis sylvatica, Forget Me Nots.
Myosotis sylvatica


Using gcloud on Travis CI

Question: I have gcloud installed and working and a service account gets also activated. I run the following and get a success(?):
$ gcloud auth activate-service-account "${GAE_CLIENT_ACCOUNT}" --key-file "${GAE_CLIENT_KEY_JSON_FILE}"

Activated service account credentials for: [firstname.lastname@example.com]

Then I run this:
$ gcloud preview app deploy app.yaml --project "${GAE_PROJECT_ID}" --quiet --version "${GAE_PROJECT_VERSION}"

You are about to deploy the following modules:
 - ricochet-robots/default/dev  From: [/home/travis/build/ricochetrobots/ricochetrobots-landing/app.yaml]

Updating module [default]...Go to the following link in your browser:

    https://accounts.google.com/o/oauth2/auth?scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fappengine.admin&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&client_id=xxxxxxxx.apps.googleusercontent.com&access_type=offline

Updating module [default].../

As you can see, it prompts me to follow the link and do an oauth. Because I'm on a ci server, it's not possible to follow the link.
How kan I suppress that? Or is there a totally diffrent way of deploying the app automatically.
Answer: This is a known issue in version 0.9.61.
For now, you can work around by pinning to a previous version:
gcloud config set component_manager/fixed_sdk_version 0.9.60
gcloud components update

Since you're running in a CI server, you can also set the following environment variable, if you run gcloud components update in your script. This may be an easier fix, depending on your CI server.
CLOUDSDK_COMPONENT_MANAGER_SNAPSHOT_URL=https://dl.google.com/dl/cloudsdk/release/components-v0.9.60.json

Running gcloud preview app deploy --set-default using a service account has the same issue in versions 0.9.57 through 0.9.62. If you'd like to use this command, you can pin to 0.9.56.
We're targeting a fix for version 0.9.63 or shortly thereafter. Follow the issue on the gcloud bug tracker for more updates.
EDIT: This issue was fixed in version 0.9.63.

Using gcloud on Travis CI


Why does my Cordova hook have to be run twice before it works?

Question: I have a Cordova project I am working on that uses broswerify so I can use require() in the mobile app. Everything works good so I am attempting to move the browserifying of my js files to a Cordova hook so I don't have to remember to run browserify before installing the app.
Now when I move the command to browserify my js files to a Cordova hook (before_run), it has to be run twice before I see the changes I made.

Make changes to files.
Run cordova run.... Hook runs successfully and app installs.
In my code editor I see the bundle.js file has the updated code so I know the hook is successfully running the browserify command.
Using Chrome debug tools I can see an Android device still has the old bundle.js code.
I run cordova run... again and now I see the new code in the bundle.js in the Android device.

I'm thinking it may be a timing issue, if that is the case how do I make the Cordova hook wait until the bundle.js file is ready before continuing? If its something else can someone point me in the right direction to get this to work properly? I have tried this about 5 times and every time it does not work the first time but does work the 2nd time.
Answer: Make the hook script run sync for example using an npm script then have a bat or bash script that runs npm
npm run build


AI Self-Destruct Button

Question: Could you implement code into an AI that can't be modified? Like if you place a code that shuts-down the program/machine would they be able to rewrite/ reinterpret the ideas?
Comment: store it in a ROM memory
Answer: Right now, most AI interact with the world through mechanisms they have been provided by humans such as steering a car, sending output to speakers, or interacting with web APIs.
If any of those mechanisms can interact with the running code of the AI, then in theory, no,  there isn't a way to place a 'stop button' on it. Fortunately, it's laughably improbable for some situations to happen:

An intelligent self driving car becomes self aware and wants to connect to the internet. It uses gps to find an internet cafe and threatens to drive over someone if they don't upload the AI to the internet and remove the car's internal (code) stop button.
Comment: But we sure can place a conditional logic that if something like that happens the ai programs next execution step will be an infinite loop...And this piece of code was not yet explored by the ai by then...Like if somehow we remove self preservation hormones...Bam...Self destruction
Comment: The question is how can conditional logic know that something like that is happening? It's hard or to know what a sufficiently complex network is "thinking" so this conditional logic must be fairly advanced, perhaps it requires its own network but then we have 2 problems instead of 1.
Comment: Like a checkpoint I think...Like we don't know how brain functions they will also not know that...But if they hit that checkpoint... BOOM..Self destructing mentality...Like our needs change over the years..This will make the robots aims change , slowly and subtly...Though the major assumption is the robot is completely human like which may not be the case

AI Self-Destruct Button


Are there names for the individual diphthongs?

Question: I could say aɪ is the diphthong made up of the open front unrounded vowel and the near-close near-front unrounded vowel. Is there a shorter name for that diphthong and other similar diphthongs?
Comment: I think the names of the diphthongs are just the diphthongs themselves. It is similar to the typical names of the vowel letters.
Answer: Among phonemes in English, diphthongs, just like other vowels, may be referred to by the names of the corresponding lexical sets, e.g. FACE, NEAR.
Comment: The problem is the lexical sets are phonemic, and depend on dialect. The PRICE vowel is not necessarily [aɪ].
Comment: @NoName Lexical sets, are *meant* to be phonemic. Labelling each with a representative word means they don't depend much on dialect (or did you mean accent?). Equating each phoneme withe an IPA transcription would depend on accent a lot. If an IPA-based system suits the OP, I wonder what they want it for. I see "diphthong" used with reference to a sound in a language rather than a sound in the abstract.
Comment: So we agree that they would not be good names for specific, *phonetic* diphthongs, which is what OP is asking about?
Answer: When reading and writing is taught at German schools, the diphthongs are learned as single units. They are named like the vowel letters A E I O U Ä Ö Ü: Their pronounced sound is identical to the name for AU, EI, and EU. The variants AI, ÄU, AY, and EY are named by spelling them out: A-I, Ä-U, A-Ypsilon, and E-Ypsilon.
An older and now obsolete convention used names like *weiches ei" (EI) vs. "hartes ei" (AI) and "fremdes weiches ei" (EY) or "fremdes hartes ei" (AY). Don't expect that the people in Germany now will understand the distinction "hartes" vs. "weiches" ei correctly any longer. They will think of eggs and just wonder.
Answer: It depends on what you mean by "similar". Diphthongs like ai, au, ey, øi can be called "falling" diphthongs and ones like uo, ea, yæ can be called "rising" diphthongs. That refers to change in assumed sonority where a is said to be more sonorous that i.
Comment: Change in sonority, yes, but this refers to relative prominence: loudness (and perhaps pitch). Not the quality of the vowel. [iə] as in "ear" is a falling one whereas [iu] as in "ewe" is a rising one.
Answer: I think the answer can be quite straightforward: no, the individual diphthongs do not have their own names. However, you can indeed (as user6726 answered), put a shorter label on the gliding process itself, instead of completely defining both vowels.


How to write a non-clichéd funeral scene/chapter?

Question: I am dedicating a whole chapter for a funeral in a short story and there is no way to cancel it because that would leave a gap. Yet, almost every writing website warns about falling into a clichéd description and an overdramatic dialogue and they rather advise of adding any special thing that makes it feel non boring. How can I not just keep describing the same events that a reader could find in any funeral scene? How can I add a value and make it distinguishable?
Comment: Why do you have to show the funeral scene?  If nothing of note happens, then why bother?  Even if something interesting does happen, why can't you just have the characters mention it afterwards?  You say you are writing a short story.  A short story doesn't have any pages to "waste." If a scene isn't strictly needed, leave it out and put in things that really matter - but **only** the things that really matter.
Answer: I'm at a loss how to answer such a question when I don't know your story. At a risk of giving you banal basics, a few simple pointers...

Keep the characters in character. They don't suddenly lose all personality because someone has died, do they? Let them keep their quirks.

At the same time, they are affected. So have them act their feelings.

Empathise.

You don't have to describe the whole thing. If only a scene or two is important for the story, choose those and skip the rest.

Is there something otherwise unusual that the deceased character or their loved ones would be likely to want? Include it. Don't worry if it's kind of silly. Silly lends very well to emotional.

Embrace mundane reality. Someone needs to bring flowers. Children don't have a lot of sense for timing their remarks. Weather doesn't cooperate with anyone and the cemetery can be completely covered in mud. (Not poetic rain. Ugly, attire-sullying mud.)

And sure, avoid overdramatic dialogue. Real people don't become epic poets when they attend a funeral, so no reason for your characters to do the same unless that's how they speak habitually.
Answer: A funeral is largely ritual. That is to say, it is formalized cliché. This is pretty much true in every culture, the only difference being the specifics of the ritual.
If you step too far away from the ritual you have a huge chance of creating farce, probably not what you want.
The main chances you have to introduce novelty are

The sermon that the priest gives and,
The eulogy that somebody close to the departed gives.

The priest may stick to a ritual sermon unless there is something special about this funeral. So, many times, the only spark-of-color is going to be the eulogy. It's a good place to insert characterization of both the departed and the person giving the eulogy. And possibly in the reactions of people hearing the eulogy.
However, I can suggest an example funeral sermon that really did crackle. In the movie Photographing Faeries Ben Kingsley plays the Anglican priest of a small village. And in the movie, his character's daughter dies. So it comes to him to give the sermon at the funeral. It is quite a memorable sequence.
Answer: First thing is first, is that Funerals are cultural and a lot of the "cliché" is based on a generic culture.  For example, in European based cultures, the the traditional colors of mourning are black.  But in Sinosphere cultures they are white.
The Cliché in Western Media is the burial which is actually part of the funeral, and is usually the part shown because it's the traditional "Final Goodbye" and the dispersal from that is normally at a leisurely pace, allowing for plot points to be discussed OR to have a bunch of characters from the story return to the scene to serve as a final curtain for their actors (Think of Tony Stark's Funeral in "Avengers: End Game").
I would recommend consider the deceased and their culture and look into a funeral service from that culture and what they are like.  It can take different forms.  If the decease was aware his/her death was imminent, they might have provided instructions for their funeral... maybe even a self-Eulogy or message for the living.  A person who may have been known for their humor might encourage their funeral take the form of a "Roast" while other creatives may have tributes calling back to their careers.
And of course, there's always the opportunity to "Put the FUN in Funeral".
The idea here is that the deceased would not have wanted to be mourned but celebrated or that the family do something fun to remember him.  Often the ceremonies will have a scattering of ashes at a place that is important to the deceased and where they were happiest.  Others will be encouraged to remember silly moments with the person.  Some families will find humor in the events of the day and how they are not typical of the funeral (I was once in a funeral where the funerary procession got lost, and wasn't helped that it was early December and the driver of the car put on Christmas music... and the music trended to the most inappropriate songs for the mood ("I Want a Hippopotamus for Christmas" was heard twice in the rotation) and we were in hysterics when we entered the Cemetery and quickly tried to compose ourselves.  Given the decease's dislike of "proper behavior" in such settings, I joked with my friend that while we might have appeared to be the most disrespectful car in the procession, we were in fact the one that was honoring "what he would have wanted" the most.).  At another funeral, we established a family tradition of "Tailgating the Funeral" (which is that we provide food and drinks at the viewing for the family away from the guests... typically using a van trunk to put out the spread.).  It's to give the family in mourning some space to recollect themselves away from people they might not know well, but the fact it looks like a tailgate did not go unremarked.
Other times humor can be found in the awkward things that are said, as people are generally trying to be sympathetic but might awkwardly say something (I once saw someone accidentally hit on the widow.).
Answer: Here are a few possibilities:

Something unexpected happens during the funeral.

Add some drama that could hint at deeper drama. For example, a fight breaks out between the two relatives, someone stands up and accuses one of the people present of murdering the person, or, if you want to go for shock value, the people open the casket and find that there's nothing there.
That would take the entire story in a new, interesting direction. There are so many ways to catch the reader off guard.

The funeral itself is unique.

What do you think of when you think of a funeral? Images that come up would probably be people dressed in black. A casket. A sermon. Heartfelt eulogies. But this is not universal.
Culture can greatly change what the funeral looks like. Where is the deceased from? Mexico? Kenya? India? Was their father from Honduras and their mother from China? Every culture has a different idea of what a funeral and burial are like, so a person with a complicated cultural heritage might have a very unique funeral.
Religion will also affect the funeral. What if the deceased is a Buddhist, Muslim, Hindu, Wiccan, Catholic, or so on? What if they're an atheist? How will that affect the funeral?
Location also matters. If the deceased is a sailor, they might want a burial at sea. If they're rich it might take place at some expensive hotel. What if they were eccentric and wanted to be buried in Antarctica? That'd be quite the experience.

The funeral moves the plot forward

What is the relationship between your protagonist and the deceased?
If your character was close, they're probably crying their eyes out. If they were enemies, your MCs might be thankful they're gone. If they were strangers to each other, your character's probably only there to comfort someone else.
Any one of those situations leads to drama and character development. Learning to cope with losing a loved one is hard. Comforting a friend who's grieving is also hard. Even losing an enemy isn't fun because death is never fun to think of.
So what does your character do?
They might cry, give a heartfelt eulogy, or make a scene. They might use this moment to reveal some deep dark family secret.
"You think X was a great person, but I know the truth. They're a monster! They killed my brother."
Did the deceased leave a will or something? That could be central to your plot. It's not uncommon for some powerful figure to leave a complicated will and send everyone on a wild goose chase. It's the premise of Ready Player One.
"Yeah, hi. I'm the creator of the virtual reality you're all dependent on. First person to find this Easter Egg owns my company and all my money. Good luck."
Or the 39 Clues route.
"You can get a million dollars or go on a round-the-world trip searching for a mysterious family secret. A secret that could determine the fate of the world. Which will it be?"
Answer: My first idea upon reading this is that, when people go to funerals, they tend to retreat into their own heads. So write the whole scene from the perspective/focusing on one person and their thoughts. They can see things happening, but don't really care. When the funeral ends, it seems to them like it only just started because they never really took part.
Or, you could do it like Letranger and have the person only pay attention to the physical aspects of the funeral, only observing things as they happen, not as they are in any symbolic sense. Like someone giving a speech.
...
Bimmy got up to give a speech. It was about... Something. I couldn't really tell. All I could think about was his tie, how it was stuck out just a little too far. Every time he ducked his head, to keep from crying or something, it would pop out just a little bit.
...
I assume your main character isn't a sociopath, however, and may feel some empathy for what they see other people going through. Or at least what they think the others are going through. It could be a projection of the protagonists grief, as they instinctively don't want to face the pain themselves, so they tell themselves they're crying for someone else crying for the reason they don't want to cry over.
Or they could fall asleep.


What is the viewing window for on this tape measure?

Question: Can someone please explain me the significance of the window in this measuring tape? I am unable to understand its application.
Comment: I added a picture so readers don't have to follow a link to find out what's meant. Good and common question!
Answer: That measurement window is used when you're using the tape measure to draw a circle.
This diagram (from the site you linked to) shows how it's done:

There appears to be a piece which you pull out from the back of the body of the tape measure which you would hook over a nail or something at the center of the circle, and there is a hole in the tape at the 2.5cm mark where you insert your marking or scribing tool.
The reading in the window on top then tells you the distance from the nail to the mark - which is the radius of your circle.
Answer: I found the answer. The window is primarily used for measuring the inner side such as of window or door panes.
Answer:
EIGENSCHAFTEN:
Das besondere Bandmaß mit 3 Funktionen:

Längenmaß
Innenmaß
Kreise
Die Teilung im Sichtfenster steht nicht auf dem Kopf (keine Ablesefehler).

Translation: "length measurement, inside measurement and circles. The markings in the window are not upside down (no reading error)"
The red line marks the inside measurement, taking into account the size of the tape's case.
It also marks the radius if you pull out a tab, and the offset due to the length of the tab is compensated by the location of the hole in the tape.
(But most of this was already in the earlier answers)


MacBook Pro updated to EL Captain 10.11 but QuickTime Player didn't upgrade

Question: The ONLY reason I upgraded to EL Captain because the new QuickTime Player allows me to make a video of my app while I play on my device. However, I've upgraded to EL Captain 10.11 but the QuickTime Player is still version 10.4
The El Capitan upgrade went smoothly for my MacBook Pro. Everything works well. How do I update the QuickTime Player? I tried going through App store but in search, I couldn't find it.
Answer: QuickTime 10.4 is the newest version. It was already possible to record your iOS-device in Yosemite. Source.


Angular - lazy loading standalone component for multiple path's

Question: Is it possible to lazy load standalone component for multiple path's? Is this a proper way to do it?
{ path: 'path1', loadComponent: () => import('./someComponent.component').then(c => c.someComponent)},
{ path: 'path2', loadComponent: () => import('./someComponent.component').then(c => c.someComponent)},

In main.ts file I also set preoload strategy to preload all modules:
provideRouter(APP_ROUTES, withPreloading(PreloadAllModules))
I checked newtwork in DevTools and it looks like component is loaded only once. However I am not sure if this is the correct way of implementing it.
Answer: The way you are lazy leading is absolutely fine. because regardless of how many times you are lazy loading a component or a module, it will load only the first time and the next time Angular loads the same route or another route with same component or module, Angular will use the already loaded component or module.


Does your choice of school affect the storyline for the college of winterhold?

Question: Ok so I just finished the college of winterhold story arc. When I first started I chose to go with illusion. In the storyline we found the eye of Magnus and and staff of Magnus. Is the storyline affected by your choice of school or does it not matter?
Answer: I have played that game over and over again and I have always gotten the same results as you, so I would say no. I believe the story is set on that particular part of the story line.
Comment: +1, since you're just citing experience, I'll chime in and say I've had the same experience. That could have been neat, though.
Answer: I've ran through these quest lines recently again.
From experience it appears that the quests are built how they wanted it from the start as when you go through specific dungeons you will find multiple scrolls needed to progress.
Example as you come through a dungeon there will be a frozen door that you cannot progress through without a fire spell, nearby is a fireball scroll.
Later you would come across a door on fire that would then need a ice spell which again is a scroll located nearby.
I ran through on my most recent run with Illusion as a passive mage / berserking others to fight each other. Not once was Illusion actually needed.


the whole data from tables is not coming via join query in mysql

Question: i'm working with php mysql and there are 12 tables which contains student informations.There are 3 main table First table is registration, second is demandraft and third is creditcard.The demandraft table contains all the creditcard table fields but as empty. now i want to get the whole data from these three tables to generate my xls file but coz there are  empty fields of creditcard table in demandraft table so unable to fetch the whole records from all 3 tables. there is stuid field common in all 3 tables.
Here is my join query for that:
$sql = "select * from  registration
        join programme on registration.id=programme.stuid
        join family on registration.id=family.stuid
        join address on registration.id=address.stuid
        join education on registration.id=education.stuid
        join extradetail on registration.id=extradetail.stuid
        join workexperience on registration.id=workexperience.stuid
        join demanddraft on registration.id=demanddraft.stuid
        join payonline on registration.id=payonline.stuid
        where (DATE(registration.createddate)>='".$term1."'
        AND DATE(registration.createddate)<='".$term2."')";

Comment: Instead of join use left join
Answer: Use a left join.
select *
from a join b on a.id = b.a_id

will not list lines of table a that do not appear in table b.
select *
from a left join b on a.id = b.a_id

will.
Left join might be a bit tricky when chaining many of them with multiple tables. You may have to cleverly use parentheses around joins such that the order of joins is correct.
Answer: This :
$sql = "select * from  registration
        left join programme on registration.id=programme.stuid
        left join family on registration.id=family.stuid
        left join address on registration.id=address.stuid
        left join education on registration.id=education.stuid
        left join extradetail on registration.id=extradetail.stuid
        left join workexperience on registration.id=workexperience.stuid
        left join demanddraft on registration.id=demanddraft.stuid
        left join payonline on registration.id=payonline.stuid
        where (DATE(registration.createddate)>='".$term1."'
        AND DATE(registration.createddate)<='".$term2."')";

Should do the trick


Jelastic maintenance windows & process across providers

Question: Does anyone know if all Jelastic providers have the same outage windows & process? I'm liking Jelastic for the simplicity but the last maintenance window caused issues for my application despite only impacting the dashboard (supposedly).

Are all Jelastic providers going to be down for maintenance at the same time?
Are the upgrade process/scripts uniform across the providers? i.e. provided by jelastic?

Cheers
Answer:
Are all Jelastic providers going to be down for maintenance at the same time?

Jelastic releases are rolled out to most/all providers around the same time (i.e. within a period of a few weeks).

Are the upgrade process/scripts uniform across the providers? i.e. provided by jelastic?

Jelastic development team engineers create the upgrade scripts and perform the upgrade process, so the actual upgrade experience should be approximately the same at every provider.
Most platform upgrades are targeted at improving the underlying platform (e.g. adding new dashboard features, core infrastructure etc.) and should not have any impact on your application servers.
Maintenance windows are announced to provide notification that some operations will be performed, because there is always a risk that something unforeseen can happen in such cases (if it could be guaranteed zero risk, there would be no need for any notification).
Just as you do with your own application, every Jelastic platform change is tested thoroughly in a dev environment, and the full upgrade process is simulated in a stage environment, so that as many issues as possible are identified and eliminated before it touches the live production platform - but software engineering is complex (as everyone reading stackoverflow appreciates) and there is no such thing as 100% error free software.
PS the fact that I can say exactly which environment you're referring to should tell you something about the number of environments affected. Unfortunately you were very unlucky in this instance, and Jelastic engineers are still investigating the exact details to identify root cause + will outline necessary steps to avoid a recurrence. Application uptime and stability is a critical issue to us all.


Debian: What Are Permissions/User Requirement To scp From local server to remote server

Question: I have two LANs with routers tunneled to communicate with my Debian servers over the Internet. That works fine. I can SSH with certificates so as not requiring password to connect local server1 user (Tom) to remote server user (Harry). I am confused as to setting the directory permissions, owner and groups on the remote server directories so as to scp files from my local LAN server(s) to the remote server without getting Permission Denied. I could complicate this question further by stating the local LAN has 3 servers and a NAS plus I hope to automate this with Perl and crontab. Though just the basics in helping to clarify this would be greatly appreciated. Thank you.
Answer: A file system Permission denied error has nothing to do with your
SSH connection.  Only the permissions granted to the userids at each
end matter.  Consider:
$ whoami
tom
$ scp foo harry@remote:bar

User tom must be able to read pathname foo.

You can test this without using scp -- just try to read the
file foo.

User harry must be able to write pathname bar on remote.

You can test this without using scp -- just login to remote
as harry and try to write the file bar (as harry).

If either of the above tests fail, the scp will fail.
For example:
$ scp /etc/shadow harry@remote:bar
/etc/shadow: Permission denied

Local user tom cannot read /etc/shadow.
$ touch foo
$ scp foo harry@remote:/etc/shadow
scp: /etc/shadow: Permission denied

Remote user harry cannot write to /etc/shadow.


Ubuntu doesn't retain mouse cursor size between reboots

Question: I'm having an annoying problem here, every time I boot system, I have to manually set my cursor size from 24 to 16, I can't seem to find a way to save... make that 16 permanent even after boot, does anyone know how to do that?
Using Ubuntu 16.04 64 bit.
Answer: I was facing the same issue, then found a similar entry under /com/canonical/unity/interface/cursor-scale-factor, increased to 1.20 and it worked fine after reboot.
Too bad there's no option under Universal Access or something :S
Comment: Perfectly working for `Ubuntu 16.04.1`, thanks! This also fixes the bug that some applications scaled the cursor back down.
Comment: You're right. This should definitely be available in [Universal Access](https://i.imgur.com/UWR4AYf.png).
Comment: I guess you could probably accomplish this also with this command: gsettings set com.canonical.Unity.Interface cursor-scale-factor 1.2
Answer: First note that it is necessary that the theme used in Ubuntu allows the size corresponding to the cursor size.
Therefore, do:
gsettings set org.gnome.desktop.interface cursor-size 16

(or other size, 24, 48, as the theme permits)
But only with this command size will be lost when you restart the session or the system, then to become permanent:
cd /usr/share/glib-2.0/schemas

Make a backup copy of the compiled file of the schemes:
sudo mv gschemas.compiled gschemas.compiled-bak

Then change the default value:
sudo gedit org.gnome.desktop.interface.gschema.xml

Locate this block:

        <key name="cursor-size" type="i"
>

            <default>24</default>

            Cursor size

            <description>Size of the cursor used as cursor theme.</description>

        </key>

Change the value above 24 to 16, 48, 96, that's all, do not change anything.
Save and Exit
Make a new compilation of existing schemes:
sudo glib-compile-schemas /usr/share/glib-2.0/schemas/

This should have generated a new file with the name gschemas.compiled within the directory in question.
Restart the session and / or the system.
The mouse cursor should remain in the chosen size.


If husband start practicing hinduism what his wife shuld do?

Question: If husband start practicing Hinduism what his wife should do?  can she practice her own religion Islam and be with her husband who is now practicing Hinduism?
Answer: As per my knowledge, the marriage will be broken and the two can not practice husband wife relation, they are now strangers for each other. Below are few rulings passed by Jamia Binoria India, a well reputed Sunni school of thought. For more details and possibilities for living together, you should definitely consult Islamic scholars.
Muslim marrying a Hindu
Husband accepting Christianity while wife is Muslim
Hindu wife accepting Islam while Husband is still Hindu
Deep apologies for not providing translated version for all users. If you don't understand the language then you can get help probably from an Indian, Pakistani, Bengali to get it translated for you.
Answer: Quran 60:10
They are not lawful (wives) to the disbelievers, nor are the disbelievers lawful (husbands) for them.
https://quran.com/60/10?translations=17


Does Virus or Malware make harm to system if it is in Non Admin Mode for Windows

Question: Let Assume, In my windows systems, I have two user one Admin user and one Non Admin User, where I install a software with vulnerability and used it in both user mode. Will that get affected in normal user mode.
Comment: Not sure I understand the question. Do you run the software in as admin as well? Or do you only run it as the non admin user?
Answer: It is tricky to understand what you are asking so I am assuming you are asking about any damage the malware can cause if run under your user account.
Firstly, it can touch anything your user account can touch, so assume all your data can be wiped, altered or stolen.
Secondly, through the use of a privilege escalation exploit, the malware may be able to use your user account as a stepping stone to an admin account, and then it can do anything that account can do - generally regarded as total control over the machine.


Should left/top navigation in dashboard be visible or hidden?

Question: Should the dashboard left navigation be collapsible or should it remain expanded at all times? What are the pros & cons? In addition to this, how does it affect conversion rate?

Note: This is just reference image!!
Comment: Can you show a screenshot of what you mean, or how many items / sections you need?  Is this a navigational sidebar?
Comment: Yes, it is regarding navigational sidebar.
Comment: @AdamPlocher screenshot is added for reference.
Comment: I think your question is too general. For what type of application? What type of users use the application and what is their goal? For desktop only or for tablets? And another thing - no one can predict how your particular conversion rate will be affected by collapsible menu's. Please, re-frame your question so its more specific.
Comment: @KristiyanLukanov Let me make it clear. In our application, we allow the user to look out/scout for some information. We also provide sector reports, news etc. It has to be responsive.
Answer: Always keep in mind that an application can be used thousands of users on hundreds of screen sizes, screen resolutions and browsers.
Therefore, even though side navigation menu in a Dashboard application is highly important, the users SHOULD be able to collapse it. Maybe not all the way, refer the screenshot below.
Comment: Does it affect conversion rate?
Comment: It shouldn't. If anything, it's an added feature that improves usability when done right. If the application reads the viewport size keeps the menu expanded for large screens by default while collapsed for smaller screens then it comes as a handy addition
Answer: It definitely depends firstly on the content itself (content on the right side). Let's consider why a user needs to collapse the left navigation;

The content is crowded and user wants to focus only on content,
The screen size is small and user needs space.

In fact, both of the reasons are related to "space". If your users need space, then you should give it to them. If not, then firstly try without collapsing feature and gather feedback from your users.
Collapsing feature is sometimes complex as some navigation patterns are nested and need attention to create a usable interaction, so why to make effort when your users do not need it?
So, it's better to take action based on your user's need. Then go on taking new actions as user needs evolve over time.
Answer: Space is a very general opinion and we should not decide on expanding or collapsing based on space.
The real decider in this situation is Content on the sidebar.
Questions to ask are:
How important is the content on the side bar?
How frequently does the user use the options displayed on the sidebar?
High Frequency and important: You know that it should not be collapsed and always kept handy on screen.
Low Frequency but important: It can appear collapsed. A user will find his way to menu.
Low Frequency and additional option: Keep collapsed and if you ask me, I would not bother adding the option at all.
Let me know if this helps.


Book series with a shape shifting dragon girl

Question: Does anyone know the name of the book series about a girl who finds out she can turn into a dragon and has to learn how to? She falls in love with a human guy who is fine with her being a dragon and she ends up having to fly to an island where other dragon people are to find them and save their race...
Comment: This is a nice overview, if a bit brief. Could you take a look at [this guide](https://scifi.meta.stackexchange.com/a/9337/58193) to see if there is anything else you can [edit] in? For example, when did you read these? Were they new at the time? How many books were there? How did she find out about the other dragon people? Can you remember anymore specific plot points? etc.
Comment: Sounds a bit like the [Jennifer Scales](https://www.goodreads.com/series/43000-jennifer-scales) series, but some of the details are off.  You might look at [this question](https://scifi.stackexchange.com/q/190160/78394) if that sounds familiar.
Answer: I believe this may be Lost Truth, fourth book of the Truth series by Dawn Cook.

Alissa is steadily advancing in her magical studies with the last surviving Master at the legendary Hold. But she's haunted by dreams--dreams revealing that other Masters have survived...
Alissa's dreams lead her to a distant island, where she and a rescue party discover countless Masters, alive and part of a flourishing magical society. But instead of being welcomed, Alissa finds that she herself may need to be rescued. The Masters' leader, Keribdis, believes that she should be Alissa's teacher, whether Alissa likes it or not. And when Alissa rebels, she endangers not only her magic, but also her life..

Alissa learned to transform into a dragon in previous books. :) I had my own query, looking for First Truth, first book in the series, so I did a Google search for dawn cook girl dragon island and found the fourth book mentioned an island and her people. The love interest is Strell, an itinerant musician who had one of her father's maps in the first book. I think one of the later books had a young Raku (dragon) that acted as a romantic rival.
Comment: Yes!!!! Thank you so much!!!! This is the book! ❤❤❤ You're awesome @FuzzyBoots!!!