How do I make Emerald Green Arborvitae grow as fast as biologically possible?

Question: I'm buying a bunch of these babies below to create a privacy screen in my backyard. I'm getting young ones and want them to grow as fast as I can make them grow. Is there anything I can do to make them grow extraordinarily fast?
Answer: The time you spend in preparation is as, or more, important than post planting time.

site location, cedars like access to water, not soggy and not dry
some shade is fine and full sun is tolerated if the soil is not too dry
a wide variety of soil types but I would avoid very sandy soils or soils low in organic matter
protection from winter winds. Cedars that are sited where they are exposed to cold drying winter winds or bright winter sun can suffer "burn" which can take years for new growth to hide
protection from animals. Rabbits and deer will eat cedar if there is not much else about.
proper spacing. These plants can be twelve feet tall and four feet wide at maturity. Allow space for them to reach these dimensions. Plant at least two feet away from fences.
planting hole. For a hedge plant at two foot spacing. Dig a hole at least as deep as the root ball and about one and a half times as wide as the root ball.

Post planting

lack of water is the most frequent cause of dieback.  Water frequently and thoroughly in the first year. In subsequent years water during the summer if it's dry and water thoroughly in the autumn if you have cold winters
prune the top of the cedars back six inches spring or fall to get a bushier plant
mulch the planting area

What you don't need to do

bonemeal does not cause faster growth
fertilize more than once a year.
add good soil to the planting hole.  Use the local soil.
Answer: There's an interesting piece of research online carried out in June 2005 at the Connecticut Agricultural Experiment Station, and published in the Horticultural Research Institute Journal; one of the subjects in the trial was Thuja Emerald Green. Under control conditions, they were planted with various amendments (bio gels, mycorrhizal fungi and various other products) with a control which had nothing added other than 3 inches of pine mulch at first planting, and a year later. Most were finger weeded in the immediate area during the two year trial period where necessary.
The results show that the Thuja planted with nothing but the addition of a 3 inch layer of pine mulch on top of the soil did better than all the others - the mulch was applied at planting time, and then again a year later. The conclusion from the trial was that this worked best because the mulch retained moisture and kept down weed competition to the plants, though there is a caveat - it depends on the state of your soil currently as to whether they would benefit from other treatments. If your soil hasn't recently been brought in from elsewhere, or been graded or disturbed greatly, and it isn't particularly prone to drying out completely, then planting with the 3 inch mulch of pine would seem to be a good choice. If your soil tends to dry out rapidly, the addition of Soilmoist Gel into the planting hole, around the roots, will make a difference, but the mulch should still be applied.
Otherwise, Kevinsky's answer gets a vote from me.
Answer: Thujas like a fair amount of "food" to jump start them after xfer/transplant. Purchase some sort of evergreen fertilizer product ("M Roots" is one name brand) that has a mycorrhiza element within it as these are the fungi that help with the nutrient transfer for a healthy plant. Also, we have used a 1:1:1 mixture of organic compost, loam, and peat moss for the process of back filling the root ball in the hole. Avoid "dirt" with a high rocky content...if the original dirt from the hole is good, you can use that with the compost and peat... but avoid clay heavy or rock heavy soil. Sandy soil is ok though...but add a bit less peat and a bit more loam if that is the case.
Answer: Depending on your space...STAGGER your plants making an equilateral triangle between 3 plants.  2' distance on each side or more (how high did you want to make this hedge?). 2'is great for a 6-8' hedge.  Leave more distance for a taller hedge. If you see one of your arborvitaes begin to 'flag', a particular branch versus all over, get it diagnosed (Cooperative Extension Service).  It might be a very virulent disease and you'll want to get it out of there...soil and all.  But if you lose one or two having planted in a staggered row, it won't be as noticeable if at all.
Make sure that you do not dig the hole any deeper than the height of the root ball.  Trees and shrubs, woody plants, have a very distinctive line between ROOTS and STEM.  Only the roots get covered with soil, the woody stem cannot be covered with soil, mulch, paper, rocks...this allows bacteria needing moisture to start decomposing the bark/stem.  Very shortly this will effectively girdle your tree or shrub, a year or two.  I even plant leaving an inch or two of the rootball out of the soil so that I can add mulch.
I once used Thuja plicata 'Virescens' for a screen.  I made a 'hedge' in a more natural way, grouping 3-4 at 5' oc making a break (a small grove of elderberry with dark purple leaves) then adding 2 more Virescens Cedars (thick, fast-growing, narrowly pyramidal tree), one staggered front, the other rear, another matching elderberry and then a grouping of 3 Virescens.  Just an example...within 2 years we had a dependable, low-maintenance privacy screen.  In 9 more years, we still did not have to prune the tops of the trees and we had an oasis.  Great for the wind, too.  At the time, the Virescens cedar was less expensive than the arborvitae for the same height.


Transferring image from one window to another

Question:
As per the diagram shown, my inside window looks out on a shared hallway, not the outside. Using mirrors or optics, I would like to be able to see the tree and sun from inside. I can't alter the shared hallway, and I would like the solution to take up as little room inside my own space as possible. I'd also prefer the image plane be vertical, as if it were a window. How might the image be transferred?
Comment: web cam + large flatscreen monitor?
Comment: Start by getting some pictures through your window at different angles.  That will provide what you have to work with.  From there you'd have to figure out where you want to be standing to see what you photographed, and draw your line of sight and the line you photographed from as the constraints for your optics.
Answer: The simplest solution would be to use a periscope. You need to be aware of a few points - mostly that light travels in straight lines and that when reflected on a mirror the angle of reflection is equal to the angle of incidence (hence a 45° mirror will turn the light by 90°).

Figure 1. Getting closer to the aperture increases the field of view.
A viewer at B will have a wider field of view than a viewer at A. In your case the closest you can get to the window will be the height difference between your eyeballs and the centre of the window + a bit!

Figure 2. The periscope.
Here you could optimise the mirrors to give a good view from one position - your desk, perhaps. As you move about the room the view will change. Changing your eye-level will cause an image shift. Moving left or right might be OK if the windows are wider than your mirrors.
Other considerations:

The top mirror may cause some loss of overall daylight in the room.
Overhead mirrors pose a life-threatening hazard. I don't know if you can get laminated or safety mirrors but I suspect there must be some form of safety glass used in sliding wardrobe door mirrors.

I suggest that you make a scale mockup from a cardboard box and a couple of pocket mirrors to get a feel for it. You could use a laser pointer to check your field of view from any position (the head position in Figure 2), sweep it up and down, left and right, and see the results. Then do a drawing to figure out the smallest mirror sizes that will do the job.


When freezing jalapeños, can I leave the seeds in?

Question: When cutting up the jalapeño, can I leave the seeds in them if I just lay them on a tray, freeze, then put them in my Seal a Meal? Do you think I need to blanch them, and if so can I leave the seeds in?
Answer: You can certainly leave the seeds in (there is no food safety issue), but the peppers themselves will be affected by the freezing.  Peppers have a tendency to be somewhat mushy when thawed out.  That's usually fine in when they are cooked or put in something soft, but may not be great on something like nachos. Blanching is only needed if you want to peel the peppers or if you're cooking them after thawing them anyway.


Changing TF300 keyboard dock to Icelandic

Question: I have a Asus TF300 keyboard dock that has an American-style qwerty layout. Is it possible to change it to Icelandic, so that I can type in Icelandic letters from the keyboard dock?
Comment: Did the answer help you?
Answer: Try External Keyboard Helper.

A non visible soft keyboard (Input Method) intended to be used with hardware Bluetooth and USB keyboards. It automatically brings up the Input Method dialog when Bluetooth keyboard connects or disconnects (on some devices this can also be made to work with USB keyboards). It supports a lot of different keylayouts also provides a lot of configuration options.


Ubuntu 14.04 install problem

Question: After installing Ubuntu 14.04 and entering my password the screen freezes.
I have tried reinstalling a few times, but the same thing happens.
Any ideas?
Please help urgently.
Answer: Try reinstalling ubuntu desktop.
First, access tty command line by pressing on the login screen Alt+Ctrl+F1. And you'll need internet connection, which you can get in the login screen.
Reinstalling ubuntu desktop:
sudo apt-get install --reinstall ubuntu-desktop
sudo shutdown -r now

Last command reboots the system.
This might be a graphics driver issue as well, so if reinstalling ubuntu desktop didn't work, you could try moving onto graphics drivers. Of course it's much more lengthy process and a little more tricky. Do you know what's your graphics card ? If you dont you can find out using sudo lshw -C video | grep product.
I've found how-to thread on ubuntuforums about nvidia drivers: http://ubuntuforums.org/showthread.php?t=2081649
And for ati driver: How to install Radeon Open Source Driver?
Let me know if that helps
Answer: if it installed well and only crashes when entering to unity(default desktop), that's probably the issue. before entering the passw press ctrl+alt+F1 and log in. then try to install kubuntu-desktop  -> sudo apt-get install kubuntu-desktop
it's heavy and is gonna take a while. Then restart the computer and log-in using kde instead of unity(a little button next to username).
Answer: This happens when when your drivers are not compatible with your hardware.so u need to download the compatible ones.

first of all open the grub menu by clicking f6 or f7 when ur PC starts(depending on ur PC)and then open the OS in advanced-> recovery mode and then click on fail safe X mode and if it shows that you are low on graphics,cannot detect screen and devices then the problem will be mostly due to the driver.
Now depending on your hardware install the drivers from the internet whether its nvidia drivers or ATI etc.
Then go to the setting option->software and updates-> additional drivers->then selct anyone of the drivers and then click on apply changes and then restart your PC.

This will do your work if the problem is with the drivers.
for detailed description check this out (askubuntu.com/questions/141606/…) contains all the description of low graphic mode.

Ubuntu 14.04 install problem


Which photo sensor should I use in dust prone areas?

Question: I am trying to automate the street lights near my house by using a photo sensor.
But before even starting I thought of asking if there is any way of sensing light in dust prone areas, since I don't want to use a sensor and then keep cleaning it to remove dust.
Comment: You are authorized to control street lights near your house? This should be interesting! Seriously though -- are you just trying to detect day/night (so the photosensor could be located anywhere it can see the sky), or are you trying to detect the light from the lamps and modulate it with some sensitivity?
Comment: trying to do both actually ....
Answer: The sensor housing should be smooth so that it cannot accumulate dust. The sensor housing should be mounted so that rain and wind wash away any accumulation. This can be established by testing different sensor housing materials and shapes over a season.
There are special nano-materials which prevent dust from sticking to a surface, but I doubt you will need these.
If you simply must allow for dust to accumulate on the sensor housing, you can put two sensors in the housing. One sensor watches the sky. The other sensor looks at an LED with fixed brightness--a light reference. When the LED sensor detects loss of light due to dust, the gain of the sensor which watches the sky can be increased.


Why does the inner product require the base field be $\mathbb{R}$ or $\mathbb{C}$?

Question: I've often wondered why it seems inner products only ever use $\mathbb{R}$ or $\mathbb{C}$ for the base field of their vector space, or sub-fields like the algebraic or construct-able numbers. According to Wikipedia, these are the only fields we can use which have the right properties. Why? Why not use other, stranger, more complicated fields? What breaks down if we do so, and is there a meaningful generalization? What does it say about the inner product to have these restrictions?
Comment: Anyway, inner products are certainly used for other fields, for example finite fields.
Comment: Here is where the Wikipedia article says that it only works for real and complex numbers:

https://en.wikipedia.org/wiki/Inner_product_space

>There are various technical reasons why it is necessary to restrict the basefield to R and C in the definition. Briefly, the basefield has to contain an ordered subfield in order for non-negativity to make sense,[5] and therefore has to have characteristic equal to 0 (since any ordered field has to have such characteristic). This immediately excludes finite fields.
Comment: >The basefield has to have additional structure, such as a distinguished automorphism. More generally any quadratically closed subfield of R or C will suffice for this purpose, e.g., the algebraic numbers or the constructible numbers. However in these cases when it is a proper subfield (i.e., neither R nor C) even finite-dimensional inner product spaces will fail to be metrically complete. In contrast all finite-dimensional inner product spaces over R or C, such as those used in quantum computation, are automatically metrically complete and hence Hilbert spaces.
Comment: Can you document where Wikipedia says these are the *only* fields which we can use for inner products? Or do they simply omit consideration of other possibilities?
Answer: The comments point out is that your original assumption isn't really correct (although the reals and complexes are very common choices).
One thing that you often want is for the field to not have characteristic two.
If you do, the relationship between "squared distance" (by which I mean $\| v \|^2 = v \cdot v$) and inner product gets messed up: you can no longer recover the inner product from the distance via the polarization identity, which reads (in two forms):
$$
\| x+y \|^2 = \| x\|^2 + 2 x \cdot y + \|y\|^2 \\
\frac{1}{2}\left( \| x+y \|^2 - \| x\|^2 - \|y\|^2 \right) =   x \cdot y
$$
Recovering the inner product from the distance requires dividing by $2$, which isn't possible in characteristic $2$. (This peculiar annoyance, for integer quadratic forms, leads down a whole interesting trail to something called the Arf invariant, which actually matters in the topology of 4-manifolds, and perhaps $4k$-manifolds...it's been so long that I've now forgotten.)
Comment: I've edited my question to account for certain subfields. I guess the motivation for my question is how inner products of complex vector fields are sequilineear, and I wanted to know if there was a generalisation of sequilinearlity for arbitrary fields and what that meant conceptually, even if just to put the complex and real cases in context. But I found that the normal definition apparently implies the base space can only be real or complex (which you have denied). So how do we generalize?
Comment: I defer to @LeeMosher, who's more current on such things than I am. It's a pity you changed your question, because it makes the answers you've already gotten look foolish, which isn't very polite.
Comment: My apologies, I had thought it was the right thing to do given the site's focus on useful, targeted questions and answers. I thought that the oversight in my original question made it inane and not worthwhile.
Comment: What you can do is to keep the original form of the question on top, but then add a new heading like "Additional comments" or "Edited question" below that.
Answer: If the field is $\mathbb{R}$ or $\mathbb{C}$ you have the order structure of $\mathbb{R}$ at your disposal: directly if you get $\mathbb{R}$ or by requiring that the product is actually hermitian in the case of $\mathbb{C}$.
This allows you to prove Cauchy-Schwarz inequality (you have nothing similar in the context of a generic field), and then it follows that $||x||:={\langle x,x\rangle}^{1/2}$ is actually a norm so, if you define $d(x,y):=||x-y||$, you have a (homogeneous and translation invariant) metric at your disposal on your initial vector space that allows you to use the instruments of metric spaces.
This is not the whole story: using orthogonality (that you can state also in the case of a generic field) and the fact that you have an order structure (and now you need $\mathbb{R}$ or, thanks to the hermitian trick, $\mathbb{C}$) you can prove Bessel inequality, that allows you, for example, to prove Riemann-Lebesgue lemma. Also, if you require the completeness of the metric, what you get from Bessel inequality is that, given an arbitrary orthonormal set, for each element of the space, the corresponding Fourier series is norm convergent and, if the orthonormal set is actually complete, this series converges in norm to the element that originates it: you have got Parseval identity. Then you have the machinery of Fourier series at your disposal.
A final note: you may wonder why not using just an ordered field at this point. In fact, also in this case, you get both a generalized form of Cauchy-Schwarz and Bessel inequality. However, now a problem pops up: if your ordered field hasn't the least upper bound property, you can't get only from Bessel inequality the convergence of the Fourier series. So, because there exists (up to isomorphisms) just only one ordered field that has the the least upper bound property (i.e. $\mathbb{R}$), basically you have that the Fourier series machinery works only if your ordered field is $\mathbb{R}$.


Regular language under intersection and complement confusion

Question: I know that regular languages are closed under closure properties. But, for example, we know if $L$ is regular, then its complement $L^\complement$ is also regular. If we have $L_1$ and $L_2$ as regular then $L_1 \cap L_2 = L_3$ makes $L_3$ regular. Now for the case of when $L$ is not regular, then its complement $L^\complement$ is also not regular. But when $L_1$ and $L_2$ are not regular then $L_1 \cap L_2 = L_3$ doesn't make $L_3$ not regular, why? does being closed mean for non regularity too?
Comment: Just a simple observation. Take any two language, be it non-regular, with no common strings. Their intersection must be $\emptyset$ which is regular. In general, I think the intersection can be quite arbitrary depending on the languages you are intersecting, so it can either result to a regular language or not. I am not 100% sure here so I am just making this a comment.
Comment: https://cs.stackexchange.com/q/14462/755
Answer: Non-regular languages are not closed under intersection.
Let $L_1 = \{aa^nb^n \mid n \ge 0\}$ and $L_2 = \{ba^nb^n \mid n \ge 0\}$.  Then $L_1 \cap L_2 = \emptyset$ is regular, but neither $L_1$ nor $L_2$ are regular.
Answer: Intersection of 2 non regular languages means the languages could be anything other than regular, and each class of languages have their own set of closure properties. The problem of finding which class a language belongs to is undecidable.


Removing suspension springs of a washing machine

Question: This is one of the springs that the drum of a washing machine is attached to. Now I want to go further into that washing machine, hopefully up to the electric motor. First I need to remove that cross-bar kind of thing which the other end of the spring is hung onto. Please suggest me some safe ways to get the spring off both the drum and the bar
Answer: To get the spring out begin by removing the weights (the concrete-like block in the left part of the photo). One of the studs holding that weight is just barely visible. There must be a nut just out of our view; you might need a deep socket for your socket wrench in order to reach and turn the nut. With the drum weights removed there'll be much less tension on the springs and you'll be able to lift and unhook them easier.
If your objective is to service the motor you may be going about it the wrong (hard) way. There would usually be an access panel on the rear of the washer for reaching the motor, drive belt, etc without disassembling the drum.
Comment: I removed the nuts and the concrete block is free to move upward but that bar stands on the way, prevents me from taking block away.
Answer: Stick a crow-bar into the spring between two rotations of the coil's helix, near the top, and apply upward force to take the weight off its upper hanging point.
If needed, brace the crow bar on a temporary brace of some sort, so you have some leverage.
Then unhook or uncurl the spring, and VERY GENTLY release the force.
Best to make sure the drum is supported underneath, with some wood, so that it does not collapse if you wish to remove more than one spring.


Why didn't copper act as a reducing agent

Question: In lab, we took $\ce{CuCl_2(aq)}$ and poured it into a cup. Then we took some aluminum foil and put it inside and started to stir. I could see the aluminum getting eaten by the copper because it was a better reducing agent. However, when I put silver instead of aluminum, nothing happened. I know it's because the standard cell potential of silver is greater than that of copper, but why didn't the copper act as a reducing agent?
Comment: What would the copper reduce?
Comment: Cu++ from CuCl2 has already given its electrons to 2 Cl-.  Aluminum *metal* is the reducing agent, giving them back to Cu++ --> Cu metal.  Similarly, Copper *metal* would reduce Ag+.
Answer: Copper is already oxidized as $\ce{Cu^2+(aq)}$ and silver reduced as $\ce{Ag(s)}$. Copper would act as a reducing agent in $\ce{Cu(s)}$ and $\ce{AgNO3(aq)}$ scenario.
Using $\ce{CuCl2}$ instead of $\ce{CuSO4}$ is a mistake, if $\ce{Ag}$ is involved, as forming insoluble $\ce{AgCl(s)}$ would complicate things. Eventually, $\ce{Cl-(aq)}$ may keep $\ce{Ag/Ag+}$ potential below or near $\ce{Cu/Cu^2+}$ potential:
$$E = E_{\ce{Ag/Ag+}}^\circ + 0.059 \log{[\ce{Ag+}]} =  E_{\ce{Ag/Ag+}}^\circ + 0.059 \log{\frac{K_{\mathrm{s},\ce{AgCl}}}{[\ce{Cl-}]}}$$
(simplified replacing activities by concentrations)
But, forming $\ce{AgCl(s)}$ layer would freeze it kinetically.
Answer: The answer lies in the redox potential chart:
Reactions:
$\ce{2 Alumimum metal + 3 Cu++ -> 2 Al+++ + 3 Copper metal}$
$\ce{2 Silver metal + Cu++ -> 2 Ag+ + Copper metal no reaction}$
Drawing the half reactions:
$\ce{Al+++ -> Aluminum metal   - 1.66 V}$
$\ce{Cu++ -> Copper metal       + 0.34 V}$
$\ce{Ag+ -> Silver metal        + 0.80 V}$
We can see why Copper ions react with Aluminum metal but not Silver metal.
Silver metal has a higher voltage potential to keep its electrons than both Copper and Aluminum metals. Aluminum metal (and Sodium) are strong electron donors.
In this case Copper metal sits right between Silver and Aluminum metal.  Copper metal will give electrons to Silver ions, and Copper ions will take electrons from Aluminum metal.  Silver metal and Copper ions will not react, nor will Silver metal and Aluminum ions.


How do I add my own OAuth server to OAuth.tools?

Question: I am trying to add my server to OAuth.tools. I clicked the Environment button as described in the getting started video. I see a long list of input fields:

Do I have to fill all these in myself?
Answer: There are a few different ways of adding an OAuth Authorization Server (AS) or OpenID Connect Provider (OP) in OAuth.tools:

Manually filling in the various endpoints
By providing an OpenID Connect issuer
By providing OpenID Connect or OAuth metadata
Using WebFinger and OpenID provider issuer discovery

The first option might seem like a lot of work, but it can be the only option at times. For a server that doesn't support metadata, this is the only choice. Such servers usually don't support all the endpoints listed on that page, so you typically would only need to fill in a couple.
The second option is helpful to quickly add an OP. Just typing in the issuer into the Issuer textfield and click Discover. This will append /.well-known/openid-configuration to the issuer URL and fetch metadata from there. If all goes well, the endpoint textfields will be populated automatically!
If the server doesn't support OpenID Connect metadata but OAuth metadata, the above option may not work in some cases because the URL might not end with /.well-known/openid-configuration. You may also have the entire metadata URL in your clipboard and don't want to delete the end part. In such cases, just enter the metadata URL in the textfield with that label and hit Discover. Again, if all goes well, the endpoints will be automatically populated. (If both the Issuer and Metadata URL fields are filled in when Discover is clicked, the later will be used.)
The final way is using WebFinger and OpenID provider issuer discovery. To use this, hit the Use WebFinger button in your screenshot there. Then, enter a resource. This could be an email address, host name, or other. If the server supports this and all goes as expected, the WebFinger modal will be closed and all endpoints will be filled in.
For an example of how to set this up using Google's identity service, checkout this answer.


Dimmable LED in ceiling fans

Question: The ceiling fan I just bought has dimmable LED lightbulbs. I want to replace them with a non-LED bulb. Does it have to be 'dimmable'? If so - what are the options?
Comment: Are the LEDs in the fan in the form of removable bulbs? What model of fan is it? Many new light fixtures are designed with only LEDs in mind and can't be used with less efficient bulbs which generate more heat, like incandescents.
Comment: If they are screw in type or Edison bulbs the maximum wattage in a ceiling fan is 190w , most lamp holders have a maximum wattage sticker on them of 60w but if 4 lamps still limited to 190w. It is possible that the fan lighting kit can not handle 190 but it would be clearly labeled as required.
Comment: Khrrck - Yes, they are removeable bulbs, The model is - 'home decorators collection - dimmable lights - COPLEY - 52 inch LED ceiling fan' purchased from Home  Depot.  Ed - they are screw in type.  I will check the maximum wattage. There are only 2 lamps.
Comment: what non-led (ok, and non-cfl) bulb isn't dimmable? you can use a pair of 8w incandescent bulbs, but that won't be very bright. Higher-watt incandescent bulbs are too hot to use.
Answer: Watch carefully for the fan's thermal rating, in two areas.

The actual rating of the bulb sockets - which should be labeled for a maximum wattage.  This is because too much wattage will make too much heat, and damage the fixture or start a fire.
The total wattage rating allowed by the fan.  Fans cannot support unlimited watts, and UL requires that a safety limiter circuit be part of the fan.

A fan built for the LED age may not have the thermal rating an older fan would - but the instructions and labeling are the final word on the subject (assuming the fan was actually approved by UL, CSA or ETL).
A third issue is if the fan does not have lamp sockets* or if they use a special lamp socket that is designed to reject incandescent lights.  In that case, the fixture is absolutely, positively not made for the heat of incandescents, and incandescents cannot safely be used at all, even with some sort of cheater adapter (which will not be UL listed, note).

* There is no reason for LED lights to be socketed, since the semicondctor emitters (these things) don't fail. They are semiconductors, after all.  You may have experienced LED screw-in so-called "bulbs" fail, but crack one open - you'll find semiconductor emitters, but also some power supply (driver) components.  Unless something went wrong with the heat sink (like being cheap), the driver will have failed.  I joke that the LEDs don't need to be socketed, the drivers do - and some lamp manufacturers aren't laughing - they actually did that.

Dimmable LED in ceiling fans


Geolocation failed on Android webview and browser

Question: I am facing a problem while working on Android Emulator. I am interested in setting the mock location through the LocationManager class and reading the geolocation in the Webview. I cannot read the location in the Webview where the location is read through the HTML5 geolocation API. I have tried on different versions of Android emulator (for API level 8, 12). I looked into previous questions at stackoverflow, but no luck. Let me know if I am missing anything.
I noticed the following issues in my implementation:

(In the logcat) WebChromeCliet was notified that the geolocation service failed to start.
I tried to set mock location through geo fix telnet command. I did not notice any corresponding information in the logcat messages.

Similar problem I noticed in the Android Browser. The browser also did not detect the location after geo fix command.
FYI, in my code,
1. The project settings include ACCESS_MOCK_LOCATION, ACCESS_FINE_LOCATION, ACCESS_COARSE_LOCATION

The emulator has the settings for "mock locations" and "GPS support". I also enable
geolocation and gps provider.

I will appreciate any help or suggestions.
Answer: In order to use html5 geolocation you have to use uses-permission android.permission.ACCESS_FINE_LOCATION. The html5 geolocation does not work when just coarse location is requested.
Alternatively, it might or might be possible to use uses-feature android.hardware.location.gps for an optional use, even though I haven't managed to have the html5 geolocation working with uses-feature (is it a limitation of the Android SDK?).


Copy paste field in Access vba

Question: I am trying to write an access macro in VBA and to start I want it to copy and paste all the information from two different fields in one table into a new table. Is there a vba command that would allow me to do this in access? Any help would be highly appreciated.
Comment: You should write a query for this - working with data in tables is done via querying, not via macros (you can run a query from a macro though but technically you are still moving the data with a query)
Answer: Charleh is right, but you can run "query statements" from VBA.  Here are a couple of examples;
If the new table does not exist, or you want to overwrite it then;
Docmd.RunSQL "SELECT tbl_Table1.str_Field_1, tbl_Table1.str_Field_2 INTO tbl_Table_2 FROM tbl_Table1;"

If the target table (#2) exists and you want to append the data from tbl_Table1 try;
Docmd.RunSQL "INSERT INTO tbl_Table_2 ( str_Field_1, str_Field_2 ) SELECT tbl_Table1.str_Field_1, tbl_Table1.str_Field_2 FROM tbl_Table1;"

You do not have to use the same field names (but they have to be the same type) in the second example i.e.
Docmd.RunSQL "INSERT INTO tbl_Table_2 ( str_Field_A, str_Field_B ) SELECT tbl_Table1.str_Field_1, tbl_Table1.str_Field_2 FROM tbl_Table1;"

Copy paste field in Access vba


Marketing Cloud - Journey Tagging

Question: I have noticed this (what appears to be a) "tagging" or label option (image below) available in my Marketing Cloud instance on the Journey Builder page, but it seems to be greyed out.  I have investigated the various ways (security options, journey configurations, etc.) to make it available to my users and me but have had no success (e.g. is there a way to tag/label respective journeys and then filter on those tags/labels). As far as I am aware, this feature is/was not available.  Am I missing something totally obvious as it relates to this button?  Has anyone else had any success in utilizing this?
Answer: Answer:  Missing something totally obvious.  (big eyeroll and cue more coffee) :-)
There is a checkbox to the left of each journey.  Once selected, you can then specify a tag (or tags) for the journey, etc.  (Screen shot below).
In other news - I did see, there was an update today (3/29/18) from a product manager on this idea (Create folder structure in Journey Builder):  https://success.salesforce.com/ideaView?id=0873A000000E4xvQAC that folder structure for JB was in development and planned for the June MC release.
Answer: Just wanted to share an update on this topic - since I had posted it some time ago.  Journey Folders (Folders for Journey Builder) will be in the June release (June 23) for Marketing Cloud.  Just an FYI for anyone who's anxiously been waiting for this feature!
https://help.salesforce.com/articleView?id=mc_rn_june_2018_journey_folders.htm&type=5

Marketing Cloud - Journey Tagging


Prove that Gramian matrix is Invertible iff $(v_1,...,v_k) $ is linearly independent

Question: Prove that Gramian matrix is Invertible iff $(v_1,...,v_k)  $ is linearly independent
$G=G(v_1,...,v_k) = [\left\langle v_i,v_j\right\rangle ]_{i,j=1}^k $

I have great idea to calculate $\det G$ and show that if $(v_1,...,v_k)  $ is linearly independent then $\det G \neq0$ and vice versa.
 Plan sounds good (?) but how to calculate $\det$ of this?
\begin{vmatrix} \langle v_1,v_1\rangle & \langle v_1,v_2\rangle &\dots & \langle v_1,v_n\rangle\\
 \langle v_2,v_1\rangle & \langle v_2,v_2\rangle &\dots & \langle v_2,v_n\rangle\\
\vdots&\vdots&\ddots&\vdots\\
 \langle v_n,v_1\rangle & \langle v_n,v_2\rangle &\dots & \langle v_n,v_n\rangle\end{vmatrix}.
Probably I should use some scalar product propeties but it isn't clear for me how can I do that.
Comment: Since $G=V^T V$, $\det(G)=\det(V)^2$ is non-zero iff $\det(V)$ is non-zero, i.e. iff the convex hull of $0,v_1,\ldots,v_n$ has a non-zero (oriented) volume.
Answer: Let $v_i=\sum_{k=1}^n a_{ki}e_k$, where $\{e_1,\dots,e_n\}$ is an orthonormal basis. Then
$$
\langle v_i,v_j\rangle=\sum_{k}\sum_{l}a_{ki}a_{lj}\langle e_k,e_l\rangle=
\sum_{k}a_{ki}a_{kj}
$$
and therefore, if $A=[a_{ij}]$, we have $G=A^TA$.
If $Gx=0$, then also $x^TA^TAx=(Ax)^T(Ax)=0$, so $Ax=0$.
The matrix $A$ is the matrix (with respect to the basis $\{e_1,\dots,e_n\}$) of the linear map defined by $e_i\mapsto v_i$, for $i=1,\dots,n$. The rank of this matrix is $n$ if and only if $\{v_1,\dots,v_n\}$ is linearly independent.
If the set is linearly independent, then $Ax=0$ implies $x=0$; thus $Gx=0$ implies $x=0$ and $G$ has rank $n$.
If the set is not linearly independent, then there is $x\ne0$ with $Ax=0$, so also $Gx=0$ and $G$ is not invertible.
Notes. If the inner product is over the complex numbers, then $G=A^HA$ (the Hermitian transpose) and the argument goes through using the Hermitian transpose instead of the transpose. An orthonormal basis exists because of Gram-Schmidt algorithm.
Comment: Thanks for clear solution


Time limit on ads

Question: I'm not at all against ads.  I don't block them.  I actually pay attention to the advertising on trilogy sites for benchmarking.  But, can there be a limit placed on how long a specific ad can be run before the advertiser has to replace it with a new image?  The "Free as in beer" Splunk ad comes up on SF on seemingly 80% of my page loads and is getting quite stale......
Comment: I agree about how annoying that ad is.  Unfortunately it probably stems from having too few other advertisers.  It wouldn't be so bad if it only showed up once in every ten pages.
Comment: ... and there's nothing worse than stale beer.
Comment: I **don't** feel bad about blocking a **particular** ad, which is borderline abusive. So far on SO it happened only to Splunk beer ad.
Answer: Perhaps have new advertisers submit 1 design for each week for the length of their ad slot.  So if they buy a month of advertising, they have to submit 4 substantially different ads that are rotated to avoid user annoyance.  If they buy one week, and extend it, they have to submit a new ad, and can choose to have just the new ad run, or both randomly.
Comment: My thoughts exactly.
Answer: Rich's answer explains one of the big reasons: who's going to build the banner creatives? Quality banners require both skill and time (and, let's not forget the meta-time involved with approving, revisions, etc), and investing that cost (just to reach the high-rotation goal) likely won't bring a return in value.
But then there's also another thing to consider. Many visitors won't notice or click on an ad without seeing it lots and lots and lots of times. I don't know what the numbers are (they vary by creative, location, etc), but since you visit the site a lot more than most, you'll naturally see a lot of the same ad more and more.
To prevent this from happening, we could simply disallow big/long campaigns. Or we could impose more non-industry-standard rules (in addition to no animation, no 3rd party hosting, reduced advertising, etc). Obviously, these would both have an impact on our revenue... so it really comes down to... is this feature/policy/rule worth everyone taking a pay cut?
Comment: I'm getting bored with the look and feel of SO. Could you guys change the whole site to be different every month?
Comment: @Alex : I know what you're saying.  I do amateur graphic design myself and have a brother in the profession so I know what's involved with creating them and the time/effort it takes.  If it's that much of a hit to put more stringent guidelines on them then fair enough, an annoying ad is certainly something I can live with (or choose to block).  But if the revenue's-a-flowin' then I stick with my request.
Comment: Gotta agree with that second paragraph. I only *remember* seeing the beer ad once - which is once more than I remember seeing most ads, but still... it *can't* be that rare if someone's complaining about it here. I'd rather have repetitious ads (that I can ignore...) than more flashy / creepy ads.
Answer: As a user I can see your point, but as an advertiser on Super User and army of 1, I'd find it hard to come up with a fresh supply of ads week on week. I agree that ads should be rotated fairly regularly, both to avoid annoyance and to stop them being ignored over time.
Rotating ads is a good idea anyway as you can get an idea of what works well and evolve them to snare more suckers attract more visitors interested in the finer points of home theatre.
It's worth noting that the nice ad weasels here will rotate your ads (I don't think they even do it manually) so there is no technical reason to keep the same one on permanent display. For example I originally had two sidebar ads that were rotated evenly, but dropped one because it didn't perform so well. When I get a chance I plan to create 2 or 3 more and add them to the rotation.
It may also be more annoying if the advertiser has paid for a greater number of views. With my tiny budget I think my ads are displayed about 10% of the time, if someone has bought a bigger share it will be on show more and maybe annoy more.
Comment: I hadn't thought about ad performance, but that's true.  In a group of ads, one ad will always have slightly better performance than the others, and this can be tested easily.  Once that's determined, why would the advertiser continue to show the poor-performing ads?  The simple fact is that this ad, as annoying as it is, is grabbing you eyes, and that is probably the reason they are still using it.
Comment: yeah, if you're going to link to something like that you need to note that it shows images one might not want on screen when the boss comes by...
Comment: sorry didn't mean to cause offence, thought I'd put an nsfw mention in there
Comment: Now I'm curious!
Comment: @voyager, it was a BoingBoing page featuring ads of the kind that Bill Hicks predicted, Google `bill hicks drink coke boing boing` for the nsfw version or see the description on this page: http://www.bbc.co.uk/dna/h2g2/A609563
Like I said, didn't mean to cause offence
Answer: I don't think I'd like this.
Currently I tend to notice a new ad.  The new ad gets a small amount of attention and very rarely a click to open in a new tab that I may or may not have time to follow up on.  Then it fades to the background.  If they're changing them up all the time then it's much harder to spot the new ones.  I end up having to ignore all the ads and space just becomes wasted - I may as well block them as there'd be no difference.

Time limit on ads


Distinction between tsere and segol in Yekkish pronunciation?

Question: I've heard that tsere and open-syllabic segol are pronounced the same in Yekkish (Western Ashkenazi) Hebrew. That said, everyone talks about how Ashkenazi is the only pronunciation with distinct sounds for every vowel (I know that they're talking about earlier Ashkenazi pronunciation, as well as varieties from other regions). Even if there is a distinction, I can't produce it to save my life if open-syllabic segol is pronounced [eː] (which I'm pretty sure it is). I intend on pronouncing open-syllabic komets as [oː] and choulom as [au] and it makes sense to have symmetry, but as stated I have trouble with that.
Comment: Welcome to Mi Yodeya Nathan!
Answer: While a lack of sources is unideal, as one of the resident Jekkes, I feel confident that I can provide an answer.
The long and short of it is that it depends on the Jekke. If you listen to recordings of Benno Weis ז"ל, you'll hear very little distinction between segol and tzere (recorded here in שני זתים).
On the other hand, R' Michael Friedman, chazzan of Khal 'Adas Yeshurun in Ramot (KAYJ) differentiates between the two vowels.
On a personal note, I try to differentiate between the two, although I'm more likely to render a tzere as a segol than vice-versa.
Comment: @Kazibácsi, he recorded the entirety of the Torah and it can be found on the Dartmouth Jewish Sound Archive
Comment: Do we have any Torah reading recordings available of Reb Weis?


Redirect empty search results

Question: What's the best way to deal with soft 404 errors from Google? I have hundreds of soft 404s which are empty search result pages. I don't really want to have to manually create url rewrites for all of them.
Answer: I think you should ask yourself why google is crawling this much dead ends on your site in the first place. There should be links to these pages on your site or you have disappearing content. Disappearing or moving content should be redirected using 301, 302. Dead links aren't good either. Your Google webmaster tools will tell you if you have it setup. I recommend doing so.
Magento's default search functionality isn't very helpful. I always recommend a search plugin to my clients. There are many available in different price classes. I especially like the one from Mirasvit as it frequently gives good results. It's also able to redirect straight to a product or CMS page if there's just one (obvious) match from this search.
Another option would be to redirect all 404's to home using 301's. There's even an free extension available for this on Magento Connect
https://www.magentocommerce.com/magento-connect/404-replacement-with-301-redirect-to-homepage.html

Redirect empty search results


When does it matter to use %d over %s when formatting integers to strings in python?

Question: Assuming I don't need padding or other formatting conversion, when does it matter to use %d over %s when printing numbers ?
From the snippet below, there seems to be no difference.
>>> "%d %d"%(12L,-12L)
'12 -12'
>>> "%s %s"%(12L,-12L)
'12 -12'

Comment: Is there a difference if you are using locales?
Answer: %s can format any python object and print it is a string. The result that %d and %s print the same in this case because you are passing int/long object. Suppose if you try to pass other object, %s would print the str() representation and %d would either fail or would print its numeric defined value.
>>> print '%d' % True
1
>>> print '%s' % True
True

When you are clear if you want to convert longs/float to int, use %d.
Answer: There is little difference in the basic case. The %d does allow you to do numeric formatting that %s does not. There is a also a difference in type checking. If you happen to send a non-int to %d you will get an error, but %s will happily stringify whatever it gets.
Python2> "%s" % ("x",)
'x'
Python2> "%d" % ("x",)
 <type 'exceptions.TypeError'> : %d format: a number is required, not str

Answer: There may be no difference in your case, but you can't do the opposite :
>>> "%d" % ("12")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: %d format: a number is required, not str
>>> "%s" % ("12")
'12'

Answer: It depends on whether you want a decimal or a string approximation of the true value. Check out the docs.
>>> "%d %d" % (12, -12.9343)
'12 -12'

>>> "%s %s" % (12, -12.9343)
'12 -12.9343'

>>> "%f %.5f" % (12, -12.9343)
'12.000000 -12.93430'

>>> "%.5d %.5d" % (12, -12.9343)
'00012 -00012'

>>> "%.8f %.8f" % (12, -12.9343)
'12.00000000 -12.93430000'

>>> "%5.2s %5.2s" % (12, -12.9343)
'   12    -1'

Answer: If you restrict yourself to sufficiently tiny toy cases, you will find no difference - the string representation of the number 12 is indistinguishable from the string representation of the string "12".
However, even a little more complexity shows a difference.  Try 12.54, for example:
>>> "%d %d"%(12.54,-12.54)
'12 -12'
>>> "%s %s"%(12.54,-12.54)
'12.54 -12.54'

and you'll see a difference.  And as others have noted, while a number can be coerced into a string, a string cannot be coerced into a number.


Why the submarine sinks into the bottom of ocean once it starts to sink?

Question: An inflated ballon will rise yo a definite height once it starts rise where as a submarine will always sink to bootom of ocean once it starts to sink, if no changes are made. How then can a submarine stay at a definite level under water.
Comment: I question the assertion of the first sentence...
Answer: There's a few effects in play.  What you've noticed is that floating level is an unstable equilibrium.  Too light, and it rises uncontrollably.  Too heavy, it sinks to the bottom.

As a general rule, submarines stay very close to neutrally buoyant.  They tend not to go to the extremes.  This is still unstable, as you noticed, but it means the instability is smaller
While moving, the submarine can stabilize with hydrodynamics.  With the adjustable fins on the submarine, they can push water up or down as they move.  We have control systems (or people) that oppose any such instability as it happens.
While not moving, they can pump water in and out of their ballast tanks.  Again, the goal is to have a control loop which stabilizes the movement.  If they're rising, they can pump more water in.
There are some interesting depths at which the thermoclines result in more dense water layered on top of less dense water.  When this happens, this changes the buoyancy effects in a stabilizing fashion.  This is a special case, of course, but its nice because it doesn't require the submariners to maintain a control system loop.
Answer: I think the main difference between a balloon's and a submarine's behavior is that air is quite compressible, while water is highly incompressible. The density of air therefore changes considerably with altitude, while the density of water is almost independent of depth. An object experiences neutral buoyancy when surrounded by a fluid of the same density. So there's a much wider range of object densities (basically any density less than that of the atmosphere at ground level) for which the object will equilibrate at a finite altitude, but there's only a tiny range of densities (just a hair above the standard density of water) for which an object will equilibrate at finite depth underwater.
Answer: submarines sink without limit for the following reason: As a submarine goes down, the pressure on its hull causes it to contract slightly. This decreases the displacement of its hull and thereby reduces its buoyancy, which makes it sink faster, which increases the pressure on the hull more, which makes it contract more, lose more buoyancy, and so on... until it reaches it crush depth.


Should I write to invite a professor to be my PhD thesis examiner?

Question: My supervisor has already invited formally the professor to be my examiner.
Do I need to invite the professor personally as he may learn more about my work?
Is there any conflict of interest to do so?
Comment: My uni explicitly said we must not contact examiners ourselves. I'd be slightly surprised if that's universal though. Check your rule-book.
Comment: Vote to close because it is too localised. It depends on the rules and procedures of the institution.
Answer: The way in which doctoral examiners are selected will differ between countries, between universities within countries, and within schools. Ask your supervisor for advice on what you should do here and follow their instructions.
Answer: Ask your supervisor but I've never heard of PhD students being expected to invite people to examine them.  You're right to worry about conflicts of interest and appearing to try to influence your examiner by contacting them.
Comment: In just depends. In the US model, the examining committee is involved earlier on and it is normal for the student to ask them. For example, although I coordinated with my supervisor, I was the one who approached every person on my general and dissertation examination committees.
Comment: In my experience as an external examiner for dissertations in Canada, Europe, and New Zealand, I have always been invited to be an external examiner by a dean or department chair, with the formal invitation typically proceeded by informal discussions with the advisor.  This is completely different from the situation where I am a member of the dissertation committee for a student at my own institution.  In that situation, it's typical for the student and/or the advisor to ask me if I'm willing to serve.  The committee is then formally appointed by the graduate dean.


Multivariate outlier analysis of data with multimodal distribution

Question: I have a data on methylated gene expression which follows a bimodal distribution. Can I use a multivariate outlier analysis to detect differentially methylated genes? What are the various methods of doing this and what assumptions come with them? I know similar analyses have been used in analyzing gene expression data, but they claim the data are assumed to follow a multivariate normal distribution.
Answer: No, you ought not assume that.
Finding outliers in any data set is tricky; assumptions are dangerous. Even if the data ought to come from a particular distribution, outliers change the parameters of that distribution.
If you know the form your data ought to take (that is, not just that it is multivariate and bimoodal, but the parameters associated with the distribution) you could simulate the data and see how often you get values as extreme as the ones you think are outliers.
But I think maybe you don't need outlier detection so much as some form of regression.
Answer: It is good to explore the shape of the data when plotted using a histogram. It's also good that you've observed these data roughly follow a bimodal distribution. It makes sense to want to report the size or effect of the difference in the data you've observed. This is a kind of exploratory analysis.
In the machine learning world, I would ask whether this is a supervised or unsupervised learning problem. In the supervised setting, we would have labels attached to the two types of genes here. If you were, say, measuring zinc finger in two ethnic groups, you could have a hypothesis of whether there is a difference between them. That is a supervised setting because you've controlled the groups to which you will draw comparisons explicitly. The simple T-test is effective for testing for differences in groups, given sufficiently large sample size, and is very robust to distributional assumptions.
In the unsupervised setting, you might not know whether there is a genetic marker for differences in zinc finger, but you ask "Are these data consistent with two (or more) distinct (and unknown) groups have statistically significant zinc finger expression?" And this becomes an unsupervised clustering problem. In this setting you may use the EM algorithm to iteratively maximize likelihood by estimating both the group means and group assignment in the data. A ML test against the null hypothesis (unimodal normal ML) is an effective test of hypothesis. This does introduce important distributional assumptions because this is not a test of means but a test of variances (which in general have less power and can be biased).
In either situation, neither of these methods can be called outlier detection. Because you're interested in significant and reproducible results which an outlier is not.


Is it possible to include all DE registers in the CC/BCC functionality of an email in Marketing Cloud?

Question: Someone enters a journey and an email is fired to that person. However I would like all registers in a DE to receive that email. Is it possible to include them inside the CC/BCC functionality?
Comment: I believe this is also covered in one of the answers on this post: https://salesforce.stackexchange.com/questions/42601/sending-a-triggered-send-to-multiple-to-cc-bcc-recipients-via-the-api/58650#58650
Comment: What would be the use case for this? I am not quite certain what you are trying to accomplish by adding everyone on a CC/BCC?
Comment: As a note, I believe each of the CC/BCC on the email will still count as an individual send in SFMC, so if you are looking for a way to limit costs on sends - this is not the way. There are other 'gotchas' as well involved that would need to be considered too. (e.g. one person clicks the unsub link then no one will get the email again, only 1 reference for clicks/opens, etc)
Answer: If you add a column called CC(or something that makes sense to you) to your DE with as a default value for that field the emailaddress you want to CC/BCC, you can use a personalization string to add this to the CC/BCC field.
It's not out of the box but it does the trick.


Tensorflow: Interpretation of Weight in Weighted Cross Entropy

Question: The Tensorflow function tf.nn.weighted_cross_entropy_with_logits() takes the argument pos_weight. The documentation defines pos_weight as "A coefficient to use on the positive examples." I assume this means that increasing pos_weight increases the loss from false positives and decreases the loss from false negatives. Or do I have that backwards?
Answer: Actually, it's the other way around. Citing documentation:

The argument pos_weight is used as a multiplier for the positive
  targets.

So, assuming you have 5 positive examples in your dataset and 7 negative, if you set the pos_weight=2, then your loss would be as if you had 10 positive examples and 7 negative.
Assume you got all of the positive examples wrong and all negative right. Originally you would have 5 false negatives and 0 false positives. When you increase the pos_weight, the number of false negatives will artificially increase. Note that the loss value coming from false positives doesn't change.
Comment: Thanks. So if using a mutually exclusive classifier with more than 2 classes and 1-hot truth labels, increasing pos_weight has the effect of amplifying the losses in all cases with wrong estimates, and cases with correct estimates are unchanged (because the loss in the correct-estimate cases is zero)?
Comment: amplifying the losses in all cases with *false negatives*, but yes, I think so.


Do bubbly water points and worms count towards "forage" points?

Question: According to this question forage points are limited per area. If there are 6 items on the ground is it impossible for a worm space or a bubbly water spot to spawn? Or are they considered independent of "foraging" spots and can spawn anywhere at any time?
Comment: From the answer to the question you linked, during the Winter buried forage items would count. I don't know about other "worm" spots. I doubt bubble water counts because they appear and disappear through out the day. They aren't spawned by the same mechanic that spawns forage items.
Answer: After taking a look at the source (as of V1.07) it seems that splash points do not count towards the forage points. Only a single splash point can exist in a location and they will never spawn on your farm. If a splash point is not present at a location it will attempt to spawn one by testing a random point on the map at about a 50% rate every time the game updates for the 10 minute interval. If a splash point exists it will have a 10% chance of being removed during the tick. Additionally it looks like if you are on the map that a splash point is spawning you should hear a water slosh sound play.
The worm spots also do not add to the forage points. There is no hard limit on how many worm spots can spawn in a location. At the beginning of the day each map location is given several chances to spawn worm spots (this is done the same method which adds forage spots). The game will keep trying to add worm spots until it fails a check, with the likelihood of passing the check becoming less each round...during the winter ~10% chance is added at the end of each round with the result being the spots happening more frequently during that season. After passing the initial check a random spot is chosen and tested to see if it is suitable, a spot will only be added if it passes the tests.


Did Susan Collins explain why she voted against Amy Coney Barrett's nomination?

Question: Susan Collins of Maine was the only Republican who voted against Amy Coney Barrett's nomination to the Supreme Court. Has she explained why she did so?
Answer: According to the Portland Press Herald, Senator Collins wanted to uphold the precedent set four years ago in which a nominee should not be voted upon so close to a Presidential election, and that the winner of the said election should be the one to fill the vacancy.

"Prior to Justice Ruth Bader Ginsburg's death, I stated that, should a vacancy on the Supreme Court arise, the Senate should follow the precedent set four years ago and not vote on a nominee prior to the presidential election," she said. "Since her passing, I have reiterated that in fairness to the American people – who will either be re-electing the President or selecting a new one – the decision on the nominee to fill the Supreme Court vacancy should be made by whoever is elected on November 3rd."
Answer: Susan Collins is the least conservative member of the Republican party in the U.S. Senate (there are a couple of other Senators that bob and weave for that spot from year to year, but she frequently holds it), which is one of the main reasons that she's one of the only Republican federal elected officials in New England.
She's also running for re-election in a week in a very tight contest in which her opponent is arguing, successfully for the most part, that Collins has ceased to be moderate enough. The FiveThirtyEight election forecast as of today gives her a 40% chance of winning and gives her Democratic party opponent a 60% chance of winning. This is a horrible showing for a long time incumbent U.S. Senator known as a moderate (she was first elected to the U.S. Senate from Maine in 1996), running for a fifth term of office, from a state that is fairly conservative as New England goes, and fairly moderate from a national perspective.
Collins' vote to confirm Brett Kavanaugh (despite acknowledging that allegations of misconduct by him were seriously enough that she joined a request for an FBI investigation of Kavanaugh) is Exhibit A in the attack on Susan Collins' moderate credentials  by her opponent in campaign ads this year. A "no" vote on the Barrett nomination is a final last gasp effort to regain the public's perception of her as a moderate in the hope that this will help her to get re-elected.
Comment: @AES. the OP has been edited. Around the time this answer was listed, it was "Why did Susan Collins vote..." It was changed to "Did she explain why she voted..."
Comment: But the question was "Has she explained why she did so?"
Comment: This answer seems like little more than speculation. Yes, there are plenty of references, but you're picking and choosing facts and linking them together in a way that just isn't in any way supported by evidence. It's pretty easy to further just about any narrative using the same strategy, even particularly ridiculous ones that are clearly and blatantly false.


Accessing non-Kohana php files

Question: I have a Kohana application running in the web root and everything is working fine. But when I try to add a subfolder to the root with non-kohana PHP code, I can't access it. Kohana still tries to find a route for the file..
Example:

public_html

application
modules
subfolder

index.php
test.html

If I try to access /subfolder, I get the following error:
Class controller_subfolder does not exist
But if I try to access /subfolder/test.html it works fine.
My .htaccess file is the default:

<code># Turn on URL rewriting
RewriteEngine On

# Installation directory
RewriteBase /

# Protect hidden files from being viewed
<Files .*>
  Order Deny,Allow
  Deny From All
</Files>

# Protect application and system files from being viewed
RewriteRule ^(?:application|modules|system)\b.* index.php/$0 [L]

# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# Rewrite all other URLs to index.php/URL
RewriteRule .* index.php/$0 [PT]
</code>
Comment: Can you post your bootstrap.php routes?
Answer: Maybe apache is not configured to deliver index.php in the DirectoryIndex?
Take a look @ http://httpd.apache.org/docs/2.0/mod/mod_dir.html

Accessing non-Kohana php files


What to call it when someone always looks for greener pastures?

Question: Someone who always looks for the "better" and more ideal places (to live), jobs, things to buy that fit his taste/mood etc. He is always looking for better because he always feels it's "not enough".
Comment: Looking for " better " things always and looking for things that fit your taste/mood are 2 different things.
Comment: "Looking for better things to fit your taste/mood" was the meaning of that sentence. Not just looking for things that fit your taste/mood.
Answer: Although Maulik V. is right in stating that what you describe is human behaviour, not all humans display the behaviour in such a way that it deserves special attention. For the cases where the behaviour is note-worthy (and potentially annoying), you could use opportunist: it describes someone who will see and seize any opportunity to advance their own position. As an adjective, you can describe the person as opportunistic.
As for the neutral description of the behaviour, as you mentioned in the question already, that person is looking for greener pastures. An expression that also fits is the grass is always greener on the other side of the fence, which describes the tendency that humans display to always assume life is better somewhere else (in a literal or figurative way).
Comment: opportunist may also imply lack of ethics or moral integrity when it comes to accomplishing a goal. Opportunists often times exploit the situation. I don't know the answer, but I am eager to know if there is such a term implying " seeking out better opportunities" yet not implying " exploiting or being smart in using the presented opportunity" but just plain "looking for better things/opportunities".
Comment: @NANDAGOPAL I agree on the negative connotations, which is why I said it would work for someone displaying the mentioned behaviour excessively :) For the neutral version, the OP answered it in the question: someone is looking for greener pastures. I made a small _neutral_ addition :)
Answer: This is basically a person who always feels "not enough". This is exactly the opposite of a contented person, someone who is content with his or her life. So, I'd like to suggest this for such a person: a discontented person.
A discontented person is someone who feels unhappy with his or her life. This might be a result of several possible reasons, such as they feel like they are prevented from achieving something (they're frustrated), they might feel that they're treated unfairly (they're resentful), or they might just simply want more (they're insatiable).
A few words with a similar meaning to insatiable are greedy, voracious, and esurient.

As an aside, I googled for these words to see if anything interesting might come up, and I found this interesting essay:

"In subservience to the internal demands of this system [modern commercial culture], the elementary need for material sustenance, for the basic requisites of life, becomes blown up into an insatiable urge for status, power, and luxury. The masters of commerce strive to create in us a perpetual discontent, to induce feelings of inadequacy, to stir up the need to purchase more. As a result, envy and resentment replace contentment; titillation replaces satisfaction; prestige value eclipses life value. The one word to be banished from the dictionaries is "enough." For the corporate-based economy to flourish there must never be enough, but always a thirst for more: for the bigger, faster, and better; for novelty and variety."
  –– Facing the Future: Four Essays on the Social Relevance of Buddhism, by Bhikkhu Bodhi
Answer: A "restless" person might always be "looking for greener pastures", or think "the grass is greener on the other side of the fence".


Why is my battery life fluctuating?

Question: I installed CM7 on my LG P500, and ever since the battery sometimes lasts 30 hours, sometimes for 8 hours, under the same usage and same power state (conservative).  How can I fix this?
Comment: Have you tried wiping and reflashing?
Comment: Yes, did that! Now I am slowly getting use to the shenanigans of CM7, but I hate it when I cant predict how long the battery is going to last.
Comment: Please ask distinct questions separately.  I've edited this down to just the first issue, you can post the others as separate questions.  Hopefully that will get you more attention and answers.
Answer: I was having that problem, and the solution that helped me was to charge up the battery completely, then use the recovery boot menu to wipe battery stats. Then, I used the phone until the battery died and the phone shut itself off. During that time, it is important to not plug in your phone to USB or charger, it has to drain continuously. Then you can charge it back up again and use it as normal. It should help to make the battery percentage more accurate, and to drop in a more stable way.

Why is my battery life fluctuating?


Is a 404 on a non displaying files a problem

Question: One of my clients web pages has a error in the theme which calls a redundant .css file that does not exist. The page however, looks fine. Thus the client is not willing to have the error fixed. What reasons can be given for fixing the error when it does not cause any issues with the page display.
Answer: Http calls have the biggest single impact on front end performance, reducing them should be a priority for every webmaster (even just that one little one that's 404'ing).
From Yahoo's performance guidelines:-

80% of the end-user response time is spent on the front-end. Most of
  this time is tied up in downloading all the components in the page:
  images, stylesheets, scripts, Flash, etc. Reducing the number of
  components in turn reduces the number of HTTP requests required to
  render the page. This is the key to faster pages.

If you can't fix it, at least put a blank CSS file in the right place so you don't waste time with 404's for it.
Comment: Why would a blank file be any faster than a 404? Assuming the 404 error page's text is minimal is there any speed difference between Apache serving a real file versus the 404 error page file.
Comment: @Rincewind42, a 200 status is faster than a 404 and it won't clog up your logs.
Comment: @toomany What is the reason a 200 status is faster? Doesn't make sense to me - for a linked CSS file the browser is unlikely to bother downloading the response if it says 404.
Comment: @DisgruntledGoat we're talking milliseconds, and it vairies by server setup but the 200 header length is about half of a 404 and the 404 log entry is longer. Some of the sites I've worked have huge traffic. c. 25 million visits annually and billions of page views so eliminating 404ing files, even stuff that's invisible to the user really helps overall performance.
Answer: In regards to the mega SEO engine that is Google....
http://googlewebmastercentral.blogspot.com/2011/05/do-404s-hurt-my-site.html
Basically, no.  It does not hurt anything, including your SEO priority.
You could argue that it wastes a few milliseconds generating that 404....


How can I protect my WiFi if I have two routers?

Question: I have a main desktop computer in my basement.  It is connected to a modem box that my ISP gave me, which is also wireless.  They also recommended a stronger wireless router, from Linksys, that would better carry the signal upstairs, to my laptop.  How do I better protect myself from intruders?  Is it necessary to change both the passwords from the modem AND the Linksys?
Answer: There is not so much you can do with securing wireless network from a router standpoint, but key points to hardening are:-

Change default password.
If available use WPA, not WEP.
Disable remote administration
Change the default SSID name
Enable router firewall
Disable SSID broadcast
Enable wireless MAC filter
Answer: The question is whether the ISP's device and the Linksys can pair together in order to provide a single WiFi node (with the same settings and password).
If they can do this then you simply need to perform the typical hardening of a device that you normally would (no external access to the admin page, change the default password, etc.)
Answer: Having two routers (or one router and one modem with wireless capability) gives attackers the possibility to enter your network in two ways, thus doubling the attack surface. An attacker would only have to know one of the two passwords to access your network.
If you use both devices, I would advice setting the SSID and the password the same. This way, the WiFi clients can connect to either device.
If you only use the Linksys, see if you can disable the WiFi of the modem altogether.
Comment: it looks like he needs 2 APs to ensure signal coverage
Comment: Sjoerd, I don't get it.  I have to set up the l/p the same for *both* the model and the router?  How would that protect against intruders?


Polar and parametric curves

Question: I was solving a calculus problem on polar coordinates and I came across with some doubts, I don't know how to solve it. It says: "Given the curve $C: (x+1)^2+y^2=1$ parametrize the arc of a curve that intersects the points $A=(-2;0)$ and $B=(-1,1)$ and that doesn't intersect the point $(0;0)$. Do this using polar coordinates.".
What I have done so far is writting the curve as a parametric equation using polar coordinates, and it looks like this: $r(x;y)=2cos^2 (t); 2cos(t)sin(t)   t\epsilon [\pi /2;3/2 \pi]$. How should I go on?
Comment: What are your doubts?  I haven't checked the details but that's pretty much what I would expect for the answer.
Comment: Do you have to use polar coordinates? There's a somewhat simpler parameterization centered at $(-1,0)$.
Comment: I don't know how to go on. Because I don't know how to parametrize it in way that it intersects the points that it has to intersect. And in a way that it doesn't intersect (0;0)
Answer: First, after expressing $(x,y)$ in polar coordinates, you get the equation $(r\cos t+1)^2+(r\sin t)^2=1$, which after a few computations turns out to be $r(r+2\cos t)=0$. So, $r=0$(which is the case when $(x,y)=(0,0)$, we are not interested in this) or $(r+2\cos t)=0$, i.e. $r=-2\cos(t)$. So, the parametrization that we get is $$(x,y)=(-2\cos^2(t),-2\cos t\sin t)$$
 (so the parametrization that you got was missing a "-" sign.)
Now, we are just left with finding the bounds for $t$ (i.e. find the interval). We want $A=(-2,0)$ and $B=(-1,1)$ to be in our parametrization. Note that $A$ occurs when $t=0,\pi,2\pi,\cdots$ and $B$ occurs when $t=\pi/4,3\pi/4,\cdots$. Now, you want your parametrization not containing $(0,0)$ (which occurs when $t=\pi/2,3\pi/2,\cdots$;
so you just need to choose a good interval not containing these $t$-values.
For instance $t\in[0,\pi/4]$ works.

Polar and parametric curves


How to show form elements within PDF by print module?

Question: I'm using the print module to convert a node to a PDF. I see that there is the print.tpl.php for theming, but where can I say that I want to show form elements (eg. input fields, radiobuttons, ..) within the PDF?
Answer: Not sure if this is exactly what you mean but you can show / hide elements via the ui.

go to admin/structure/types/manage/your-content-type/display
Under Custom Display Settings enable Print
admin/structure/types/manage/page/your-content-type/print

This will show or hide form elements for the pdf version as well as the print version.


Hume's induction using circularity fallacy

Question:
Hello everyone, i was going through this reading of a book in which it present Hume's induction wrong using circularity . I was trying to find some error in it as given there but could not pinpoint the exact mistake . However i feel conclusions 5-10 are clear of any mistake. Can someone help or is up for a discussion on it?
Comment: What is Hume's solution to this conundrum? "Since we're determined—caused—to make causal inferences, then if they aren't "determin'd by reason", there must be "some principle of equal weight and authority" that leads us to make them. Hume maintains that this principle is *custom* or habit." We may say that the "firware" of our mind is programmed to perceive or extrapolate causal relations and uniform laws.
Comment: This is exactly the same doubt I have. Please answer.
Comment: Do you think it is a "reasonable" reconstruction of [Hume's argument](https://plato.stanford.edu/entries/hume/#Cau)?
Comment: The gist of Hume's approach is: regarding *matters of facts* (where a priori reasoning is inapplicable) we use probable reasoning connecting (presumed) causes and effects. This reasoning is based on the fundamental assumption that we may call the *uniformity principle*:  The future will be like the past. This principle is not demonstrable, and thus we cannot ground inductive reasoning on "absolute" principles.
Comment: Having said that, where is the fallacy? In "human" attitude? in Humean's philosophy? in the (unknown) author quotation above?
Comment: It occurred to me that Newton's first law is an idea very similar to the Uniformity of Nature. "… an object at rest will stay at rest, and an object in motion will stay in motion unless acted on by a net external force." Wikipedia. Perhaps the theoretical underpinnings of the first law also resolve Hume's paradox.
Answer: If you look at the Stanford Encyclopedia of Philosophy page on "The Problem of Induction", the argument you quote is a formalization of the "second horn" of Hume's dilemma about our having no firm grounds for trusting inductive inferences. The first horn is about how there is no good "demonstrative" argument for induction from principles that we feel totally confident in a priori akin to axioms of some area of math like arithmetic. The second horn is about how we can't make an empirical or "probable" argument from experience to support the idea that induction is trustworthy, since such an argument would have to presuppose the very thing it's trying to prove, and thus would be circular.
If you look at the various responses to Hume in the SEP article, I don't think there are any philosophers who have argued there actually is a fallacy in the second horn of Hume's dilemma, i.e. there's no one who actually takes the position that we can be confident induction will work in the future solely because we've seen that it's worked in the past. Most responses either attack the first horn and say there is some a priori reasoning that leads to the conclusion that induction should work, or they just say that induction is not something we can have an argument for but something that we basically just have to presuppose when making any argument that isn't purely logical/mathematical, perhaps because it's built into human consciousness to presuppose such a principle (which I think was basically Kant's view, see this answer), or perhaps because it's just part of some normative rules of linguistic argument that we have to mutually accept if we want to talk to other people (which is how I would interpret Wittgenstein's response in section 5.2 of the article).
Comment: Don't forget Popper's view, that induction is not widely used, and not key to doing science.
Comment: @CriglCragl - True, the sort of "pure" induction as conceived by Aristotle and by most philosophers of science up through the late 20th century is different from the hypothetico-deductive method that is a more common way of thinking about science today; for those who aren't familiar with the distinction see  http://people.loyno.edu/~folse/HypDeduc.html and http://people.loyno.edu/%7Efolse/HypDeduc5.html (from the philosophy of science course site at http://people.loyno.edu/%7Efolse/Phil236f02.html ) for more.
Comment: (cont.) In my answer above I was using "induction" in the broader sense of any kind of claim based on evidence from experience, as opposed to logical deduction, and Hume's problem would apply equally to the hypothetico-deductive method. Popper's view that scientific claims are purely about some theory not yet being ruled out doesn't actually claim anything about positive reasons to believe the future will resemble the past (it doesn't try to say 'emeralds are grue' type theories are less likely), so it isn't subject to Hume's problem of induction even under a broad definition of "induction"
Comment: Meant to say "up through the late 19th century" in my comment above, not "through the late 20th century"--by the 20th century Baconian induction was falling out of favor and hypothetico-deductive becoming a more popular way of thinking about science, though there were a few who endorsed it in the 19th century like Charles Sanders Peirce and Ludwig Boltzmann.
Answer: I agree that the idea of the Uniformity of Nature, or the Uniformity Principle, is essential to induction. However, I disagree that the idea is circular.
At academia.edu I posted a paper that argues for noncircularity. "Induction and the Uniformity Principle; derivation of the principle from fundamental axioms". The argument is that the Laws of Thought, taken together, show the validity of the Uniformity of Nature.  https://www.academia.edu/41240897/Induction_and_the_Uniformity_Principle_derivation_of_the_principle_from_fundamental_axioms
Here is the abstract:

The Uniformity Principle is the notion that relationships between
future events will resemble the relationships between similar events
in the past. The principle is essential to inductive reasoning. The
primary objection to the Principle is that it appears to be circular;
its content is the very assumption that the inductive process sets out
to prove. This essay proposes that the Principle is not a part of
circular reasoning. Three fundamental axioms, titled Existence,
Identity, and Continuity, show that the Principle is noncircular.
Comment: However in an article of https://plato.stanford.edu/entries/induction-problem/ it is quoted that Hume says that argument is circular in nature . I am sorry but I fail to get across this point can you elaborate a bit :(
Comment: In the essay, I offer that the Laws of Thought are a foundation for the Uniformity Principle, and so avoid the need to simply assume the principle is true without further proof.


Expanding environment variables in active-directory

Question: I'm trying to set a user's profilePath like this:
<code>$commonname = "Firstname lastname"
$samaccountname = "some-user-name"
$user = organizationalUnit.create("user", "CN=$commonname")
$user.invokeset("SamaccountName", $samaccountname)
$user.commitchanges()
$profilePath = "\\domain.local\profiles\%USERNAME%"
$user.invokeset("profilePath", $profilePath)
$user.commitchanges()
</code>
When I look at the newly set attribute however, the %USERNAME% variable does not get expanded to "some-user-name". When I type the same profile path in the windows server manager gui for active-directory and click "Apply", it does get expanded.
How can I make the %USERNAME% variable expand?
Answer: You can access environment variables via <code>$env:variablename</code> syntax. Like so,
<code>$profilePath = "\\domain.local\profiles\$env:username"
</code>
Comment: Sorry if that was unclear, but I need to insert (many) names different from mine.
Comment: Isn't the username the same as the samaccountname?


Is there any difference between "careless" and "irresponsible"?

Question: I know that they are synonyms. But is there any slight difference between them?
Comment: Please edit your question to include research you've done and your own understanding of the two words up to this point. (For example, have you contrasted their definitions using a dictionary? Compared sentences from books or online resources to see how they are used differently?)
Comment: I completely agree with @pyobum here. You got three answers in two hours, and, for the most part, these answers simply gave two definitions and said little else. This question makes ELL look like a dictionary concierge service. Please, research this on your own first, and then [share the results of that research](http://meta.ell.stackexchange.com/questions/439), so we can start the conversation from there.
Answer: Careless and Irresponsible have lot of difference in meaning.
Careless - Taking insufficient care.

"It is natural for careless writers to run into faults they never
  think of"

Irresponsible - One who has no sense of responsibility.

"behaved like an irresponsible idiot"
Comment: Thanks a lot. I think I got it now.
If you forget about you tasks you're probably careless. But if you don't care (don't want to care for/thinks it's not important) about your child properly than you're irresponsible. Are these examples correct?
Answer: They are different terms:
Careless -

Not giving sufficient attention or thought to avoiding harm or errors.

Irresponsible -

A person not showing a proper sense of responsibility.
Comment: What dictionary did you get these definitions from? (You should cite quoted definitions.)
Comment: https://www.google.com/search?q=define%3Acareless
Answer: They are very different, cannot be used interchangeably at all.
Careless — Do not care.
Irresponsible — It is your responsibility to "care" but you did not.
Comment: Cannot be used interchangeably at all? I disagree; they may not be complete synonyms, but there is still quite a bit of overlap. Imagine me telling my 10-year-old son: _"You left your baseball glove out in the rain; that was very _______ of you."_ I'd say either word could fill in the blank, and the sentence meaning doesn't change very much.


How do faction bounties work?

Question: Now that bounties are system-wide rather than global, what happens if you get scanned by Imperial police while having a Federal bounties (from attacking ships in Federation space and etc.) or vice-versa? Does the police ship just let you go or are you attacked?
Answer: While there's some consideration towards (re)introducing interstellar bounties, you don't have to worry about your reputation preceding you across the galaxy. Because bounties are now scoped to the system jurisdiction, the only time you'll ever get in trouble with the law for a given bounty is within that particular system, regardless of their major faction association.
When you perform an illegal action that triggers a bounty, there'll be a cooldown period of up to seven days in which the bounty will be visible to that system's authority, as well as commanders scanning you with a Kill Warrant scanner. Committing additional bounty-level offenses in the same system will both increase the bounty amount and reset the timer.
Once the time expires, the bounty will become dormant for another seven days, during which time it'll only be visible if the system authority for the issuing system scans you. If this happens, the bounty will become active again.
Bounties that also complete the dormant cooldown become legacy fines, which are a fee that's added to your rebuy cost if you happen to have to respawn in a station or outpost owned by the issuing faction. These never expire, but can be paid off via the Contacts menu in a station/outpost within the issuing jurisdiction*.
*I think paying them off might have some minorly positive effect on your reputation with the faction as well, but I haven't Scienced™ it.

How do faction bounties work?


Proportional Editing and Laptop Problem

Question: I am using blender 2.7 and the laptop mandates the "Emulated Numpad." Upon attempting to use "Proportional Editing" in a "Bound" within the UV Editor while using projection process, I cannot use "Proportional Editing" while the attempt to grab with G. The attempt simply moves the entire "Bound." The only way I have been able to even move a vertex of the bound is to disable proportional editing. Any ideas? I have tried every imaginable hotkey combination.
Answer: On Mac laptop you need to press Fn and scroll (two finger gesture) up or down.
Answer: Proportional editing effects all items within a sphere of influence. If the sphere is very large then everything appears to move the same amount.
The two standard methods of adjusting this size are mouse scroll wheel and page up/page down. For a laptop there is also a trackpad pan setup, I believe apple trackpads do panning with a two finger swipe.
If you still have trouble you can modify this shortcut yourself, you can find it by going to the user preferences->Input, down the bottom of the list there is a group called 'Transform Modal Map' expand that and you will find Increase Proportional Influence and Decrease Proportional Influence for both keyboard and mouse, you can change these to any key combination that works for you.
Comment: Oddly, Proportional Editing works fine until I setup a projection to the UV Editor? The models mesh moves fine in edit mode until I select the models head area after having seamed the models head and selected all the head faces and then unwrapping! After having unwrapped the head area all appears fine in the uv map and the bounds appear fine while scale, rotate work fine for rough placement before I attempt proportional editing for a closer fit, however, the G key moves the entire bound even while the proportional incrementation numbers reflect a radius size change with PGUP/PGDN..any ideas?
Comment: The radius size may change but is it small enough to see the circle of influence? Is it less than 1.0?
Comment: On my Mac, you emulate Page Up and Page Down with fn + Up/Down arrows.  Hope that helps somebody.
Answer: On windows, Use Pageup or Pagedown after pressing G until the you see circle comming up and move track pad pointer to adjust the required modfication

Proportional Editing and Laptop Problem


MonoMac Exceptions Not Bubbling Up

Question: I'm relatively new to MonoMac, and I'm having a problem handling exceptions that are thrown from a referenced assembly. I'm building my GUI on OS X 10.7 (MonoMac 2.10, MonoDevelop 3.1, Xcode 4.3), and I'm referencing a .NET 4.5 assembly I built on Windows 7 with Visual Studio 2012. The library is completely compatible with Mono: no flags at all are raised when I run it through MoMA. The problem is this: if an exception is thrown in the library, the GUI hangs, even in debug mode. There's no exception handling in the class library: the try/catch statements are around the calls in the GUI, but the exception never gets there. If I test the same failed method in a console app in Windows, the exception bubbles up correctly. Has anybody experienced this, or have any idea what I might be doing wrong? Thanks in advance for your help.
Answer: Er, um, heh heh. My bad: it was how I had configured the debug settings in MonoDevelop -- I had everything turned on, so my basic exceptions were getting lost in the mix. Sorry about that. Thanks.

MonoMac Exceptions Not Bubbling Up


Nikon D810 FX- Aperture Question

Question: Can you change the aperture on the camera without the lens or does the lens on the camera have to be connected to the camera?
Answer: The Nikon D810 has no aperture to set. Only lenses attached to the D810 have apertures that can be set.
The camera can remember what the aperture setting was the last time a "CPU" lens was attached and apply that setting the next time another "CPU" lens is attached, assuming the attached lens is capable of the stored aperture setting.
For example, if the aperture is set at f/1.4 and you detach your 50mm f/1.4 "CPU" lens and attach a 24-40mm f/2.8 "CPU" lens, the aperture will not remain set at f/1.4, it will shift to f/2.8 since that is the nearest setting that the second lens can do.
On the other hand, if the 24-70mm f/2.8 "CPU" lens is set at f/5.6 and you swap it out for the 50mm f/1.4 "CPU" lens, the camera will set the aperture on the second lens at f/5.6.
What you have no way of doing is telling the camera to change the remembered aperture setting when there is no lens, or a non-CPU lens, attached.

Nikon D810 FX- Aperture Question


Creating specific rule in Outlook

Question: We recently changed our company name so our email domain has changed.  How do I set a rule to send a reply (Template message) to only people using my old email address? I don't want them to get it if they are using the new one.  The message is to inform them of the email address change.
Comment: This might gives a hint to the corect answer: https://community.spiceworks.com/topic/404336-outlook-rules-based-on-email-address-alias-sent-to.
Answer: These instructions are for Microsoft Outlook 2016 (not the Office 365 Outlook). It should be fairly easy to adjust these rules for any version of Outlook back to Outlook 2010.

From the HOME tab, pull down RULES and select Create Rule...
Click on Advanced Options...
Select the condition "with specific words in the recipient's address"
This condition will appear in the rule description below. In the rule description, click on the highlighted "selected words".
In the Search Text dialog that appears, in the first field, enter the old email address, or enough of it to ensure that it will trigger on that and only that, then click on Add..., then click on OK
You'll return to the Rule Wizard. Click Next >
You will now be selecting an action. The action you want is "reply using a specific template".
Select the template. You will need to have created the template and saved it earlier. Once it's selected, click NEXT >
Select any exceptions, and edit the criteria as needed, then click Next >
Give the rule a name, and click FINISH. The rule is now ready to run, and will run the next time someone sends you a message to the specified address.

Creating specific rule in Outlook


Template missing error in case of CSV format

Question: I am generating a csv file as a report. It works fine if model validations are passed. In case of failed validations I want to show errors on the "new" action view and keep user there until they correct errors, just like any HTML form. However since I am using format=>'csv' with my form I am getting template missing error when the user input fails model validations.
Missing template /new.html with {:formats=>[:csv],

I tried the following render in my controler but it did not work:
format.csv { render :template=>"new.html.erb"}

I even tried to add a handler in an initializer but did not work:
ActionController::Renderers.add :csv do |csv, options|
  self.content_type ||= Mime::CSV
  self.response_body  = csv.respond_to?(:to_csv) ? csv.to_csv : csv
end

Answer: Can you redirect_to you new path in the controller?
redirect_to :action => 'new', :format => 'html'


How do I prefill a paragraph field in a node form?

Question: I have a content type with a paragraph entity reference field and every time a user is going to add a node of this type I want to have the paragraph field already open and prefilled. I've tried with hook_form_alter, but it's not opening the paragraph form with prefilled values.
Answer: In the form display for that content type you can tell the paragraph field to have a default paragraph selected. So when new nodes are created it will appear there
Then on your actually paragraph you'd need to set the default values for each field it contains (Just by editing those fields on the paragraph and setting the defaults)


Pointers in C with binary file

Question: I am reading the contents of the file using fread into an char array. But I am not sure why it is not getting printed in the output. Here is the code:
void getInfo(FILE* inputFile)
{
   char chunk[4];
   int liIndex;
   for (liIndex = 0 ; liIndex < 4 ; liIndex++)
   {
      fread(chunk, sizeof(char), 4, inputFile);
   }
   printf("\n chunk %s", chunk);
}

Output prints nothing at all. Where am I going wrong?
Regards ,
darkie
Comment: Instead of hadcoding "4" in the fread() function, you can try: sizeof(chunk).
Answer: Move the printf into the loop. As it is, you're only printing the last chunk read.
Edit: I read the question but not the title, apparently. You'll have to do this and switch to fwrite like Thomas said.
Answer: In my opinion, fread and fwrite are just adding a layer of confusion.
Try byte-oriented input and output functions instead, since 4-byte chunks aren't much better than not using chunks at all, and you can't make mistakes in code that you don't write.
int ch;
while ((ch = getc(inputFile)) != EOF)
   putchar(ch);

But I think the real issue here is that you might not completely understand what you're asking for.  You are reading binary data, and then trying to print it out as character data;  many arbitrary byte values don't correspond to any printable characters.  What do you expect to see for those bytes?
A more informative approach might be to print out the integer value of each byte, as well as the character it represents.  This will let you see clearly when there are unprintable characters in your file.
eg,
void func(FILE *s)
{
   int ch;
   while ( (ch = getc(s)) != EOF )
      printf("%d -> %c\n", ch, ch);
}

When I run this program snippet on a file containing one of each byte, it becomes clear that  many values have no meaning when interpreted as a character:
[snip...]
29 ->
30 ->
31 ->
32 ->
33 -> !
34 -> "
35 -> #
36 -> $
37 -> %
38 -> &
39 -> '
[...more snipping]

Answer: You cannot print a binary file using printf. printf will treat the binary blob as a null-terminated string, so any '\0' byte that happens to be in your chunk will end the "string".
To write the chunk to stdout in full, use fwrite:
fwrite(chunk, sizeof(char), 4, stdout);

Comment: Hi,

I silly question though. I used the statement above and used fprintf to print the stdout. But still nothing is being displayed. Sorry for testing your patience .. But can you please tell me where I am going wrong
Comment: Of course you can print a binary file using printf.  The issue is with the %s format.  But %d or %c would work just fine, depending on what darkie15 expects binary data to look like.
Answer: Deconstructing your source code a bit:
void getInfo(FILE* inputFile)
{
   char chunk[4];
   int liIndex;
   for (liIndex = 0 ; liIndex < 4 ; liIndex++)
   {
      fread(chunk, sizeof(char), 4, inputFile);

You're reading 4 bytes at a time, repeated 4 times; that means when the loop exits, you've read 16 bytes, and chunk contains bytes 12-16.  Is that what you intended?  If you just want to read the first four bytes, ditch the loop and just call fread once.  If you want to read and print the first 16 bytes, then you'll need to move the output statement into the loop as well.
As others have mentioned, don't hardcode the 4; use sizeof chunk instead.
   }
   printf("\n chunk %s", chunk);
}

Remember that the %s conversion specifier expects the corresponding argument to point to a 0-terminated sequence of printable characters, so chunk[0] through chunk[2] need to be printable (i.e., isprint(chunk[i]) == 1), and chunk[3] had better always be a 0, or you could get some strange output.  Since that tends to rarely be the case in binary files, you may want to change how you write that output.
Here's how you could print the individual bytes as integer values:
printf("chunk: ");
for (i = 0; i < sizeof chunk; i++)
  printf("%02x ", chunk[i];
putchar('\n');

Pointers in C with binary file


Zero W Shuts down when connecting usb converter

Question: I just received my Pi Zero W and Pi 3. The Pi 3 works perfectly, the Pi zero boots up nicely but then shuts down when I connect the usb converter... any ideas? I can now obviously not connect a keyboard or another external device.
Comment: What type of USB converter? Normally this is a power issue? Are you connecting your peripherals to a powered USB hub? Or powering them from the Pi? How are you powering the Pi? Note: answers to my questions belong in your question, not the comments.
Answer: Unfortunately, it is not possible with the Pi Zero (W) to hotplug an OTG cable. The moment the OTG cable (or a OTG shim) is inserted or removed, the Zero (W) will either reboot or crash. Please note that this applies only to using OTG cable/shim. And it is happening regardless of the power supply you are using. Even with the official 2.5A 5.1V power wart you'll experience these unfortunate crashes when hotplugging or removing OTG cables or OTG devices.
However, with the OTG cable firmly attached before boot, you can still hotplug USB devices on the Pi Zero (W), as long as you don't pull the OTG cable itself from the Pi.
Also, without any OTG cable, you can hotplug the Pi Zero (W) as an USB device ("gadget mode") into USB hosts without any issues.