Downloading an entire folder from my server to iPhone

Question: Is it possible to download an entire folder of files from my server to the user's iPhone rather than just one file at a time?
Also, is the NSURLConnection class the way to go?
Also, should I be using an HTTP path or an ftp path? (I've gotten the download of a single file to work with the HTTP, but don't know how to with the ftp or even if I should bother.
I'm trying to implement the StoreKit and I understand that after I get payment verification, it is my responsibility to provide the additional content to the user's iPhone.  That's the part I'm currently stuck on - downloading that content from my server.
The reason for my request is that I must download a large number of files (which is a variable number of files) and it would be vastly easier if I could just specify the path to the folder and download that folder and everything in it intact.
Any help would be very appreciated.
Answer: You can download zip files and unzip it with ZipArchive


Square with equilateral triangle drawn it it, find area of the triangle.

Question: ABCD is a square and CMN is an equilateral triangle, with M on AD and N on AB. If the area of ABCD is one square inch, compute the area of CMN in square inches.
I have been able to find all of the angle values after discovering that triangle MDC and NBC are congruent. This means that triangle AMN is isosceles, and from there one can find all the angle values. However, I have not been able to find anything that will help me find the area. Setting algebraic values and then bashing them has not seemed to work. What is the proper way to approach this question?
Comment: I've given you a non trig solution, in case you're interested.
Answer: If the side of an equilateral triangle is $A$, then the altitude is $\sqrt {A^2 - (A/2)^2} = \sqrt {(3/4)A^2} = \frac {\sqrt 3}2 A$
The side of the equilateral triangle here is $\dfrac{S}{\cos 15°}$, with $S$ the length of the square side.
The $15°$ comes from considering $\angle DCM + \angle MCN + \angle NCB = \angle DCB$ (and $\angle DCM=\angle BCN $).
Comment: This answer is wrong. The right angle in the right triangle with the altitude is opposite the altitude. The method is right, though, so you can fix it.
Comment: Ah yes. I thought the numbers looked screwy.
Answer: Here's a non trigonometric way. Uses Pythagorean Theorem ("PT")and a little algebra.
Let $\displaystyle AM = AN = x$ (you know that $AM$ and $AN$ are equal by symmetry).
Then $\displaystyle BN = DM = 1-x$.
By PT, $\displaystyle MN = \sqrt 2 x$, and thus $\displaystyle CM = CN = \sqrt 2 x$
Now considering the right triangles $CMD$ and $CNB$ and again applying PT, we get:
$$(1-x)^2 + 1^2 = (\sqrt 2 x)^2$$
which quickly reduces to the quadratic:
$$x^2 +2x - 2= 0$$
for which the only permissible solution is $x = \sqrt 3 - 1$
From that we can get the area of $AMN$ as $\displaystyle \frac 12 (\sqrt 3 - 1)^2 = 2-\sqrt 3$
The areas of $CMD$ and $CNB$ add up to $\displaystyle (2)(\frac 12)(1-x) = (1-\sqrt 3 + 1) = 2- \sqrt 3$ (i.e. the combined areas of $CMD$ and $CNB$ are equal to that of $AMN$, an interesting geometric insight).
So the area of the equilateral triangle is simply $\displaystyle 1 - 2(2-\sqrt 3) = 2\sqrt 3 - 3 \ \mathrm {sq. inch.}$
Comment: Would this be equivalent to @Joffan's answer?
Comment: Equivalent? It definitely gives the same answer (through a non trig approach), although Joffan did not compute that answer.
Answer:
$$\text{area of $2\times 2$ square} \;=\; 4 \;=\; 2\color{purple}{x}
\;+\; \color{red}{\frac{1}{2}\cdot 2\cdot\sqrt{3}} \;+\; 5\cdot\color{blue}{\frac{1}{2}\cdot 2\cdot\left(2-\sqrt{3}\right)}$$
$$\to\quad \color{purple}{x} = 2\sqrt{3} - 3$$
Answer: Take $C$ as the origin, $CD$ along positive $X$ axis and $CB$ along positive $Y$ axis. Let $CM$ make an angle $\theta$ with the $X$ axis. Then $M$ is $(a, a\sin\theta)$, where $a$ is the side of the square, and $CN$ makes an angle $30^\circ-\theta$ with the $Y$ axis. Length of $CM^2$ is $a^2+a^2\sin^2\theta$ and that of $CN^2$ is $a^2+a^2\sin^2(30^\circ-\theta)$. Equating these, we obtain $\theta = 15^\circ$. Hence the length of $CM^2$ is $a^2 + a^2\sin^2 15^\circ = a^2\left(1+\frac{1-\cos 30^\circ}{2}\right) = a^2\left(\frac{3-\sqrt{3}}{4}\right)$. Now the area of the triangle is $\frac{\sqrt{3}}{4} CM^2$
Comment: Is this solvable without using trig? I feel that there is a much simpler answer.
Comment: You can deduce that the angle made by $CM$ with the side is $15^\circ$ as follows: Reflect the figure in the diagonal $CA$. Then by symmetry, the side $CM$ must go to the side $CN$ and hence the angle made by $CM$ with $X$ axis is the same as the angle made by $CN$ with $Y$ axis. It follows that the angle is $15^\circ$
Comment: Then how would this connect to your trig answer?
Comment: You can now compute $CM$.


Configuring fuel gauge IC (BQ35100) with USB-I2C converter

Question: I want to use TI's BQ35100 fuel gauge IC for my circuit. As per this instructional video, I would need an evaluation board and a communications interface adapter to configure the IC. Could I just use a simple USB-I2C converter (e.g. this Adafruit converter) to configure the IC instead?
Comment: I did a similar thing with BQ20Z40 with FT232H converter. It had the difficulty of having SMBus instead of plain-I2C interface, which required tuning the timings a bit. But BQ35100 looks like plain-I2C, so it should work if you write your own configuration scripts.
Answer: Yes, you certainly can configure the fuel gauge IC with your own I2C interface and, when the IC is embedded into a system, you will do it from your own code.
But the IC is conveniently supported by a system configuration applet called Battery Management Studio, BQSTUDIO, with all registers properly displayed and broken into individual control bits, with designations in accord with specification. Unfortunately this applet only understands the TI interface adapters like Ev2400. While it is pricey for DIY, but it will speed up your development.
The BQ35100 is a complex chip with elaborated control over several sophisticated algorithms, and uses SHA-1 hash encryption for some parts, see Programming Manual. The EV2400 and bqSTUDIO  will help you to wade through all these intricacies, which will guide you with design of your own code. I would highly recommend getting the EV2400 box.
Answer: There may be another alternative to the Adafruit converter you mentioned: Bus-Pirate
As per their docs:

Bus Pirate v4 is a universal bus interface that talks to electronics from a computer serial terminal. Get to know a chip without writing code. Eliminates a ton of early prototyping effort with new or unknown chips.

It supports these Protocols : 1-Wire, I2C, SPI, JTAG, asynchronous serial (UART), MIDI, PC keyboard, HD44780 LCDs, and generic 2- and 3-wire libraries for custom protocols.
In principle, EV2400 must be nothing but a USB-I2C converter. However, as @Ale..chenski mentioned, it may be difficult to make BQStudio communicate using these custom USB-I2C converters. This could be because TI may have locked BQStudio so that it would communicate only when EV2400 is connected.
UPDATE:
As per the TI forum:

The chem id is contained in private registers that you do not have access to. You can program the data flash or the entire firmware image of the device to the gauge but you can't just program the chem id using your host because the registers are private due to them being proprietary

So, it seems that using a custom USB-I2C converter, it will be difficult to program BQ35100.
Comment: The TI forum info looks like a nonsense. EV2400 communicates with gauge IC over standard I2C protocol. So if there are any private undocumented registers, one should be able to get access to them anyway. However, the bq35100 does have some security built-in, "SHA-1 authentication to help prevent counterfeit battery use", so the access should be documented.See http://www.ti.com/lit/ug/sluubh1c/sluubh1c.pdf


Is weakly continuous operator weakly compact?

Question: Suppose we are given an operator $T\colon X^*\to Y$ and both $X$ and $Y$ are Banach spaces. Assume that operator $T$ is continuous for the weak$^*$ topology of $X^*$ and weak topology of $Y$. Does it imply that operator $T$ is weakly compact?
Answer: Let $S^*$ be a unit ball of $X^*$. As $X$ is a Banach space, then so is its dual. Hence, from Banach-Alaoglu theorem, we deduce that $S^*$ is weakly$^*$ sequentially compact. Now, since $T$ is continuous from $X^*$ endowed with weak$^*$ topology to $X$ with weak topology, we deduce that $T(S^*)$ is weakly compact.


Changing default wp search string

Question: By default WordPress use a + between spaces whenever we search for something on a blog which is built on WordPress. Is there any way to change that + into a hyphen.
Answer:
By default WordPress use a + between spaces

No, it doesn't. WordPress doesn't generate + characters, it doesn't use those characters, and it can't see them.
So Where Does the + Come From?
The browser and URLs. Spaces in URL parameters are encoded as + characters or %20. Forms specifically become +.

When data that has been entered into HTML forms is submitted, the form field names and values are encoded and sent to the server in an HTTP request message using method GET or POST, or, historically, via email.[3] The encoding used by default is based on an early version of the general URI percent-encoding rules,[4] with a number of modifications such as newline normalization and replacing spaces with + instead of %20. The media type of data encoded this way is application/x-www-form-urlencoded, and it is currently defined in the HTML and XForms specifications. In addition, the CGI specification contains rules for how web servers decode data of this type and make it available to applications.

https://en.wikipedia.org/wiki/Percent-encoding#The_application/x-www-form-urlencoded_type
Search URLs convert "test data" to test+data because that's how URL parameters generated by HTML forms are meant to work.
But Can It Be Done?

Is there any way to change that + into a hyphen.

Not without causing major problems, and unexpected bugs. To do this you would need to intercept the form inputs and replace spaces in the input with a - using javascript.
Then, you would need to intercept it on the PHP side and undo the change. As a result it will be impossible to search for things that contain hyphens. This will also break search functionality in a lot of themes and plugins.
This would also break most search plugins, and interfere with SEO plugins, which will interpret the search query as a single word with hyphens.
Comment: You mean HTML forms are causing this problem
Comment: I'm saying this is how forms are supposed to work, it is not a bug, and trying to change it is a really bad idea that will require a lot of effort and cause a lot of problems

Changing default wp search string


Is it legal for my boss to require I take the covid 19 vaccine?

Question: I'm from South Africa but we basically follow British/USA law so answers from any of those jurisdictions will be fine.
I work in digital marketing. But my boss doesn't want us to work from home.
Please note I have no condition that restricts me from taking the vaccine, I just prefer not to.
Comment: No just prefer not to take it
Comment: What industry / profession are you in? In England for example it's a mandatory condition of employment for some NHS workers (doctors, nurses etc who have physical contact with patients etc).
Comment: digital marketing. But my boss doesn't want us to work from home.
Comment: Do you have a medical reason for not being able to take the vaccine besides being scared of needles?
Comment: Have you had COVID recently? Some measures allow that in lieu of a vaccine.
Comment: No I have not..
Answer: south-africa
It is legal for South African employers to adopt a mandatory vaccination policy.  The guidelines for such policies are described in Annexure C of Consolidated Coronavirus COVID-19 Direction on Occupational Health and Safety Measures in Certain Workplaces, released in June 2021.
Briefly, it appears that employers may impose mandatory vaccination policies.  However, employees can object to being vaccinated policy on "constitutional1  or medical grounds".  If the employee does so, the  employer must "counsel the employee", refer them for further medical examination (if a medical exemption is claimed), and provide "reasonable accommodations" so that employees who remain unvaccinated can remain employed.
What exactly is a "reasonable accommodation" is in the eye of the beholder.  Working from home is mentioned as a possible accommodation in the above-linked document.  Other possible accommodations might include being transferred to a position that involves less public interaction, being required to wear a mask at all times, or working at different hours or a different location from other employees.  If reasonable accommodations cannot be made due to the nature of the employer and the employee's position & duties, then the employee may be dismissed.
Ultimately, what types of accommodations are "reasonable" will depend on the specific circumstances of the employer and the employee.  If you are considering going this route, it would be worth your while to consult with a lawyer.  If you have a trade union that represents you, it might be worth consulting with them as well.
Finally, while the above outlines your legal rights to refuse to be vaccinated, I feel obliged to encourage you to just get vaccinated.  The risks are minuscule and the benefits to you and those around you are substantial.

1 "Constitutional" here refers to religious beliefs but also to Section 12(2)(b) of the South African Constitution, which guarantees that everyone has the right "to security in and control over their body".
Answer: england-and-wales
Pimlico plumbers announced that they would be instituting such a policy.  However after some time they changed their mind to only require it of new starters.  It is thought this is because they considered it would be illegal to do so, under the Equality Act 2010.
Every case will be considered on its merits, and if the employer can make a case that theirs is a high-risk coronavirus work environment then it is quite possible that it would be ruled legal.  If digital marketing is a desk job, and other protections could be put in place that would not have such a discriminatory effect then that would probably not be easy.
Comment: Note that trypanophobia is not covered under the 2010 equality act- the potential issues were people with disabilities or religious objections.


CM module is height-unmixed?

Question: $A$ a Cohen-Macaulay ring (not necessarily local), $M$ a Cohen-Macaulay $A$-module. Then does it necessarily follow that $\mbox{ann}(M)$ is height-unmixed?
Answer: This is true if $A$ is local but fails in general.
First, a counterexample. Let $A=\mathbb Z[X]$ and $M= A/p\oplus A/q$ with $p=(2)$, $q=(3,X)$. Since any maximal ideal $m$ of $A$ can not contain both $2$ and $3$, when you localize at $m$ only one of the summands can survive at most, so $M_m$ will be CM. The annihilator is $p\cap q$ which is mixed.
Now assume $A$ is local and $I = \text{ann} (M)$ . We need to show that all the associated prime of $I$ have same height. Any associated prime $p$ of $I$ would be an associated prime of $M$, as $M$ is a faithful $A/I$ module. But then $\dim A/p = \dim M$ (see Bruns-Herzog, Theorem 2.1.2). Now, as $A$ is also CM, $\text{height}(p) = \dim A - \dim A/p =\dim A-\dim M$. QED
Comment: Thanks! I was aware of the local result, but spent an inordinate amount of time today trying to prove the non-local version. Your example puts an end to that. Greatly appreciated!

CM module is height-unmixed?


How plausible are inverted humanoids?

Question: How plausible is an upright, humanoid creature that is inverted, with the head at the bottom and the posterior region at the top? This creature could have evolved from a typical biped that evolved into an ape-like creature that brachiated with its hind legs, which then convergently evolved into a humanoid. The creature is not a tetrapod, and has a shoulder-like system on all limbs. Are there any issues with the inverted humanoid or it evolutionary history?
Answer: They are not plausible
There's a lot that makes this build troublesome. First is obvious. Hygiene. Things from the top go down. Some creatures are build to be strong against these things, but it does require energy and a special evolution to get this. Just having it go down your body, not even to your head, can be dangerous. Even without cuts or damages it can be bad, but anything open will receive a dose of dirty whatever.
Others aren't as obvious. Peristaltic movements (hope the translation is correct) now have to push up. Compared to an arm pushing food up, the gut isn't so effective or efficient against gravity. You'll expend a lot of energy just for digestion. As an extra bonus it's difficult to push water and such up. Not impossible, as the gut keeps gasses down, but their relative lightness and push from solids and liquids down can help a lot. In general just inefficient and requiring a lot of adaptations to function.
But your head between/in front of your legs also limits vision, possibly hearing and it's more prone to damage. You don't see just less from a lower ooint of view and require to look both up and down to navigate, you can't look easily past your legs. A knee, branch or just falling and hitting things with your crotch is unpleasant. The same with your head is downright dangerous. Especially if you try to move sensitive organs like ears, nose and eyes in better positions, it'll most likely also be more susceptible to damage.
There's probably a lot more, but this should already dissuade such evolution. It's just inferior, bringing a lot of problems.
Comment: @IchthysKing I can only say that I fundamentally disagree with that statement. Hygiene is very important to bith humanoids and brachiating humanoids. If feces and other run down the body, I'll say they don't even get to evolve before they die out from disease and infection. The suboptimal shape will also make it mighty difficult to thrive, unless there's little predation and easy food in abundance. I'm not saying it's impossible. I'm answering the question if it's plausible. It is not plausible, but not impossible.
Comment: Evolution doesn't work to perfect things. Most of these wouldn't be very big problems for the first, brachiating humanoids, and the later humanoids would more or less be stuck with their suboptimal shape
Comment: @IchthysKing except in here the hygienic conditions (or lack of), the potentially higher risk of diseases and the issues related to circulation and digestion could easily act as selective factors that favor a more "normal" posture over the inverted one. Not even sloths, which would benefit from being able to do their needs in the trees engage in such activities, even though going to the ground to relieve themselves is incredibly dangerous. [Same for how flying foxes do their deed](https://m.youtube.com/watch?v=H9ZK_NjBoJI).
Answer: I asked a similar question to a biology teacher when I was in high school, and he told me this:

It is very important for a mobile creature to see where it is going. That would not be possible if your seeing eye were the eye of your [redacted].

A few years later, Spore came out. I could put what my teacher had said to test, with mixed results.
Some creatures do manage to have their rears quite close or overlapping with their heads. Crabs and cephalopods are examples of creatures who do have a discernible head and who defecate through it. However those are a far cry from a humanoid shape or even a tetrapod one (consider the humanoid crabs of Fallout, though).
For a creature that hands around by the feet as you describe, consider bats. They also "brachiate" somehow with their feet, and they spend a lot of time hanging upside down. But when they do move, their head is ahead and their hind is behind.
This also made me think of spiders, who sometimes hang from a ceiling before pouncing on prey. They too move with their heads to the front most of the time.
If you wish a butthead to be a sensible biological feature, you've got to figure out how it can be an advantage. I just can't think of one. Easier grazing? Other animals manage by having a long neck. Defense? That gets harder when you can't see much well due to eye position. Sexual selection? Maybe, but introduces more problems than it solves. So... I think this one is a no.

How plausible are inverted humanoids?


Proper way of removing/hiding unwanted elements?

Question: There are many times where in drupal I'm styling a theme and if I don't need some element I cannot remove in settings I just hide it with css(display:none, or similar).
Is it considered a bad practice to do this and should I always use hooks or some over methods?
Comment: Can you give a few examples of unwanted elements?
Comment: Yes, hiding via css is bad practice, since it will anyway generated on Drupal, loaded to browser and make some js/css calculations.
So best way is theming/coding on Drupal side.
For your task hiding depend what you want to hide: form, page elements...
Comment: examples would be unwanted labels, links, some kind of extra options for a field(show row weights, edit etc.) sometimes whole  fields in comments section(only one i'm using a hook for it).
Answer: It depends what you are hiding.
If it is something like a page or block title or labels or other semantic type markup, you should hide it using the element-invisible class, which effectively hides it but without using display: none. This way screen readers can still see the text, which helps give visually impaired users context for the subsequent content, which is required for accessibility reasons.
If you are hiding actual content, like fields, or whole blocks, or menus etc. you should not be doing it in the CSS. It is best to do it on the back end.
The time when this is most important is hiding for access control. Never use css to hide data or fields that a users should not be allowed to see. Because that data is still available to the user, it just isn't visible by default. So that would be a security issue.
For forms you can use hook_form_alter(), hook_form_BASE_FORM_ID_alter() or hook_form_FORM_ID_alter().
For other areas, there are many possibilities depending on what you are themeing and what you are intending to do. Some examples, are hook_node_view_alter() for node pages, hook_user_view_alter() for user pages, other alter hooks, template preprocessors, theme functions and template file overrides.
For more information on drupal hooks see http://api.drupal.org
For more information on overriding theme functions and template files see http://drupal.org/theme-guide/6-7
Answer: The best way is to use hook_form_alter to get the form and unset the form elements.
Another approach is to make the element type to hidden.
i prefer the first one.


Accepted shared outlook.com calendar now what

Question: I've shared my live.com calendar with another outlook.com account following the steps at Share with People You Choose.  I clicked on the accept link in the the outlook.com account.  It asks me to log in, but I just see the calendar for the outlook.com account.  I don't see a way to see the calendar that I've supposedly shared.  Does anyone know how to get this to work?  I've shared calendars via urls before, but this sounds like it would be better if I could get it to work.
Answer: I suspect this "sharing with people" will show you open times and relevant information to them (share receiver), when you attempt to create & send an appointment/ meeting invite from the other account (share receiver).
A - Share Calendar
B - Receive Shared Calendar
B - Creates & Sends Appt. / Meeting Request - while doing this can see their own calendar and the open/ close times of A's calendar
I do not know for sure as I have not done this with anyone on live.com/ outlook.com personal accounts.
But, the typical behavior in Corporate Exchange Outlook is one where all employees are able to see 'partial' schedules i.e. atleast open/ close parts of other peoples calendars, when they wish to send an appointment/ meeting invite.


macOS version file

Question: This is kind of a weird one, does anyone know what contains the information of the version of macOS? is it written to some file? If so where does the file reside and can it be edited to a different version of macOS?
Comment: Possible duplicate: https://unix.stackexchange.com/q/582/117549
Comment: If the release number was available in a file, and you changed it, it would not change the release of macOS installed on the machine.  What is it that you are trying to do?
Comment: thanks for the reply, i am testing a feature that scans for a version of macOS, so if a user is on a version older than 12.x.x it should throw an error, I want to test this without imaging a mac device with an older version like 10.11.x, to save some time i want to see if I can edit the /System/LIbrary/CoreServices/SystemVersion file to set it to an older version of macOS (temporarily)
Answer: You can use sw_vers to determine this:
$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.14.5
BuildVersion:   18F132

Or, for a more succinct answer:
$ sw_vers | awk '$1 ~ /ProductVersion/ { print $2 }'
10.14.5

Comment: thanks for the reply, I know there are several ways to get the current version of macOS (such as "system_profiler SPSoftwareDataType), I'm wondering if i can edit the version of macOS in order to trick the system into thinking that it is something older (temporarily).

macOS version file


Problem with taxonomy

Question: I created a "Science" category, which shows up at the bottom of the add content page. But I also created a "History" category and that doesn't show up. Any ideas?
Comment: Thank you for your question and welcome to Drupal SE. What do you mean that the science category shows up at the bottom of the add content page?
Comment: If I hit "add article," when I am filling out the article, there are tags and below it, the science category that I can fill in.
Comment: This isn't enough information. What did you build it to do?
Comment: First off, thanks for responding. I am rebranding a current website (www.yttwebzine.com). The new website will be studyhallrocks.com. It offers historical context to today's issues, science news and current events. I know it's important to get the categories right!  Right now, under "vocabulary name" in Taxonomy, I have: forums, history topics, news, science topics and tags. I'm hoping I've done the categorizing the right way. But when I add an article, I find a box at the bottom that says "science categories." I don't find one that says "history categories."
Answer: The best I can interpret your question:
A "category" in this context is typically a Taxonomy. If you see the "Science" category when creating a node, that would mean there is a "term reference" field added to that content type.
If you do not see the "History" taxonomy options when adding new content, I would assume there is no term reference field on that content type to this taxonomy.
Add a new "Term Reference" field to this content type. Ensuring it is associated with the "History" vocabulary. Then when creating a new node of this type, you should see this field.
If this field is added to this content type, then I would double check your "form display" settings on the content type to ensure this field is available.

Problem with taxonomy


Convert Fanaticism

Question: Okay. I am not Jewish at all, but I follow the 7 Noahide laws.. my question comes why do some Jewish converts or people that are going through conversion, seem way way over the top and way too fanatic than lets say a Jewish person or example even a Rabbi?
Comment: I think it is the same with anything new.  For those of us who have been born into it, we take a lot for granted and it is harder to find that level of enthusiasm
Comment: https://www.sefaria.org/Pesachim.91b.12?lang=bi&with=all
Comment: Rubberducky, I suggest you work @שלום 's link into your question and reframe it completely away from being your personal experience, otherwise this is going to get closed as opinion based, which is a shame because you've spotted something fact based
Comment: They are keen just to "make up for lost time" and that translates itself into heightened level of enthusiasm.
Answer: I think that any area that is new, a person can become excited.
That being said I think there is a spiritual flaw/benefit that can be involved as follows:
Flaw:
Evening prayers it says in Hashkiveinu:
<code>והסר שטן מלפנינו ומאחרינו

Remove impediments (satan/evil inclination) behind us and in front of us
</code>
The Chofetz Chaim asks that in "in front of us" is obvious since he is blocking us from doing good deeds. What is "behind us"? He explains that sometimes the evil inclination can push us from behind to do more mitzvos. Why? To damage us, like giving too much charity so we become destitute. Or to stay awake learning Torah so we become weak the next day.
An excited "Baal Tshuvah" might be experiencing this Yetzer Hara. They should know what is "too much", but also don't do "too little". It is a hard balance.
Benefit:
The Rambam and many others explain that to find the "middle road" which is desirable (ie: to not be extreme) one (who is accustomed already to an extreme) sometimes must push themselves beyond the middle and relax into the middle road. For example a stingy person might need to spread too much money (beyond the normal charity) to accustom himself, and then to stop and relax into the middle road. (Chapter 4 of Introduction to Pirkei Avos).
Conclusion:
So perhaps done with keen insight this can be a useful tool for character development but done with pure emotion and no thought, can cause burnout causing more destruction. For this reason I always suggest caution and to go slow when uncertain, but this is my personal nature.

Convert Fanaticism


How do I politely say I want to be rolled off to a project?

Question: I suffering from bipolar disorder and the daily night shifts doesn't help my condition either. I want to be rolled-off in the project but I do not know how to say or start with this in a polite manner.
Comment: A rough location would be good too, to know what jurisdiction you're in.
Comment: Can you give some additional detail such as: what are the alternatives in your company to being on "this project" -- have you already identified an opportunity you could move to? What sort of setup do you have, e.g. is it a "consultant" sort of model where you get assigned to particular projects or are 'on the bench'? How did you come to be in the situation? And (if relevant) how your disability (?) affects this, is it worse lately etc? [I suspect it's likely to be closed as "too vague" or similar unless you can give more context and detail, although I didn't downvote or vote to close.]
Comment: Here's a formula I find useful in asking questions on here: 1) Background (e.g. history, type of work if relevant, any back-story that sheds light on it), 2) The current situation / problem (what's going on that you need an answer to) 3) Question/problem to be solved 4) Things I've tried already (if relevant)
Comment: e.g. *Background/Current situation*: I work for a consulting [or whatever] org and I'm currently assigned to a project which requires night shift support work ([Or whatever it is]) for the last 3 months. So far I have been performing well but I suffer from bipolar disorder and the night shifts are not helping my condition and my health is suffering. So if possible I would like to move to a different project for health reasons. *Q to be solved*: How can I politely ask to be moved to a different project? *What I've tried*: .. [I can't suggest this as I've no idea what you've tried!]
Answer: Politeness is about the words you chose, and your tone, and not so much about what you are asking for. Be clear about what you are asking for and why.
If you want to be taken off of a project, it's not going to happen if you don't ask. It also might not happen if you do ask, but if it's something you need for your well-being, than find a way to make it happen for yourself. You are worth it.
Answer:
the daily night shifts doesn't help my condition

I think you mean that you have to work nights, and that working nights has been detrimental to your health in the past.   (Even if it hasn't been detrimental yet in this job.)
So, we are really close to an employment law question and the two problems I have are that I don't know your jurisdiction... and I am not a lawyer (IANAL)  :-)
Given that, I'll still suggest a few things:
If my assumptions above are correct, you can talk to your health professional about it and request a "doctor's note."  It doesn't need to mention bi-polar, just that you request the "reasonable accommodation" of being moved to first or second shift.
The employer may not regard this as reasonable, especially if it was part of the offer they made to you.  Or if it was part of the offer when it was made to your employer.
You can talk to your health professional about it and see if there are different drugs or dosing that will make it less likely that your bipolar will flare up during night work.  In addition to IANAL, I'm also not a pharmacist, nor have I any medical training (except an old CPR course).
If the lack of daylight is an issue, maybe you can adjust to be awake more daylight hours.   What I did in college: sleep from 2pm-10pm so you are rested for your job (Midnight-8 AM) but still get six hours of sunlight (from 8 AM - 2 PM).


Research fund for PhD students in Italy

Question: Are there any sources where I can find the information regarding the research funds for PhD students and the purposes list on which it can be used?
There is 10% of annual stipend amount available as research fund for PhD students in my University, however I cannot find the regulations for it in English, only in Italian.
I know that these money might be used to cover the travelling expenses for the conferences, but what I wonder is if I can transfer these money to my stipend if I don't use it totally?
Comment: Perhaps I'm misunderstanding something, but it sounds like you should be asking your university this question.
Answer:
but what I wonder is if I can transfer these money to my stipend if I don't use it totally?

No, usually you can't.
In Italy, typically, funds cannot be transferred directly to non-employees (a PhD student is not an employee of a university), and only certain funds, like those coming from research contracts, can be transferred to employees. In the latter case, the payment should be approved by the department.
Moreover, as a PhD student, you are probably not even directly responsible of those research funds, which are probably under the responsibility of your advisor.
Answer: I don't know the regulations of your institution, but normally, in Italy like anywhere in the world, one is not allowed to transfer research funds directly into their pockets, for many good reasons. There are strict regulations on which expenses and activities you can use them for, to prevent abuses.

Research fund for PhD students in Italy


Orthonormal Basis integration and Kronecker delta

Question: Given that this integral I'm trying to solve is
$$\frac{2}{\pi}\sum^{\infty}_{l=0}\sum^{l}_{m=-l}\int_{r=0}^{\infty}\int_{k=0}^{\infty} R_{nl}(r)b_{lm}(k)j_{l}(kr)k^2 r^2 \int_{\theta = 0}^{\pi}\int_{\phi=0}^{2\pi} Y^*_{lm}(\theta,\phi)Y_{l'm'}(\theta, \phi)\sin\theta \,\mathrm d\phi\,\mathrm d\theta\,\mathrm dk\,\mathrm dr$$
where $R_{nl}(r)$ is the Radial Wave Solution of the Hamiltonian of the Hydrogen atom, $b_{lm}(k)$ is a spectral function that depends on $k$, $j_l(kr)$ is the Spherical Bessel Function and $Y_{lm}(\theta, \phi)$ is the Spherical Harmonics. Given the orthonormal relations of the Spherical Harmonics, the integral should technically then becomes
$$\frac{2}{\pi}\sum^{\infty}_{l=0}\sum^{l}_{m=-l}\int_{r=0}^{\infty}\int_{k=0}^{\infty} R_{nl}(r)b_{lm}(k)j_{l}(kr)k^2 r^2 dkdr \delta_{ll'}\delta_{mm'}$$
I have a very simple question which is how does this integral usually proceed from here with the sums and Kronecker delta given that they are summing over two different indices, do the sums not just collapse to one term where $l=l'$ and $m=m'$?
Comment: in a word: yes.  Basically do the $m$ sum first to pick up the $m=m'$ term and then the sum over $\ell$ to pick up the $\ell=\ell'$ term.
Comment: But how does that affect the l's and m's of the $R_{nl}(r)$, $b_{lm}(k)$ and $j_l (kr)$?
Comment: @ZeroTheHero That should have been posted as an answer
Answer: The Kronecker Delta in a sum acts like the Dirac Delta function in an integral. So basically you can drop the sums and remove the delta terms. Your integral will be the integrand without the Kroneker Deltas. You technically can make the $l$s and $m$s primed if you wanted to, but that's unneeded primes (unless the context requires the primes).
Comment: I suppose it depends on the context for this expression, whether the primes are unneeded. If it's set equal to another expression which also has prime indices, then the indices obviously have to match. But of course you're right that on its own, you might as well use unprimed names for the indices. (Thanks for converting this BTW)
Comment: @DavidZ yes I agree with you on this.


Is it illegal to post a picture of you and your ex best friend on social media without her consent?

Question: We went through a fight and me and her are no longer best friends. I posted a TikTok about her and me no longer being friends. It says "dear ex best friend" there is nothing inappropriate or rude. The pictures are of me and her. She did not give consent. She is telling me I need to take it down. And that it is illegal. Can I get in trouble for not taking it down?
Comment: Take it down, which is the decent thing to do in the situation. You can lose your account if you don't (I know you can on Facebook) because that's what the company can do. Legal consequences are possible; she might get a court to force you to take down the image, depending on where you are.
Comment: Jurisdiction matters and needs to be specified, I believe the answer for this will be different in different countries.
Answer: If someone else took the picture, you have to have their permission to make any copies including posting it online. The TikTok EULA (US version) allows you to post material that you have the right to post (e.g. a photograph that you took; the photo is not a "private photo") as long as it isn't in violation of the various prohibitions in §5 (intimidating, pornographic, or material that TikTok judged to be objectionable). Nothing in the EULA requires you to obtain permission to post pictures of an individual. There is no US law requiring permission to post a picture of a person.


How to create a tag synonym?

Question: I think I found a good tag synonym, so how should I create it? Do you have to be a mod to create it? Please tell me quick, since I might forget it.
Answer: The tag synonym system doesn't really scale down to sites as small as ELL.  If you'd like to propose a tag synonym, I suggest creating a meta thread to discuss it.  If everyone agrees, a mod can create it for you.
Eventually, if the site gets bigger, the system for suggesting tag synonyms may be useful.
Answer: You need to have the Create Tag Synonyms privilege to propose tag synonyms. If you think a synonym is necessary, you can post it here, and someone with the required reputation can propose/add it.

How to create a tag synonym?


How can I test the maximum current an outlet will provide?

Question: I want to know how much power is still available on a circuit.
I went to the electric supply store but they could not locate the device I described...
I want to plug a device into an outlet and slowly increase the draw until the breaker pops so I know how many more things I can plug into the outlet.
Comment: Hello, and welcome to Home Improvement. As others have said, what you describe would be dangerous, as breakers aren't perfect when you're running near (or a bit above) the limit. And, you should probably [take our tour](//diy.stackexchange.com/tour) so you'll know how best to participate here.
Answer: It's called a Kill-A-Watt
A testing instrument that tells you what your appliances are currently drawing.

But you don't load up the circuit to breaker trip, because that would be reckless and unsafe.  You use it (or them) measure the actual current draw of the other loads and add them up.
You must also multiply any continuous loads by 125% when factoring.
Example: You have a 20A circuit.

1 amp of floor lamp
5 amps (a 4 amp PC, on continuously so rated 125%)
8 amps of air conditioner

That leaves 6 amps usable for a non-continuous load, or 4.8A for a continuous load.
Answer: Intentionally overloading breakers isn't a good thing to do and I don't know of any device that does that. What you can do is add up the wattage on the circuit and divide by the circuit voltage. A 20 Amp breaker will handle 2400 watts at 120 volts; a 15 Amp breaker will handle 1800 watts at 120 Volts.
You can also buy an AMPROBE which is a meter to measure current. You clamp it on to a single wire in the circuit and it measures the current being drawn.
Answer: I think the safer way to go about this is to determine what else is connected to that breaker.  Then total up the amps of everything.  (Don't forget about the potential unused outlets that could consume current someday).  I believe Harper's derating (125%) is important as well.  Many things will tell you the maximum current they consume (printed somewhere).  The meter Harper mentions will tell you what it is consuming at a point in time (similar for Jack's amp meter/probe).  Use a meter if a device's current consumption is unknown, but be aware it's possible it could consume more at times (for example, have current peaks like a motor has when starting up).


How is it possible to have four types of generating functions?

Question: Since the Hamilton's equations of motion remain unchanged in form under a canonical transformation $(q,p)\to (Q,P)$, the Lagrangians must differ by a total time derivative of a function of $q,t$. In other words, $$L-L'=\frac{dF(q,t)}{dt}$$
$$\Rightarrow (p\dot{q}-H)-(P\dot{Q}-K)=\frac{dF(q,t)}{dt}$$ where $H(q,p,t)$ and $K(Q,P,t)$ are respectively the old and new Hamiltonians. How can there be four types of canonical transformations $$
(i)\ F_1(q,Q,t), \qquad (ii)\ F_2(q,P,t),\qquad (iii)\  F_3(p,Q,t),\qquad (iv)\  F_4(p,P,t)$$  if $F$ were to be a function of $q$ and $t$ only?
Answer: OP's first formula applies to the Lagrangian formalism in configuration space. In the context of canonical transformations (CT), it must be replaced with the corresponding formula in Hamiltonian phase space, i.e. the generating function $F(q,p,t)$ is also allowed to depend on momenta $p$. Since the new phase space variables $(Q,P)$ are supposed to depend on the old phase space variables $(q,p)$ and time $t$, we may assume that the generating function $F(q,p,Q,P,t)$ depends on both new and old variables. The four types of CT are special cases.


Sequence that converges weakly but not strongly

Question: I'm trying to construct a sequence that converges weakly but not in the norm. I assume that in $l_\infty$, $$x_n = (0,\ldots,0,\underset{\substack{n\text{th}\\ \text{position}}}{1},1,\ldots)$$ will do the job. It does not converge to $0$ in the norm, but I do not see why it converges weakly (if it does?).
Comment: Your sequence would furnish a counterexample in $c$.
Comment: I'm not sure it does. See [this post](http://math.stackexchange.com/questions/184083/characterization-of-weak-convergence-in-ell-infty). However, consider the unit vectors in $\ell_2$ for an example of a weakly convergent sequence that is not norm convergent.
Comment: I think DavidMitra is right about your example.
If we take the [ultralimit](http://en.wikipedia.org/wiki/Ultralimit) $f(x)=\operatorname{\mathscr{U}-lim} x$ for some non-principal ultrafilter $\mathscr U$, then $f\in\ell_\infty^*$ and $f(x_n)=1$ for each $n$. This argument wouldn't work if you took $1$ *only* in the $n$-th position and zeroes on all other positions.
Answer: This particular sequence does not converge weakly in $\ell^\infty$: On one hand, let $\pi_k\colon\ell^\infty \to \mathbb K$ by the $k$-th coordinate projection, then as
$$\pi_k(x_n) = 0, \quad n > k $$
the only possible weak limit is $0$. On the other hand, let $c \subseteq \ell^\infty$ denote the subspace of convergent sequences, let $L \in(\ell^\infty)^*$ be a Hahn-Banach extension of $\lim \colon c \to \mathbb K$. We have $L(x_n) = 1$ for all $n$, but $L(0) = 0$. So 0 isn't the weak limit either.
Comment: Thanks for the comments. I was trying to show the following: If F is a Banach space and $f_n\subsetF^∗$ is weak star converging to $f\in F^∗$ and $x\in F$ is the weak limit of $(x_ n)_n\subset F$ then $f_n(x_n)\longrightarrowf(x)$ does not hold in genearal. So I am trying to construct the corresponding sequences, without success so far.
Comment: For any $F$? If you only want some $F$, take $f_n = x_n = e_n \in \ell^2$. Then $f_n(x_n) = 1 \not\to 0 = 0(0)$.
Comment: right, just one $F$ in which the property fails. Thanks.


Patching GHOST Vulnerability # CVE-2015-0235 SLES 11 SP3

Question: I need to upgrade a SLES 11 SP3 server for the new ghost vulnerability that has been discovered.
According to http://www.cyberciti.biz/faq/cve-2015-0235-patch-ghost-on-debian-ubuntu-fedora-centos-rhel-linux/ I should be able to run zypper although this doesn't work as it says there are no packages found.
However, Zypper isn't any good to me any as the server I need to upgrade doesn't have direct access to the internet, so I need an offline install, I guess an RPM would be best. I've had a look at the novel repos but it doesn't seem to have been updated.
Thanks for your help.
Answer: Do you have a Novel account?
Regarding this link you can download the files.


How do I add a receptacle outside off the porch light

Question: I put in a gazebo in the back of the house and I want to install a receptacle from the only electrical source which is a porch light. I could just run some wire thru the base of the light and run it to the receptacle but it looks very cheesy. Is there a type of box or extender I could use to make up to code and look like it was done right
Comment: What kind of load will you put on it?  You would likely need a GFCI outlet.  How is the light attached to the wall and what is the shape of its base (a picture would help)?  Are you considering a surface mount box, or surface mount channel running to a surface mount box, or mounting it inside the wall?
Comment: Can you post photos of the existing configuration?
Comment: The light is presumably controlled by a wall switch which means that it *might* have only *switched* power at the light. If so, a receptacle fed from the light would only be powered when the light is switched on. However, it is possible that you have line power (not switched) available in the box. You would have to open it up and look at the wires. If there is only one cable in the box with one black, one white and a ground, then you don't have line power (always on) available in that box.
Answer: You can add a box extension with knockouts, then run conduit down to a box with a WR weather resistant GFCI. If the cover or roof of the gazebo protects the location from rain a standard cover can be used but if it is wet your will need a hard use or in use cover (and the box itself will need to be listed for wet locations). Some folks don't like surface mount conduit if this is you you can box the conduit in. I have seen some very artistic "cover up's of conduit that made it look like a grape vine at first I did not realise it was conduit as they were on several posts.


How to burn Windows compatible CD on Mac OS X Mountain Lion

Question: I burned a CD with pictures and PDFs on my Mac Pro but my Windows machine cannot read the CD. Should I have burned the disc differently to make it Windows-readable?
Comment: How do you burn CDs then? Using the Finder should result in a CD which is readable by more or less every OS out there.
Comment: That's what I thought. And I used to do so on Snow Leopard. But in Mountain Lion, there are no burn folder in finder, all I can do is right click and files and burn them onto the CD.
Comment: You can either burn a folder via right-click or create a burn folder via the menu. Both should create standard CDs
Answer: From http://support.apple.com/kb/PH10699?viewlocale=en_US (it applies to OS X 10.8 "Mountain Lion"):

You can burn files to a CD or DVD and then use that disc as a backup,
  send it to friends, or copy the files on it to another computer.
  Discs you burn on your Mac computer can also be used on Windows computers and other types of computers.

You just have to follow the instructions in there. If you prefer, you can read more detailed instructions here: http://www.dummies.com/how-to/content/burn-cds-and-dvds-on-the-fly-in-mountain-lion.html
Both guides come down to this:

Insert a blank CD.
When the disc appears on your desktop, double click it and drag the files you want to burn into the window.
Then press the "Burn" button in the top right corner of the window, change disc name to something that makes sense to you and press OK.

Make sure you choose a CD type that can be read on your Mac and your Windows machine. For instance, check that CD speed and capacity are supported by both optical drives.
If you wish to reuse a disc (CD-RW/DVD-RW/DVD+RW) you have to erase it first using Disk Utility. See http://support.apple.com/kb/PH5849 for more information.


How to import a plain private key into Parity?

Question: Basically the parity version of this.
Can Parity import raw private keys or Geth keystore files?
Answer: In addition to stone.212's answer, here is another way:
Simply follow the instructions to import a private key into Geth, and then copy your keystore file into Parity's keys folder.
Answer: I seem to remember just copying them into .local/share/io...../keys.  The keys I had were generated on myetherwallet though, not geth.  Or depending on how you installed, it might be ~/.parity/keys.
I think there is also an "import" function in the Parity UI that is accessible at port 8180.  So open a browser to 127.0.0.1:8180 on a computer that is running Parity.)
Answer: There is also a command-line option:
<code>parity account import [path to geth keystore file]
</code>


Is there a Catholic ceremony for virgins who are not nuns or sisters?

Question: I once saw online that there is a Catholic classification or special private ceremony for women who are chaste and do not engage in any form of sex. This is for women who are not nuns or sisters. Is there such a thing?
Comment: Take a look at the [Wikipedia article on "Consecrated virgin"](https://en.wikipedia.org/wiki/Consecrated_virgin) and see if you still have questions.
Comment: There's a good blog on this: https://sponsa-christi.blogspot.com/
Comment: Yes, there is. In fact our diocese has some consecrated virgins that do marvelous work here. They were in fact consecrated in a public ceremony  by the Archbishop of Vancouver (Canada).
Answer: Nuns (contemplatives) or sisters (active life, e.g., teaching, nursing, etc.) belong to religious orders or congregations. They take vows required by their order, which include the vow of virginity.
A lay person can make a private vow to observe virginity "under the virtue of religion."¹

a vow of perfect chastity by a lay person…could be a public vow only if it were made in the name of the Church and accepted as such by a legitimate ecclesiastical superior.¹

Although "such a public vow was forbidden by the Holy See in 1927,"¹ it is permitted by the 1983 Code of Canon Law canon 604, as it had been at other times in Church history.
On the difference between public and private vows (and solemn and simple vows), see 1917 Canon 1308 or 1983 Canon 1192 (commentary):

A vow is public if a legitimate superior accepts it in the name of the Church; otherwise, it is private.

A vow is solemn if the Church has recognized it as such; otherwise, it is simple.

Vows are also either perpetual or temporary. Vows differ from promises in that vows bind under the virtue of religion; viz., to break a vow is a sin against the virtue of religion.

ch. 5, "The Manner of Dedication," of The Mystery of Love for the Single: A Guide for Those Who Follow the Single Vocation in the World by Fr. Unger. For an explanation of the 1927 denial, see: "Explanations for the 1927 Denial" (PDF pp. 129-33) of the 2019 dissertation by Judith M. Stegmancf. also Pope Pius XII's encyclical Sacra Virginitas and this informative blog written by a consecrated virgin
Comment: Good answer. Here is an example http://www.madisoncatholicherald.org/bishop/41-bishop-category/2774-gudenkauf-consecrated.html from my diocese
Comment: I believe they take a bow of chastity, not virginity. A woman who was not a virgin when they became a nun could not take a vow of virginity.
Comment: It looks like there are a couple of dangling asterisks. Were you trying to italicize something or perhaps have a footnote that got excluded?
Answer: Desiring to expand on Geremia's answer, I would like to add the following.

The consecration of a virgin living in the world, which dates back to the earliest years of the Church, fell into disuse for centuries before it was restored after Vatican II.
Worldwide, there are approximately 3,000 consecrated virgins, with an estimated 215 in the United States, according to the U.S. association, which currently has about 100 members. Many consecrated virgins are aged 40-60 and hold a variety of professions, according to Judith Stegman, the association's president.
Consecrated virginity is not a sacrament because there is no outward sign (unlike marriage, the consecrated virgin's spouse, Christ, is not visible). The consecration is public and permanent, per the Code of Canon Law. "Through their pledge to follow Christ more closely, virgins are consecrated to God, mystically espoused to Christ and dedicated to the service of the Church" (Canon 604 on the Order of Virgins). "In itself, the state of consecrated life is neither clerical nor lay" (Canon 588), so the women remain in the secular state in the world.
According to the Rite of Consecration to a Life of Virginity, it is "a solemn rite constituting the candidate a sacred person, a surpassing sign of the Church's love for Christ and an eschatological image of the world to come and the glory of the heavenly Bride of Christ." Thus it is open only to women because they alone can physically image a bride, Stegman explained. -
  Consecrated Virgins: Witnesses to Christ's Love for All Souls

The actual Rite of Consecration to a Life of Virginity can be found here: CONSECRATION TO A LIFE OF VIRGINITY FOR WOMEN LIVING IN THE WORLD.


How to give a name to my forked Ethereum blockchain

Question: I created my own private blockchain with Go Ethereum, now I want to put my own name for the symbol and network name. To do this, I checked the BSC code, it is a fork of Ethereum, and the BNB name in code is not specified anywhere. The guess I made myself is that the name is a contractual thing and it does not need to be defined somewhere, unlike the name of the token where we specify the symbol and the name, in fact we do not specify a place in naming the coin. And we just call our blockchain by this name and others know it by this name, is my guess right or am I wrong? , please help me.
Comment: A chain is typically identified by a chain/network id and not a name. So you'd want to configure a chainId for your network and metadata such as the name is managed/announced externally. See https://chainlist.org/
Answer: Heyy Mehran Ra,
So If You Forked/Clone the Repo of geth and runned the Private Node
You must have made the Genesis.json there
Give them a Unique Chain Id there.
In Config File aka genesis.json you cant name the Chain because the Identity of the chain is Chain Id not the Name
If You have any doubt you can ask. ✌


make vertices have the same number of weights

Question: In my scene the model only has three bones attached to it.  Most of the vertices have weights for these three bones, but a few of them only have weights for one or two of the bones. For some reasons, I'd like to let all of them have weights for "at least" three bones, and "no more than" three bones, because for now a few of the vertices only have weights from one or two bones.
Answer: Bones deform vertices that belong to a vertex group of the same name as the bone. You can manually assign and adjust the weight a vertex has for each group.
While in edit mode the vertex groups panel looks like this -

The assign button will assign the selected vertices to the selected group with the current weight setting. The remove button will remove the selected vertices from the selected group.
In the properties sidebar there is a Vertex Weights panel that can help, it can be elusive as it only shows if a single selected vertex is assigned to one or more vertex groups or multiple selected vertices that belong to the same group (only the one common group will show).

There is also the show vertex groups weight addon which you can download from here.


high-level ruby library for encryption

Question: It seems like the most established ones like keyczar, cryptlib and NaCl are not available for Ruby. What are some ruby libraries (or bindings) for a high-level library where decisions about cryptographic primitives have been made for you (no need to generate IVs, CBC vs EBC etc.). I did find ruby-gpgme. There's also libmcrypt which has support for symmetric encryption of streams which is what I am ultimately interested in.
Answer: NaCl is now (1.0.0 of the gem was published some days ago) available for Ruby through RbNaCl (which uses libsodium, "portable, cross-compilable, installable, packageable, API-compatible version of NaCl"). There is also krypt.
Answer: Why not OpenSSL?
It is part of the standard libary:
http://ruby-doc.org/stdlib-1.9.3/libdoc/openssl/rdoc/index.html
Comment: It provides primitives, not really plug-and-play. Besides it's easy to make a mistake. That's why there are high-level crypto libraries.
Answer: ruby-mcrypt, last commit is from two years ago. You might be better off with OpenSSL and some tests to check any mistakes in your code.
Comment: I didn't mean implementation mistakes but wrong decisions about crypto. For example, choosing the wrong cipher mode, using Random instead of SecureRandom etc. These kind of mistakes are hard to spot even through code review. In the case of mcrypt - yes, I should probably just use OpenSSL's ciphers. There's not much I can mess up :)
Answer: Since Keyczar is a Java library, you should be able to use it by either running JRuby or by accessing it with RJB ( http://rjb.rubyforge.org/ ) from plain old Ruby.  It doesn't look like there are any extremely simple interfaces to it or documentation on using it in JRuby, but the Keyczar API is pretty simple and it may not be hard to integrate.
Answer: There is a plug'n'play library providing some cryptographic services in a very easy-to-use manner for Ruby, it's called Themis (gem rubythemis, more info @ https://www.github.com/cossacklabs/themis).
Disclaimer: I'm one of the contributors in this library and am very interested to draw more attention from Ruby community to it to make it more suitable to Ruby people: we understand how Ruby hold completely different patterns and methods of working with external libraries and would like to hear any feedback and advise - for now it just works, but the beauty factor is left aside :)

high-level ruby library for encryption


GameCenter doesn't use sandbox mode

Question: my app doesn't use GameCenter in sandbox mode on my iPhone. Usually (on my old and new iPad) the sandbox mode is enabled after I started a development which was installed through Xcode with dev-profiles. It disables GC when you launch an app which was installed through GameCenter.
I've already tried several things: Logging out and in in the GC app and int the settings app, restoring the iPhone, deleting the app. I don't know what to do next and need some help.
Answer: You need to log OUT in the GC app. Make sure your app is registered in itunesconnect.apple.com even though you're not ready to submit it yet. Then make sure game center is enabled for it in itunesconnect. Then launch the app and log into GC from within the app. You should then be in sandbox mode.

GameCenter doesn't use sandbox mode


How to create urgency for clients to provide content, answer e-mails, etc

Question: So as the title says, how do you (freelancers, or the company you work at) create some urgency feeling so that clients don't take forever to come up with content or to reply to your e-mails? There are some clients that are stretching projects way past their normal development time because they are just so slow when it comes to answering. I present them with a fully developed site with dummy content (if no final content is provided) and clients have CMS access. It seems to be more of an issue at the end of a development cycle when the site is ready for launch, sometimes clients get stuck on minor details or board approvals that take forever and some projects can get stuck for months even when it's a big company...I am not contemplating monetary fines but I'd like to know if you have any techniques to create some urgency feeling.
Answer: Honestly this is an ongoing issue for all of us, and there are no good solutions. I know you said you are not contemplating a fine, but that's what I've now resorted to after several years of dealing with this. Here are a few things I've tried:

Clear language in the initial contract about the importance of deadlines.
Set up project management software to automatically remind the client of deadlines as they approach.
Weekly reminders/check-ins about upcoming and past deadlines.
Higher-up point-of-contact if things get delayed.

Even with all of these, sometimes money is the only answer to create urgency. I've now added a "project reinstatement fee" for projects that are beyond 1 month delayed due to client inaction. It's up to my discretion to initiate it, and they'll be contacted first to let them know the fee is impending. Basically, it's to put them back in the queue rather than at the bottom. Good luck!
Comment: Thank you for your answer, it really is something to consider, I just wanted to make sure all of the possibilities are covered before getting to that but I'm sure it's the most effective way.
Answer: I ask closed questions and provide what I call "default answer" in case of missing reply.
E.g. "I've use this green color. If you want another shade of green you have 7 days to mail me with your preference" or "I've wrote this text, send me corrections. After 14 days with no replyes from you, the text is considered correct". When client has to provide content you can ask "I need this picture/text and If you provide me in the following days I will upload them for free. After 14 days with no content provided, you accept to receive an 'how to' explaining how to do it yourself at a cost of $$$".
(Note: for practical use, it's better to add theese sentences a little more kindness :P they're just examples)
After the time frame you set, the client risks to pay a little fee justified by the fact you have to regain focus on the project.
In a wordpress script of mine a client took 1.5 years to check for correctness. Finally it was correct, but I've to wait so much to be paid and to declare the end of the project.
Now I've learn to use 'default answers'... maybe I wait a little more than claimed and I add a little of flexibility, but even from a legal point of view, I'm more protected (with pec or mail with receipt confirmation or whatsapp messages where you have proof of message read/received).
This way the client has a time limit to act and if he waits too much, he has accepted my 'default answers' so I can ask payments, continue with the following step of the project, ecc. In case of late reply I have to take extra steps or undo/change something and it can require a little extra payment.


Representation of Sampling Frequency in the Fast Fourier transform

Question: I have 21600 data in the time domain. What Sampling frequency should I use? can someone explain the effect of showing the result by selecting different sapling frequencies?
Cheers
Comment: If you have 21600 data points in the time domain, your data has already been sampled. At that point a sampling frequency was already chosen. Can you clarify what you would like to do with the data?
Answer: For a N sample FFT, the samples are distributed from DC (f=0) up to one sample less than the sampling rate.
I have the plots below demonstrating this (the FFT is an algorithm that gives us the DFT or Discrete Fourier Transform), where the last sample is shown as the sampling rate, but as mentioned above, in this example it would be sample number $101$ not shown that would be exactly $f_s$.  What is also shown is the frequency periodicity property of the DFT, where the frequencies above $N/2$
 are also equivalently the negative frequencies (where in Matlab / Octave and Python scipy.signal we can use the fftshift command if we want to view the spectrum centered about 0.
The common ways to represent the frequency axis are listed in the plot below, showing how they all relate to the sampling rate.  The top row with frequency given in cycles/sec or Hz would be our typical representation in the continuous time domain, as well as radian frequency given as radians/sec which is not shown but would extend from $0$ to $2\pi F_s$. The second and third row are "normalized frequency" where we divide the Hz or radians/sec representations by the sampling rate, which is most commonly used for representing discrete time signals. The bottom row is the frequency index of the DFT, where $k$ represents the bin number for the $N$ samples in the DFT, ranging from $k=0$ to $k=N-1$.


What is a sustainable source of mailing envelopes?

Question: Where can one obtain mailing envelopes which are more sustainably sourced than usual?
Answer:
The following practice is not 100% sustainable.
However, the practice is more sustainable than what a lot of people do.
Given two practices p1 and p2 we can say that practice p1 is more sustainable than p2 in the same way that given buildings we can say which building is taller than the other building (via relativistic comparison) in spite of the fact that neither building is an element of the set of all tall buildings.
Use used shipping supplies
Purchase (or make) a large box or bin for shipping supplies.
When you receive a box, or envelope, remove the item you purchased from the package you received.
Place the used empty bubble mailer, used box, and/or used packaging material inside of your bin for shipping supplies.
The mass of materials required to preserve, and store, used packaging materials is less than or equal to the mass of materials required to preserve, and store, new packaging materials.
For example, a warehouse full of used cardboard boxes has the same amount of steel framing as a warehouse full of newly manufactured boxes.
Whenever you wish to mail, or ship, an item to another person, then place your item inside of the used box or used envelope.

Addendum on Tape
My main point was that using used mailing and shipping products is more environmentally sustainable than using new products, relatively speaking.
The envelopes can be re-sealed with tape.
Kraft tape, which is made of of paper and water-activated adhesive, is more sustainable than tape with a plastic backing or plastic substrate.
The rate at which most vegetation grows is faster than the rate at which black petroleum oil forms from dead algae and small ocean animals.
The rate at which perennial trees (and the annual plants used to create linseed linen, grow back) is greater than the rate at which petroleum finishes forming from dead plants.
Plastic tape sourced from petroleum is less sustainable than paper or line tape sourced from perennial trees or annual plants.
Answer: In most developed countries it is possible to buy envelopes made from recycled paper. They are made in a variety of colors: brown unbleached, white, cream and black.
If you enter sustainable envelopes or envelopes made from recycled paper into an internet search engine you'll be able to find a supplier new you.


Is there a source for the claim that a dishonest person cannot do teshuvah?

Question: If I recall correctly, I remember someone saying in a shiur a long time ago that a dishonest person cannot do teshuvah. Is there any source for this claim?
Comment: What does this mean? Teshuvah means that he no longer acts dishonestly and pays back what he has stolen.
Comment: I've no source, but it stands somewhat to reason. I mean, someone thoroughly dishonest can't admit to himself that he did wrong, a key component of _t'shuva_.
Comment: @msh210 That is exactly the type of dishonesty that I was referring to, lying to himself and to others. Shall I edit the question to replace the words "dishonest person" with "habitual liar"?
Answer: Anyone can do Teshuva but a dishonest person can't always pay back and make amends.
The Gemora (Bova Basra 88B) says קשה עונשן של מדות יותר מעונשן של עריות
The punishment for using false measures is more severe than the punishment for transgressing the prohibition of forbidden sexual relations.
The Gemora goes on to discuss why and says מאי עודפייהו דהתם אפשר בתשובה והכא לא אפשר בתשובה
in the case of one who engages in forbidden relations, he has the possibility of repentance. But in the case of one who uses false measures, there is no possibility of repentance because he has no way of knowing whom he cheated, and is therefore unable to return the stolen money.
However the Gemora (Bava Kama 94B-95A)discusses Teshuva for  theft. Even if the thief doesn't know who he stole from he can try to pay back by paying communal needs. (Tosfos says that doing so isn't a real repayment)
It is said over in the name of the Chofetz Chaim that Gezel Shinah (keeping someone else up) has no way to be paid back


Git under nushell not using added ssh-key

Question: I am having trouble setting up nushell in windows 11 to not always ask me for the password for my ssh-key when I am using git.
I have confirmed that ssh-agent is running used ssh-add to add my key and
ssh-add -l
shows that the correct key is indeed added.
But whenever I issue a git command that would require ssh, I am asked for my password again.
Any ideas why this might be the case?
Answer: Short Version
git config --global core.sshcommand "C:/Windows/System32/OpenSSH/ssh.exe"

More Detail
I was able to reproduce this.  It seems that, by default under Nushell:

In my case, ssh-add (and ssh) in Nushell is coming from the Windows OpenSSH implementation.  I'm assuming you have the Windows OpenSSH client installed?
> which ssh ssh-agent ssh-add
╭───────────┬───────────────────────────────────────────┬──────────╮
│  command  │                   path                    │   type   │
├───────────┼───────────────────────────────────────────┼──────────┤
│ ssh       │ C:\Windows\System32\OpenSSH\ssh.exe       │ external │
│ ssh-agent │ C:\Windows\System32\OpenSSH\ssh-agent.exe │ external │
│ ssh-add   │ C:\Windows\System32\OpenSSH\ssh-add.exe   │ external │
╰───────────┴───────────────────────────────────────────┴──────────╯

On the other hand, as far as I can tell, git for Windows seems to default to using the Git-bash provided /usr/bin/ssh.  This requires that the environment variables are set properly by /usr/bin/ssh-agent -s (normally eval'd into Bash or other shell).  Under Git-Bash:
$ which ssh ssh-agent ssh-add
/usr/bin/ssh
/usr/bin/ssh-agent
/usr/bin/ssh-add

Since the Git-bash /usr/bin/ssh-agent isn't available under Nushell for Windows, we need to config Git to just use the Windows OpenSSH agent directly.  This can be done (reference) via:
git config --global core.sshcommand "C:/Windows/System32/OpenSSH/ssh.exe"

After I did that, git under Nushell used my ID to access private GitHub repos.
Comment: Ha! Very nice! And thanks a lot for the in-depth explanation! Kudos!


Taxonomy GetAllTerms on level 2

Question: We have a termset with parent term name "State" and with child term "City".
I want to show all child terms "City" in a dropdownlist.
Who can I retrive only child terms from this termset?
Answer: you need to first finding the termset "State".
for ex:   TaxonomySession session = new TaxonomySession(SPContext.Current.Site);
          // Get a reference to the store
          TermStore store = session.TermStores[_tTaxonomyField.SspId];
<code>      TermSet _termSet = store.GetTermSet(_tTaxonomyField.TermSetId);

       foreach (Term termSet in _termSet.Terms)
        {
             // all child term found here
        }
</code>
hope this help.

Taxonomy GetAllTerms on level 2


Compact subgroups of the unitary group of operators in a hilbert space

Question: Is there a characterization for the compact subgroups of the unitary operators in a Hilbert space, where the unitaries are furnished with the norm topology? What about other topologies?
Comment: For the strong topology, there is no characterization: any compact group $G$ embeds into the unitary group of $L^2(G)$ via the left regular representation.
Comment: The unitary group $U(H)$ of a Hilbert space $H$, with the norm topology, has no small subgroup (its intersection with the ball of radius 1 centered at the identity operator, contains only the trivial subgroup). Therefore the same holds for a compact subgroup $G$ of $U(H)$. Isn't there a result related to Hilbert's 5th problem (by von Neumann maybe?) that implies that $G$ is a Lie group? (a not necessarily connected Lie group, of course). I've no time to look it up today...
Comment: @Andras Batkai: Actually, the unitaries with the weak topology do not form a compact group. In fact, the weak and strong topologies give the same relative topology on the space of unitaries.
Comment: According to Wikipedia, yes :  "Gleason, Montgomery and Zippin characterized Lie groups amongst locally compact groups, as those having no small subgroups."
Answer: In fact, for any Banach space $X$, every norm compact group $G$ of invertible operators on $X$ generates a finite-dimensional semi-simple algebra (which is isomorphic to a finite direct sum of matrix algebras). So, $G$ is indeed a Lie group as was suggested. I don't know a right reference, but such $G$ generates contractible (aka super-amenable) Banach subalgebra of $B(X)$, which has to be finite-dimensional at least when $X$ is a Hilbert space (see Paulsen--Smith, Proc. Edinb. Math. Soc. (2) 45 (2002), or my paper arXiv:1110.6216). The proof for general $X$ is bit tricky, but reduces to the Hilbertian case. (I learned it from Nicolas Monod.)
Comment: Ah I see, that's also good to know.
Answer: I think that the answer is that all such groups are Lie groups, and one can decompose the Hilbert space to a finite direct  sum  s.t. each summent will be a tensor product of a f.d. representation of the group and an Hilbert space with a trivial action
"proof"
as Alain suggested a subgroup $G$  winch is compact w.r.t. the strong topology is the same as (faithful) unitary representation of $G$. any such representation can be decomposed to an Hilbert direct sum:
$$H:=\bigoplus W_i \otimes V_i,$$ where $W_i$ are (f.d.) distinct irreducible representations of $G$ and $V_i$ are Hilbert spaces. The question is: What are the conditions on $V_i$ so that the map  $G \to O(H)$ will be continuous?
I think that the answer is that all but finitely many should be $0$. This implies the above claim.
Comment: Are you allowing your Lie groups to be finite?
Comment: "All such groups are Lie groups" ?
Comment: @Yemon Choi: Yes
Comment: @Amin: What is the question?
Comment: Well, I don't see why it's clear that they are Lie. But in the meantime, A. Valette gave the reason, which I would never have guessed to be honest. Actually, I think that the OP was asking that.
Answer: U(H) with the strong topology (H an infinite dimensional Hilbert space with orthonormal base $(e_i)_{i\in I}$) has the compact (abelian) subgroup T of all diagonal unitary operators. As a topological space T is the product of infinitely many circles with the product topology. T is certainly not a Lie group, finite or infinite dimensional.


Android UI library that has Action Bars, Dashboards, etc

Question: Is there an Android UI Library that has components like Action Bars and Dashboards? A lot of new applications seem to have these components, so I was hoping there was a solution available (either free or paid).
Answer: Also have a look at GreenDroid which allows you to implement e.g. the action bar.
Comment: I cannot recommend GreenDroid highly enough. Very well thought out library.
Answer: Not that I know of.  Your best bet is to look at an app like iosched and see how the components are implemented.  It probably wouldn't be too hard to create an action bar and dashboard as a reusable widget, but as far as I know, no one has done so yet.
Comment: +1 The Google IO schedule app is a great resource for those UI components - I used it for many of my apps.
Answer: https://github.com/johannilsson/android-actionbar/
Take a look at the link above for one of the best action bar libraries I have come across so far. Its quite straight forward to use.
Answer: In short: No! There is no such library to create a dashboard or actionbar in a short way.
In this video Android UI design patterns, however, developers state in Q&A part that they may release a library to achieve those UI design patterns in the future.
Until then you need to design and implement your dashboard and stuff. I strongly recommend to checkout and take a look the code at iosched as Eric already mentioned. There is a beautiful dashboard implemented.
You can also use DroidDraw to design and implement UI views easily by drag&drop. DroidDraw can also then export your design to android xml file.
Hope that helps
Answer: Yes, there is.  DroidUX is a UI/UX component library with ActionBars, Dashboard, GalleryFlow, Wheel, ScrollableTab, and other components/widgets that you can easily use to build the UI for your app.
Check it out at www.droidux.com.
Comment: It comes with a high price tag for an indie developer to subscribe to, don't you think?
Answer: If you want external library You might be interested to have a look at ActionBarSherlock library. But android.support.v7 libraries ActionBarCompact  componnt can also do this job without an external library.


Problems with finding points along a line

Question: I've drawn a line, using an X1, X2, Y1, Y2 variable. I'm looking to find any number of points along a this line, and to that extent I've written this:
Private Function genPointsArray(ByRef xPointArray() As Integer, ByRef yPointArray() As Integer, startX As Integer, finX As Integer, startY As Integer, finY As Integer, numPoints As Integer) As Integer
        ReDim xPointArray(numPoints)
        ReDim yPointArray(numPoints)

        xPointArray(0) = startX
        xPointArray(numPoints - 1) = finX
        yPointArray(0) = startY
        yPointArray(numPoints - 1) = finY

        For i = 1 To numPoints - 2
            xPointArray(i) = xPointArray(i - 1) + (finX - startX) \ numPoints
            yPointArray(i) = yPointArray(i - 1) + (finY - startY) \ numPoints
        Next

        Return 0
    End Function

As you can see, it accepts the X1, X2, Y1, Y2 variables (startX etc), two arrays to store the resultant points, and a number of points to find. The issue it has is that (worryingly often) a point is a pixel off (due to the actual result being a decimal). This then gets progressively worse as every following point is 2,3,4,5 etc pixels off, making the effect quite noticeable. Does anyone know of a way to make sure every point is along the line- either through a better algorithm or validation?
Thanks
Answer: In terms of geometry a line is unidimensional, i.e. it doesn't have width and hence it's hard to know if a point is on a line without defining a criterion.
A common way to test if a point resides on a line is to compute the distance from that point to the line, and if such a distance is small enough (less than an epsilon value), then the point is considered to be on the line. I don't know VB but here is snippet that illustrates this idea:
boolean inLine(Point2D a, Point2D b, Point2D p)
{
    double a1 = b.x() - a.x();
    double b1 = b.y() - a.y();
    double a2 = p.x() - a.x();
    double b2 = p.y() - a.y();

    double alpha = Math.atan2(b1, a1);
    double beta = Math.atan2(b2, a2);
    double theta = Math.abs(alpha - beta);
    double dist = Math.abs(a.distanceTo(p) * Math.sin(theta));
    double eps = Math.abs(fx(3) - fx(0));

    return dist < eps;
}

This algorithm is known as Distance from a Point to a Line.
The epsilon value depends on your particular problem, how much precision is needed, for most applications 1e-9 will be OK.
The method distanceTo() in the code simply computes the Euclidean distance between two points.
Answer: The reason why your generated points drift is because you're allowing the error of the integer rounding to accumulate. It's like walking with your eyes closed.
Instead of basing each point from the previous, keep going back to your original endpoints. Each point that results will be off at worst one due to rounding.
Replace
    xPointArray(0) = startX
    xPointArray(numPoints - 1) = finX
    yPointArray(0) = startY
    yPointArray(numPoints - 1) = finY

    For i = 1 To numPoints - 2
        xPointArray(i) = xPointArray(i - 1) + (finX - startX) \ numPoints
        yPointArray(i) = yPointArray(i - 1) + (finY - startY) \ numPoints
    Next

With just
    For i = 0 To numPoints - 1
        xPointArray(i) = startX + (finX - startX) * i / numPoints
        yPointArray(i) = startX + (finX - startX) * i / numPoints
    Next

Please forgive any syntax or loop bound errors; I don't write VBA
Answer: A foolproof formula is ((N - I) * Start + I * Fin) / N. For I=0, gives you exactly Start, and for I=N, gives you exactly Fin. Intermediate values will be regularly aligned.
This works both in integer and floating-point coordinates, but mind overflows.
Comment: This worked perfectly as well, but I feel like I'm more likely to get it wrong if I look back at it. Thanks though!


How to convert garden fertilizer dosage to container dosage?

Question: I have a bunch of old-school mineral fertilizers that I would like to use for container plants. The problem is that the dosage on them is grams/m2, lets say for simplicity it is 100 grams/m2. How do i convert that dosage for container plants ? Taking 0.2 meters as depth (and this is pretty low i think) 1 m2 with 0.2 meters depth becomes 200 liters of volume. My biggest container is 20 liters, so i only need to put 10 grams of fertilizer per container ? This seems pretty low, especially since this is supposed to feed the plant for 6-8 weeks.
Comment: I'm pretty sure the m2 is for the surface area (not the depth). So, grams per square meter of surface area. It's probably not the best measurement for containers.
Comment: Can you tell me which mineral fertilizers they are? That could help us find the answer as to how much fertilizer you should use.
Comment: A little late, bit it definitely refers to area.  Because of the dosage, I would guess that it's meant for large gardens or lawn.
Answer: The one fertilizer I use inside and out is MiracleGrow. There are several different mixtures of this stuff, but many say:

For Outdoor Plants: Mix 1 tablespoon of Miracle-Gro for every gallon of water.
  For Indoor Plants: Mix 1/2 teaspoon (not tablespoon) per gallon of water.

I use a teaspoon per gallon indoors.
Of course, your mileage may vary, but half strength is a good place to start.
Answer: Water it down, grind up the fertilizer and apply it in dilute amounts. A 20 liter pot has a surface area of 0.08 sq meters You only need about 1/10th the fertilizer per square footage. BUT what you're growing determines fertilizer demand.
Answer: Late to this, but your math checks out.
For container gardening, the problem isn't that the amount is low, it's that the amount you put in will leach out over time as you water. Depending on the fertilizer, I tend to refill a little more often than the recommended rate to account for leakage. You can't just add more to account for leakage because too high an amount at one time will burn the roots.
For water soluble fertilizers that don't have low measurement amounts listed, I cut dosage substantially and apply more often.
If in doubt, give less fertilizer and replace with better potting soil in the pot.


Calculate Raspberry led strip's power need

Question: I have a LPD8806 led powerstrip with 32 leds connected to my raspberry and it works fine on my 5v 2a power supply.. I ordered now also a 60 led version.. is there a easy formula to calculate how much amps my power supply has to be when I increase the number of leds?
Comment: Better suited to http://electronics.stackexchange.com/ since the question is not Pi specific.
Answer: Generally you would need to measure the power consumption of one LED with an ammeter (or multimeter). Than you can multiply this by 60 to get the consumption of one meter.
Easier would it be to measure the consumption of the complete strip you got and multiply the consumption by 2 to get the consumption of the new strip. That just works when you use the same lenght. If they arent, you need to divide the 30Led Strip consumption by its lenght and multiply that with 2 and the lenght of the new strip.
You could also guess it, but thats rather dangerous. If they are SMD ones, you can guess they consume 20mAh per Color when they are full on. that means one LED consumes 60mAh completely. If you multiply that by 60 LEDs per Meter you get 3,6A per Meter, which is way too much than your power supply can deliver
Comment: Measuring the consumption of the working 32 led strip is a good idea.. i will do that and then calculate it to 60. Thanks!
Comment: are both strips the same lenght?
Comment: Yes, 1 meter.. just more leds
Answer: Without knowing the exact juice you'll need, I know the power delivered through the GPIO won't be enough.  Any current pull above ~15mA (on a single pin) or ~50mA (total all pins) will result in a less stable berry.  Having 5V on 4A pushed in through the microUSB won't change a thing.  You'll need external power to power those leds.  Apparently you've got away with it in your current setup, wherefor I'm happy for you, but I won't use this in real life.


How do I brighten a part of a picture with Gimp?

Question: Say I wanted to bring out the colors in the shadowy bottom right hand part of the attached image, how would I go about it? I assume I need to restrict the processing to that part but I have no idea what technique I should use and how to limit the effect to part of the image.
Comment: This tutorial about a special mask could be useful: https://www.gimp.org/tutorials/ContrastMask/
Answer: For a smooth brightening (or darkening) of shadows (resp. highlights) I prefer the color curves tool (Shift+C) where you can define a non-linear curve for all channels, or a single RGB color channel.
In the example image I used a positive S-shaped curve for all values and a negative S-shaped curve to remove blue from the shadow parts of the image:
Comment: Is there any way to restrict this processing to the shadowy part?
Comment: @Johnny You could select a region with a mask but this mostly leads to unwanted artifacts even when the mask was feathered. I'd only do that on geometrical objects, where the mask can be hidden better.
Answer: One year later:)
In fact on such image you want to use "Luminosity masks" that are progressive selections that cover the parts of the image within a given luminosity range. The good things about them is that the effect of the color tools apply in proportion to the lightness or the darkness of pixels so you never have visible transitions. There are scripts around that can generate the 5 canonical masks, but here is a quick demo with only two.

Duplicate the image
Colors>Desaturate and use Luminosity
Open the Channels list, and copy any of the RGB channels by dragging it to the main list. Rename the Channel "Highlights"
Duplicate the channel, and rename the copy "Shadows"
Colors>Invert to invest that channel.

Once this is done, you can work on the Highlights parts of the image by going to Channels, right-clicking "Hilights" and doing Channel to selection (and then reselecting the layer otherwise you'll be working on the selection channel). For instance, using this technique, I just dimmed a bit the highlights and lightened the shadows. No other adjustments necessary:

There is a more complete tutorial on the matter.
Answer: I use Magic Wand to highlight areas proposed to be changed and then use Curves
Comment: please refrain from using ALL CAPS, it's considered shouting.
Answer: Your photo is already a heavily processed JPG. Lifting up the shadows will introduce visible blurriness and other errors, which have been less offensive as dark. 8 bit JPG simply hasn't enough data left. The result is quite coarse. There's noise, JPG compression errors and too few brightness levels in the dark areas.
The next version is a test what is available in the shadows. The image is opened in a RAW image processing program and got the same treatment as a real RAW image. There's fill light, local contrast boost and radical sky blue reduction in shadow areas. The shadow has fortunately sharp border for easy selection.

If you zoom in you can see that the lifted shadows are very coarse behind the lake, because they were noisy and blurry and the bit depth is too low for nice contrast increasing.
But the result can still be acceptable. We can try to get this in GIMP.
The old approach to fix your photo would have been to increase brightness and contrast in shadow areas with curves and then fight back the introduced excessive colorfulness. This is presented already by others. We try something else which wasn't possible before GIMP 2.10.
GIMP 2.10 has a polar version of CIELAB color system named LCH which is especially useful and makes a new answer worth writing. We make a good colorizable BW version of the image and colorize it with blending mode Color LCH.
Colorizable BW image has grey midtones where one expects color. Too full black and white are not colorizable. We can make one by desaturating and masked contrast increasing. GIMP hasn't adjustment layers like Photoshop, Krita, Affinity Photo etc... but we can work around with layer copies.
Start by making a couple of desaturated copies of the original image layer:

Insert a layer mask. Let it be the BW image as inverted

Disable temporarily the layer mask. Move the original colored image on top and let it have blending mode Color LCH.

The result is quite the same as the original, but you can make radical changes by editing the BW image and its layer mask.
At first find a good Color > Color curves > Value setting which lifts the dark areas acceptably. The bright areas get too flat, but we'll fix it later:

We do not want to lift already bright areas. Enable the layer mask and apply curves to the mask to get some area separation. Click the mask icon to get the mask under editing:

Unfortunately the mask has too much details. Details suffer badly. A real man would paint the whole mask manually to get the exactly right effect strength distribution, but we can cheat. Let's apply some blur to the mask and get boosted local contrast that way:

Even more local contrast is available by flattening the image to a single layer and applying Unsharp Mask:

The version from a RAW developer program clearly has some saturation boost which is missing here due the LCH colorizing. If that sweetening is wanted, increase the saturation:

I guess the whole tinkering is not worth the effort if you can invest the needed time to learn to cope with a RAW developer. Photoshop's Camera Raw is the easy one, but generally they are complex. Raw Therepee is free and it can be used as plugin from GIMP.
Done
Answer: To restrict the processing to a part of the image you use a selection (Freehand selector, here). Once there is a selection most tools apply only to the selection. If you use that 'raw' selection there will be a very visible edge between the parts that were changed and those that were not, so to smooth the transition you usually feather the selection (this is an option ("Feather edges") in most selection tools, but it can also be done afterwards (menu Select>Feather)).
The simplest tool to use afterwards is Brightness/Contrast, but don't overdo it.
Answer: Total rank amateur, here.
Very tedious approach, but, it worked pretty well.  I have a number of scanned old chemical photos.  They have darkened across the top 1/3rd of the photo.  I tried a number of tricky ways to do it and finally ended up doing this.
Incrementally work up the image.
1 - Select the top 1/2 of the image.
2 - Menu->Colors->Brightness-Contrast - turn up the brightness 2 (very little).
3 - Starting from the top select down to just above the previously selected portion (a little less that 1/2 of the top of the image).
4 - Repeat step 2.
5 - Repeat step 3.  The top edge of the selection is always the top of the image.  The bottom edge of the selection creeps up the image with each iteration.
6 - Then, repeat step 2.
7 - Continue to the top of the image.
This takes a few  minutes, but, it effectively builds a gradient of increased lightening as you go up from the middle of the image to the top.  The lightening effect is gradual enough to avoid obvious lines/edges.  You'll likely want to modify the Brightness step (more or less) depending on how slowly or quickly you want the effect to move across the image.


How do I link to wechat from a webpage?

Question: Whatsapp allows you to link to a new message via

How do I do the same thing with WeChat?
Answer: WeChat does have a URI scheme that can be used from a browser. The scheme prefix is weixin://.
There are a few URIs that can be used with this:
weixin://dl/stickers
weixin://dl/settings
weixin://dl/posts
weixin://dl/moments

However, in answer to your question specifically, there is one where you can chat to a contact specifically:
weixin://dl/chat?{toID}
You will need to replace {toID} with whatever the destination user's WeChat ID is.
For reference's sake, these are the URLs that I've found this information from previously:

https://www.quora.com/Does-WeChat-support-posting-text-to-chat-via-a-url-scheme-for-mobile
https://www.zhihu.com/question/30616809?sort=created (will require translation, unless you are fluent in Chinese)
Comment: Can you tell me what WeChat ID are you referring to? I am trying to use the `weixin://dl/chat` deep link, but I can't make it work. I've been trying to put the OpenID and the WeChat ID. Both leave me in the main conversation list.

By WeChat ID, I mean the ID you are able to set yourself and by OpenID, I meant the one that is return on the webhook as `FromUsername`. Looks like this: `ogc7Qwpp0cf9ewOJKjpsEhKl_CIX`

Can't make it work with a regular WeChat user or an official account.
Comment: @Guillaume I've also had reports from other people that this doesn't work anymore, so you're not the only one. I suspect WeChat may have changed something around this.
Comment: this is not working at all and it's mentioned in one of the links that he has mentioned https://www.quora.com/Does-WeChat-support-posting-text-to-chat-via-a-url-scheme-for-mobile
Comment: Does this still work? for me it only opens up the app and then nothing happens. Only `weixin://scanqrcode` works and open the QR code reader in wechat
Comment: how to link wechat miniprogram from website?
Answer: Weixin released an update 6.3.25 on 2016-09-05, which blocks almost all URL schemes request from non-weixin's application. Only requests from weixin's applications and some "white-listed" applications are allowed.

微信在 2016 年 9 月 5 日的 6.3.25 更新中,已经屏蔽了绝大部分外部发起的 URL Scheme
  请求,只允许在微信内部或少量白名单应用中进行调用。鉴此,以下所展示的内容目前可能已经失效,本文仅供存档参考。

Translated from a mainland china's developer blog:
Source: https://spacekid.me/weixin-url-schemes/
Answer: I'm not sure if what you wants to do is to hava a button on your view or web page, where on click it opens wechat and allows users to share the content to other people?
If it is an mobile application, you may want to have a look at wechat's offical api document.
You would first need to do some applications to wechat, then they may give you permission to use this function by providing you with an appId, you utilize this appId and implement interfaces they provide to realize sharing functions.
If you have a wechat offical acount, or you wish to show your web application pages within the browser inside the wechat app (this is my understanding), then you would want to take a look here. You would first have to register an offical account, and bind your application domain in the settings page within the account.
If you have a PC website and wish for users to share certain pages to wechat. what you can do is generate a QR code for that link, thus when users scan the code with wechat's scan function, the link would be opened within the browser inside wechat, and allowing users to use all wechat functions such as sharing.
Comment: Their JS SDK does not work. It accepts configuration, it can check your API permissions, but calls to any other methods do absolutely nothing. I have no idea why, but it just does not work.
Answer: When logging into wechat on a PC, you normally load the wechat webpage where there is a QR code. This must be scanned via the wechat client on your mobile phone. The client must be for the user attempting to contact you, it is their PC link to wechat. The user will be presented with their chat window (with their contacts listed). This is a security feature of wechat to ensure registered users only have access to the servers and to slow down trolling. The users mobile phone is the link to the system. When I go to the wechat webpage, I get a qr code and once I have scanned it using my phone app, I get my chat windows with only my contacts. You may be able to add your contact to the list but it still requires the user to have previously registered their mobile phone to the system.

How do I link to wechat from a webpage?


How can I connect nodemcu with laptop wifi

Question: Question is odd, but I want to know that how I connect nodmcu with a laptop wifi without using any router. Is it possible if yes then how?
Answer: Configure and activate the access point mode on NodeMCU. It creates a WiFi network and you can connect to this network with your computer.
Comment: @HasnainRaza, did this help? if yes accept the answer to mark the question solved