RSpec not printing failure reports

Question: I managed to mess up my gemsets by mixing rvm and sudo. Ended up having to uninstall ruby, rvm and start from scratch. Now I've got everything up and running, except my RSpec isn't behaving as it should be. All it displays is:

bundle exec rspec spec/
      ..................................................................F.

In the past it would display a detailed failure report showing which test failed, and why, like:
1)
'User should be in any roles assigned to it' FAILED
expected in_role?("assigned role") to return true, got nil
./user_spec.rb:7:

Finished in 0.0172110000000001 seconds

1 example, 1 failure

I've tried playing with the various formatter options. The 'd' option gives me the most verbose results, but these are too verbose as every single test that succeeds is also printed in full on a new line, which quickly starts turning the report into pages.
What can I change to make RSpec work like before?
Answer: You need ask to rspec say the complete backtrace. The option is --backtrace or -b
You can define it in your .rspec file in your directory or in your rspec command line.
Comment: Already tried it. That didn't work either:

bundle exec rspec --backtrace spec/

..................................................................F.

RSpec not printing failure reports


Default value of a TextBox being columns in the database

Question: I'm not sure if this has been answered before, I looked for about a half an hour with no luck, so if it has been, sorry.
I am trying to have all TextBox on the page load with default values that are in the database, so the user can edit each value and save with one button without emptying out each text box.
I have added a form view and put the text boxes inside the >ItemTemplate> tags, so that I can add text='<%#Eval("DataBaseColumn")%>' as default values but the problem is, it doesn't have the values on page load.
Is there a way that I should be doing this with viewstate?
Any help would be great.
Thanks in advance
Answer: If I understand correctly, you're trying to set asp.net form data from a database. You've already halfway there - you've initialized and set up the view. Next thing to do is to fill the data that the view is going to use. That is done in some method in web form code-behind like Page_Load using the following:
ViewState["SomeKey"] = SomeValue;

You then can get this data using the "SomeKey" key.
Comment: Thanks for the quick answer.

Yes that is correct, it is an edit profile page and the issue that I am having is, when the page loads the text boxes are empty and the form uses one button to submit the changes to  the profile database, so if I was to change my first name, I would have to fill in every text box before submitting the changes, if not, the form would remove all existing data in all fields except the firstname that I just put in.

So are you saying that I would declare the ViewState as a variable on page load and the make the  ?
Answer: please make your gridview in edit mode
protected void Gridview1_ItemCreated(object sender, EventArgs e)
    {
        FormView fv = sender as FormView ;
        if (fv.CurrentMode == FormViewMode.Edit)
        {

        }
    }

You will get your Default value loaded their...
Cheers!!


Replacing the wiring to a socket in a home?

Question: In my home, in one bedroom circuit, there are several receptacles.  After first two receptacles, next socket has no power.  After significant effort, it has been determined that the sockets are fine, connections are okay, but one wire coming from attic via the wall is broken.  However, I do have a 100% confirmation.  Questions:  (1) How can I be 100% sure of this diagnosis. (2) Assuming that my diagnosis is correct, how to replace existing discontinuous (broken) wire with a new one through the wall.  Earlier answers did not answer either of these questions.  M.S.
Comment: How much access in the attic and is it an insulated outside wall or hollow interior wall?
Answer: To confirm the wire is broken/damaged, you can measure the electrical resistance of the cable with a multi-meter.  If the wire is OK, you should get a near-zero measurement.  If it is broken or significantly damaged, the resistance will be a high value or infinity.
You need to isolate the section of cable you think is damaged to in between two electrical boxes.  With the power off, at one end of the cable, connect the hot and neutral with a wirenut.  Measure the resistance between the two at the other end. Repeat this with all combinations of hot/neutral, hot/ground, neutral/ground in order to figure out which wire is broken.
As far as replacing the cable, you will likely need to cut one or more holes in your wall in order to pull a new cable through.  If it's a relatively straight and short run you might get away just removing the electrical boxes and fishing a new cable through, and then replacing the electrical boxes, but usually you have to cut multiple holes to run a new cable.
Comment: I am not 100% sure.  I did everything short of taking out the box.  I have replaced the receptacle with a new one and new connections at the nut.  What is bothering me is that I have not ben able to locate the junction box in the attic (probably buried somewhere under the insulation).  That is a major weakness in my argument.  Therefore, the second answer provides me the procedure for eliminating any holes in my reasoning.  I may be able to use a fish-line or cut a small hole in the wall if I have to.  Thanks for both answers.  I never believed that my argument is 100% correct.
Answer: I will all but guaranty the wire, in the section between boxes, is FINE. It is a very common misconception that wiring somehow goes bad in the middle of a run. It is extremely rare that it does. The almost certain point of failure is a splice or connection point, such as at a receptacle.
Let me ask, how did you determine the devices are OK?
Are there any backstabs (quickwire connections) in the backs of any receptacles?
Did you completely remove all receptacles and replace them back in the boxes using the side screws?
Can you confirm the 2 splice/connection points between what you think is the bad cable section?
Comment: This does not answer the question, and may be better as a comment on the question.
Comment: Sorry Tester. I'm still figuring out the quirks of how this site is run.
Comment: No problem. I'm just offering (hopefully helpful) guidance, on how the site works.  If you have any questions about how the site works, there's sometimes helpful folks hanging out in [chat](http://chat.stackexchange.com/rooms/111/home-improvement).  Or you could ask/read questions on the [meta](http://meta.diy.stackexchange.com/) site.


How can i configure ip address to cisco switch without configuring vlan

Question: How can i configure ip address to cisco switch without configuring vlan. I have configured ip with vlan.
Comment: Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer.
Answer: A layer-2 switch can have only one management address assigned to it (on a single VLAN.) You can have as many VLANs as you like, but only one interface vlan# can be no shutdown at a time.
A layer-3 switch can have secondary addresses on any routed interfaces. Routed interfaces are usually limited to VLANs, however, some switches do allow switched interface to be converted to non-switch mode (no switchport)
Additionally, if the switch has a dedicated, out-of-band management interface, it can have an address as well. That's the only non-routed interface that supports layer-3 functions.
Answer: You can turn a layer 2 switchport into a layer 3 port and assign an IP address if you do no wish to use a vlan interface.
Note, you must have ip routing enabled and the switch must support it.
Use the following commands to do so.
Switch(config)# ip routing
Switch(config)# interface gi 0/1
Switch(config-if)# no switchport
Switch(config-if)# ip address 10.0.0.1 255.255.255.0
Switch(config-if)# no shutdown

For some further reading and study please refer to the cisco doc : Chapter: Configuring Layer 3 Interfaces
Hope this helps you on your quest.
SleepyMan.
Answer: The VLAN is configured already on all ports by default - VLAN1.  Simply assign an IP address and subnet mask to interface VLAN1.  Configure the ip default gateway so that you can remotely manage the switch via telnet, for example.  Telnet must be configured finally for the remote access to work.
Comment: Cisco recommends changing from VLAN 1, but I digress. However, one should *never* use Telnet to communicate with infrastructure (or anything really)... use SSH, *especially* from an external source.
Comment: Where does Cisco recommend that VLAN 1 should be changed?  Telnet continues to be used to connect to networking infrastructure, especially private network infrastructure, or no?
Comment: Google "why shouldn't I use vlan 1 cisco", and read through some of the results. There are only two reasons why Telnet is still used... 1) the system you're connecting to doesn't support SSH, or 2) the person responsible for maintaining the system is either lazy or too incompetent to configure SSH. In the latter case, they should do some serious studying before managing a network.

Telnet is an unencrypted protocol, meaning that I can sniff the wire and easily grab your user credentials, or perform man in the middle attacks.
Comment: People still use telnet, especially on the inside of their networks.  It's not as obsolete as you say.  SSH adds a layer of complexity that is unrelated to the question.  I think the primary question is how to configure an ip address on a Cisco switch.  My answer is the only one that addresses all the main tasks required to achieve the practical working solution.


What is needed to utilize my HTPC as a DVR?

Question: What is the recommended hardware/software that I need to install?
FYI, I am running Windows 7 on the HTPC
Answer: I'm familiar with Windows Media Center (Vista and 7), so I'll tell you what I am familiar with.  There are also others available from the Linux world such as MythTV.
Besides the TV tuner card, I'd recommend that you purchase a MCE compatible remote and receiver if you don't have one already.  MCE compatible remotes usually include wakeup support, so you can wake your PC if it goes into standby.
The software I use is

Media Center
Lifextender
MCEBuddy

Media Center records the TV show.  Lifextender then automatically grabs the recorded show and removes the commercials.  If I haven't deleted a show after 2 weeks, MCEBuddy compresses that show so that I don't run out of space.
Right now, third party tools work better with Vista than with Windows 7.  Lifextender does not work directly with the WTV files that Windows 7 produces, but there is a work-around at http://www.hack7mc.com/2009/03/cut-out-commercials-in-7mc-with.html.
UPDATE
How could I forget - http://www.codinghorror.com/blog/archives/001107.html
Answer: First, you'll need a TV tuner (or two) to receive the signal.
Second, a large fast hard drive - the largest and quickest with the highest data transfer rate you can afford.
It's difficult to make specific recommendations as a) I don't know what part of the world you're in and b) any hardware I recommend today could well be superseded tomorrow.
UPDATE
I've found some info on iViewCameras.co.uk which would seem to indicate that a 7200 rpm hard drive should be up to the job of recording video. Though I would think the Data Transfer Rate - 300 MBps in this case - would be more important.
Comment: thanks, as for fast harddrive is the standard 7200rpm sufficient?


GUI: should a button represent the current state or the state to be achieved through clicking the button?

Question: GUI: should a button represent the current state or the state to be achieved through clicking the button?
I've seen both and it sometimes misleads the user. what do you think?
Answer: The label on the button should reflect what the button does, i.e. it should describe the change the button makes.
For example, if you have a call logging system a button should say "Close Call" and the user can click it to close the call.  The button should not have the label "Call is Open" and the user clicks to change the call status as that's very counter-intuitive, since the button is effectively doing the opposite to what it says on it.
In my opinion the label - and so the function - of a button should rarely, if ever, change.  A button is supposed to be a like a physical button and they usually only do a single thing.  (There are a few exceptions like play-pause on a media player where it's OK for the button label/icon to change, but at least this is copying a button from a real physical device.)
To carry on the example from above, I would say usually you would want two buttons, "Open Call" and "Close Call" and disable whichever one is not appropriate.  Ideally you'd have a field elsewhere displaying the status of the call.
In summary, buttons are for doing things not for passing on information to the user.
Comment: I agree. But I've seen the opposite, and it's confusing.
Answer: The button should represent the action to be executed, not the state.
Answer: Some buttons are actions and are not ambiguous, like "Save", "Print" or "Enable user".
When a button represents a state that can be toggled, like Enable and Disable something, I do one of the following:
Change the button text, and make it always point to the state that will be achieved; (i.e. make the button point to actions, not states);
- Keep the button's text the same, but use one of those sticky buttons that will stay pressed, representing that the current state is "on" or "off". I prefer the former approach, though.
Answer: It should represent the action taken when clicking the button. States should always be presented by other means.
But I know what you mean. My car radio has buttons with text that shows the current state. It is really confusing.
Answer: This depends on the function which will be triggerd by the button click.

if the click changes the state of an entity i would suggest that the button represents the  state the entity will enter after clicking the button
if the click triggers some kind of functionality the button should represent the function.
Answer: The appearance of the button is also a clue to its state.  It should follow the standards of the environment if any exist (example, beveled edge / shadow appears on mouse click in Windows).


What is exactly a joint controller in GDPR? Examples

Question: I am not sure I really understand the concept of "joint controllers" in GDPR, and I'd like to have some concrete examples, especially examples of joint controllers relating to the internet (websites, services, hosting, providers, etc.), if it makes sense for any to exist.
Answer: The website of the European commission has a similar asked question with answer and a small example:

Controller and processor
A brewery has many employees. It signs a contract with a payroll
  company to pay the wages. The brewery tells the payroll company when
  the wages should be paid, when an employee leaves or has a pay rise,
  and provides all other details for the salary slip and payment. The
  payroll company provides the IT system and stores the employees' data.
  The brewery is the data controller and the payroll company is the data
  processor.
Joint controllers
Your company/organisation offers babysitting services via an online
  platform. At the same time your company/organisation has a contract
  with another company allowing you to offer value-added services. Those
  services include the possibility for parents not only to choose the
  babysitter but also to rent games and DVDs that the babysitter can
  bring. Both companies are involved in the technical set-up of the
  website. In that case, the two companies have decided to use the
  platform for both purposes (babysitting services and DVD/games rental)
  and will very often share clients' names. Therefore, the two companies
  are joint controllers because not only do they agree to offer the
  possibility of 'combined services' but they also design and use a
  common platform.

If you want more information on the legal part, here some links to the relevant GDPR Articles:

Legal information on joint Controllers you can find in the GDPR Article 26.
The definition of a controller in the GDPR Article 4 (7).
The definition of responsibility of a controller. GDPR Article 24
The definition of a processor. GDPR Article 28.
Processing under the authority of the controller or processor. GDPR Article 29
Comment: Spam spam spam spam...
Comment: @BlueDogRanch: While the latter links are *hosted* by a business, they all appear informative and responsive to the question and are presented here as such.  To me this looks like a decent answer and not a significant infraction of the SE spam policy.  (Though, as always, I'm open to persuasion to the contrary....)


is it good to translate my competitor website's post?

Question: my website Alxa rank into my own country is 24000 and my competitor website is 34. me and my competitor both translate the foreign post. i really don't know what kind of post should i have to translate. is it good to translate my competitor post again( i mean about a translation that is completely different(word and verb)).
does it improve my Alexa rank?
Comment: Alexa rank can be faked too. You shouldn't concern yourself to much with alexa. You should focus on writing more quality articles and hope for Good Google rankings.
Answer: First of all, Alexa rank is more about traffic than your content. More traffic = higher rank.
From an SEO standpoint, copying another sites content is never a good idea. Even if you 'spin' the article like you mentioned by changing around certain words or re-ordering things Google will often pick up on this as 'duplicate content' and it will negatively impact your SERPS.
I would focus on increasing your website traffic if you really care about increasing Alexa rank, though I have always thought of Alexa rank as pretty meaningless. Create good, unique content and the traffic will come - worry less about copying your competitor and more about creating original content :)
Comment: @KarimiBanam I see, I misunderstood that part of your post originally. I think you could create good, unique content by translating certain articles from English to your native language. Just keep in mind that the content should be unique, and written by you not copied from another source.
Comment: thank you to answer my question. but i don't want to changing my competitor post's word or you said copy!! i just want to translate it's website post. for example my competitor website  translate a post about microsoft office word 2013 and his resource is microsoft press. can i translate a post about microsoft office word 2013 from different press for example another website like bbc.com. i don't want to do duplicate content. i don't want to copy his post. i just want to talk about his post in different point of view.
Comment: Does using my competitor keyword helpful to improve my rank? because my competitor using meta keyword tag.
Comment: @KarimiBanam According to Matt Cutts, Google doesn't even read the keyword tag - http://www.mattcutts.com/blog/keywords-meta-tag-in-web-search/ so no, using it won't improve your rank or SERPS.


Running multiple concurrent background processes then wait for all of them to terminate, on Windows

Question: Anybody know if there is cmd script that does that and/or a command line tool ready for the job?
Comment: @Santosh: what do you mean by "can harm your data"? In my specific case the background tasks would process their own independent data sets. No risks of concurrent modifications.
Comment: From Win32 API side, I *think* [WaitForMultipleObjects](http://msdn.microsoft.com/en-us/library/windows/desktop/ms687028%28v=vs.85%29.aspx) with bWaitAll=TRUE would do the job. It wouldn't be hard to write a program that just forks off programs given in some input file, if there are no satisfying answers.
Comment: @grawity: yes, I plan on doing just that if nothing comes up (and post the code here), but let's see if I can avoid reinventing the wheel :)
Comment: Doing so can harm your data!
Comment: Reinventing the wheel is a good thing if currently existing wheels are square...
Answer: Create the three batch files below.
Main.bat launches 1.bat and 2.bat
1.bat and 2.bat write out temporary files for which main.bat checks.
While 1.bat and 2.bat are working, main.bat reports back that processing is still occurring.
When you hit enter on either 1.bat or 2.bat's open window, the temporary file is deleted, and the program exits. This simulates processing stopping for that .bat file.   If you do this for both 1 and 2.bat, main.bat reports to you that processing has completed for these processes. You can make 1.bat and 2.bat do anything you want, so long as you clear the temporary file when you are finished.    At this point main.bat can do anything you want it to do as well.
1.bat
echo %time% > 1.tmp
pause
del 1.tmp
exit

2.bat
echo %time% > 2.tmp
pause
del 2.tmp
exit

main.bat
@echo off
start "1" 1.bat
start "2" 2.bat
    @ping -n 1 127.0.0.1 > nul
:loop
@echo Processing......
if not exist *.tmp goto :next
    @ping -n 5 127.0.0.1 > nul
goto loop
:next
@echo Done Processing!

Comment: Having done this before, I can tell you this approach is not as hard as it seems. Additionally,  is easy to maintain - to expand and add logic, and easy to train someone else to maintain it.  Usually these things take on lives of their own...
Comment: I'm happy with this solution.
Comment: Could you expand on the @ping command? I don't understand why you choose to do this and what 127.0.0.1 is.
Comment: Joe, when I wrote that response back in 2012, either timeout.exe was not available, or i didnt know about it.  In any event, each ping packet takes ~1 second to process.  The ping command above pauses the script for ~5 seconds, and >nul tells it to echo nothing to the screen.
Answer: Simple enough, provided the processes don't need standard input or output.  From the command line, or in a batch file:
process1 | process2 | process3 | process4

This will run all four processes simultaneously, and won't return until they've all exited.  (Possible exception: if a process explicitly closes the standard output it might be treated as if it had exited.  But that's unusual, very few processes do that.)
I'm not sure exactly how many processes you can launch simultaneously this way.  I've tried up to ten.
Comment: Uhm, what I get is that all processes are indeed started at once, but process3 is kept waiting till process4 has completed, process2 is kept waiting till process3 completes, and so on. This is from the classic Windows command prompt by the way.
Comment: @Sergio: What do you mean by "kept waiting"?
Answer: The only way to do this is to start separate batch files (see start /?) that run the individual task and write a text file upon completion. Then, you periodically check whether the text files have been made.
Answer: I was also looking for similar task. Objective was to run multiple commands parallel and extract output (stdout & error) of all parallel processes. Then wait for all parallel processes to finish and execute another command. Following is a sample code for BAT file, can be executed in CMD:
(
start "" /B cmd /c ping localhost -n 6 ^>nul
timeout /t 5 /nobreak
start "" /B /D "C:\users\username\Desktop" cmd /c dir ^> dr.txt ^2^>^&^1
start "" /B cmd /c ping localhost -n 11 ^>nul
timeout /t 10 /nobreak
) | pause
Echo waited
timeout /t 12 /nobreak

All the statements inside () are executed first, wait for them to complete, then last two lines are executed. All commands begining with start are executed simultaneously.
These links are helpful:
https://stackoverflow.com/a/43762349/9689416 and https://ss64.com/nt/start.html
Answer: You might look at the Powershell Start-Job cmdlet.  It should allow you to do this.  More here
Powershell is Microsoft's shell of choice.  It is much more powerfull than cmd scripts and well worht the investment of your time
Comment: PowerShell isn't crap, it's just a full programming language one has to learn, instead of a traditional sh-like syntax. I remember feeling exactly the same way about Perl, Python, Tcl, C#, and every other language I tried to learn "for the lulz" without any real use yet. (When I actually *needed* them, though, it went fairly easily.)
Comment: This does not wait for all of them to terminate?
Comment: It certainly can depending on how you write it.  You can poll the started jobs to see whether they've completed and exit your script once they have. The code on that page processes a whole list of jobs, three at a time and waits for them to exit.
Comment: Uhm, never did anything before with Powershell. I tried to change the example to run arbitrary processes and wait for them to complete and after about 30 mins and 100 lookups on M$ technet I gave up. I'm sorry if I hurt anybody's feelings but Powershell is crap. It's easier to do this in C (which I think is telling...)
Thanks anyway, I bet someone will still find this useful.
Comment: If there's one thing Powershell isn't is crap and you won't hurt my feelings if you don't use it.  You will not, however, learn it in 30 mins of searching.
Answer: Or you can use this:
http://www.out-web.net/?p=167
I did it, it works, however it happens sometimes that the PID of the finished process is immediately re-used by another Windows processus which just started, and it makes the detection of the end of your processus hazardous/erroneous.
Comment: Please summarize what that link says.  If the page goes down, this answer will not be helpful.
Comment: Too late is seems.
Comment: https://web.archive.org/web/20160914142436/http://www.out-web.net/?p=167


What happens when devices request different voltages from a USB hub?

Question: I'd like to charge two devices with one USB charger, one requests 5V, the other 9V. I plug an USB hub (potentially an old USB 2.0 one) in the (9V capable) charger and plug the two devices in the hub. How would this be handled? Would it potentially kill the 5V device or the USB protocol somehow assures that both devices will be powered from 5V?
Comment: Read that, doesn't have anything about USB hubs.
Answer:
I plug an USB hub (potentially an old USB 2.0 one) in the (9V capable) charger

Then your device will get 5 V.
It's only able to request 9 V from the charger if it is attached directly to the charger.
And the old USB hub will not be designed to work with 9 V, since the USB 2.0 standard only allowed 5 V on the VBUS line. If somehow the device did signal to the charger to provide 9 V, it would most likely damage the hub.
In order to charge your device with 9 V, you need to connect it directly to a source that is designed to the USB Power Delivery standard or one of the earlier proprietary high power charging standards (both devices using the same standard).
Answer:
I plug an USB hub (potentially an old USB 2.0 one) in the (9V capable)
  charger and plug the two devices in the hub. How would this be
  handled?

When you plug an old USB 2.0 hub into a modern charger that potentially supports higher charging/operating voltages, nothing will happen above the default +5V, simply because the old hub has no idea about any special voltages and can't signal (or "negotiate" or "request") anything. So the charger will output the default +5V safe voltage.
Now, a standard USB hub has an upstream facing port decoupled from downstream ports, which includes data lines AND power lines. And the old hub has no idea about voltage negotiating and such on its downstream ports. So if some modern device tries to request higher fast-charging voltage, it will receive no response from the hub (because the hub has no idea about any extra functionality), the device request will be simply ignored, and the power will be at default, +5V safe level.
Since the hub ports (data lines) are completely de-coupled, the device request can't possibly propagate upstream and trick the charger into high-voltage mode.
In the past of PowerDelivery specifications the power negotiations were envisioned to use VBUS (power) wire to exchange negotiation packets (at radio frequency rate). Then someone raised a concern that some old bus-powered hub can accidentally couple the downstream VBUS signal into upstream port, and vice versa, so the charging port can accidentally engage into high voltage while the hub itself can't handle more than 5.5V, and will be fried. It turned out that this possibility did exist, and that't why the Power Delivery no longer uses RF negotiation over VBUS. The only permitted protocol is over Type-C connector, over its dedicated CC channel. Alternatively the Apple and QuickCharge signatures use D+/D- wires to "negotiate" fast-charge voltages. Since D+/D- are never directly coupled in any standard USB hub, this accidental negotiations can never take place.


Are higher dimensional Heisenberg groups free nilpotent?

Question: I know that the Heisenberg group { x,y | [x,[x,y]]=[y,[x,y]]=1 } is free nilpotent; what
about the higher dimensional ones?  Do the higer dimensional Heisenberg groups have nice presentations?  By higher dimensional Heisenberg groups I mean nxn upper triangular matrices with integral entries.  Thanks.
Comment: What do you mean by 'Heisenberg groups'? Upper triangular matrices with integral entries and ones along the diagonal?
Comment: There is no free nilpotent group; there are instead e.g. free k-step nilpotent groups. So in asking your question, you should figure out what the degree of nilpotency would be (i.e. the value of k). Then it should be clear that the Heisenberg groups are not free k-step nilpotent. In particular, if you look at the ranks of the associated graded (quotients of successive terms in the lower central series), the ranks for the free k-step nilpotent group grow according to Hall's formula. In the Heisenberg case they get smaller by the end; I think the last term has rank 1 (the upper-right corner)!
Comment: It would be nice to give faithful representations of the free nilpotent groups in GL(n,Z) for minimal n.  GAP's polycyclic package can very quickly produce linear representations, but I'm not sure if they are minimal, and the basis chosen is somewhat difficult for humans.  As a specific version, the free group of rank 2 and class 3 is represented in dimension 6 (which I believe is the minimal dimension, by easy counting).
Answer: The higher dimensional Heisenberg groups are the matrix groups G(V,R,f) = { [ 1, x, z ; 0, 1, y ; 0, 0, 1] : x,y in V, z in R } where V is an R-module, R is a ring, and f is an alternating R-bilinear form on V.  Typically V is a free R-module, and R is a field or the integers, and f is a block diagonal matrix with blocks [0,1;-1,0].  Sometimes V is just called a symplectic space over R.
The group has a normal series 1 ≤ ⟨ z: z in R ⟩ ≤ ⟨ y,z : y in V, z in R ⟩ ≤ G.  This gives a very nice presentation of the group as ⟨ x,y,z : [x,y] = f(x,y), [x,z] = [y,z] = 1 ⟩ where the relations from V (for various "x", and also for various "y") and R (for various "z") are implicitly added.
For instance taking V free of rank 2 over R=Z, you get ⟨ x1, x2, y1, y2, z : [ x1, y1 ] = [ x2, y2 ] = z, [ x1, x2 ] = [ y1, y2 ] = [ z, x1 ] = [ z, x2 ] = [ z, y1 ] = [ z, y2 ] = [ x1, y2 ] = [ x2, y1 ] = 1 ⟩.  This is a very pretty presentation, but is not usually "free".  Way too many things commute.
However, these types of groups are very important.  When R=Z/pZ, these are the extra-special groups of exponent p.  Rather than "free products" they are "central products".
These form reasonably nice examples of just-non-abelian groups, since V can be a fairly arbitrary R-module as long as R is Z/pZ.
Answer: Let $U_n$ be the group of upper triangular integer matrices of size $n$ by $n$ with ones on the diagonal. Then $U_n$ is generated by the elements $x_i$, $i=1,...,n-1$, with Serre relations
$$
[x_i,[x_i,x_{i+1}]]=[x_{i+1},[x_i,x_{i+1}]]=1,
$$
and $[x_i,x_j]=1$ if $|i-j|\ge 2$ (EDIT: one needs additional relations, see below). Indeed, the group $G_n$ generated in this way maps surjectively to $U_n$ by $x_i\mapsto 1+E_{i,i+1}$, and one can check that this map is injective (EDIT: with additional relations) by writing every element of $G_n$ as an ordered product of powers of $x_{ij}:=[x_i[x_{i+1}...x_j]]$, $i\le j$. The corresponding groups over $\Bbb Z/m\Bbb Z$ are then obtained by adding the relations $x_{ij}^m=1$.
EDIT: As Jack kindly pointed out, I erroneously ignored the treacherous 2-torsion.
According to Theorem 1 of the paper
D. Biss, S. Dasgupta, "A presentation for the unipotent groups over rings with $1$",
J. of Algebra, v. 237, pp.691-707, 2001,
the above statements are correct over $\Bbb Z/m\Bbb Z$ when $m$ is an odd integer.
In general (i.e. for any integer $m$, including $m=2$ and $m=0$),
it suffices to add the relation
$$
[[x_i,x_{i+1}],[x_{i+1},x_{i+2}]]=1
$$
for $i=1,...,n-3$.
Moreover, over $\Bbb Z/m\Bbb Z$ with $m\ne 0$ it is enough to impose the relations $x_i^m=1$ (the relations $x_{ij}^m=1$ will then follow).
Comment: For n=3, this map is not injective. You mean the group generated by x,y,z subject to the relations [x,z], [x,[x,y]], [y,[x,y]], [z,[y,z]], [y,[y,z]], right? The group G3/γ5(G3) (of nilpotency class 4) has 2-torsion. Maybe you also need to enforce a nilpotency class condition?


Empirical cdf in several dimensions

Question: Is there a sensible notion of empirical cdf in several dimensions? If not, what other meaningful ways of saying "this collection of points in $\mathbb{R}^d$ looks like it could be iid from this multivariate distribution" are there?
Answer: As long as I know there is an extension of the co-occurance matrix denoted by $$C(i,j), i=1,...,N-1, j=0,...,M-1$$
It is used in the context of image processing and essentially the extension of the histogram to multi dimensions. There are several papers who use multivariate co-occurance matrix in order to state the multivariate emprical density function. As the density can be obtained uniquely from the distribution function, one can say that this collection of $\mathbb{R}^d$ looks like it could be iid from this multivariate distribution.

Empirical cdf in several dimensions


Effectively storing arrays of float and short values in a file

Question: I am currently in the planning stage of an Android application in which I will need to read some values stored in files. The values will be floats of an unknown (but potentially large) amount that in the application will be put into FloatBuffers when loaded.
The float values will come in groups of five and in groups of three.
I do not have that much experience when it comes to efficient file writing (or reading) but my idea is to create the files using a DataOutputStream, to write the floats, preceded with a length-index describing the amount of five-groups. After that amount the three-groups can be written.
As I am writing this I have also found the FileChannel which could help with reading directly into the buffers, but I have never used this before and is a bit uncertain on how to use it in this case.
Now, before I actually write any code I would like to get some input on this. Will it be effective using this (I am specifically thinking about the reading from file into buffer), or is there a better way to go about it?
I will include some specifications for the file below:
The file will have to be able to:

Contain groups of five floats.
Contain groups of three floats. (Both in the same file)
Be ordered. The order of the groups is very important, as well as the order of the values in the groups.
Allow for efficient (fast and not too memory consuming) reading into FloatBuffer.

The file will not have to be:

Modifiable. The application will only read the data from the files, they will never be modified after having been.
Secure. The data in the files will never represent anything such as passwords or other sensitive data.
Fast to write. The creation of the file will be done beforehand, on a computer. In the mobile application it will be read-only.

Thank you for your responses.
Edit: after some quick and dirty testing, I have compared the performance of the RandomAccessFile and a buffered DataInputStream for reading the data. The results show that DataInputStream is much faster (10-100%, depending on the amount of files).
Comment: You can also use a `Scanner` to read from the file -- or a `RandomAccessFile`
Answer: You can implement all these yourself but I'd recommend you to think about database. Andoroid supports SQLite, so take it and use. Create 2 tables: GROUP5 and 'GROUP53`. Define relevant indexes and you will be able to store data, retrieve it using any sorting policy etc.
If you still prefer to make your own implementation I'd recommend you to store data in 2 files: one for 5 fields and other for 3 fields. In this case you will always know the data record size, so you will be able to use random access (either using RandomAccessFile or by using mark() and skip() for regular FileInputStream.
Using of file channel does not have any advantages here. It allows reading from several files simultaneously. Reading from one file just cause performance degradation relatively to regular FileInputStream (http://alexradzin.blogspot.com/2011/07/file-access-stream-vs-nio-channel.html).
Comment: Thank you for you answer, using a database seems like an option, but for now I would like to create a custom implementation.
I will look into the RandomAccessFile and see if this might be what I need.
Answer: If the amount of Data is huge I would still go with a SQLite Database. With the Helper it is easy to handle huge amounts of Data and as far as I know due to its efficient handling of queries it is fast for random access of data sets (If you want to sequentially read your file then it is probably not faster than  the Dataoutputstream, because then the query routine of SQL will always query the database and process the result cursor instead of just increasing the position counter in your file by x). I am not sure if it is the fastest way but it is definitely a convenient and fast way.


Hydraulic sub brake lever as primary lever

Question: I can see answers for this question with cables but cannot find an answer for hydraulic brakes. I am looking for a 31.8mm clamp hydraulic disc brake lever for my fixed gear commuter, and have seen the shimano grx BL-RX812 sub lever. Does anyone know if this be used as a primary lever?
Answer: No.

It has two ports, the one normally connecting to the main brake lever needs to be blocked.
If you somehow manage to block it. It's reservoir probably wouldn't be large enough to adjust for brake pad wear, as BL-RX812 relies on the reservoir of the main brake lever.
You would need to block the port using some kind of diaphragm to allow pressure equalization between the reservoir and ambient pressure.

The animation is from https://commons.wikimedia.org/wiki/File:Hydraulic_disc_brake_diagram.gif
Instead of the reservoir the fluid inlet and compensating ports of the BL-RX812 are connected via hyraulic line to the outlet of the main brake lever.
The only way to make them work independetly is to add some kind of external reservoir.
It will be way easyer to just get some 22.2mm handlebars and normal flat-bar levers.
Comment: Thanks for taking the time to answer and sharing your knowledge.


What is up with screen resolutions?

Question: I thought, it is determined by the horizontal pixel width, but why is 1920*1080 1080p but 1280*720 720p? It makes kinda no sense or is my source wrong?
Comment: It's an idiotic change made by manufacturers so that the latest jump to "4k" sounds like a huge deal rather than the on going incremental change that it is. Up to 4k we were naming the resolution by vertical resolution and then suddenly with 4k they decided to use the horizontal width instead.
Comment: You thought what is determined by horizontal width? Screen resolution is width by height. Multiply one by the other to get "K" [in the broadest terms]. 720p & 1080p are rendering standards, not resolution standards. The 'p' means progressive scan, to differentiate from the inferior 'i' for interleaved scan.
Comment: I'm very confused because I don't see a difference between the two examples of 1920*1080 and 1280*720. The "p" number is the second number in both cases. Maybe the "but" should be an "and", because, as written, it reads very odd to me.
Comment: @Mokubai - yeah the next step is for them to go all hard drive on us and we'll lose the last 96 pixels too.
Comment: Possible duplicate of [What is the difference between 4K, UHD and QHD? Do we agree on one official resolution?](https://superuser.com/questions/977654/what-is-the-difference-between-4k-uhd-and-qhd-do-we-agree-on-one-official-reso)
Comment: I'm in general confused by what makes a screen 4k or 2k and I thought that number was determined by the number of horizontal pixels
Answer: In the "old days", TVs were analog devices - a CRT scans an electron beam across the front of the display, from left to right. In this sense, people have tried to argue that analog TV has "infinite" horizontal resolution, but they have an exact vertical resolution - the picture is formed of multiple horizontal lines.
Depending on where you are, this would have been either NTSC (525 lines) or PAL (625 lines).
Modern resolutions are still referred to by their "line count" - hence 1080 is the vertical resolution.
With such displays, the image was transmitted interlaced - i.e: the first field contains lines 1, 3, 5, etc... and the second field contains lines 2, 4, 6, etc...

With the advent of digital TV, the display technology changes - we now have discrete pixels instead of lines. A 2D image made from an array of pixels - the array having specific dimensions in the horizontal and vertical axes.
At this point, interlacing remains around only to reduce the bandwidth required for a video stream - in my opinion it's a horrible idea that is fundamentally incompatible with digital display systems.

As mentioned earlier, modern resolutions are still referred to by their "line count". But as shown above, we also have to identify whether we are referring to "interlaced" video (indicated by an i), or "progressive" video (indicated by a p).
The frame rate can also be specified, for example:

480i60 - 480 rows, interlaced, 60 Hz field rate (i.e: 30 Hz frame rate)
1080p30 - 1080 rows, progressive, 30 Hz frame rate

"... okay, but where did 480 come from?"
The analog electronics involved in CRTs are imprecise, and a particular feature of early models was that as the set warmed up, or the capacitors and electronics aged, the image started to change shape. In addition to this, the electron beam has to be turned off and then redirected to the left of the screen for each line, and to the top for each new field/frame - this takes time, and is the reason for "blanking".
To account for this somewhat, only a handful of the scanned lines were intended / expected to be displayed. NTSC scans 525 lines, but only 483 if these are intended for display - each field shows ~241.5 lines to a viewer (with an additional 21 lines of "blanking"). ~240 lines per field (remember, this is interlaced) equates to 480 lines per frame (in the progressive world). Thus 480. Yay.

For the digital resolutions we follow a pattern... ish:

480 * 1.5 = 720 - "HD Ready"
720 * 1.5 = 1080 - "Full HD"
1080 * 2 = 2160 - "4k" or "Ultra HD"

So actually "4k" isn't following the * 1.5 pattern from before, and it's not really 4000 pixels in either dimension - it's 3840 × 2160.
"4k" is actually "Four times the number of pixels as Full HD". 1920 * 2 = 3840 and 1080 * 2 = 2160. Or lay out four 1080p displays in a 2 × 2 grid - you get 3840 × 2160.
Additionally, if we're using 1080p as a resolution description, then really "4k" should be called 2160p (which it is in the technical world).

In summary, in the consumer / broadcast space:

480 is because that's approximately the number of visible lines that NTSC would display
720 is because that's 1.5× 480
1080 is because that's 1.5× 720
2160 is because that's 2× 1080
"4k" is because it's a marketing thing - it isn't a technical specification, and I don't believe that there are any stipulations around the use of it...

Note: I've been taking about consumer / broadcast...
Within Cinema there is DCI 2K (capital K, 2048 × 1080) and DCI 4K (capital K, 4096 × 2160), where the 'K' presumably refers to kibi and the horizontal resolution. "DCI 4K" predates consumer "4k".
The aspect ratio of DCI 4K is not 16:9, but a slightly wider 256∶135... to bring the resolution back in line with 16:9, you can increase the vertical resolution, or decrease the horizontal... But I'm not entirely convinced that the cinema and broadcast standards evolved this closely.
Cinema evolved from whole-frame positives (aka film) directly to digital, whereas TV evolved from a scanning electron beam (line by line) to digital. This is evident in both broadcast, and the way that VHS operates too.

As a little extra, I've included the graphic below to expand on the "image changes shape" statement from above.
The graphic (from here) indicates the various "television safe" areas... note the rounded corners...
Importantly:

5 is the "television scanned area"
6 is the "television safe area for action"

Faces and important plot information should not fall outside this area

7 is the "television safe area for titles"

No text should be outside this area to ensure that subtitles / news tickers / etc... don't overhang the edge of an old display
Comment: 480i30 would be a weirdly low frame rate; much more common is 480i60, 60 fields per second (can be combed into 30 frames per second).  You can deinterlace it to 480p60 (doubling the vertical spatial resolution) or 480p30 (discarding half the temporal resolution).  Agreed that interlacing is stupidly horrible now that progressive displays are nearly universal, and it always sucked to store digitally.
Comment: There are actually a few different resolutions that have been called "4K". The first usage however (according to Wikipedia) was a camera using 4096×2160. Someone thought 4096 was pretty close to 4000, and decided that saying their camera had a 4K resolution sounded cool. It's really just marketing.
Comment: The rate number is the temporal resolution.  Number of times the display changes (or could change) per second.  I think this sometimes gets fudged with progressive content stored as interlaced (evil, bad, and stupid), where both fields are actually from the same time, rather than evenly spaced times.  (And of course there's 24p content hard-telecined to 60i, or worse telecined to 60i and then having VFX added at 60i or 30p, like the Star Trek DVDs before they remastered.  Those DVDs switched from soft-TC  24p for most scenes to 60i for VFX shots, because the show was edited on video.)
Comment: It should also be noted that 480i or 480p use 720 horizontal pixels with a width to height aspect ratio of 8/9 (= .88888....), which creates an interpolation issue on digital monitors. For CRT displays, this isn't an issue because it just involves a change in the sweep rate (and effective thickness) of the beam used to light up the phosphors.  CRT based HDTV's generally support 480i / 480p  / 1080i as "native" resolutions, with a better image for 480i/480p than digital displays, but not as good as 1080p digital displays.
Comment: @Peter thanks - I couldn't remember if the number was field rate or frame rate...
Comment: I thought 4k was 4000, as in 4000px wide (rounded up). If it's actually "Four times the number of pixels as Full HD", then what's the "k" for? Or what's it supposed to be for, because as you say it's just marketing?
Answer: Attie has explained how vertical pixel counts were derived for traditional resolutions such as SD (480p), HD (720p) and Full HD (1080p). I would like to discuss K measurements which originate from the cinema industry. A K is about 1000 horizontal pixels and 2K and 4K were casual terms referring to resolutions of approximately 2000 and 4000 horizontal pixels.
Different K measurements were later standardised for digital cinema (2005) and consumer television (2007).
Digital Cinema Initiatives has specified the DCI 4K and 2K resoultion standards (4096 × 2160 and 2048 × 1080). These are the full frame resolutions for digital cinema projectors, with many films displayed in the a crop format such as flat crop (3996 × 2160 , 1.85∶1 aspect ratio) or CinemaScope crop (4096 × 1716, ≈2.39∶1 aspect ratio).
The 4K standard for consumer television (UHDTV1) can be more accurately labelled as Ultra HD or Quad HD. It is equivalent to 4 Full HD frames placed together. It is 3840 × 2160 with ≈1.78∶1 aspect ratio.
The Wikipedia article on 4K resolution provides a helpful visualisation which compares different frame sizes.
Answer: Your assessment that resolution is pixel pitch is kind of correct.  In fact, for everything except digital displays, that's the correct definition of resolution (well, more accurately, it's the smallest detail that can be resolved accurately, which functionally translates to the size of the dots making up an image, and from that pixel pitch).  If you ever talk to somebody in the printing industry, this is usually what they mean when they say 'resolution'.
The reason that the term has a different meaning for computer displays is largely historical, but is actually pretty easily explained without getting into much history.
On a raster display1, you have what's known as a 'native' resolution.  This is the highest number of pixels you can have on each side of the screen, and is usually what is used to describe the screen.  For example, a Full HD display has a native resolution of 1920 pixels horizontally, and 1080 vertically, so a Full HD display with a roughly 18 inch diagonal has a resolution (in the classical sense) of about 120 dots per inch (DPI) (which is actually pretty low compared to print media).
However, you can run most displays at lower than their native resolution, which is functionally equivalent to having a larger pixel pitch on the same display.  Taking that same 18 inch Full HD display and running it at 1280x720 gives you the equivalent of 80 DPI on the same screen.
Now, the OS and application software (usually) don't care about the exact physical dimensions of the screen, because that information is not really all that useful to displaying information unless you need to display something 'real-size'.  Given this, the OS just assumes the size of the display never changes, which means that the different pixel counts are functionally equivalent to the resolution.

A display that uses rows and columns of individual points that can be turned on and off to produce an image.  Almost all modern computer displays are raster displays, because they're fare easier to make.  Compare to a vector display, which just draws lines directly (with one of the most recognizable examples being the displays used in the original Asteroids arcade cabinets).
Comment: "_Resolution_" doesn't have any bearing on dot size, pitch or aspect ratio as such - it refers to the smallest addressable "thing" - DAC resolution of 16-bits, screen resolution, etc... interestingly with RGB displays, you quite whole pixels, not sub pixels. With print it's quite meaningless to advertise a resolution across a page due to various sizes (A4 / A5 / etc...), margins, etc... so instead they specify the area (typically an Inch) and count the dots inside it (DPI)
Comment: @Attie No, it does have bearing on dot size and/or pixel pitch (though not really aspect ratio).  If you have a display of a given size, higher resolution means smaller pixel pitch, period (and thus higher detail and less aliasing).  The reason resolution matters for actually displaying anything when dealing with anything higher level than drivers is pixel pitch and pixel count (which is a side effect of pixel pitch and display size), _not_ addressing.  Also, the use of dots-per-unit-area in print far predates computer displays.
Comment: I completely agree that "_resolution_", "_pixel pitch_" and "_physical dimensions_" are all intertwined (how could they not be)... but "_resolution_" by itself has no bearing on the other two. The fact that software is typically aware of a display's physical dimensions or PPI means that it's possible to display things at approximately real size.
Comment: As for DPI in print and [pixel aspect ratio](https://en.wikipedia.org/wiki/Pixel_aspect_ratio) - until recently pixels were not square! IIRC facsimile had pixels with a 2:1 aspect ratio, and NTSC was 10:11... rendering the image with an incorrect PAR produces squashed/stretched looking images. Additionally, [DPI](https://en.wikipedia.org/wiki/Dots_per_inch) in print usually needs to be so high because of the limited count of discernible colors - [dithering](https://en.wikipedia.org/wiki/Dither) coming to the rescue.

What is up with screen resolutions?


Opportunity Team - Role Hierarchy?

Question: If I share an opportunity with a user via opportunity team, only the user will have access or his role hierarchy has access as well?
Answer: If you share Opportunity or any standard object record with a user or his role.All users in above hierarchy will have access to that record.

you can disable the Grant Access Using Hierarchies option for a custom object.

But You can't remove Grant Access Using Hierarchies for standard objects.

Opportunity Team - Role Hierarchy?


Can I access all live broadcasts with YouTube's LiveStreaming API?

Question: Meerkat allows access to all its live broadcasts via REST API. Does YouTube's live streaming API allow the same? I can see that they allow CRUD through the API for a particular user. My question is can I access all live broadcasts with the API?
Comment: Hey @nkukday did my answer help?  Let me know if you have any more questions.
Comment: I was able to retrieve the streams! Thanks!
Answer: You can use the Search/list endpoint of the regular YouTube v3 API and filter the results to only receive live content.  Make sure to pass in the following parameters:
part -> snippet
eventType -> live
type -> video (required when setting eventType to live)
The full get request:
HTTP GET https://www.googleapis.com/youtube/v3/search?part=snippet&eventType=live&type=video&key={YOUR_API_KEY}

Comment: Does the YouTube v3 API expose an endpoint to access the .m3u8 for the live stream?
Comment: @nkukday you should ask a new question.
Comment: unable to see a manifest file in the response, even the videos endpoint.


How to calculate step response for $y''(t) - y(t) = x'(t) - x(t)$ in time domain?

Question: How to calculate step response for $y''(t) - y(t) = x'(t) - x(t)$ in time domain? So, without Laplace or Fourier Transforms.
This is what I tried:
The Homogeneous solution of the differential equation would be: $ y_{homogeneous} = A*e^t + B*e^{-t}  $.
u(t) is the unit step function.
When I try to fill in the stepfunction for x: x(t)=u(t). So x'(t) = u'(t) = $\delta(t)$
And I try a step response $y= s= y_{homogeneous}*u(t) =  (A*e^t + B*e^{-t})*u(t) $
$\frac{\partial ^2 (  \left(A e^t+B e^{-t} \right)u(t) )}{\partial t^2}-\left(A e^t+B e^{-t}\right) u(t)=\delta(t)-u(t)$
So, I will get:
$2 (A-B) \delta(t)-A \delta(t)+A \left( \delta ' (t) \right )+B \delta(t)+B \left( \delta ' (t) \right)=\delta(t)-u(t)$
But there's no u(t) at the left hand side.
Answer: Multiply with $e^{-t}$. Then the ODE can be rewritten as
$$
(e^{-t}y')'+(e^{-t}y)'=(e^{-t}x)'
$$
which integrates to
$$
y'+y=x+Ce^t
$$
This removes the need to introduce distributions. Now integrate to the left and to the right of the jump and adjust the two integration constants on both sides in such a way that the combined function is continuous.


Convergence of $\sum\limits_{n=1}^{\infty}\left(\frac{\sqrt n-1}{\sqrt n}\right)^n$

Question: $$\sum_{n=1}^{\infty}\left(\frac{\sqrt n-1}{\sqrt n}\right)^n$$
It kind of looks like the Euler's number limit, but I didn't succeed in proving that it converges. Anyone? This was an exercise at the end of a chapter on sequences and series, much before Taylor series and integrals, so I don't think it would be "fair" to use those.
Answer: Note that $1-x\leqslant\mathrm e^{-x}$ for every $x$. Applying this to $x=1/\sqrt{n}$ yields
$$
\left(\frac{\sqrt{n}-1}{\sqrt{n}}\right)^n\leqslant\left(\mathrm e^{-1/\sqrt{n}}\right)^n=\mathrm e^{-\sqrt{n}},
$$
hence it suffices to show that the series
$$
\sum_{n\geqslant1}\mathrm e^{-\sqrt{n}}
$$
converges. There are several ways to do so, an instructive one is to note that the function $x\mapsto\mathrm e^{-\sqrt{x}}$ is decreasing hence, for every $n\geqslant1$,
$$
\mathrm e^{-\sqrt{n}}\leqslant\int_{n-1}^n\mathrm e^{-\sqrt{x}}\mathrm dx.
$$
Summing these yields
$$
\sum_{n\geqslant1}\mathrm e^{-\sqrt{n}}\leqslant I,\qquad\text{with}\quad I=\int_0^\infty\mathrm e^{-\sqrt{x}}\mathrm dx.
$$
Now, the change of variable $x=t^2$ yields
$$
I=2\int_0^\infty t\mathrm e^{-t}\mathrm dt=2\,\left.(t+1)\mathrm e^{-t}\right|_0^\infty=2,
$$
which is finite, hence the series of interest indeed converges.
Another approach, with no integral, is to show that there exists some finite $c$ such that, for every $n$,
$$
\mathrm e^{-\sqrt{n}}\leqslant\frac{c}{n^2},
$$
since every series with general term $c/n^2$ converges.
Starting from the elementary fact that $\mathrm e^x\geqslant x$ for every $x$, one gets successively $\mathrm e^{x/4}\geqslant x/4$, then $\mathrm e^{x}\geqslant x^4/4^4$ for every $x\geqslant0$, which, for $x=\sqrt{n}$, yields
$$
\mathrm e^{-\sqrt{n}}\leqslant\frac{256}{n^2}.
$$
To sum up, the argument with no integral is that, for every $n\geqslant1$,
$$
\left(\frac{\sqrt{n}-1}{\sqrt{n}}\right)^n\leqslant\frac{256}{n^2}.
$$
Answer: If $f(n) = \left(1 - n^{-1/2}\right)^n$, then $$\ln(f(n)) = n \ln(1 - n^{-1/2}) =
n (-n^{-1/2} + O(n^{-1})) = - n^{1/2} + O(1) < -2 \ln(n)$$ for $n$ sufficiently large.  Thus $f(n) < n^{-2}$ for such $n$.
Comment: this was an exercise at the end of a chapter on succession and series, and before taylor series and o notation. Do you think it is possible to prove that it converges using only the comparison test?
Answer: Well,
$$ \left(\frac{\sqrt{n}-1}{\sqrt{n}}\right)^n = \left[\left(1-\frac{1}{\sqrt{n}}\right)^{\sqrt{n}}\right]^{\sqrt{n}} \to \mathrm{e}^{-\sqrt{n}}. $$
This suggests a limit comparison test to $\sum_n \mathrm{e}^{-\sqrt{n}}$; one way to determine this "simpler" series convergence is by the integral test.
Comment: "Don't waste your time seeking ways with more rigor. Just raise up your hands and wave with more vigor!" =)
Comment: @AntonioVargas I have no idea, but I'll just confidently assert it was Richard Feynman and wave my hands vigorously.
Comment: I should add that my limit-taking process involved lots of hand-waving. How much rigor do you need in the limit?
Comment: The point is that this was a chapter-end exercise on sequences and series, and much before integrals, so I cannot use that test. The only test that it would be fair to use is the comparison test.
Comment: @DavidH, that's a great quote!  Do you know the source?  (Is it you?)
Comment: One wonders what could be the meaning of $\to$ here, rigorous or otherwise.
Answer: $e^{- \sqrt{n}} \geq \left( \frac{ \sqrt{n} - 1}{\sqrt n} \right)^n  = \left((1 - \frac{1}{n^{1/2}})^{n^{1/2}}\right)^{n^{1/2}}  \quad \forall n \geq 1$ (since the RHS approaches the LHS from below).
Here is a method to show that $\displaystyle \sum_{n=1}^{\infty} e^{- \sqrt{n}}$ converges, so by comparison your series converges as well.


Does the Pi 3 support Vulkan?

Question: I have tried running Fuchsia OS on my Raspberry Pi 3 but it is not able to run because there is no support for Vulkan APIs on it.
Please explain why Vulkan Support is not there on the Raspberry Pi 3 and how it can be modified to get this?
Answer: The Raspberry Pi will support vulkan soon, see VK driver for the Raspberry Pi (Broadcom Videocore IV)
Comment: "soon" - well `Not supported: 3497/3888 (89.9%)` a *long* way to go yet ... and from that page, *As far as I know the PI is **NOT fully VK capable** on the hardware level. I can already see that **some things will need to be emulated and others won't ever be emulated**. The compiler is also a huge unknown at this point as I plan to write one from scratch* - seems there is absolutely no hope
Answer: PCWorld states that Vulkan is not supported on the Pi 3 due to the lack of GPU support:

The Raspberry Pi has an aging graphics core, and a GPU upgrade would have made the computer better at gaming. The BroadCom VideoCore IV 3D graphics processor can play 1080p video at 60 frames per second, and it'll run OpenGL games. But it isn't compatible with Vulkan, a new gaming API that will bring visually stunning Linux games to PCs and mobile devices.

Unfortunately, you will not be able to modify the Pi to support Vulkan, as the issue is the GPU capability. The GPU is contained in the BCM2837 system-on-a-chip, as you can see here:

(the SoC is the black square labelled 'Broadcom')
That chip isn't exactly open to modification, so there's not much you can do. If you need Vulkan, you're going to need a different board than the Pi 3.

For your specific issue with Fuchsia, you may be interested in viewing Magenta on Raspberry Pi 3. This is Google's documentation of the current state of Magenta, Fuchsia's kernel, on the Pi. It is specifically stated that:

The following peripherals are not yet supported:

Wi-Fi
Hardware Accelerated Graphics

Note also that "Initial specifications stated that Vulkan will work on hardware that currently supports OpenGL ES 3.1 or OpenGL 4.x and up", according to Wikipedia. The BCM28xx video core "is documented to fully support OpenGL ES 2.0", which is not sufficient for Vulkan.
Answer: In addition to pi-vk-driver, there is also a wip mesa branch:
https://github.com/abergmeier/mesa-vulkan-broadcom/commits/libvulkan_broadcom
Comment: That's for the VideoCore VI gpu found in the RPi 4, as mentioned in the repository and the [guy's talk](https://av.tib.eu/media/47390). It has nothing to do with this question.

Does the Pi 3 support Vulkan?


Snap to Object/Control feature

Question: i am doing an editor kind of project application in wpf in which i am allowing user to drag their controls (i have defined my own controls that allows user to customize their screens) to the Canvas window i.e I have toolbar and canvas area.i have placed controls in the toolbar and those controls can be dragged and dropped on the canvas.
i am done with dragging and dropping stuff and currently looking for the feature that allows me to snap one control from the boundaries of another control while placing a control to Canvas.
i.e. when i am placing 2nd control benith/after of the 1st one and if 2nd control is coming in same vertical/horizontal line in that case system should show floating visible line to properly place control in one line.
The feature i have seen in Visual Studio form desigining such as,

Please, advice me how to do this thing.
Thanks in advance,
Mandar.........
Answer: Don't have the full answer, but I do know the snap lines and grab handles in VS make use of the Adorner

Snap to Object/Control feature


Is it possible to convert a C++0x lambda to a clang block?

Question: I've wondered if it is possible to convert a C++0x lambda to a clang block. So far anything I've seen on it has involved the discussion between their differences. My primary reason for looking into this, is to make an eventual wrapper for libdispatch, and while I'm quite aware of dispatch_*_f functions, any information on their use has been quite lacking, in comparison to their block counterpart.
So far I've been able to find information on converting a C++ lambda to a function pointer, but this is more in the realm of the reverse.
If anyone knows anything related to this, and could provide a link, or at least point me in the right direction, I would really appreciate it. (even a "This is not currently possible" answer will suffice)
Comment: BTW, your title asks to convert lambda -> clang block, but your question asks to convert block -> lambda.
Answer: A patch enabling this conversion implicitly was just added to clang trunk.
Comment: With url: [http://llvm.org/viewvc/llvm-project?view=rev&revision=150620](http://llvm.org/viewvc/llvm-project?view=rev&revision=150620)
Comment: I just noticed the page located on the clang website which details how this works, so I'm marking this as the answer.
Comment: Unfortunately this feature seems to have been removed (without explanation) a few months later, in [Clang commit 151131](http://llvm.org/viewvc/llvm-project?view=revision&revision=151131). Or at least, it now appears to work only in Objective-C++, not plain C++.
Answer: Generally, when lambda is used for "downward" closure, you can convert a c++ lambda to a clang block by converting:
[&](int i) { return i; }

to:
^(int i) { return i; }

There is still some subtle differences. Clang's blocks only capture C++ classes by const. I don't know if this includes C++ POD types too.
Finally, if "upward" closure is needed, then the two diverge drastically. Clang's blocks require variables captured to be annotated with __block, which the compiler will allocate it on the heap. Whereas, in C++, the way the lambda captures, needs to be decided based on the lifetime of the object.(That is by value making a copy or by reference).
Also in C++, copying the closure is handle automatically by the copy-constructor mechanism in C++. However, with clang's block, Block_copy and Block_release need to be called to handle the copying of the block. A simple wrapper can be written in C++ to handle this. For example:
typedef void (^simple_block)(void);
class block_wrapper
{
  simple_block block;

public:
  block_wrapper (const simple_block& x)
  : block(Block_copy(x)) {}

  void operator() () const
  {
    block();
  }

  block_wrapper(const block_wrapper& rhs)
  : block(Block_copy(rhs.block))
  {}

  block_wrapper& operator=(const block_wrapper& rhs)
  {
    if (this != &rhs)
    {
      Block_release(this->block);
      this->block = Block_copy(rhs.block);
    }
    return *this;
  }

  ~block_wrapper ()
  {
    Block_release(this->block);
  }
};

Answer: I don't think an actual convert is possible. Unlike the reverse case, getting rid of the original clang block, has some side effects that you can't recover from. While C++0x lambdas can capture variables by reference, nothing special is done to make sure the original variable is still there when you actually intend to use the lambda. Blocks on the other hand, can interact with variables declared with the __block storage qualifier, in which case these variables will be kept in memory (even if it means being copied from stack to heap) for as long as that block lives (including copies made by Block_copy):

__block variables live in storage that is shared between the lexical scope of
  the variable and all blocks and block
  copies declared or created within the
  variable's lexical scope. Thus, the
  storage will survive the destruction
  of the stack frame if any copies of
  the blocks declared within the frame
  survive beyond the end of the frame
  (for example, by being enqueued
  somewhere for later execution).

Therefore unless you intend to keep the original block around (and thus wrapping rather than converting it), some of its original functionality will be missing as the __block variables will be gone.
However, I'm no expert on the subjects and would love hearing other opinions :)
Answer: Well, Clang doesn't yet support lambdas, and neither does the Apple GCC. FSF GCCs recent enough to support lambdas don't support blocks AFAIK. So the question of conversion between them doesn't yet apply.
Once Clang supports both of these, there may be a way in ObjC++ mode to convert between them.
Answer: I recommend using the *_f versions of the libdispatch functions. All the block versions are implemented in terms of the function versions under the hood, and it's far easier to write a C++ template that produces a function that calls a lambda object than a template that produces a block that calls a lambda object.
However, the current lack of support in Clang for C++ lambdas may throw a damper on the whole thing.


Solidify modifier not working correctly

Question: I am trying to make an interior for one of my models. I decided to use a solidify modifier to give it thickness on the inside. Some faces are extruding inwards nicely and others are not.
So, what have I tried? I have checked for and fixed; non-manifolded faces; loose geometry; interior faces. I have also; applied all the scale and rotation; manually converted the whole mesh to quads; removed any modifiers in the modifier stack; and also checked the face orientation is correct. I have also tried the complex setting on the solidify modifier and tweaked some of the options and I also did that on the simple setting. I also added a vertex group but that didn't make thing any better. Non of these have changed anything and I am starting to wonder if its not possible to make an interior using the solidify modifier and if I should instead be using booleans but I don't want to, as the result won't be too accurate. The modifier also distorts in certain places where its just a flat surface.
If you have any ideas on how to fix this, I would be much appreciated if commented on the post.
Comment: Hello, please share your file: https://pasteall.org/blend/
Comment: @moonboots https://pasteall.org/blend/863fbf2c096342388e65ffc9af4f91aa
Comment: I've created a new Solidify modifier to come back to default settings and it seems to work fine, except of course the faces are going to overalp, you can't avoid that with a complicated shape like this
Answer: Under Blender 3.2 I checked both Fill and Only Rim under Solidify and it fixed this problem.

Solidify modifier not working correctly


Howto list EPSG codes as proj.4 strings from the new Proj 6 sqlite3 proj.db

Question: I want to list all EPSG codes from the new PROJ.6 tool in form of proj.4 strings. Is there a tool / SQL script to replicate the former /usr/share/proj/epsg file from the SQLite3 proj.db?
Answer: You can use Python for this purpose
Install the Python lib
# use version 2.4.2 as it install a version 6 of proj behind the scene
python3 -m pip install pyproj==2.4.2 pyproj

Then, run the following Python script
import os
import pyproj

all_epsg_crs_code = pyproj.get_codes('EPSG', 'CRS')

# Be aware that with to_proj4 usage you will get below warning
# UserWarning: You will likely lose important projection information when
# converting to a PROJ string from another format. See:
# https://proj.org/faq.html#what-is-the-best-format-for-describing-coordinate-reference-systems

with open('/tmp/epsg', 'w') as input_file:
    for i in all_epsg_crs_code:
        my_proj = pyproj.CRS("epsg:{}".format(i))
        old_epsg_string_format = """# {}{}<{}> {} <>""".format(
            my_proj.name,
            os.linesep,
            i,
            my_proj.to_proj4()
        )
        input_file.write(old_epsg_string_format)

You may want to set the path to your proj version content using https://pyproj4.github.io/pyproj/dev/installation.html#envvar-PROJ_DIR as by default Pyproj install it own binary/lib of proj.
Comment: Already mentioned in the code snippet but here the clickable link https://proj.org/faq.html#what-is-the-best-format-for-describing-coordinate-reference-systems. As I do not need projections with specific parameters, proj.4 or WKT are the same for me. Can't understand your pain in this case, just sympathize
Comment: Direct transformations between datums aren't possible with Proj.4 since the definitions can be ambiguous. That's one of the main reasons for the deprecation of proj.4
Comment: Thank you, I will try your code snippet. Have you an idea, why the description of SRS goes forward to much more complicated WKT notation. In terms of comandline usage like in the proj.4  notation to the WTK one is not handy anymore.
Comment: Yes I've scrolled through the code version 6 and 7 and since version 5, a lot of code refactoring is done, including new UTM transformation features. Code improvements are fine, but I'm a fan of breaking of long-term running legacy code by adding  features or changing  the behaviour of the complete tool set. If you check the code, it is planed that version 8 the proj.4 strings will be deprecated.  Pitty is that, new code breaks the UNIX philosophy https://en.wikipedia.org/wiki/Unix_philosophy. The larger form of SRS definitions breaks "Interactive use instead of batch processing." for example.


Night-blooming Jasmine (cestrum nocturnum) leaves are being eatin by something!

Question: My Night-blooming Jasmine (cestrum nocturnum) leaves are being eatin by something. Anyone know what it could be and how to avoid this?
Answer: Looks remarkably like caterpillar damage - check the plant all over for signs of them, or leaf hoppers, and take a torch out at night and check then. Also inspect the backs of the leaves for signs of invaders resident there, though they won't be caterpillars.
Comment: Could also be slugs. Check for them at night and also hiding in shady spots or under leaves and mulch during the day.


How to block sites with iptables

Question: I would like to block sites using iptables. How do I go about this, and how do I ensure that the iptables rules are saved?
Comment: What linux distribution are you using?
Comment: I'm using the Gentoo Linux.
Comment: Why not use /etc/hosts? cf. [this](https://newspaint.wordpress.com/2014/08/18/filtering-easylist-for-hosts-file-style-adblock/)
Answer: Blocking sites with iptables rules is a very bad idea, mainly because iptables (as most firewalls) deals with the IP addresses, and relationship between a site and its IP address(es) is rather loose:

One site can have many IP addresses, which can be changed rather frequently. Once iptables rules are created, even if you specify a site's name as part of a rule, the first IP address at that moment is used. If site's address changes, your iptables rules will be out of date.
One IP address can host many sites (and it happens often). This will only get more frequent, because of the IP address scarcity. If you block an IP address, you block all sites hosted on it.

So, even though other answers explain how you do it, I urge you to seek some other solution. For example, installing a transparent http proxy will achieve what you need. This transparent HTTP proxy HOWTO is a bit outdated, but it will help you get started.
Once you have a transparent proxy, you can add arbitrary rules to it to block specific sites, you don't even need to use the caching feature of squid, if you don't want it.
There are other ways to handle site blocking (other firewalls, proxies, etc.), but iptables rules is pretty much one of the worst possible ways to handle it.
Comment: This answer is no longer relevant due to @PetaspeedBeaver's answer below, which does not depend on addresses.
Answer: You can use iptables string matching to achieve this:
iptables -A OUTPUT -p tcp -m string --string "block-me.com" --algo kmp -j REJECT

-A OUTPUT adds the following rule to the OUTPUT chain.
-m string --string "block-me.com" --algo kmp tells iptables to look for the string block-me.com using the Knuth-Morris-Pratt matching algorithm.
The easiest way to make your iptables are restored when you restart your machine is to install the package iptables-persistent if available on your system. If you install the package after you set the new rules you will be asked if you want to save the presently used rules for permanent use. iptables-persistent basically just loads the rules saved in files /etc/iptables/rules.v4 and /etc/iptables/rules.v6.
If you change your rules again, to save changes and restore them at a reboot, you have to save them to the above mentioned files using the commands
iptables-save > /etc/iptables/rules.v4
iptables-save > /etc/iptables/rules.v6

They will now be restored at a reboot.
Actually you don't need iptables-persistent either. This question has another almost as simple solution.
Note that you need to run iptables-save as root, or with sudo like this:
sudo bash -c "iptables-save > /etc/iptables/rules.v4"

If you just run sudo iptables-save > /etc/iptables/rules.v4 you will get an "access denied" message for rules.v4.
Comment: @artificerpi Hello, nice with your input, but I think you should make it a question if you want it answered. Have a good day!
Comment: This will work fine for most sites, but `youtube.com` and `googlevideo.com`, which do not use TCP but UDP, cannot be blocked unless you substitute `-p tcp` with `-p all`.
Answer: There are multiple way we can restrict https sites.
1- Squid Proxy
2- IPtables
With Squid Proxy Server
--> Open you squid configuration in my case (vim /etc/squid/squid.conf)
--> Place the rules as defined.
acl badsite dstdomain .facebook.com .soundcloud.com .playit.pk .songs.com
http_reply_access deny badsite # This line blocks HTTP
http_access deny CONNECT badsite # This Line block HTTPS
--> After this restart your squid
With Iptables
Need to put rules as define here
iptables -N STREAM
iptables -I OUTPUT  -m string --string "www.facebook.com" --algo bm --from 1 --to 600 -j STREAM
iptables -I OUTPUT  -m string --string "facebook.com" --algo bm --from 1 --to 600 -j STREAM
iptables -I FORWARD  -m string --string "www.facebook.com" --algo bm --from 1 --to 600 -j STREAM
iptables -I FORWARD  -m string --string "facebook.com" --algo bm --from 1 --to 600 -j STREAM
iptables -A STREAM -j REJECT
Answer: ok, Lets say you want to block the IP address 192.168.1.5, just enter this at command prompt in your shell script:
iptables -A INPUT -s 192.168.1.5 -j DROP

Then you can block outoging IP address 192.168.1.2 from the server with this command:
iptables -A OUTPUT -d 192.168.1.2  -j DROP

and it should block that site from ever bothering you again. hope this helps.
Comment: Alright. And for save the rules ?
For example to restart the machine, continue with the same rules.
Without the rules is lost ?

Thanks a lot!
Comment: i think so, although i never quite got the hang of linux, and switched to mac OSX soon after. but from what i know, it should work.
Comment: No, it won't without specifically stating the rules should be saved.  The iptables command just tells the kernel to block various things.  At boot, these commands would need to be replayed.
Comment: @thatguy - I edited out the `-p tcp` from your outgoing block, as it would only stop tcp packets outbound, rather than all packets.
Answer: Under gentoo, to save the iptables rules you have added, use
/etc/init.d/iptables save

However, you'll also need to make sure that the iptables init script (whose purpose is to reload the rules) is run at boot:
rc-update add iptables default

Both commands should be run as root (via sudo if you have it installed)
Answer: -A INPUT -p tcp -m tcp -d www.facebook.com -j DROP

we just have studied it today
Debian 7
if you want to let them ping this site, just add    --dport 80,443   after the name of the website

How to block sites with iptables


Natural phenomena caused by Aroden's death

Question: I know about the Worldwound and the Eye of Abendego. But is there anything else mentioned in the official books in terms of consequences of Aroden's death on the world?
Comment: On a scale of 1 to 10, how *natural* do you consider that *"Prophecies will no longer come true"*?
Answer: Actually...
Let me get some things out of the window first:
The developers have not confirmed whether or not the Worldwound or the Eye are connected directly to Aroden's death, as in "his death caused these disasters", even though that is implied by the Inner Sea World Guide's entry to the Eye:

The Eye appeared in 4606 AR in what was then known as the Abendego Gulf. Although the exact cause of its appearance is unknown, it came into being after three weeks of tempest following the death of Aroden, and remains as the greatest physical evidence of the event.

And the entry for the Worldwound:

Before the Age of Lost Omens on the site of the modern Worldwound was a powerful, yet barbaric, Kellid nation called Sarkoris. When Aroden died, it caused a very slight planar shift that knocked the whole of Golarion from its normal metaphysical alignment and slightly toward the fearful abyssal plane. This shift manifested itself in the northern reaches of Sarkoris, where their mystics and witches foresaw a time of chaos and a thinning of the borders between realities.

In fact, they have said exactly that this is one of Golarion's mysteries:

It's possible that even the developers don't actually know what happened to Aroden.
Actually... I do know what happened to him. Whether or not Aroden is connected to the Eye of Abendego, though... that's one of those mysteries we're deliberately leaving a mystery.
James Jacobs

(And he doesn't seem to be messing with us)
We do know, that several landscape-changing events happened right after his death, but we don't know if those were caused by his death, or were caused by something else taking advantage of the situation, like a certain imprisoned god trying to break free.
The region around the Eye is known for being filled with rovagug cultists, for instance. The boggard entry specifically mention how they shifted their worship to Rovagug after the Eye appeared. Also, Storm Giants travel to the eye of the Eye and return unharmed, for unknown reasons.
We also do know that the Worldwound was mentioned before the death of Aroden (in 4606 AR), in documents found during the Wrath of the Righteous campaign, by cultists of Deskari, which have been around since before Aroden became a god. The rumors here say that when Deskari's avatar walked the world, it was defeated and banished (and probably imprisoned) in the land of Sarkoris (now the Worldwound).
The spell keeping him there was probably broken with Aroden's death, and Deskari infected the world with his corruption, but this is merely speculation on my part.
Finally, there is evidence that some people figured out how Aroden died in the setting, the nobility of Lirgen. When they found out how or why he died, they all commited ritual suicide. It is also rumoured that Pharasma knows this mystery and is using it to keep Groetus in check.
We really don't know (yet)
With all that said, it is unknown which natural (and supernatural) events were caused directly by Aroden's death. There are dozens of events related to it, and since we don't know how he died, we cannot tell you what exactly is related to his death or not. But, you are welcome to join the conspiracy theorists (and I count myself among them) on paizo messageboards.
Comment: Could you tell me where you got that "It is also rumoured that Pharasma knows this mystery and is using it to keep Groetus in check." from?
Comment: @ruedi I was speaking from memory, but I believe its from [Occult Mysteries](https://pathfinderwiki.com/wiki/Occult_Mysteries). But again, pretty much everything in that book is *official rumor* and not *official facts*.
Comment: The wiki merely hints at it, but won't go into detail. *"The gods might know his true fate, particularly Pharasma, but if they do, they are not revealing it to mortals"* There are only three major sources about Pharasma: The Inner Sea World Guide, Inner Sea Gods, and the novel Song of Silver.
Answer: The Shatterfield
In the Heart of the Jungle splatbook a phenomenon known as the Shatterfield is briefly described, in the plains of the Mwangi Expanse south of Mzali. At the same time as the Eye of Abendego was forming, the region was subjected to repeated intense earthquakes which effectively destroyed all civilisation in the area, and (like the Eye) still has not settled, so it's a very dangerous place to travel and basically inhospitable to resettlement due to frequent earthquakes and general instability. It is believed to be another consequence of Aroden's death.
Looking through the Pathfinder wiki's timeline starting in 4606 AR when Aroden died and over the next few years, there were plenty of political consequences to Aroden's death, but there doesn't seem to be much in the way of "natural" phenomena relating to his demise besides that which we've already covered. The eruption of Mount Kuvetheir mentioned in 4607 AR a year later is temporally close enough that it might be related, but it also could be coincidental; given that Aroden's death and related events are all very much shrouded in mystery as ShadowKras's answer describes, it's impossible to be sure.
Comment: To complement your second paragraph, there is a volcano that erupted [a year](https://pathfinderwiki.com/wiki/4607_AR) after his death, in Taldor, causing blast shadows to haunt that region.
Comment: @ShadowKras I saw that one, but given that it happened a year later and there's no description that seems to tie it to the other events, it seems like it could simply be coincidental.

Natural phenomena caused by Aroden’s death


My daughter bites her nails - me too and my husbands says its my fault....?

Question: My 4 year old daughter recently started biting her nails. Not seriously short or bleeding but I never have to cut it. I've been a nail biter since I can remember but now my husband says she is biting because I bite mine. I have a 11 year old son as well and he doesn't bite his nails....I was just wondering - is this really my fault? You know...monkey see, monkey do?
Comment: Nail biting can be genetically influenced, it can be mimetically influenced, or it can be a completely individual choice, so there is no single answer to this question: Is this my fault? The cause of your son's nailbiting cannot be determined by any of us over the internet, but there is good advice below.
Answer: I think you and your husband should be careful with blaming each other. Kids will always do something you don't expect and it doesn't  help your relationship if you start blaming each other.
A few things you have to consider now:

Do you really mind if your daughter bites her nails? You've grown up with nail biting so is it really a problem?
Try to find out why your daughter is biting her nails. My son does it because he is bored. My daughter does it out of stress. For both of them I'm trying different tactics to get them to stop nail biting (that said it's a work in progress so I have no magic bullet).
It might help to talk to your daughter and see if you can stop together. Then you both try to remind the other if she forgets. That way you turn it into a game instead of being "bad" and "fault".
Comment: of course it can be, but there are many problems when dealing with kids. the OP has to decide if she really wants to work on this or leave it be because for now it's just a minor thing
Comment: "is it really a problem?"  It can be: https://en.wikipedia.org/wiki/Nail_biting
Answer: Well there is no 100% yes or no answer.
Children mimic their parents behavior, so it is not unlikely, that she got it from you. But they also mimic behavior from other people and develop their own habits, so she also could have gotten it from somewhere else. That your son isn't chewing his nails won't help your case though.
To get some "useful" parenting advce out of this, it is always a good idea to try to get rid of habits you don't like on yourself when becoming/being a parent and make it more unlikely that they will develop those habits. But it doesn't give a guarantee.