GFIC requirements for a Kitchen multi-outlet strip

Question: I was thinking of replacing my current kitchen counter receptacles with a Hard Wired Multi-Outlet strip that would run below my cabinets. My question is How would I provide GFCI protection? Can a Multi-Strip outlet be used without GFCI protection for a kitchen counter that's near the sink?
Answer: Ground-fault circuit interruption protection is required for all receptacles installed in a kitchen, that serve the countertop surfaces.

National Electrical Code 2014
Chapter 2 - Wiring and Protection
Article 210 - Branch Circuits
I. General Provisions
210.8 Ground-Fault Circuit-Interrupter Protection for Personnel. Ground-fault circuit-interrupter protection for personnel shall be provided as required in 210.8(A) through (C). The ground-fault circuit-interrupter shall be installed in a readily accessible location.
(A) Dwelling Units. All 125-volt, single-phase, 15- and 20-ampere receptacles installed in the locations specified in 210.8(A)(1) through (10) shall have ground-fault circuitinterrupter protection for personnel.
(1) Bathrooms
(2) Garages, and also accessory buildings that have a floor located at or below grade level not intended as habitable rooms and limited to storage areas, work areas, and areas of similar use
(3) Outdoors
Exception to (3): Receptacles that are not readily accessible and are supplied by a branch circuit dedicated to electric snow-melting, deicing, or pipeline and vessel heating equipment shall be permitted to be installed in accordance with 426.28 or 427.22, as applicable.
(4) Crawl spaces — at or below grade level.
(5) Unfinished basements — for purposes of this section, unfinished basements are defined as portions or areas of the basement not intended as habitable rooms and limited to storage areas, work areas, and the like.
Exception to (5): A receptacle supplying only a permanently installed burglar alarm system shall not be required to have ground-fault circuit-interrupter protection.
(6) Kitchens— where the receptacles are installed to serve the countertop surfaces
(7) Sinks — located in areas other than kitchens where receptacles are installed within 1.8 m (6 ft) of the outside edge of the sink
(8) Boathouses
(9) Bathtubs or shower stalls — Where receptacles are installed within 1.8 m (6 ft) of the outside edge of the bathtub or shower stall.
(10) Laundry areas

You can either provide ground-fault protection by feeding the device from the load side of a  GFCI receptacle, or installing a GFCI circuit breaker on the circuit.
Keep in mind that you may not be able to replace all the receptacles in the kitchen with a single multi-receptacle unit, but may install the multi-receptacle unit in addition to, or as a substitute for the required receptacles.

National Electrical Code 2014
Chapter 2 - Wiring and Protection
Article 210 - Branch Circuits
III. Required Outlets
210.52 Dwelling Unit Receptacle Outlets. 210.52 Dwelling Unit Receptacle Outlets. This section provides requirements for 125-volt, 15- and 20-ampere receptacle outlets. The receptacles required by this section shall be in addition to any receptacle that is:
(1) Part of a luminaire or appliance, or
(2) Controlled by a wall switch in accordance with 210.70(A)(1), Exception No. 1, or
(3) Located within cabinets or cupboards, or
(4) Located more than 1.7 m (51/2 ft) above the floor
(C) Countertops. In kitchens, pantries, breakfast rooms, dining rooms, and similar areas of dwelling units, receptacle outlets for countertop spaces shall be installed in accordance with 210.52(C)(1) through (C)(5).
(1) Wall Countertop Spaces. A receptacle outlet shall be installed at each wall countertop space that is 300 mm (12 in.) or wider. Receptacle outlets shall be installed so that no point along the wall line is more than 600 mm (24 in.) measured horizontally from a receptacle outlet in that space.
Exception: Receptacle outlets shall not be required on a wall directly behind a range, counter-mounted cooking unit, or sink in the installation described in Figure 210.52(C)(1).
(2) Island Countertop Spaces. At least one receptacle shall be installed at each island countertop space with a long dimension of 600 mm (24 in.) or greater and a short dimension of 300 mm (12 in.) or greater.
(3) Peninsular Countertop Spaces. At least one receptacle outlet shall be installed at each peninsular countertop space with a long dimension of 600 mm (24 in.) or greater and a short dimension of 300 mm (12 in.) or greater. A peninsular countertop is measured from the connecting edge.
(4) Separate Spaces. Countertop spaces separated by rangetops, refrigerators, or sinks shall be considered as separate countertop spaces in applying the requirements of 210.52(C)(1), (C)(2), and (C)(3). If a range, counter-mounted cooking unit, or sink is installed in an island or peninsular countertop and the depth of the countertop behind the range, countermounted cooking unit, or sink is less than 300 mm (12 in.), the range, counter-mounted cooking unit, or sink shall be considered to divide the countertop space into two separate countertop spaces. Each separate countertop space shall comply with the applicable requirements in 210.52(C).
(5) Receptacle Outlet Location. Receptacle outlets shall be located above, but not more than 500 mm (20 in.) above, the countertop. Receptacle outlets rendered not readily accessible by appliances fastened in place, appliance garages, sinks, or rangetops as covered in 210.52(C)(1), Exception, or appliances occupying dedicated space shall not be considered as these required outlets.
Comment: As long as the Plugmold strip meets spacing requirements there is no reason it cannot replace standard receptacles.

Curious, what is "a combination GFCI circuit breaker"? I know of combination AFCI's, but never heard this applied to GFCI's.
Comment: @SpeedyPetey Fixed both points.
Answer: Steady,
Receptacles serving kitchen counter areas MUST have GFI protection. No exceptions for Plugmold. As Tester stated, this can be accomplished by feeding from the LOAD side of a GFI receptacle somewhere else in the kitchen, or by a GFI breaker. Typically a GFI breaker is used in my installations.
Comment: They also make blank GFCIs, basically a GFCI outlet without the outlets, which can feed your strip. This gives you access to the GFCI for resetting it without actually adding an outlet. For example, http://www.leviton.com/OA_HTML/SectionDisplay.jsp?section=42307
Comment: Very true, although I see no reason to use one in this installation. They cost more and there's no downside to an additional receptacle in this application.

From a fellow doxie lover. :)
Answer: Kitchen receptacles must be GFCI protected, and also arc fault protected as of 2014. Plug strips in kitchens are extremely tough to do; the cost makes it impossible. The breaker cost, on an average, is about $100.00, and you need a minimum of two on the counter. With plug strips you added the cost of the kitchen by at least $1000.00 by the way you have to wire it


Which file is responsible for off the canvas menu in mobile view in rwd theme?

Question: Where does off the canvas menu comes from in Magento 1.9.2? Which file is responsible for it? How can I make off the canvas menu default in desktop view?
Answer: go to this path file app/design/frontend/your-theme/default/template/page/html/topmenu.phtml
hope you can got your answer, you can customize this file if you use your own theme, or you can edit existing theme


Adding new participant to a breakout room after breakouts are in progress

Question: Suppose I am hosting a Zoom meeting and I have already created some breakout rooms and moved people into breakouts.  Then a new participant joins the call.  I'd like to find out someone new arrived and add them to an existing breakout room.  If I am in a breakout room at the time, how can I find out that someone new has arrived and should be assigned to a breakout room?
Answer: You would have to exit from the room, check for new people, and add them to the appropriate room. You must do this from your host screen and controls.  If you have two screens or computers you might be able to do it from a second computer. In our meetings the host is normally not in a breakout.
Comment: Thanks for your reply.  I want to make sure I am understanding your answer.  I believe you to be saying: (1) while I'm in a breakout room, there's no way to be notified that someone has joined the main room; (2) while I'm in a breakout room, there's no way to assign a new participant to some breakout room.  Do I have that correct?  Thank you for your assistance!
Comment: Correct . If you are in a participant room, you cannot add an incoming participant to a room.
Answer: I have discovered through experimentation that you can detect when someone new enters the room because there will be an indicator above the "breakouts" icon on the toolbar: if 2 people have entered but not yet been placed into a breakout room, there will be a red (2) hovering over the "breakouts" icon.  When opening the breakouts window, they will show up under "Unassigned".
The host can then assign them to a breakout room.  There is no need to switch back to the main room to make the assignment: the host can assign them to a breakout room from whereever the host is, even if the host is in a separate breakout room.
Answer: Some of the issue may be around whether you are using a Waiting Room or not. If you're using a Waiting Room, you should get a notification as the Host if you're in a Breakout Room that someone is now unassigned but you don't know if they're in the Waiting Room or the Meeting Room. If you assign them to, say, Breakout Room 2 and they're in the Waiting Room, they are still stuck in the Waiting Room, but now you don't know they're stuck there! Worse still, if you realise, leave your Breakout Room, let them in from the Meeting Room, you can't now assign them to Breakout Room 2 because Zoom thinks they've already been assigned there. It's a bit bizarre. If you do that, you need to assign them to the wrong Breakout Room, then assign them to the right one! Worse still, since the latest update (5.4.2), I'm not even getting a notification that someone is unassigned when I'm in the Breakout Room. I only get the notification when I'm in the Meeting Room.


Select pseudorandom row from a very small partial index in Postgres?

Question: I have a huge table, with a tiny partial index on <0.1% of the rows satisfying a certain condition (one column is null). I would like to pseudorandomly select a row that satisfies this condition. Can I use the partial index that already exists to speed this up, and if so, how?
Answer: Shouldn't be a problem, just put the WHERE condition of your partial index into the WHERE condition of your query.
create table foobar as select id, case when random()<0.001 then NULL else random() END as nullable, random() as z from generate_series(1,1000000) f(id);
create index on foobar (id ) where nullable is null;
select * from foobar
   where nullable is null order by random() limit 1;

This does have to read all the indexed rows, so there is only fast it can be.  It also has to "sort" all the rows, but since the sort knows about the LIMIT it is not a full sort and so is not really Nlog(N).
If you are willing to augment your table with a column of random numbers (which I had already done in my example, just for filler at the time), then you can do better.
create table foobar as select id, case when random()<0.001 then NULL else random() END as nullable, random() as z from generate_series(1,50000000) f(id);
create index on foobar (z) where nullable is null;

with rand as (select random()/1.0005 as rand)
select foobar.* from foobar,rand where nullable is null
  and z between rand and rand+ 0.0005
order  by random() limit  1;

You would have to tune the constant 0.0005 with knowledge of how many indexed rows there are.  If you make it too small, there is the possibility that the range will contain not rows and so you get no result (you could then retry it), and if you make it too large you use more time than necessary.
Without changing the table, then I think you can't do much better than reading all of the indexed tuples; without being willing to compromise on the quality of the randomness.
Comment: Thanks! I was skeptical that this would be performant, but I tried it with the table having 100k, 1m, and 10m rows, with the nullable column scaling with it (so that there was a constant number of null rows), and the final select took consistently 6ms. Works great!
Comment: Actually, this seems to scale with O(n) with the number of candidate rows, with the column being null. Is there any better way to select a random row, maybe O(1) or O(log n) or something?


Can't connect to greenplum with error message : "no pg_hba.conf entry"

Question: I'm using gp 184.108.40.206, and I followed the manual http://184.108.40.206/gpdb.docs.pivotal.io/c3pr90ntcsf0/gs/43/pdf/GPDB43xGettingStarted.pdf
I can connect to server with admin user, but when I try to use another user, I get the error message
psql: FATAL:  no pg_hba.conf entry for host "[local]", user "gpuser", database "rdw", SSL off

I've already done some research on stackoverflow. I modified the pg_hba.conf, add an entry
host  all  all 0.0.0.0/0 md5

and then reload the config file with gpstop -u and SELECT pg_reload_conf();, even tried to restart the gp server. But I still get the same error.
I also tried other entries like
host    all             all             127.0.0.1/32            md5

this didn't work too.
Please tell me how to fix this.
edit:
I reinstalled the database in single node mode and followed exactly the manual mentioned before. I create two users : user1, user2 and grant role users to these two users.
What I executed:
In command line:
$ createuser -P user1
Enter password for new role:
Enter it again:
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) y
Shall the new role be allowed to create more new roles? (y/n) n

In psql:
=# CREATE USER user2 WITH PASSWORD 'changeme' CREATEDB NOSUPERUSER;
=# CREATE ROLE users;
=# GRANT users TO user1, user2;

Here is my whole pg_hba.conf, which is located at /data/gp/server/master/gpsne-1/pg_hba.conf. I add the last 3 lines.
local    all         hadoop         ident
host     all         hadoop         127.0.0.1/28    trust
host     all         hadoop         10.10.10.32/32       trust
host     all         hadoop         ::1/128       trust
host     all         hadoop         fe80::d6ae:52ff:feb9:87c2/128       trust
local    replication hadoop         ident
host     replication hadoop         samenet       trust
local tutorial +users md5
local tutorial +users 127.0.0.1/28 md5
hostssl tutorial +users samenet md5

But I still get the same error.
psql: FATAL:  no pg_hba.conf entry for host "[local]", user "user1", database "tutorial", SSL off

When I installed the database, I got a warning message, not sure if it is related.
20160302:10:44:51:023434 gpinitsystem:bobcat04:hadoop-[WARN]:-Host 127.0.0.1 is assigned as localhost in /etc/hosts
20160302:10:44:51:023434 gpinitsystem:bobcat04:hadoop-[WARN]:-This will cause segment->master communication failures
20160302:10:44:51:023434 gpinitsystem:bobcat04:hadoop-[WARN]:-Remove 127.0.0.1 from local host line in /etc/hosts

Comment: "[local]" as in Unix Domain Socket? This requires "local" instead of "host".
Comment: The entry you've added seems correct. The problem must be somewhere else. Maybe you changed a wrong 'pg_hba.conf' file, or didn't restart the server.
Comment: Please post your entire pg_hba.conf, but without the comments.
Comment: @A.Scherbaum thank you for your advice, I provide more details.
Answer: You have a mistake in the 2nd last line:
local tutorial +users 127.0.0.1/28 md5

There should not be an IP address listed for local connections.
Did you run gpstop -u to reload after making the changes?
I suspect the reload failed due to the invalid line.
Remove the line and run gpstop -u again and try to connect again.
Comment: Thank you! I removed the line and it works! But the GP getting started manual says to add that entry...I will report this to Pivotal.
Answer: psql: FATAL:  no pg_hba.conf entry for host "[local]", user "gpuser", database "rdw", SSL off

This means you are trying to connect to Greenplum from the master host using psql and without specifying the hostname.  If you just type this:
psql

The psql client will attempt to connect to the LOCAL instance of Greenplum.  The pg_hba.conf entry you added was for HOST authentication, not LOCAL.
You can fix this by doing one of two things.

When using psql and you want to authenticate with a HOST entry from the pg_hba.conf file, add the -h option.  This tells the client to connect to Greenplum and authenticate with the host entry.
psql -h mdw

You can also add an entry to the bottom of the pg_hba.conf file like this:
local all all md5

or if you trust everyone locally
local all all trust

More information on the pg_hba.conf file is here: http://www.postgresql.org/docs/8.2/static/auth-pg-hba-conf.html
Comment: Thank you for your reply. But this doesn't solve my problem :( Please see more information I add to the question.


Make [answers-in-comments] a synonym of [answers-as-comments]

Question: The tags answers-in-comments and answers-as-comments seem to refer to exactly the same thing: comments that should be answers. Because of that, answers-in-comments should be made a synonym of answers-as-comments. It should not be the other way around because answers-in-comments has a lot less questions and no tag wiki.
Comment: I was just thinking the same. Too bad it has been sitting here for almost a year with no progress at all. I doubt there is anyone with score 5 in either of these tags, seeing they are used sparsely. Only 23 and 6 questions respectively.
Answer: I have created the synonym as suggested.
I haven't merged the tags as yet.
Answer: "Answers as comments" seems ambiguous to me. Does it mean "answers being used as comments" (the content is a comment, but the post is an answer post) or does it mean "answers posted as comments" (the content is an answer, but the post is a comment post)? Both interpretations seem equally plausible.
Ideally, we should keep answers-in-comments and comments-in-answers and get rid of answers-as-comments and comments-as-answers.


Why weren't the U.S. aircraft carriers in Pearl Harbor on December 7, 1941?

Question: Where were the American carriers and why were they not in or around Pearl Harbor when the Japanese attacked?
Comment: There have been many books written, movies made, and analyses performed about this specific day. Have you even done any initial research?
Comment: A lot of Japanese pilots asked the same question.
Comment: Please do preliminary research as described in [ask]; H:SE should supplement wikipedia and google, not replace them.
Comment: Hi, you might want to change the expression 'our' for a more neutral one.
Answer: The U.S. Pacific Fleet had three carriers at the time of the attack:
U.S.S Lexington was at sea with Task Force 12, ferrying aircraft to Midway Island.
U.S.S. Enterprise was at sea and returned to Pearl Harbor in the evening following the attack.
U.S.S Saratoga was in San Diego, following a refit, to embark her air group who were training onshore.
Comment: To clarify on the Enterprise a bit, it looks like from the Wikipedia page that she (like the Lexington) spent a lot of her time not in port, but ferrying aircraft to the US's various pacific island airbases. So there's nothing unusual about her not being at her base that morning. In fact, she was on her way back from Wake after an 11-day run, so if anything it was odd that she was as close as she was when the attack occurred.


How to start the killed java process with its PID?

Question: How to start the killed java process with its PID in Linux?
Answer: A process's PID is an ephemeral bit of information that has no bearing on the program itself. It is not possible to restart a dead process just by knowing its original PID. You need to know what the process was, as well as any environment variables and parameters, to restart it the way it was running.
Depending on how the process was killed, some of that information may be available in your logs. For example, if the kernel killed a process you can find the process's title information in the kernel log by checking dmesg output or /var/log/kern.log (exact file location varies).
Answer: You can't, unless you have more information.
The PID (process ID) is only active when the process is running. When the process is done, the PID is no longer in use.
Trivia:
If the process is still running and you wish to start the same executable, it is possible to execute /proc/PID/exe, where PID is the PID in question. This can be useful if you have a server running in screen and just upgraded the screen executable and can't reconnect without using the original screen executable.


When bulk uploading products via csv

Question: When bulk uploading products via csv, do the columns need to be in a specific order or having the correct column name is good enough?
Answer: No you don't need to worry about column order. You need to specify proper column name to import product.
For proper name you can just export 1 product and use that name for column to specify proper attributes.
Answer: It depends how you are importing bulk products.
If you are using dataflow profiles to import products, then there is an option under data format tab i.e Original Magento attribute names in first row: Select yes if you are importing with attribute name in first row. ANd if you are selecting it as no, then you have to maintain the order of columns.

When bulk uploading products via csv


What can I replace my generator's starter cord with that will last longer?

Question: I broke the cord on my generator and I want to replace it with something stronger than typical rope. Does anyone have experience with another material?
Answer: If you use stronger cord, you'll just break something harder to replace next time. The cord is a "mechanical fuse" - a "weak link" - if it's breaking, it's either quite old, or you are doing something wrong when starting the generator.
Replace it with the same stuff, don't yank it past the point where it turns the generator, and it should last for many years.
Comment: I'd normally expect longer, but there are various factors that can influence lifetime - apart from potential user error (overpulling, mostly), there would also be an issue if some part of the assembly is chafing the cord, or if it's a cotton clothesline type of cord and the generator is stored someplace damp so it rots - or with things (bugs/rodents) that chew the cord..
Comment: Age is a good point. I don't have a good gauge for how long they should last. Is 3-4 years too short?
Answer: Rope and/or cord is available in many different materials, sisal, hemp, nylon, etc. For a generator starter pull cord, you'll want something flexible, strong, abrasion resistant at the very least.
A product on the market used in so many different ways is a cording called Spectra. It's common in fishing lines, as small diameter versions mean low drag, yet fairly high breaking strength.
Spectra is often used as the inner fiber of paraglider suspension lines. Small diameter again, for low aerodynamic drag, but very very strong for keeping the pilot aloft. Another advantage of this material specifically to this application is that the lines have very low stretch and are available in pre-stretched configuration. The tuning of a paraglider wing requires fairly careful attention to distance between attachment points.
In the use of a generator, low stretch means that more (all?) of the force put into the handle will be transferred into the cord and starter spin. You don't want stretchy nylon using up half your energy by stretching out when you yank it.
This material can be considered UV sensitive, but the starter cord typically spends most of its life inside the starter housing.
A quick search on eBay found some spectra line with 50 pound breaking strength for under ten dollars, but it's 0.4 mm in diameter. Not too practical for a pull cord. Even 150 pound stuff is 0.8 mm diameter.
Another term to use in searching is dyneema. A jump over to eBay finds some 5000 pound breaking strength stuff at 1/4" diameter for US$17 for 50 feet. That's a rather good price. The item description also notes in a different manner that it's low stretch. The expression used is that "it doesn't store energy" preventing injuries due to whiplash when broken.
I had a paraglider winch which used 700 pound test spectra/dyneema, equally unsuited for pull cords, as it was 3 mm x 1 mm cross section.
The trickiest part of making a product such as this work in your application will be to ensure you have secure knots at the ends. The stuff is slippery and frequently secured by sleeving and weaving. One end is fed back into the hollow core using a fid, for a substantial overlap. When tension is applied the weave clinches down on the inserted piece and holds stronger than might be believed.
I think it would work well for your application.


Paper resubmission to Special Issues of a journal

Question: I had a submission recently to a special issue of a journal. It was rejected. I noted that there exists another special issue in the same journal and my paper is also within the scope of that. Is it reasonable to resubmit that for another special issue of a same journal, whereas already rejected?
Comment: Why was your paper rejected?
Comment: on the basis of discipline, novelty and general significance
Answer: In theory, special issues have guest editors. Guest editors are often not members of the editorial board, although the editorial board still has oversight and veto power over any accepted paper. That means that if you submit to another special issue, it's similar to submitting to another journal - you'll reach another editor who might decide differently to the first editor.
However, given that it is the same journal, odds are the journal's editorial management system will flag your submission as a duplicate. So your paper might be rejected at this stage - either by the journal staff, or by the new editor (using the old editor's decision).
One can't predict what will happen to your paper reliably, but since the rejection reasons are generic, if you resubmit, you should do serious revision, either by adding more results or by arguing the novelty of your work more convincingly. The more work you do here, the less likely it is that your manuscript will be desk rejected.
Answer: If the paper was rejected only (or mostly) because it was a bad fit for the special issue, then it might be a better fit for the new issue, depending. In that case, resubmission might be warranted. But, given your comment that it has novelty and significance issues, I'd say that resubmitting would be pointless unless you can address those issues.
That will take work, however, with limited time for it. I'd guess your better option is to work on those issues for a future submission, probably elsewhere.
I'll also guess that if the paper fit the new requirements that you'd get (actually, might get) an invitation from the editor(s) to resubmit.
I'll also note that another possible reason for rejection from a special issue is that there are too many good submissions to fit them all (print journals primarily). But that isn't the issue in this case.


Add method to interface for only one implementation

Question: I have a factory for an interface with different implementations. But one implementation needs an extra method which the others don't need. How do I solve this without implementing "not implemented exception" methods in other implementations?
Comment: Could you give a more concrete example? Why does one implementation need an extra method? How are the things that take objects that implement this interface supposed to know they've received the one with the extra method without putting implementation details everywhere?
Comment: If you give a concrete example you will have a more accurate answer. For instance if you take the close() method in some stream interface, in-memory implementation may have an implementation that just do nothing. In other cases that may not be desirable.
Answer: Do the consumers of the inteface need to call the method that is only required for one implementation?
If the consumer does not need to call the method, it is an implementation detail. Therefore, it is not of interest to the consumers of the interface, as they even should/must not call it. Just add the method as a private method of the implementation that needs it.
If on the other hand the method must be accessible for the consumers of the interface, you are violating the Interface segregation and Liskov substitution principles. Extract the method in an own interface.
Answer: Do not add the method to the interface. If the method is relevant only for that one implementation, only add it to that one. The point of the interface is to abstract the common elements of every factory, so a method specific to a single factory should not be in the general factory interface.


Wait until web browser has loaded first page Visual Basic Net

Question: I want to do a 2 step Source-Download-Process. So I have like
WebBrowser1.Navigate("http://www.first-site.com")

'HERE code for downloading and saving the source code of the site into a variable
'Directly after having downloaded the source, open the second site and do the same

WebBrowser1.Navigate("http://www.first-site.com/sub-site")
'Download the Source code into one string variable

The problem is that my web browser will be loading two sites directly after each other very very quickly, not enabling me to download sources for both sites.
I tried everything, I googled "wait for browser to load one site" etc. and everything that has to do with while loops to see whether a browser has loaded a site it crashes my program.
What to do?
Comment: If you just want to download source code, you're probably better off with a [`HttpWebRequest`](https://msdn.microsoft.com/de-de/library/system.net.httpwebrequest(v=vs.110).aspx).
Comment: Did my answer solve your problem? If so, would you mark it accordingly. If not, let me know and I'll try to help further.
Answer: You'll want to use the DocumentCompleted event, as documented here.
Within your event handler method, call WebBrowser1.Navigate() to navigate to the second URL. Check e.Url to see which URL is being completed so you don't end up in a loop.
From the documentation:
Private Sub PrintHelpPage()
  ' Create a WebBrowser instance.
  Dim webBrowserForPrinting As New WebBrowser()

  ' Add an event handler that prints the document after it loads.
  AddHandler webBrowserForPrinting.DocumentCompleted, New _
      WebBrowserDocumentCompletedEventHandler(AddressOf PrintDocument)

  ' Set the Url property to load the document.
  webBrowserForPrinting.Url = New Uri("\\myshare\help.html")
End Sub

Private Sub PrintDocument(Sender As Object, e As WebBrowserDocumentCompletedEventArgs)
  Dim webBrowserForPrinting As WebBrowser = CType(sender, WebBrowser)

  ' Print the document now that it is fully loaded.
  webBrowserForPrinting.Print()
  MessageBox.Show("print")

  ' Dispose the WebBrowser now that the task is complete.
  webBrowserForPrinting.Dispose()
End Sub


How would iron smelting work in a planet with no oxygen?

Question: Imagine a small planet, rich with iron, but with a negligible atmosphere, mostly devoid of oxygen. Once harvested, how could iron ore be smelted and refined into iron? And would the ore itself be different in such an environment?
Comment: What is *"iron ore"* on a planet with no oxygen? On Earth, iron ore is iron oxide. That is obviously not the case on that oxygen-less world. So, what is it? It is quite important.
Comment: I suspect, that a planet without oxygen has one of two types of environment. A carbonic one, or a hydrogenic one. The smelting of iron in each of these environments is vastly different, so as it stands your question is too broad. Are you able to narrow it down by describing what kind of anoxygenic world you are working on?
Comment: Iron and oxygen apart, there are 90 more elements in nature, most of them can react with iron. Refining iron from each of those compounds will require a dedicated path, depending also on the other available elements. As it stands this question is overly broad.
Comment: Could the planet be like Mars? There's not much of an atmosphere (in comparison to Earth), and while there is some water vapor in it, it's not much in absolute terms. Definitively no oxygen in gaseous form. Still, most iron is found in oxide form.
Answer:
would the ore itself be different in such an environment?

Pretty much all the iron ores on Earth are oxides and hydroxides. No oxygen, no water, no conventional iron ores. (I listed a few of the common ores in another answer of mine with various relevant wikipedia links; I shan't copy it all out here).
If you had water, you'd have a ready supply of oxygen, of course. Given that this would trivially solve the issue, I'm assuming you do not.

how could iron ore be smelted and refined into iron?

Well, you have to think about what form the iron would be in. Metallic asteroids have native iron, for example, so whilst it might need refining it is already in a handy metal form and so there's no smelting required at all. Odds are good that in the absense of a reactive atmosphere, most of the iron you'd find would be in the native form. Earth had a lot of free dissolved iron and native iron before a bunch of oxygen-producing organisms appeared (see the formation of banded ironstone, for example).
Other ores do exist, of course. Techniques do exist for smelting sulphides (such as FeS2, aka. iron pyrite or fool's gold) but generally no-one bothers because there are plenty of sulphur-free iron deposits that are more easily smelted. Copper sulphides are exploited commercially, but their 2-step smelting process requires oxygen. Probably you'd have to import some and carefully recycle the resulting sulphates, if all your iron was only available in sulphide form. I suspect you'd need some kind of biological action to cause that to happen, though, and even then I bet that you could mine native iron if you just upped your prospecting game a little.
Of course, you could probably just take the force majeure approach and just chuck loads of energy into the problem, which will eventually solve any inconvenient chemical bond issue, but that feels a bit like cheating...
edit: for those who might be interested, the "force majeure" is basically boiling. Pyrite melts at about 1400K, and at somewhere between there about 2500K or so the Fe-S bond (or indeed pretty much any bond) will break. What happens after that depends on how soluble elemental sulphur is in liquid iron... it might vigorously outgas immediately, or you might have to electrolyse it or even raise whole the temperature of the whole lot to 3100K to boil the iron to drive it off. You probably don't have to evaporate and distill the iron, though. This is quite energy intensive, but less so than vapourising and ionising tonnes of ore and elctromagnetically separating it ;-) At that point, importing some icy chrondritic asteroids for your smelting operation might be the simpler solution, though...
Comment: 'Inconvenient chemical problems? Just heat it up. Soon enough you'll have a whole new set of problems!'
Comment: @JoeBloggs superheated sulphur gas is clearly a _physics_ problem. Just be thankful you don't need to distil the iron, too...
Comment: There are techniques in the works to do primary iron smelting (reducing iron oxides to metallic iron) electrolytically...
Comment: @Shalvenay they're probably applicable to sulphides and chlorides too. Not really sure what other forms you might find iron in... its weird enough having no oxygen, given its cosmic abundance.
Comment: Not a bad answer, but an absence of water is not a given. A hydrogen-dominated atmosphere allows for water, but not oxygen. Iron is such an environment is likely to be either dissolved in water (and not bonded with oxygen), or I suspect if some kind of reductive biochemistry has evolved there, iron sulphide based biomineralisation is possible, so the primary source of iron ore may be shell, bone, and teeth!
Comment: @ArkensteinXII the presence of water implies trivial access to oxygen (thin atmosphere inner planet means lots of solar power, obviously) and that means the smelting issue can be solved quite straightfowardly, which isn't really so interesting to think about.
Answer: While there would be specific methods used depending on the ore and nature of the environment, I'm going to assume there is a high tech society or entity actually doing the mining (a sort of space mining operation), which can be applicable to almost any environment.
A source of high intensity heat energy is needed, such as a large solar mirror or electric arc furnace is needed in order to take the ore and not only vapourize it, but bring it to a high enough temperature that it can be ionized.

Mirror for solar furnace
The second item needed is a mass spectrometer scaled for this operation. The plasma is fed through the spectrometer and different ions separated by the magnetic field. The iron is then fed into a cold trap and condenses onto the collector. This is actually very pure iron, which has different properties from what engineers usually work with. If the spectrometer is advanced enough, other plasma streams could be mixed into the iron stream to create alloys like steel that have the desired properties for the customer.

Principle of a mass spectrometer
Combining these two devices allows you to separate and combine elements in any order you like. Adding an advanced deposition system and programming allows you to "3D" print almost any item: this is a form of "Santa Claus Machine"
Answer: Iron ores exists in multiple forms: iron oxides, iron sulphides, dissolved iron in water and nickel-iron metal.
For a world without oxygen, it will depend on whether there were any water on this world.
For native Nickel-iron which is found on most celestial bodies that does not have any atmosphere nor water (deposits will come from iron-rich meteors, which will not be oxidized, and is available even with total planetary differentiation that sank any primordial iron into the core), all you need is a magnet(you won't even need magnets if your world is of class M, which means there was a high content of metallic iron, as just sawing off a part of the ground will yield malleable metal) to collect the granules of iron from the regolith.
For iron oxides (which is often found co-located with silicates), you have two choice:
if The world have water in the form of ices or a liquid ocean(as for prebiotic earth), then you could probably dissolve your rocks using an acid(depends on what other elements are found, acids are generally made from the respecting salt/salty materials using diaphragm electrolysis from the anolyte. hydrochloric or sulfuric acids may be used, as these ions are often found in ices, volatiles and prebiotic oceans. The resulting solution is then electrolyzed in a diaphragm cell again, depositing iron on the cathode and regenerating the acids (along with oxygen) in the anolyte. The water and acids in this process is purely catalytic, as it is regenerated in the reaction.
For worlds without any water deposits, if you can't import any hydrogen/water as a catalyst, the Thermite reaction will be extremely useful when it comes to refining iron. First, most rocks on the surface of many planets will generally be a mixture of alkaline metal oxide, silicon dioxide and aluminum oxide, with the occasional calcium thrown in. This composition generally melts at 1200 degrees C maximum, and depends on the exact rock composition, can either have viscosity as low as cooking oil or as high as taffy candies. Electrolysis of the molten rock using platinum electrodes(as they don't wear out) yields alkaline metals at the cathode and oxygen gas at the anode, alone with silicate glass. Divalent cations like magnesium, calcium and iron will also be deposited. The high temperatures will force these metals to vaporize, and this mixture of metals will be used to reduce any oxide ores to the metal. Depends on the rock type, the electrolyte will start to thicken as the reaction progresses, and should be replaced when the conductivity of the molten rock have dropped below economical values.
Any iron in this molten rock can be easily harvested, as it will plate out on the cathode first, and the mixture of reducing metals can now be used to reduce the actual iron oxide ore using high temperatures. The trick here, is to use an excess of the reducing metal mixture, so the excess silicates inside the ore is being turned into silicon. The iron then drops out as a molten iron-silicon alloy, which can be purified using oxygen from the rock electrolysis cells, leaving behind silica glass. The slag is primarily sodium and calcium silicate, which can be electrolyzed to recover most of the sodium-calcium metal. Any aluminates would have been converted into aluminum metal before the alkali metal silicates have became irreducible due to being thermodynamically stable, and drops out of the solution as a phase-separated layer from the iron metal.
As This process removes silica from the regolith and iron oxide feedstock, in theory we could separate all the iron, silicon, alkali metals, calcium and oxygen from any given piece of rock. The alkali metal rich slags of the reaction can be electrolyzed, which recovers most of the mobile cations, and the residual silica-alumina reduced to elemental silicon using aluminum metal. The alumina product is then reduced using sodium, regenerating aluminum and oxygen. We have achieved total separation of the rock feedstock, and refined iron from the process.
For the iron sulfides, we can employ thermal separation followed by, depends on whether hydrogen is available, wet chemical or Thermochemical methods to refine the Ferris sulfide product. Pyrite breaks down into ferrous sulfide and elemental sulfur at above 500 degrees C, and the sulfur will start to distill over at 700 degrees C. Vacuum distillation can therefore be employed to reduce all the iron and other metal sulfides to the monosulphide variety.
The wet chemical method of separation uses an acid to dissolve the ferrous sulfide, generating hydrogen sulfide gas and an iron salt. The hydrogen sulfide is decomposed at above 500 degrees C, and the hydrogen gas is recovered to either reduce any metal oxides at high temperature, or reacted with a source of oxygen to generate water.
The iron salts are electrolyzed in a diaphragm cell to recover the iron as a powder on the anode, and regenerate the acids and oxygen gas on the cathode. The oxygen gas can be used to regenerate water from hydrogen or hydrogen sulfide(yielding sulfur).
If water is again unavailable, the iron sulfide can be roasted in oxygen gas derived from melt electrolysis of rocks containing mobile cations, and the sulfur oxides reacted with the alkaline metals to yield low melting metal oxides and sulfides, both easily electrolyzed to regenerate the oxygen and alkaline metals, while the sulfur is boiled off at the anode due to the high temperatures involved. Make sure you change the receiving container when the sulfur is gone and the oxygen starts to come out. (Fluxing the magnesium-calcium oxides with some more regolith may be necessary, but the sulfides can be easily melted and electrolyzed under mild conditions, leaving the oxides behind). As long as you keeps recycling your mobile cations into the metals using electrolysis, the roasted ore (or even the sulfide ore itself) can be reduced in a thermite reaction to finally yield molten iron. Make sure to electrolyze the slag to recover your reducing agent, and if the sulfide ore itself is what being reduced, the efficiency of alkali metal recovery can reach nearly 100 percent.
You also get elemental sulfur as the byproduct, which is handy to use as cement for your processing facilities and mines, as normal concrete won't harden without water.


Hidden video on iPhone

Question: I recorded a video and cannot find it on my iPhone 6. I know it's there because when I go to settings / general / about, I see that I have one video on my phone, but it does not show in photos. What's going on here?
Answer: It would seem that it could only be in one of two places (and perhaps a third in a stretch) if you recorded it with the built in camera app.

Photos -> Albums -> Videos (or Slo-mo)
Photos -> Albums -> Recently Deleted

As I'm sure you are aware, you can also see videos under "Photos" (left most tab), or under Albums -> Camera Roll. I suspect that you checked there, though.
If you tap and hold on a video, you can choose "hide". That will hide it from places other than under Albums so the first option above should still work even if you have inadvertently hidden the video.
There is also an extremely remote chance that it is in the Videos app. But, you'd have to have to specifically put it there using iTunes as a go-between, so again, it is highly unlikely.
By the way, my phone says that I have 119 videos and the camera app's videos album shows 119.
Comment: I recorded it with the iPhone and it's not in any of the places you mention. One thing though. I remember after recording, I picked up my phone and it made a noise like it was out of storage. I only have like 1 gb of storage left.
Comment: Could you record another video briefly and see where that goes?
Comment: Yes I did that too. That video shows in photos. And when I navigate to "about" thru settings, under "video" it says I have 2 videos. But I can only see one of them. Weird.
Comment: Have you tried hard-rebooting your phone (hold down power + home buttons until the Apple logo appears)?
Comment: I just tried that, no luck. I think the video is in the phones memory somehow and did not save because storage was too low.

Hidden video on iPhone


subclassing specialized generic class in swift

Question: I have a generic class DataSource over AnyObject.
with a subscript function to pull some items from the cache.
When I subclass of DataSource for example the subscript function stops getting considered an override and subsequently invoking it on an object of type SpecialDataSource will call the super class version.
class DataSource<T: AnyObject>: NSObject {
    var cache: [T]?

    subscript(idx: Int) -> T? {
        if let hasStash = cache {
            if idx < hasStash.count{
                return hasStash[idx]
            }
        }
        return nil
    }
}

class SpecialDataSource<T> : DataSource<NSNumber> {
//The following declaration will generate:
//subscript does not override any subscript from its superclass

    override subscript(idx: Int) -> T? {
        if let hasStash = cache {
            if idx < hasStash.count{
                return hasStash[idx] as? T
            }
        }
        return nil
    }

}

after experimenting with this in Playground i found that this would not have happened if the SpecialDataSource declaration was:
class SpecialDataSource<T> : DataSource<T>

I need the subclass to be based of a common object so i can stuff a few of them in a homogenous array.
so this declaration doesn't provide that option.
When i got this error it sounded like DataSource<NSNumber> is complete different superclass.
Any Idea whats going wrong here? Im trying to understand why my SpecialDataSource can't seem to override this function.
=============== Current Solution ===========
The only way i was able to work around this problem is by specializing the return type of the subscript to NSNumber, with that in place the override did actually do the job.
Not sure if there is a better solution. Please let me know. I will be happy to try it out.
class SpecialDataSource2<T: NSNumber> : DataSource2<NSNumber> {
    override subscript(idx: Int) -> NSNumber? {
        if let hasStash = cache {
            if idx < hasStash.count{
                return hasStash[idx] as? T
            }
        }
        return nil
    }

}

Answer: DataSource<NSNumber> is indeed a different superclass. Different code gets generated!
It's not really making sense that you're specializing the parent class to use NSNumber. What's the deeper intent / goal? What goes wrong if you follow the T pattern in both child and parent?
Suppose the parent class had another method xyz that used T. Well now that's been bound to NSNumber, so xyz expects an NSNumber. And any child class of course inherits the xyz method. But now suppose your child class is instantiated with NSString for T. What is the compiler supposed to do with method xyz for an instance of SpecialDataSource? Do you see the inherent conflict?
As "magically flexible" generics are, they actually come with quite a few very specific rules.
Comment: The idea of specializing the generic over NSNumber for example is just to be able to derive two different subclasses that can have the same base class so i can stuff them in a homogenous array
Comment: I agree with your example of xyz method, that makes sense to me too. I'm gonna try to consider different approach, not sure what yet
Answer: One option may be to define the subclass like this:
class SpecialDataSource<T, U> : DataSource<T> { ... }

That adds some complexity - SpecialDataSource now requires two generic types.
But it also adds flexibility. You could have superclasses of DataSource<NSNumber> or DataSource<NSWhateverYouWant>.
Also, I believe your subclass's subscript function would look something like this:
subscript(idx: Int) -> U? {
    if let hasStash = cache {
        if idx < hasStash.count{
            return hasStash[idx] as? U
        }
    }
    return nil
}

...and the override would not be necessary (I'm not in a spot where I could test this.)
Comment: I don't have a need second generic type for this class in this case :/


How to remove WooCommerce plugin dependency from Wootique theme?

Question: How to remove WooCommerce plugin dependency from Wootique theme? When I activate Wootique theme and click on "visit site" in wordpress it shows a message "WooCommerce must be installed".
Answer: actually, You can't!
you must have to install "WooCommerce plugin", if you are using this Theme,
because the theme's source code is referring to WooCommerce plugin's functionality for displaying category wise products.
see here for details
hope this will help you
Answer: There should be a php if ( function_exists('woo-something') call in the functions.php file. Look into it, that's how wordpress themes check for installed products.
You may resolve it easily or may have to do some serious editing, I can't say since I don't have the theme.


Do I need to own assets to prove to Canada immigration officer I will leave?

Question: Is it a must that I own assets, to convince the Canada immigration officer that I will leave at the end of my visit to Canada?
Comment: including some details about your country of citizenship might be helpful
Comment: It depends very heavily on your country of origin and (probably) the type of visum. As a German citizen, I only needed an ETA and the border guard basically waved us through without asking any questions other than "business or pleasure" at all.
Answer: There is no single thing that will ensure you are admitted to visit, and no single thing whose absence will ensure you are not. The officers look at a bunch of things to see if, overall, it's believable that you are just visiting and will go home afterwards.
If you have assets in your home country, that might persuade some officers you will return. Someone needs to look after your home, your business, your car, you would never walk away from all that. But it's not as simple as a checkbox. They look at the overall ties: job, family, education in progress, and so on as well as what you own and what would happen to those things if you didn't go home again.
I know people who have been admitted as visitors to Canada with no assets outside Canada. And I know people who have been refused when they had substantial assets. So, it's not a "must" but it may help as part of the overall picture of your ties to your home country and how much of a temptation it might be to just stay instead of going home.
Comment: "no single thing whose absence will ensure you are not" - I'd say there are plenty of single things whose absence will ensure that you are not admitted.
Comment: you can say that, but you're not right. People get admitted with no cash, with no return ticket, all kinds of things. There are some things, like a criminal background, where the presence of one single thing means you are excluded, but that's not what I wrote.
Comment: @KateGregory This is getting very tangential, but I am confused by your comment since you  literally (and I don't mean figuratively...) wrote "there is ... no single thing whose absence will ensure you are not". The comment disagrees by pointing out that there *exist* such things. Obviously your answer is great and useful. But it seems the comment is pointing out a logically correct if arguably not terribly important point. I'd say your hyperbole is useful and unlikely to be taken literally. But still the comment is useful just in case.
Comment: There's no ambiguity. The comment is wrong. Davor asserts there are plenty of "single things who absence will ensure you are not admitted." I say, in my answer and my response "no there aren't." The comment is not logically correct because it's not correct. I do literally and precisely mean that you can't name anything that "oh, you don't have X? You can't visit." Davor disagrees, which is fine, but Davor isn't magically and automatically right and my statement isn't hyperbole, it's accurate.
Comment: @KateGregory - I am yet to see anyone get admitted without a valid passport or a visa where one is needed :D
Answer: No, it is not a general requirement, many people who don't own any property or other tangible assets in their own country get visas from many different countries (including Canada) every day.
However, this will depend a lot on your situation. If you have other evidence that shows a good reason to go back (a stable, well paid job, studies to continue…), it may not be necessary. If you don't have such evidence, or there are other reasons which may make them think you have a strong incentive to stay in Canada (a partner or family in Canada for instance), then owning property back home may be a good way to prove you have "strong ties" to your home country and every reason to go back.
Each situation is specific and there is no magic formula. You need to convince them somehow that you have more reasons to go back than to stay. How you do that may vary a lot.
Answer: Not necessarily.
Short an actual immigration officer willing to share an answer, we can only make assumptions here. Mine is that a country ends up with a number of overstay/deportation/crime cases each year, and the immigration service is trying to find rules which could have prevented these people from coming to the country in the first place by refusing their visas. Those rules are then applied next year, and the cycle repeats.
The basic process for establishing such rules could be to calculate a correlation between each piece of data from the visa application and the fact that the visa applicant has broken immigration rules or not. If they notice that people with assets  have close to zero chance of overstay, they will weight proof of assets more heavily. If they realize that previous Easter Island visitors tend to commit violent crimes during their stay, they may refuse you a visa if you've had a visa of Chile in your travel history, even if you own assets, etc.
There is no single factor on your visa application that guarantees you will get a visa, and the weight of such factors changes with the geopolitical situation of the country in question.


Architecture of my application

Question: this is surely a basic question for most of you but it still giving me headache when I think about it.
I have a repository class that takes a domain name to be instanciated :
public class RepositoryUserAD :  IRepositoryUserAD , IDisposable
{
   PrincipalContext context;

   public RepositoryUserAD(string domainName)
   {
    if (string.IsNullOrEmpty(domainName))
       throw new Exception("the domainName cannot be null or empty");
    DomainName = domainName;
    context = new PrincipalContext(ContextType.Domain, DomainName);
   }

   public UserPrincipal GetUser(string username)
   {
    UserPrincipal foundUser = null;
    foundUser = UserPrincipal.FindByIdentity(context, username);
    return foundUser;
   }

   public void Dispose()
   {
    context.Dispose();
   }
}

And here is my problem. If I work like this it is ok but I do not like to have my context opened with the class and closed on the dispose of the class.
 I can also use a using block but then I am facing another problem because I lose my reference to the context and thus to the object, or at least to the properties I did not get first.
My architecture is the following
Repository r = new Repository();
Service s = new Service(r);

I am torn in two because in my general approach, I would have liked to be able to filter my query in the service and ask the repository to really fetch the data. But here with the AD, I cannot, open and close my connection at the Repository level, or I losse the flexibility and the repository is fetching everything.
Everything is not clear because it is not clear either in my head, I just hope someone might show me one way out of this s***.
Thanks for your support,
Comment: "I do not like to have my context opened with the class and closed on the dispose of the class"? Why not? If you really don't want to do that, you can require callers to supply (and dispose of) the context.
Answer: What does the Service class do ?
How about this:
public class RepositoryUserAD :  IRepositoryUserAD
{
   private readonly PrincipalContext context;

   public RepositoryUserAD(PrincipalContext c)
   {
       context = c;
   }

   public UserPrincipal GetUser(string username)
   {

    return UserPrincipal.FindByIdentity(context, username);

   }
}

By injecting the context into the repository, the repository is no longer responsible of deciding when to dispose the context.  The 'caller' of the repository is responsible for it, and this is a good thing, since the repository does not know if the PrincipalContext is still necessary a little bit later (by another repository for instance).
Answer: I'm assuming there's some reason you don't just create & destroy the context for each method, efficiency?
I would create a context factory that caches contexts somehow, e.g.
 public class ContextFactory {
       private List<PrincipalContext> contexts = new List<PrincipalContext>();
       public PrincipalContext GetPrincipalContext(ContextType contextType, string domainName)
       {
           PrincipalContext existingContext = contexts.First(item=>item.ContextType==contextType &&
              item.DomainName == domainName);
           if (existingContext == null) {
               existingContext = new PrincipalContext(contextType,domainName);
               contexts.Add(existingContext);
           }
           return(existingContext);
        }
    }
    public void Dispose()
    {
        foreach (PrincipalContext context in contexts) {
            context.Dispose();
        }
     }
}

Then in whatever scope you want to use this, create a new instance of the class and use it to get a context, and dispose of it at the end. If this was a web app, it would be trickier to use it beyond the scope of a single page, but you could create (e.g.) a session cache of contexts, and have the object also periodically dispose of them if unused for some period of time. Also this code will have a race condition so you need to deal with that but this is the basic idea. This is essentially similar to the way connection pooling works.
Comment: Actually , your fist statement "you don't just create & destroy the context for each method" was clear enough to provide me the solution.
Comment: Haha! Well, the simple answer seemed so straightforward, that I figured there must be something I don't know about the overhead of creating a context in whatever situation this is... but anyway glad it worked out.

Architecture of my application


Difference in FG from recipe

Question: I just finished my second Brew in a Bag (BIAB) and although everything went well, I had
a difference in my anticipated FG. The recipe and Brewmate was giving me a finaly gravity of 1.014 but it finished fermentation at 1.010. Any reasons why the beer didn't reach the anticipated FG? I achieved my original gravity of 1.050 and I mashed at 66°C-67°C.
Comment: There is a certain degree of variability when it comes to the yeast's attenuation.  Other factors include things like mash temperatures.  What temperature did you mash at?
Comment: +1 to @Scott, who should have posted this as an answer. You should not expect your FG to exactly match your recipe or software; rather that is an estimate based on estimated attenuation of sugars by the yeast (how much of the sugars the yeast eat) in theoretical situations. Yeast often perform differently than the estimate (high and lower) in real-world conditions. Did you hit your target OG?
Comment: Indeed if following a cake recipe you wouldn't expect to get exactly 1.5 inches of rise on a sponge cake simply as that is what the original author got with a different brand of ingredients of different ages mixed with different mixers and cooked in different ovens at different altitudes. It is the same here, you will get something very similar to the original, but it will not be exactly the same.
Answer: A possible cause could be when you took you SG the wort would have suspended particles from the malts. These particles in solution will effect the density of the wort and your reading. When left to settle by the time of FG reading these particles are no longer in suspension.

The density of a sediment-water suspension depends on the concentration and specific gravity of the sediments present in the mixture. If the suspension is allowed to stand, particles will settle out of the suspension and the density of the sediment-water suspension will decrease.

O.004 is quite a small difference (+0.5% ABV) and being lower shouldn't be anything to worry about just slight more alcohol. With wines/ciders it can make taste more dry.

Difference in FG from recipe


Relating a Polynomial equation to the characteristic equation of a Hermitian matrix

Question: This question arose out of mere curiosity. Given a polynomial equation and I happen to know that its roots are real (but not the roots itself). Does it mean it is the characteristic equation of a Hermitian matrix?      And if that is the case, could I just find the hermitian matrix and solve for its eigenvalues?. When I thought about it, looks like determining the hermitian matrix from the polynomial equation looks like a daunting task. Any thoughts on this?
Comment: What about a diagonal matrix?
Comment: You mean the diagonal matrix with the roots as the entries. But I don't know the roots other than the knowledge that they are real.
Comment: Okay, then the question becomes less trivial. A shame that I can't undo my vote to close:(
Answer: Let $K$ be a subfield of $\mathbb R$ (e.g., $K=\mathbb Q$) and $f\in K[x]$ be a monic polynomial of degree $n$ all of whose roots are real. We want to compute a symmetric matrix $A\in K^{n\times n}$ such that $f=\det(xI_n-A)$. By squarefree decomposition in $K[x]$ we can assume that $f$ has only simple roots (otherwise perform euclidean divisions to compute the squarefree decomposition, find a determinantal representation for each factor in this decomposition and use diagonal blocks).
Of course, the idea is to start off with the companion matrix $C\in K^{n\times n}$ of $f$ which represents the vector space endomorphism $$\varphi\colon K[x]/(f)\to K[x]/(f),\ \overline p\mapsto\overline{xp}$$
with respect to the canonical monomial basis. We know that $f=\det(xI_n-C)$. In particular, $C$ is similar to a triangular matrix and therefore $\text{tr}(C^k)$ is the sum of the $k$-th powers of the roots of $f$ for each $k\in\mathbb N$.
Now $C$ itself is almost never symmetric but $\varphi$ is self-adjoint with respect to the $L_2$ "scalar product" given by a measure whose mass is uniformly distributed on the roots of $f$ (we use here that the roots are simple so that this really gives a non-degenerate bilinear form). Denoting the usual scalar product on $\mathbb R^n$ by $\langle.,.\rangle$ and by $V\in \mathbb R^{n\times n}$ the Vandermonde matrix corresponding to the roots of $f$, this means that $\langle VCx,Vy\rangle=\langle Vx,VCy\rangle$ for all $x,y\in\mathbb R^n$. In other words, we have $C^TV^TV=V^TVC$.
Now the Hermite matrix $H:=V^TV$ of $f$ comes naturally into play. It is a Hankel matrix whose entries are power sums of roots of $f$. But these power sums are traces of powers of $C$ and therefore lie in $K$ and can easily be computed. The idea is to replace $V$ by another matrix $W$ with $H=W^TW$. In contrast to $V$, the matrix $W$ should have entries in $K$ and should be easily computed. But this is possible: Just take any $W\in K^{n\times n}$ with $H=W^TW$. You get such a $W$ even in a triangular form if you use the Cholesky decomposition of the positive definite matrix $H$.
Now $C^TW^TW=C^TH=C^TV^TV=V^TVC=HC=W^TWC$ and since $W$ is invertible (note that $V$ and $H$ are invertible since all roots of $f$ are simple) this shows that $WCW^{-1}$ is symmetric. So you can set $A:=WCW^{-1}$.
All this is folklore.
If you want a tridiagonal $A$ then you would have to perform Sturm's algorithm as indicated above by Denis. In fact, finding a tridiagonal $A$ is essentially equivalent to Sturm's algorithm, see the recent interesting work of Ronan Quarez:
http://arxiv.org/pdf/0811.2365v1.pdf
If the coefficients of the monic polynomial are itself polynomials in variables $y_i$ such that for each fixed real value of the $y_i$ the polynomial has again only real roots (cf. Garding's notion of hyperbolic polynomials), then you can still use the Hermite matrix to do something, see the recent article of Netzer, Plaumann and Thom:
http://arxiv.org/abs/1108.4380
Answer: You may even find an explicit real symmetric tridiagonal matrix whose characteristic polynomial is the one you give yourself, say $P$. The construction uses the Sturm sequence $(P_j)_{j=1,\dots,n}$ of polynomials associated with $P$. Then the matrix is constructed by adding a row/column at each step, to pass from $P_j$ to $P_{j+1}$.
See Exercise 92 in my list of exercises, additional to my book Matrices (Springer-Verlar GTM 216)
Comment: I went through your list of exercises. Unfortunately, I can't find a solution to them. Can you please provide a link for the solutions of the additional exercise problems. I believe working on it will greatly improve my knowledge in matrix theory. Thanks a lot.
Answer: This is a special case of the Inverse Problem of the spectral theory. One can construct such a matrix
(symmetric 3-diagonal) even with rational operations (without square roots).
This construction has a very nice mechanical interpretation.
I recommend
the paper of M. Krein, On a remarkable problem for a string with beads, and on continued fractions
of Stieltjes. This paper is available as an appendix to the book
Gantmakher and Krein, Oscillation matrices and kernels... which has been recently translated into English, MR1908601.
Comment: Thanks for the answer. I will definitely have a look at that work.


May I earn Aeroflot or Air France miles flying with China Eastern?

Question: China Eastern, Air France and Aeroflot belong to the SkyTeam alliance. I'm a frequent flyer in Air France and Aeroflot and now I'm going to purchase a China Eastern flight. May I earn miles with any of the loyalty programs I'm already working with?
Answer: For Flying Blue you will earn level miles and award miles, and the flight will count as a qualifying flight, but only if your flight is not booked into the Z, Q or G booking codes.
https://www.flyingblue.com/earn-and-spend-miles/airlines/partner/180/china-eastern.html
The usual exceptions apply.
As a frequent flier, your usual SkyPriority benefits will apply on China Eastern, provided your Air France or Aeroflot number is in the booking.
[Note, that you will probably earn more miles if you book the flight under an AF or KL codeshare, as this will accrue at the AF or KL rate not at the MU rate.]
Answer: The definitive guide on where you can credit miles to and how much you will earn is on wheretocredit. From that, you can see the earning rates on Flying Blue and Aeroflot.
Where to Credit provides mileage earning calculations for frequent flyer programs around the world. The site is not affiliated with airlines (nor do I have any connection to it) and the site owners accept updates by users if any mistakes are found.
Sample output:
Comment: While the link you provide is helpful and answers the OP's question, it's good in general to include a summary of the page you link to so your answer remains useful even if the link becomes broken later.
Comment: @davidvc Noted. Updated.


Why does the X-box 360 controller battery pack have an integrated breaker contact?

Question: People owning an X-box 360 with wireless controllers came across a phenomenon where older controllers were switching off randomly while playing or if they were moved too quickly. Me and everyone I know always blamed the battery contact springs being too short. Everytime the controller switched off it was completely normal to remove the battery pack and pull on the springs so that they would be a little longer and would press more tightly on the battery contacts.
A few years have passed and my Xbox was sitting unused in a storage box, until yesterday when a friend and I decided to play Halo 3. We put new batteries in the controllers and noticed that they struggled to stay on for even a few seconds. After playing a few hours with my benchtop power supply soldered to the controllers' contacts, I started to investigate further into this issue and took the controller apparat:
To my surprise I quickly found that the contact springs weren't the culprits after all. What's causing the switch-offs was a contact in the battery pack itself, that only closes the connection between the batteries if the pack is inserted into the controller. This is done with a little notch on the controller's back that pushes two metal pieces that connect the two batteries and closes the circuit.
Over time these metal pieces corroded quite a bit and the springs of the battery packs loosened up which resulted in really bad to nearly nonexistent contact between the two batteries.

Why all of this?
This seems like a point of failure that could have been easily avoided.
The only thing I could imagine is to avoid short circuits if a battery pack is thrown into a bag. Because of the missing connection a short circuit would be nearly impossible. But then I wonder who would use a battery pack in a way like this as it's just a fancy AA cell holder. Why not just take some extra batteries with you as swapping them out takes only a few seconds longer than switching to a pre-equipped battery pack?
I don't even know if the battery packs were purchasable without a controller as I can see no use in having more battery packs than controllers.
Am I missing something, or am I in inherent danger due to the bridge I've soldered between the contacts? (Just kidding)
Edit: I've just looked it up. There are a lot of aftermarket "battery holders" available. I guess mainly because of the above mentioned issue. I don't know if Microsoft ever sold original batterypacks.
Answer: The designers wanted it to only be powered once the pack is inserted and seated properly.
I would imagine the biggest concern revolves around consumer safety.
Comment: Yeah! You are absolutely right! But how is this any safer for the consumer?
Comment: @xeetsh possibly because it's impossible to short the battery out unless the tab is also held in.


How do I add file permissions with the command line in Windows Server 2003?

Question: I've tried using xcacls and cacls on a Windows Server 2003 computer but they all replace the existing permissions when I use /g. Does anyone know of a command-line tool that will simply add permissions?
Answer: Make sure that you use /G and /E (edit mode) together (and most likely /T as well).
For reference, here is the complete usage information from the command CACLS /?

CACLS filename [/T] [/E] [/C] [/G user:perm] [/R user [...]]
               [/P user:perm [...]] [/D user [...]]
   filename      Displays ACLs.
   /T            Changes ACLs of specified files in
                 the current directory and all subdirectories.
   /E            Edit ACL instead of replacing it.
   /C            Continue on access denied errors.
   /G user:perm  Grant specified user access rights.
                 Perm can be: R  Read
                              W  Write
                              C  Change (write)
                              F  Full control
   /R user       Revoke specified user's access rights (only valid with /E).
   /P user:perm  Replace specified user's access rights.
                 Perm can be: N  None
                              R  Read
                              W  Write
                              C  Change (write)
                              F  Full control
   /D user       Deny specified user access.
Wildcards can be used to specify more that one file in a command.
You can specify more than one user in a command.

Abbreviations:
   CI - Container Inherit.
        The ACE will be inherited by directories.
   OI - Object Inherit.
        The ACE will be inherited by files.
   IO - Inherit Only.
        The ACE does not apply to the current file/directory.

Answer: You can also try to use a tool from helgeklein.com, called SetACL.exe. Very powerful tool, try it.
Answer: If you take a look at CACLS, don't forget to take a look at ICACLS


Auto update everything without asking

Question: I find myself having to allow updates in the AppCenter two times a day. Is there a way to set AppCenter to automatically update in  the background without asking me?
Answer: As of elementary OS 5.1, packages in AppCenter are just APT packages (unless you've also set up your AppCenter to work with Flatpak packages).
Auto-update APT packages using a CRON job
You can auto-update all your APT packages on a schedule using a CRON job:

Open root's crontab file (we use root because the APT commands require root access):

sudo crontab -e

Append this line to the end of the crontab file:

0 7,19 * * * (apt update && apt -y upgrade) > /dev/null

Note the following:

This command is set to run daily at 7am and 7pm. If you need guidance with writing CRON expressions, search online for a CRON expression generator such as this.
The command will run APT as root to update and upgrade your packages. Any output (e.g. information, warnings, or errors) from these commands are discarded.

With this solution, you will still see update notifications from App Center throughout the day -- but they will be installed automatically on the schedule you set.

Auto update everything without asking


How do I prepare for the end, the Fields of Trenzalore and the fall of the eleventh?

Question: I know that the final episode of the 7th season of Doctor Who, "The Name of The Doctor", which is supposed to answer many questions and address many hints dropped in the last 2 seasons, has been leaked. I don't want any spoilers, but I'm sure anyone who watched it must have walked away thinking "God, I wish I'd watched x,Y,z." What episodes do I have to watch to prepare?
Comment: Series 5, 6 and 7 of the new Who.
Answer: I am not amongst those who have seen it already, but knowing what it's supposed to address, I think I would recommend the following:
The River Song Arc:

"Silence in the Library"/"Forest of the Dead"
"The Time of Angels"/"Flesh and Stone" [*]
"The Pandorica Opens"/"The Big Bang" [*]
"The Impossible Astronaut"/"The Day of the Moon"
"A Good Man Goes to War"
"Let's Kill Hitler"
"The Wedding of River Song"
"The Angels Take Manhattan" [*]

Items marked with a [*] are those I think are more likely to be optional. The rest I recommend because they either touch on the central mystery of the Doctor himself; or touch upon the "war" to prevent him ever getting to Trenzalore.
The Clara Oswald Arc:

"Asylum of the Daleks"
The rest of Season 7 part 2 (from "The Snowmen" forward).

Lastly, while I doubt they'll delve this far back, even in an anniversary year, the last two seasons of the Classic Series contain several episodes that attempted to set up a similar arc that sadly never played out because of the series' cancellation. There are actually quite a few resonances in Season 7 part 2 to this arc, but nothing very explicit. That said, if you have the time, you might find it interesting to see how an earlier generation envisioned playing out the Mystery of the Doctor concept.
Comment: Seems we were thinking along the same lines. I'd already rewatched all of those except Silence in the Library which is an interesting suggestion. I'll watch that now.
Answer: I would recommend definitely watching "The Pandorica Opens"/"The Big Bang" because from what I've read the 50th will revolve around the Doctor's reset of the universe in those episodes. I would gather that's why we've seen the crack again in "The Journey to the Center of the Tardis"...
Comment: Very cool. Thanks.and no way that's your real name...


Do we have $\mathbb{C}[G/N] = \mathbb{C}[G]^N$?

Question: Let $G=GL_n$ and $N$ its unipotent subgroup consisting of all upper unipotent triangular matrices. Do we have $\mathbb{C}[G/N] = \mathbb{C}[G]^N$? Here $\mathbb{C}[G/N]$ is the coordinate ring of $G/N$ and $\mathbb{C}[G]^N$ is the set of functions in $\mathbb{C}[G]$ which are invariant under the action of $N$, where the action of $N$ on $G$ is given by right multiplication. Thank you very much.
Answer: The question as stated is not well-defined because you will have to say how you consider G/N as an algebraic variety. There is however a canonical way of doing this, the buzzwords are "generalized flag variety" and "Plucker embedding". The coordinate ring of G/N are then the Plucker coordinates and these are indeed isomorphic to the N-invariant elements of C[G].


What languages should I know if I'm interested in building web applications?

Question: I'm interested in developing for the web and I'm curious what languages should I know besides html, css, javascript, php/python/ruby. I don't know much about c# or java to make a decision whether to learn them or not, are they used much in the field I'm interested in?
What other technologies should I look into ?
Comment: Yes, C# and Java are used frequently for building web applications, particularly if you're talking about business applications, as opposed to hobbyist applications.
Comment: It all depends of what you really want to do. If you plan to build small apps for small companies, you seem to know what it requires. Anyway I'd advice to learn python, and Linux shell command line, and the most powerful editor of all times: vim.
Answer: HTML and CSS are not programming languages.
Google App Engine supports Java. Microsoft IIS supports C#. If you're already familiar with html, css, js, php, python, and ruby, don't bother learning any more langauges, start programming!
You need to learn some SQL to interact with database.
Comment: "HTML and CSS are not programming languages." And neither are SQL. But they are still languages.
Comment: He didn't say HTML or CSS were programming languages; he said they are languages, and they are.
Comment: I don't see the phrase "programming language" anywhere in the question. But I agree with the rest of your answer: if he knows HTML, CSS, Javascript, and several languages suitable for server-side dev already, he doesn't need another programming language; and SQL will surely be the one important thing he's missing.
Comment: Yeah I know but I thought of including them otherwise I would of got a comment saying to learn them first.
Comment: +1: Good answer.  BTW, Google App Engine supports Python also.
Comment: Actually most comp sci nuts would say that HTML, CSS and etc. are technically programming languages. They are *declarative* programming languages. They may not be Turing complete, like all the *imperative* programming languages, but they still are programming languages.
Comment: +1 Excellent answer, you already know enough for the "interested in" stage, with the exception of SQL.  I would give another +1 for the HTML/CSS are not programming languages, they are document description models.  Far too many "programmers" that know only HTML/CSS.
Comment: A discussion about this: http://programmers.stackexchange.com/questions/28098/why-does-it-matter-that-html-and-css-are-not-programming-languages
Answer: You will need to learn SQL at some point and it's probably better to learn it sooner rather than later. You'll need to know a thing or two about databases no matter what framework or language you work in so the effort spent on learning SQL won't be wasted. Most frameworks and languages try their best to abstract the database access layer but it varies from language to language and you won't see the unity unless you know SQL. Lately there's a push away from relational databases but it's still a good idea to learn the basics of SQL simply because many of the terms and concepts have analogs in non-relational settings as well.
Comment: It should be noted that you only need to know SQL if you're using a SQL database.
Comment: If we were to get really picky we could note that you could probably get away with not knowing it even if you are (depending on platform and framework) but... one would expect a non-trivial application to need to store data and the odds are that it will be stored in a database (SQL or NoSQL, but more probably SQL) and words 7, 8 and 9 in the above answer are "at some point"
Comment: @Jason Baker: I disagree. An understanding of databases is required for any non-trivial web application and SQL has been around for a long enough time to have tons of documentation and streamlined learning resources. The same can not be said for other database technologies so SQL is a good entry point.
Answer: You will get away with knowing:

At least one object-oriented
language: Java, C# are currently
among the most popular.
Not languages per se, but framework(s) to go with them (ASP.Net, JSP, Spring or whatever)
SQL - for talking to databases
HTML & CSS (purists will argue these
aren't languages (personally I
disagree - what does the 'L' in
'HTML' stand for?) but whatever - you
still need to know them.)
JavaScript and the JQuery libraries.
XML - used everywhere.
English (not you personally, but
generally speaking, and in at least
two thirds of the world)

Over and above this: any other languages - Python or Ruby perhaps, *nix shell scripts, DOS for batch files, UML for requirements definition, oh and maybe some Klingon so you can socialise with your geeky colleagues*.
* before you all start downvoting, I'd like to point out that this last bit was ajoke ;-)
Comment: I thought the joke was about UML.
Comment: PS. @ChristopherMahan: Why? Do you speak Klingon ...?
Answer: To get a quick start, you might want to look at frameworks like Ruby on Rails, Django or Grails. To use them, you need to learn Ruby, Python resp. Groovy.
Those languages are relatively easy to learn, so if you are new to web application programming, you might want to start with one of them.
JavaScript, HTML, CSS are necessary in any case. You will probably need some SQL, too.
Comment: + for Javascript
Answer: Except the ones you listed, Java, ASP, .NET (and hence C#) and SQL are common in the Web world. However, it seems to me that many of those who use PHP and C#/.NET/ASP are not enjoying it. Few are fanatic of these technologies if they are also proficient in something else.
Also, you can't learn all of these properly in a reasonable amount of time. I'd recommend to test around, and stick with one web framework you like, and learn that properly first.
The one language of the above most likely to be useful in any case is SQL, so learn that first. As for choice of web framework, the obvious ones are Ruby on Rails, Django (Python), Pyramid (also Python). I don't know which exist on Java/.NET, sorry.
Google App Engine is cool, and uses a sort of almost-Django by default, but Pyramid runs on it also. And you can run Java, but I don't know what restrictions there are there.
Well, that's all the general recommendations I have. If you want me to get dogmatic I'd recommend you too use Python with Pyramid and SQLAlchemy for SQL access. But it's so much a matter of taste. :)
Comment: Actually, these days the .NET stack is pretty enjoyable to use for large-ish projects. While webforms was pretty horrible, MVC is very usable. On the back end, WCF + nHibernate make services and persistence relatively simple too. For quick and dirty stuff it's probably over the top
Comment: I disagree entirely with your take on C# and ASP.NET. While what you say was probably true a few years ago, I'm currently seeing huge enthusiasm amongst ASP.NET developers, far more than at any previous time in the seven or so years I've been working with the platform. Developers love LINQ, they love ASP.NET MVC, they're very excited about the Async functionality currently being previewed.
Comment: @Lennart: I haven't worked with PHP but my observation is that people complain about it *more* than they used to. I'm not sure if that's because it's getting worse, or just because alternatives to PHP are improving faster than PHP is.
Comment: @Job: I'm a BFG/Pyramid fan, myself. But using smaller frameworks is generally a good idea when you don't need most of the features of the big one.
Comment: OK, it could have changed lately without me noticing it. I've never used it myself, I just notice that the users complained and rather would use something else. Same with PHP. (This is of course all people who also know Python I'm talking abut here).
Comment: Google App Engine (GAE) has no relational database, so in practice people have problems using Django to the full extent. The ORM and many contributed applications probably won't work.
Comment: @Carson63000 I think a lot of people complain about PHP, as a lot of people use it very poorly and it can be used poorly, unlike a lot of languages which hold your hand a bit more.  Personally, I can't stand the ASP.NET MVC framework, but I think C#/F# are great.
Comment: @Lennart, what are your thoughts on using CherryPy in place of Django? When would or would not this be a good idea?
Answer: Definitely check out Django if you already know Python, it's a great web app framework, really easy to get started with (there are tutorials on the Django website) and very flexible.
Comment: @dan... Yeah very flexible until the brick wall.
Comment: really easy to get started - **definitely**. very flexible **up to a point**.
Answer: Just because no one has mentioned it yet, Flash with ActionScript 3 is a rather wide-spread solution for rich-media client-side applications. It always depends on what you want to develop.
I would rather suggest that learning Java or C# now from scratch would be a bit too much and probably couldn't really help your profile. With the languages you already know, you could in theory do everything you want (with the help of a little SQL, certainly.)
On the other hand, if you're at home in the Microsoft world, some ASP.NET stuff can't be wrong. And with C# and SilverLight, you can also do the things that you can do with Flash.
Answer: Not a language as such, but you should learn XML and XPath (and maybe XSLT).
As 5arx said, XML is used everywhere and XPath is incredibly useful at pulling information out of an XML document.
Answer: I think you should focus more on how to structure a well written website. That will follow all programming languages you'll ever learn. How should the site connect to the backend, what types of storage should you use?
Basically all programming langauges offer the same service, and most of them are so similar that once you learn enough you can quickly switch between them. Stop focusing on learning programming languages, they just come along for the ride. Focus on what it is you want to achieve.
Answer: If you're looking to do web applications that require many concurrent and/or long polling requests I would say you'd have to look into Erlang and/or Node.js for server side Javascript.


A variant of travel salesman problem in grid graph

Question: In this problem, a robot is moving around on a rectangular grid and try to traverse and cover the whole grid, but it can only go one direction until it hits the boundaries/obstacles or its own trace. The problem is to determine the starting position and the directions of robot so it can cover the whole grid (also in some situations there can be no solution). An example of this game is shown below, where the starting position is chosen to be near the lower right corner, in this example, robot fail to cover the whole places. The movement constraint of robot is similar to ricochet robot but this robot can only visit a place once. I want to know if this problem has been studied before and if there is efficient algorithm to solve it. Currently I just use depth first search to attack this problem, which is quite slow on a large grid. I think this problem can be transformed into a boolean satisfiability problem. I found that this problem is called full house and is published by Erich Friedman.
Comment: It seems your graph is a partial grid, i.e., a subgraph (might not be induced) of a grid (so a grid is the cartesian product of two path graphs). Hamiltonian path (and cycle) is well-known to be NP-complete for such graphs. So my guess is that your problem is hard as well.
Comment: Nice problem! Up to my knowkledge in this "formulation" (visit all cells) it hasn't been studied.
Comment: Perhaps you might be able to make a reduction from the Numberlink puzzle game, with the variant that every grid square needs to be visited. This is known to be NP-Hard, but in your case, you would only have one terminal pair, which makes things interesting, as this case is known to be polynomial time solvable. Very interesting indeed.
Comment: There was a paper released in 2016 "Traveling Salesman Problem in grids with forbidden neighborhoods"
Answer: This is similar (but not identical) to the game Zen Puzzle Garden. The important difference for the purposes of your question is that in ZPG you can also have "walkable" squares which the robot (or rather monk, in that game) can walk freely across without leaving a trace.
It is known that ZPG is NP-complete, but our proof makes critical use of these walkable squares and so it does not extend to this problem.
When I was working on the proof above, I spent some time thinking about whether it was possible to show NP-hardness without using walkable squares, but without success. As far as I know the question is still open.


What does it mean to be looking at something that is 13.5 billion years old?

Question: Reading up on the James Webb telescope and how the images from it show us the universe as it was 13.5 billion years ago has made me wonder what does this mean?
Are we in essence viewing the past? And if the universe is always expanding does that mean there is more behind these images?
Comment: And https://astronomy.stackexchange.com/questions/646/is-the-light-we-see-from-stars-extremely-old, https://astronomy.stackexchange.com/questions/39990/if-an-exoplanet-transit-we-are-seeing-is-13000-light-years-away-are-we-seeing-a, https://astronomy.stackexchange.com/questions/46870/is-the-information-about-space-we-have-old
Answer: Yes.  Exactly that. When we look at anything we see it in the past.  When I hold my hand 30cm in front of my face, I see how it was one nanosecond ago.  When you see the moon, you see it 1.2 seconds ago.  When you see Sirius you see how it was 8 years ago.  And when the JWST sees a very distant galaxy, it sees how it was 13.5 billion years ago.
As far as we know, the universe is unbounded in extent. it is much larger than the observable universe. So there would be more space behind it now.  However we can't see much more behind it. While the universe seems to be unbounded in space, it isn't unbounded in time.  The universe began 13.8 billion years ago, and so there is nothing to see that is older than that.
Comment: I meant to say behind these images, like if we're seeing the universe 13.5 billion years ago what exactly are we looking at? Would there be more space behind it now?
Comment: We are looking at how that galaxy looked 13.5 billion years ago.  As far as we know, the universe is unbounded in extent. it is much larger than the observable universe. So there would be more space behind it now,
Answer:
Are we in essence viewing the past?

That is the essence of a telescope. Telescopes are time machines that see into the past. Electromagnetic radiation (which includes visible light) travels at the speed of light. When one views even the closest star (other than the Sun), what one sees is the state of that star a bit more than four years ago. The star Betelgeuse is about 548 light years away. If it went supernova 500 years ago, we wouldn't know that for another 48 years. What we see on Earth is the state of that object when it emitted / reflected the radiation rather than the state of that object "now".
You mentioned expansion of the universe, which is why I wrote "now" in quotes. The concept of "now" becomes a bit fuzzy when relativity and expansion of the universe are brought into play.

Reading up on the James Webb telescope and how the images from it show us the universe as it was 13.5 billion years ago has made me wonder what does this mean?

It means that the JWST will be looking for electromagnetic radiation that was emitted when the first stars and galaxies formed, which was about 13.5 billion years ago (or maybe even a bit older than that).

And if the universe is always expanding does that mean there is more behind these images?

The universe hasn't always been expanding. One of the key concepts of big bang theory is that the universe formed about 13.8 billion years ago. The universe became clear about 370 thousand years after the universe formed. Before this, the matter in the universe was fully ionized, too dense, and too hot for electromagnetic radiation to travel very far before being absorbed (and re-emitted). We can see the signs of this clearing in the cosmic microwave background radiation. The few hundred million years between the this epoch (which we can see, in the microwave) and the formation of the first stars and galaxies is called the cosmological dark ages.
The JWST will not be looking into those dark ages, or before. It will be looking for those first stars and galaxies.
Answer: Welcome.
We're only seeing the "past" as it relates to photons. Yes, you are seeing the light from photons as they left that object when it was 13.5 billion light-years away, but the light from that object will have to travel much further to reach us due to that spatial expansion and recessional velocity, making it older than 13.5 billion years old by the time it reaches our sensors. For distances over 1-million light-years, the Hubble constant must be introduced to account for that expansion. And for distances smaller than that, the change is so small as to be negligible.
Cheers.


Angular 2 and Twig site builder

Question: I am trying to build a project combining Angular 2 and Twig. At a high level the angular app would basically be a site generator. In the project there is a views folder that would contain a number of different site templates, which are Twig files. One of the components makes a request for a JSON file, which provides specific site information like the title, header, content, etc. It also specifies some sort of config variable that tells Angular which template to pull. That template is combined with data in the JSON and the site is compiled.  Does something like this sound possible?
I found this project and the developer kindly updated it to support the latest version of Angular. I put together a basic project with the angular cli and am trying to get it to render a Twig file as a template. If I include the Twig file as a template string it renders fine. If I include it as a templateUrl like this:
Component
<code>import { Component, OnInit, ViewEncapsulation } from '@angular/core';
import { Twig } from '@manekinekko/angular-twig';

@Twig({
  selector: 'app-test',
  templateUrl: '../views/test.html.twig',

   context: {
       title: 'Angular2 ❤ Twig',
       content_1: 'blah',
       content_2: 'content 2'
   },
})

export class TestComponent implements OnInit {

 content_1 ='content 1';
 constructor() { }

    ngOnInit() {
    }

}
</code>
Template
<code>{{ content_1 }}
</code>
I am getting the error that content_1 is not defined, though it works fine as a template string. I am not quite sure what is going on. I know I have the template in a separate director than the component. Could that be the problem? Ideally I would want the app to work that way so I can have all the separate site template files in a separate folder.
I welcome any thoughts to a totally alternative approach as well. Thanks!
Answer: Not sure if you still search for a solution, but I found this to your problem:
<code>{{'{{' ~ aTwigVariable ~ '}}'}}
</code>
So your template part would be
<code>{{'{{' ~ content_1 ~ '}}'}}
</code>
Hope this helps :)
Comment: thanks, we decided to go a different route in the project, so i am going to close out this question.

Angular 2 and Twig site builder