What to look for in an independent luthier?

Question: I've long been considering looking for an independent luthier to build me a custom guitar.  I have a pretty specific idea of what I want the guitar to be, but I don't know how to find the right luthier to build it.  I can't afford to do this twice, so I have to pick the right luthier the first time.  What should I be looking for in a luthier?
Comment: If you live anywhere near north west England i can recommend a guy right here :)  Other than that, I cant answer completely; their art is a complete mystery to me.  I guess looking at/playing their existing work and talking to them is a good start
Comment: If you're in Atlanta, I've got a great suggestion.
Comment: btw, what type of guitar are you looking to have built? (electric [solid/hollow], acoustic [steel/nylon])
Comment: It's a weird one: 8-string fanned-fret jazz archtop w/ low-A and high-A.
Comment: Check out: http://www.lmii.com/ProLuthier/CustomGuitar.asp at least as a starting point.
Comment: Also I am not sure what your price range is, but Ken Parker makes some really nice archtops: http://www.kenparkerarchtops.com/archtop.html
Comment: @grieve: That's Ken Parker of Parker Fly fame?!  Wow, I didn't know he build archtops, too.  Those instruments on his webpage are drop-dead gorgeous, but I can't find a price list anywhere. :(
Comment: @Alex Basson: I am not sure what the price is, but judging on how I found out about them (from Ewrin Somogyi's page) they are probably $25,000 plus. I'll never be able to afford one, but they are fun to imagine owning. :)
Comment: Just did a quick search on google, and discovered that they are ~$30,000, http://musicthing.blogspot.com/2007/05/ken-parkers-30000-archtop-guitar.html
Comment: Um, yeah... and add to that the two extra strings and the fanned frets... right, so I won't be purchasing one anytime soon.  But thanks for looking it up! :)
Comment: Hopefully the lmi link was more useful. :)
Answer: I think the key is going to be two fold:

Play, play, play. You've got to play a couple of guitars from the luthier. While the guitar almost certinaly won't be what you are looking for, you want to look at build quality. Check out the neck, ask to look at the electronics, etc. If his other guitars are good, the chances that yours will be are good too.
Talk to him (or her). Talk about what you want and see if you think he "gets it". Do his questions make sense? Is he digging in to really understand what you want? It's important that he understands exactly what you want. See how he works. Can you see the guitar as it's being built and provide input? My dad had a guitar built and went down to play it while it was still being built. He didn't like the neck and the luthier made changes while he was standing there.

To find luthiers, try checking your small, local stores. I've often seen stuff from local luthiers in mom and pop stores. I've found out about a couple of local guys through that. You can also ask the guitar techs. They're likely to know about the local people.
Answer: Yossarian has certainly nailed the important points. Look, you're deciding to go the luthier route for a reason: you're looking for something special. The great thing about luthiers is that they make bespoke instruments, even when they have set models you can tweak it to suit. You're looking at $4000+, so it pays to spend some time thinking what the instrument will be used for - which it sounds like you've done. Each luthier has their own style so then it's all about going visiting to try out what each of them do.
I would say local is definitely better. Unless you really know what you want and are very familiar with a particular builders work, you'll be wanting to visit a few times during the build to check everything is how you want it to be.
I don't know any in the New York area, but I'm sure there are good folks who can help you out. As a starting point, here is a list for New York state - don't know how up to date it is though.
New York luthiers
Happy hunting and let us know how it goes.
Comment: The strat(ish thing) that my dad had built for him is an absolutely beautiful guitar and cost him just under $2000. So I don't think you're number is necessarily accurate. Although, I'm sure you **can** pay that much. It's certainly possible to get out for *half* that much.
Comment: Sorry, it was just a ballpark figure for acoustic guitars that I'd looked at.
Answer: I have seen this question asked many times in different forums, I have observed that there is no checklist. Having said that, you really need a checklist to decide whom to choose. You need to do a bit/lot research for that. Visit guitar forums like AGF, OLF etc. to familiarize yourself about the state of the art of Luthiery world and shortlist the luthiers whose work/philosophy you like. Listen to their instruments. Search google for "Luthier Database" and visit various luthier's sites. I created my own blog http://luthierdb.blogspot.com for the same purpose, and may be a good place to start for you.
So you make two separate lists. One listing the criteria/features you want to have in your guitar (keep revising the list with any new information) and the second the list of luthiers. Now eliminate the luthiers based upon your requirements and/or other constraints (like proximity to your living area, if that is your concern). Finally, communicate with your shortlisted luthiers to pick the final one. It seems to be a lot of work, but for most, it's labor of love. Hope you enjoy the process.


sql database design for conference room scheduler

Question: I am working on designing a database for conference room scheduler application. And we have rooms that can be merged to create a bigger one. for example, Room A can be merged to Room B to hold 64 people.
I have attached my Database design below I couldn't figure out how to accommodate this feature at the back end. database level.

And also, I would like my database to accommodate the rooms information that could be merged. lkRooms table only list single rooms and their capacity. there are rooms that can be merged specifically with one adjacent to them (roomA + room B) and also I have quad rooms ( RoomC + RoomD + RoomE + RoomF). these rooms can be used as a single rooms and can be merged to create one big room. I do I make my database accommodate this? I want the application to get room information from DB. if what I want to say make any sense at all
Comment: *Room A can be merged to Room B* which means? Besides your mergedRooms table is not normalized
Comment: On the application when users book a room based on capacity there are rooms that can be merged.
Comment: yes my mergedRooms table is out of place. It is not the right approach it is where I need help.
Answer: What I would do is have the booking table reference an intermediate table, let's say bookingRoom, by fk bookingRoomID. The bookingroom record would then reference lkRoom by RoomID. bookingRoom would have multiple records for a given bookingRoomID for a "merged" room. Otherwise, for a single room booking, there would just be a single record in bookingRoom.
Comment: Yes true that is one approach. And also , i would like my database to accommodate the rooms information that could be merged. lkRooms table only list single rooms and their capacity. there are rooms that can be merged specifically with one adjacent to them (roomA + room B) and also I have quad rooms ( RoomC + RoomD + RoomE + RoomF). these rooms can be used as a single rooms and can be merged to create one big room. I do I make my database accommodate this? I want  the application to get room information from DB. if what I want to say make any sense at all
Answer: I think you need a 'partition' concept that allows rooms to merge, so instead of storing the largest room possible, you store the smallest, and people can reserve a partition to form the larger room whose capacity equals the sum of the smaller rooms.
Then you need a roomPartition relationship.  So if someone wants to book a merged room, they also book the partition.
Comment: would you please explain more :) can you see my database diagram pic I included? the lkRooms table hold the smallest partition possible. but my difficulty is how to include which room partition goes with which one. for example roomA can be merged only room B.
Comment: @Zazzu in that case, you might want to create a "mergeMap" that has all the merged room configurations possible. If a merged room is needed for a booking, you could then select one from the mergeMap.
Comment: I think the easiest solution is to treat the partitions as if they are always in place and allow the requester to remove them.  So drop your mergedRoom table entirely and treat a room with one partition like two different rooms, 1A and 1B.  A requester intending to remove the partition reserves both smaller rooms.  OTOH, if you need to represent which rooms can be merged, you'd need to store a mergedRoomID (mergedRoomID for rooms 1A and 1B is 1) and a 1-to-many relation with mergedRoom (1,1A) and (1,1B).


Configure Netgear FVS318v3 for VPN Pass Through

Question: I've replaced a Linksys Router for my home network with a Netgear FVS318v3 VPN Firewall.  The laptop I'm bringing home from work could connect with VPN over the router but cannot connect with the new Netgear firewall.  It spits out:
Error 5 no hostname exists for this connection entry.  Unable to make VPN connection.
What do I need to configure on the Netgear firewall to enable VPN pass through from the laptop out through the firewall?  The reference manual isn't much help and a Google search doesn't retrieve much besides general information that the firewall does support a VPN pass through connection.
In Response:  I believe it's Cisco IpSec but it's pre-installed on the Laptop.  I'm not familiar with configuring the client and would prefer to stay away from messing around with it.  That error is being spit out by the Cisco client in a Windows dialog box.  The Netgear firewall has had no configuration besides plugging it in - everything is defaults.
Answer: We just got rid of three of those.. (finally upgraded some remote sites) and you know, I don't think they have any option for that (not that version even with up to date firmware).. however, we never had trouble connecting PPTP through them..
What sort of VPN are you attempting? (Cisco IPSec?)
Where does it spit that out? (In the Netgear logs?)
Have you got any SiteToSite VPN's configured on your Netgear device?, if so, and you are attempting an IPSec VPN, it may be incompatible.. (which is probably why my predecessor configured our clients to use PPTP).
Is your work VPN configured with NAT-T? (ask) If not, you will find that it will not work.
Answer: The config file for the Cisco VPN was corrupted/blown away.  After getting the file replaced I port forwarded ports 500, 4500 and 10000 to allow the VPN passthrough.


Displaying gifs in jupyter notebook using widgets

Question: How do you use python widgets to display gifs in a jupyeter notebook.
I have tried:
gif_box = widgets.Image("sample.gif")

or
gif_box = widgets.Video("sample.gif")

but receiver error:
TypeError: __init__() takes 1 positional argument but 2 were given

Regardless of what I try it won't work
Answer: You need to read your image into a file handler and read it into a byte string before you can pass it into the widget like so:
# read file as bytes and get file handler. use `with` to ensure
# your file is closed after you're done reading it
with open("sample.gif", "rb") as file:
    # read file as string into `image`
    image = file.read()

widgets.Image(
    value=image,
    format='gif'
)

See the docs for the Image widget.


Question about logic

Question:
I'm trying to solve some basic statistics problems (I want to start studying next semester, and so in ordert to prepare I started learning and downloaded some practice exams.
With most logic questions i seem to do well, but with the problem below i seem to miss a key concept.
The question in German just askes how many of the statements below are true.
My first problem.
Is the weird symbol in de second and third term a existential quantifier?
I cant find a symbol in my math books, not even in a book on logic.
So assuming it is an existential quantifier:
My problems with the second and third term seems to be that i don't understand the existial quantifier as well as I assumed.
It means that there is at least one z that does belong to x.
Which does also mean that there may be a z that does not belong to z.
But how can I than say that difference of y and z is greater than 2?
I have the same problem with the third term.
I hope you can help as I really seem to not get the basic principle.
Many thanks
Petra
Answer:
To your first question, I agree with you. It seems to be a strange font face for <code>∃</code>.
The second question should read "For each y in x, there is a z in x, for which the equation holds" So a basic way to test is to see:

for y=2, is there a z, so that |2 - z| > 2? Well, z=6 satisfies the condition.
Same holds for y=1, z=6
For y=6, you have a reciprocal situation, thus z=1 and z=2 are solutions.

Thus for all y you have at least one z that satisfies the condition.
3.The order of the quantifiers in the third equation is reverse, so it would read "There is a y in x, so that all z in x satisfy the condition. If your y=6, then e.g. z=1 does not satisfy the condition. Otherwise, z=6 does not satisfy it. Thus it is false.
Comment: I think the $\forall$ is a V with a dash typed over it, and the $\exists$ is a ] with a dash typed before it.  Perhaps the text generation software did not support the regular characters - this kind of Frankenstein symbolism was more common with typewriters. This example is particularly ugly.
Comment: Many thanks for your answer, its actually pretty logic ( ;) ) i should have been able to see it that way myself. Nonetheless, i tried to solve other questions of a similar type and am now able to grasp them and solve them. It is sometimes not that easy to study on your own bc sometimes just a little hint can do so much to see the solution. :) Thanks

Question about logic


SVN shared password db on Windows server

Question: I'd like to have a shared password-db file for several repositories on my home svn server (run under Windows).  I've figured out that I need to set all the repositories to have the same realm, but I can't figure out how to just put in an absolute path to the shared password-db. I.e. the full path is something like:
c:\svn.users\passwrd
What do I set the password-db setting to in svnserve.conf so it can find this file?
Answer: I found the answer using google.  The password-db setting is a relative path unless the first character is a /. This works great on *nix systems, but in windows, not so good.  The solution is that it supports UNC paths and //./ represents the current machine. So, if you use:
//./c:/svn.users/passwrd
it works!
Answer: I really like using ViusalSVN server.  It takes some of the complexities out of managing an SVN repository and you can even use Windows authentication to manage what users have access to what.  Give it a try:
http://www.visualsvn.com/server/download/


How do I find out what mail program is installed/sending emails?

Question: I'm trying to find out what emailing program (if any) is sending emails on my server. My employer has a few servers, most of which use sendmail, but on 2 of our servers I'm not finding an email program, but somehow email has been sent with it? I don't want to just install sendmail if something is already setup, I'm just unsure as to how to find out what is setup.
The server is Ubuntu Server 12.04 LTS, and I'm using the PHP mail() command.
The only information I can find to try answering my question is Sinan's question: How to find out what program is sending emails. I tried both the answers there and found nothing.
which mail does nothing, and /var/log/mail.log is completely empty.
I tried using strace ./mail-testing-strace.php to see what happened when this file was executed, but I kept getting "permission denied", just like the below:
execve("./mail-testing-strace.php", ["./mail-testing-strace.php"], [/* 19 vars */]) = -1 EACCES (Permission denied)
dup(2)                                  = 3
fcntl64(3, F_GETFL)                     = 0x8002 (flags O_RDWR|O_LARGEFILE)
fstat64(3, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb77ca000
_llseek(3, 0, 0xbfa1ae34, SEEK_CUR)     = -1 ESPIPE (Illegal seek)
write(3, "strace: exec: Permission denied\n", 32strace: exec: Permission denied
) = 32
close(3)                                = 0
munmap(0xb77ca000, 4096)                = 0
exit_group(1)                           = ?

The file mail-testing-strace.php was very basic, just having the code:
<?php
$to = "firstname.lastname@example.com";
$subject = "Emailing Test";
$message = "This is a test, is it working?";
mail($to,$subject,$message);
?>

It's possible I'm not using strace correctly, as this is my first time trying to use it. I tried it on a server that I know sendmail is installed on and got the same message. I also tried running strace as the root user, but still no success.
Comment: In short, if you also have this question then check out the answer from @user156525 and the comment from **vstm**. These helped me to figure out that I had no mailserver installed. I really liked the suggestion to search on port 25. I also tried searching under the other email ports ( [found here](http://www.emailaddressmanager.com/tips/mail-servers.html) and [here](http://www.arclab.com/products/amlc/list-of-smtp-and-pop3-servers-mailserver-list.html) ).
Answer: You could try
$ dpkg -S `which sendmail`

I believe postfix is the default MTA for Ubuntu. Its main configuration file is /etc/postfix/main.cf
Other commands that might help:
# netstat -tanpl|grep :25

# lsof -i :25

Comment: Thanks @user156525, I tried all three of your suggestions on my known "sendmail" server (_Server A_), as well as my unknown server (_Server B_). **Server A** liked all of your suggestions while **Server B** didn't. `$ dpkg -S \`which sendmail\`` returned an error; `netstat -tanpl|grep :25` returned `(No info could be read for "-p": geteuid()=1002 but you should be root.)` if I take `-p` out or try as root then nothing is returned; and `lsof -i :25` returned nothing as well. Since nothing is found when searching on port 25, shall I assume nothing is installed for mail?
Comment: Oh, and I forgot to mention that when I search for `postfix` (using `dpkg -S`) that I get a response of `The program 'postfix' is currently not installed`.
Comment: If you are not logged in as root you probably don't have `/usr/sbin` in your `$PATH`. Could you try this: `dpkg -S /usr/sbin/sendmail` (of course if the file does not exist, then you most probably don't have any mailserver installed. And regarding strace, try `strace php mail-testing-strace.php` (the permission denied error is because the file has no execute-bit set)
Comment: @vstm `/usr/sbin/sendmail` doesn't exist, so I'm just going to assume no mailserver is installed... though this doesn't make sense that this server somehow sent an email before...? And `strace php mail-testing-strace.php` worked, thanks for the suggestion! I compared the strace results from **Server A** with **B** and **B** results say `/usr/sbin/sendmail: not found`. Thank you @user156525 & @vstm, both of your suggestions helped me in my search. I'm just going to install `sendmail` now, I'll pick this answer as it was very helpful, thank you.


Application of Skewness and Kurtosis

Question: Often in finance, stock prices are considered to follow a lognormal distribution while stock returns are considered to follow a normal distribution -prices are positive while returns can be negative(with other statistical arguments to support these assumptions as explained in this discussion).
Skewdness and Kurtosis are often applied to describe returns.
Is it appropriate to use these 3rd and 4th moments to describe other prices too, particularly where the notion of returns is not applicable e,g ticket prices? with the general goal to indicate the extent to which a given price's distribution conforms to a normal distribution?
Edit: To provide added context
I plotted the data and obtained the following graphs

The skewness and kurtosis statistics obtained are as follows for about 8700 obs:

ind:   skew (0.386333) kurt(-1.459865)
com: skew (0.492587) kurt(-1.234064)
res   skew(1.234279)  kurt(0.791562)
price skew(1.652154)  kurt(5.611179))

Following these plots, the last plot (price) seems to have a shape close to a normal distribution but the corresponding statistics look the least normal compared to the other variables. Hence the question if trying to explain these higher moments is even applicable for these variables.
Comment: is kurtosis=3 in the convention used for these plots (cfr Peter Flom answer below)?
Comment: I have listed the various skew and kurt parameters against each variable
Comment: I mean: would kurtosis be 3 for a normal distribution, in the convention used for these plots?
Answer: You can apply skewness and kurtosis to any numeric variable. They will indicate things about skewness and kurtosis.
As to how well a distribution conforms to the Normal distribution, that's another matter.  A Normal distribution has skew = 0 and kurtosis = 3 (but some programs deduct 3 and will give kurtosis 0).  But a) There are other distributions that will have those values for S and K and b) Normal distributions have features in addition to those.
The question of testing whether a distribution is Normal is a big one and has been discussed here before; there are numerous tests (e.g. Kolmogorov-Smirnov) but none of them are perfect.  The question of describing the shape of a distribution is another (related) topic.
One general idea is to use graphic methods.
Comment: I actually started by graphing and looking at the stats, I have edited the question for more context.
Answer: Descriptive statistics such as mean, sdev, skewness, and kurtosis are not as useful for prices as they are for returns. The reason is that the price data generating process is not stable; instead, the price distribution varies from day to day. Hence, a "global" measure does not necessarily refer to anything useful about "the distribution" of prices.  For example, if the price is trending upward, then the average price will seriously underestimate the means of the future price distributions.
Return distributions are not perfectly stable, but they are much more stable than prices, so their descriptive statistics are more relevant for future predictions.
On a related note, a gross mis-use of statistics is to perform any standard statistical method (t-interval etc) on prices, because the fundamental assumption that the observations are independent and identically distributed is grossly violated for prices. Generally, prices are highly autocorrelated (nearly random walk in many cases, where the autocorrelation is ~1.0). On the other hand, autocorrelations in returns are usually small (~0.0); and if not, there is a violation of market efficiency.

Application of Skewness and Kurtosis


How to flag if a 'webform' exists on a page?

Question: I an fairly new to Drupal and have a custom module in which I need to write some PHP logic. It needs to insert a flag basically, on any page which contains a 'webform' of any kind.
I see the webform api page, but I don't see anything which would just tell me if a webform is on a page.
I have tried this if statement to insert my little flag - but it is showing on every page.  I assume because drupal calls every page a form?  so technically my code bit is flagging every page?
if (function_exists(form_id)) {
    $variables['s.event4'] = "event4";
  }

Any help?
Comment: Hi @sadiecolorado, welcome to Drupal Answers. Could you add the Drupal core version you're using as a tag? So "7" for Drupal 7 and "8" for Drupal 8. Thanks!
Comment: Where is your code being executed? In a hook_form_alter() or a template_preprocess()? Also, form_id is not a function. You would want something like !empty($form_id).
Comment: Hello Wim, - I am on 7.  I'm sorry, I'm not great at Drupal yet.  I dont think the code is being executed in a template_preprocess. I see things like this in the code (someone elses custom module)  // Initialize a variables array to be returned by this hook.
  $variables = array();
Comment: Hi Mirakolous - ok thank you, I didn't know form_id wasn't a function of its own.  So for your example of !empty($form_id), would that work in my situation?  If I'm understanding you correctly, that is a proper way to use the variable, but is not applicable to finding if a webform itself is on the page?  I don't have the right variable yet I assume?
Answer: This appears to be a preprocess function. If it's hook_preprocess_page(), you can do this:
function hook_preprocess_page(&$variables)
{
  if(isset($variables['node']) && $variables['node']->type == 'webform')
  {
    $variables['s.event4'] = "event4";
  }
}


accordion is not refreshing in tab ui

Question: I can't get an accordion to size to content in a tab. I saw this article and thought I could do it with a simple refresh when the tab is clicked: http://bugs.jqueryui.com/ticket/3905. I've tried several ways to get the hidden tab to show the accordion, with the first H3 sized to the content but I can't get it to work.
Thanks!

States

Trending

Map

Cities

National Parks

State Parks

Information

Description

        Almost 70 miles (113 km) west of Key West lies the remote Dry Tortugas National Park. The 100-square mile park is mostly open water with seven small islands.  Accessible only by boat or seaplane, the park is known the world over as the home of magnificent Fort Jefferson, picturesque blue waters, superlative coral reefs and marine life,  and the vast assortment of bird life that frequent the area.

Operating Hours

        Dry Tortugas National Park is open year-round
        The following limitations apply to specific areas within the park boundary:
        Garden Key is open year round 24 hours a day.
        Ft. Jefferson, on Garden Key, is open year-round from sunrise to sunset.
        Loggerhead Key is open to day visitors year round from sunrise to sunset. All other facilities on the island, including Loggerhead Lighthouse are closed to the public.
        Bush Key is open to visitors October 15th to January 15th from sunrise to sunset.
        Hospital Key, and Long Key are closed year round and visitors should remain 100 feet offshore of all closed islands.
        Middle and East Keys are open to visitors October 16 to March 31 from sunrise to sunset.

Fees

        Entrance Fee
        The entrance fee for the park is $5.00 for visitors 16 and older. This fee covers entrance to the park for 7 days.
        Entrance Fee Collection
        Currently, the Yankee Freedom Ferry and Key West Seaplane Adventures collect the park entrance fee from their passengers. If you are the proud owner of a National Parks Pass, Golden Eagle, Golden Age, and Golden Access Passports honored, show your pass at check-in and the entrance fee will be deducted from your transportation cost.
        If you arrive by private boat, fees are collected through a self service fee area on the main dock at Garden Key. Please note that the park does not have the ability to process credit cards at this fee station.
        Camping
        The campground is a self-service fee area with a nightly fee of $3 per person. A 50% discount applies to holders of the Golden Age or Golden Access Pass. No other discounts apply.
        Camping fees are collected only at the park, seaplane or ferry concessions do not collect camping fees. Please note that the park does not have the ability to process credit cards at this fee station.

Comment: Ooops! Corrected my onclick to this... onclick="$('#accordion').accordion('refresh');"
Answer: fiddle
javascript
first you need to initialize the accordion, this will set the size on the 'div' sections, then initialize the tabs.  the information tab will then be a decent size.
I also changed your onclick stuff to the activate event that tabs provides.  I'm not sure that's where the #map initialize call should go, but if you need to only run that once, there are other events you can register for to kick off an initialize methodology
$('#accordion').accordion( {heightStyle: "content"});
$(".tab-set").tabs({"activate":function(evt,ui){
    if(ui.newPanel){
        if( ui.newPanel.attr("id")=="Information"){
            ui.newPanel.find("#accordion").accordion("refresh");
        }else if(ui.newPanel.attr("id")=="Map"){
            //you'll need some check to make sure this hasn't fired already
            //if t/his is an ajax call, move this into a "load":function(evt,ui){}
            //initialize();
        }
    }
}});

html
I changed your html a bit.  I cleaned up the accordion html by wrapping the
 in

States

Trending

Map

Cities

National Parks

State Parks

Information

Description

        Almost 70 miles (113 km) west of Key West lies the remote Dry Tortugas National Park. The 100-square mile park is mostly open water with seven small islands.  Accessible only by boat or seaplane, the park is known the world over as the home of magnificent Fort Jefferson, picturesque blue waters, superlative coral reefs and marine life,  and the vast assortment of bird life that frequent the area.

Operating Hours

        Dry Tortugas National Park is open year-round
        The following limitations apply to specific areas within the park boundary:
        Garden Key is open year round 24 hours a day.
        Ft. Jefferson, on Garden Key, is open year-round from sunrise to sunset.
        Loggerhead Key is open to day visitors year round from sunrise to sunset. All other facilities on the island, including Loggerhead Lighthouse are closed to the public.
        Bush Key is open to visitors October 15th to January 15th from sunrise to sunset.
        Hospital Key, and Long Key are closed year round and visitors should remain 100 feet offshore of all closed islands.
        Middle and East Keys are open to visitors October 16 to March 31 from sunrise to sunset.

Fees

        Entrance Fee
        The entrance fee for the park is $5.00 for visitors 16 and older. This fee covers entrance to the park for 7 days.
        Entrance Fee Collection
        Currently, the Yankee Freedom Ferry and Key West Seaplane Adventures collect the park entrance fee from their passengers. If you are the proud owner of a National Parks Pass, Golden Eagle, Golden Age, and Golden Access Passports honored, show your pass at check-in and the entrance fee will be deducted from your transportation cost.
        If you arrive by private boat, fees are collected through a self service fee area on the main dock at Garden Key. Please note that the park does not have the ability to process credit cards at this fee station.
        Camping
        The campground is a self-service fee area with a nightly fee of $3 per person. A 50% discount applies to holders of the Golden Age or Golden Access Pass. No other discounts apply.
            Camping fees are collected only at the park, seaplane or ferry concessions do not collect camping fees. Please note that the park does not have the ability to process credit cards at this fee station.

Comment: That works! I had initialized the accordion but not with the heightstyle. Thanks!

accordion is not refreshing in tab ui


What breaks down when generalising from sets to classes?

Question: I have been familiarising myself recently with some basic definitions in category theory, where we work with classes of objects and morphisms, as opposed to just sets. It feels like I am long overdue trying to understand exactly what differences there are between sets and proper classes i.e. which properties we take for granted with sets no longer hold in this more general setting.
Since I don't have any rigorous definition of what a class is (or even a set for that matter, I have not studied axiomatic set theory), what should I know about classes to avoid making false assumptions in category theory?
For example:

Do two classes $A$ and $B$ have a well-defined product class $A\times B$?
Given a class $A$, can we form a 'power class' $\mathcal{P}(A)$ consisting of its subclasses?
Can we define partial orders on classes in the same way we can for sets? (I remember being told that 'isomorphism' is an equivalence relation as an undergrad.)

I suspect the answer to all of the above is 'yes'. The only practical difference I have encountered so far seems to be that proper classes are simply too 'large' to be sets i.e. they do not have a well-defined cardinality. But can we still compare the relative sizes of two classes in some meaningful way?
In short, what things should I look out for when working with non-small categories?
Comment: (1) yes. (2) no, since a class cannot have a proper class as an element. (3) yes.
Comment: Re: (2), see also [here](https://math.stackexchange.com/a/3802018/28111). Broadly speaking, for $\kappa$ a "reasonably big/closed" cardinal (e.g. strongly inaccessible), there's a pretty good analogy "set:class::element of $V_\kappa$:subset of $V_\kappa$."
Answer: The interpretation that proper classes are simply too "large" does not only entail that they do not have a well-defined cardinality, but also that they cannot squeeze inside another class/element. If $A$ is a class (proper or not) and $B \in A$, then $B$ must be a set. In other words, a proper class is not an element of any class.
When discussing classes, we usually do it under NBG Set Theory, which is just a little bit different from the usual ZFC Set Theory that you probably hear about all the time. Regardless, the theories $\mathsf{NBG}$ (with choice) and $\mathsf{ZFC}$ are so similar that in many cases we do not have to distinguish them apart - see this post.
Thus, to answer your questions (under $\mathsf{NBG}$):

Yes. This is a consequence of Axiom of Comprehension.

No, as by definition we must have $A \in \mathcal{P}(A)$, which implies that the proper class $A$ is an element of some class.

Yes. If $A$ is a proper class and $\leq$ is a partial order on $A$, then $\leq \; \subseteq A \times A$ (all elements of $\leq$ are sets).
Comment: What do you mean by 'all elements of $\leq$ are sets'? Would a relation on a class $A$ then simply be a subclass of the class $A\times A$?
Comment: Yes, a relation on a class $A$ is a class of ordered pairs $(a,b)$ where $a,b \in A$, where the relation $a \, A \, b$ is defined as $(a,b) \in A$.
Answer: The idea that proper classes are big while sets are small is in fact equivalent to the axiom of choice (you can find a proof in my question here)
Because of that I'll try to give an answer without refering to "size".
We can view stuff from 2 perspectives:
Semantically: Let $V$ be the universe, given a model $M$ (for ease, say it is transitive) of $ZF$ inside of $V$, a "(full semantics) class$^M$" is a subset of $M$, a "(full semantics) proper class$^M$" is a subset of $M$ that is not a member of $M$.
Syntactically: (in a $ZF$-style theory) a "class" is a formula $\phi$, a "proper class" is a class $\phi$ such that $\{x\mid \phi(x)\}$ is not a set, when we say $C$ is a class and $a\in C$ we mean $C(x)$

Semantically, stuff that "works on sets but not on proper classes" are:

operator $p$ such that if $x\in M$ so is $p(x)\in M$ but if $x\subseteq M$ does not imply $p(x)\subseteq M$.

So for example (assuming for convenience sake that $M$ is a model of $ZF2$, second order $ZF$), let $p$ be the real $\mathcal P$ operator. Clearly $p(M)$ is not a subset of $M$, but $p$ does send elements from $M$ to elements from $M$ (notice that we must be careful here, because our operators must be from $V$, and not from $M$, as proper classes are not part of the model)

A formula $\phi$ such $M$ thinks it is always true, but $V$ thinks that it sometimes fails on the powerset of $M$

For example, let $M$ be $V_\kappa$ for inaccessible $\kappa$ (which is a model of $ZF2$) (ignore the complications of defining inaccessibles without AC), and assume that the first failure of AC is on rank $\kappa$, in this case, AC is true in $M$, but fails on proper classes of $M$.

Syntactically we cannot say a lot.
And not as an expression or anything, I mean that in a formal sense.
We cannot quantify over proper classes, so any sentence of the form $\forall x$ or $\exists y$ cannot (generally) be translated to sentence about classes.  We also need to change every $x\in C$ to $C(x)$.
In this sense we cannot even state $\forall X (\mathcal P(X)\text{ exists})$, but given a formula $C$ we can express $\phi(C)=\mathcal P(C)\text{ exists}$, and in fact, for each $C$, $\phi(C)$ is true, after suitable change of the definition of powerset, Let $Pc(x)=\forall y\in x(C(y))$, and after the change of definitions I said before, we get that $Pc$ is the power"set" of $C$ (remember that $C$ is fixed, so we can define this $Pc$)
Comment: Btw both Kevin answer based on *semantic* interpretation and Clement answer is a syntactic interpretation, but using different theory (and not ZF-like theory)
Answer: An alternative to the NBG theory espoused in another answer is the theory of Grothendieck universes, according to which "class" is literally just a name for an unusually large set, we never consider such a collection as "all sets whatsoever", and all constructions available for sets are (thus) available for "classes".
Answer: What you should know is, that it is never a good idea to talk about such a think as a category of all categories or a category of all sets, etc. Cause then you might ask, isn't $\mathtt{Cat}$ itself a category in $\mathtt {Cat}$, and aren't the objects of $\mathtt{Set}$ themselves a set, and thus an object of the category of sets?
Questions like isn't the category of all categories one of the categories in the category of all categories are the kind of questions which lead you into trouble. Always only consider constructions as such up to a certain size level.
Say you fix a cardinal $\kappa$. Then there is no question that you get a well defined category of sets with cardinals bellow $\kappa$. But now maybe you like you category of sets to be closed under taking coproducts. That is if $A$ and $B$ have cardinality below $\kappa$, then so has $A+B$. Here any infinite cardinal will work. But maybe you want your category of sets also be closed under other operations, like taking power sets and exponentials and having a natural number object, products, limits of sizes below $\kappa$, etc. If you add all those requirements, then you land exactly at the concept of a Grothendieck universe. You can not proof in say ZFC (or a naive set theory) that Grothendieck universes exist, you have to assume they do.
Edit: What I want to say is that you shouldn't work with classes, you should work with a countable hierarchy of Grothendieck universes as most successful proof assistants (Coq, Lean) do. Working with classes is awkward. You have a new primitive entity in your language, and as your question shows it is a priori unclear what kind of operations you can though with them. Also the semantics of classes and sets do not differ that much. When you picture a class in your head, I bet what you see is the same as what you see when you see picture a very large set. It is bad to have two words thus two distinct set of rules for what in naive semantic is basically the same concept. When you use universes, all of the trouble goes away. Classes are just sets of a larger universe than the one you are working with at the moment. You can do anything with them what you can do with sets, and thus you will feel comfortable all the time when making your arguments.
You pay for the extension with a strictly stronger consistency strength. It is in principle conceivable that ZFC without universes is consistent, but ZFC + universes is not. But on the other hand universes do much more than classes. You add classes to be able to talk about large categories as for example Top or Set. But once you have them you quickly start to construct categories which are large and also locally large such as the functor category Fun(Top,Set). But once you have categories which are locally large, you can no longer form functor categories, and you are again in trouble. This is a general theme: In mathematics there is a tendency to look at all the things you have worked with before and view them as one entity among others of a similar kind. This is a kind of zooming out move. For example you may start doing math about numbers, but quickly you like to talk about number systems and you introduce sets and functions between them to do that. Next you realise that your number systems form a system themselves, a category of say commutative rings, and you like to compare it to other such systems like for example the category topological spaces via functors. You have zoomed out one more step. A good foundation should allow you to zoom out whenever you like, because mathematicians who don't care about foundations will do it anyway. People worked with functor categories and categories before the foundations where settle, because it just makes sense. Adding classes allows to make one more zooming out step than sets, but you are quickly standing before the same problem, so it is not a good solution.


Kernel and image of $f:\Bbb{Z}\times\Bbb{Z} \to \Bbb{Z}, (a,b)\to 4a-6b$

Question: $f:\Bbb{Z} \times \Bbb{Z} \to \Bbb{Z}$,
$(a,b)\to 4a-6b$
For the kernel
$4a-6b=0$
Claim:
$\ker (f)=\{a=\frac{6b}{4},b\in 2\Bbb{Z} \}$
Proof for $\subset$:
Let $(x,y) \in \ker(f)$,
$4x-6y=0$,
$x=\frac{6y}{4} \in \{a=\frac{6b}{4},b\in 2\Bbb{Z} \}$
Proof for $\supset$:
Let $(x,y) \in \{ a=\frac{6b}{4},b\in 2\Bbb{Z} \}$
$4(6y/4)-6y)=0$ thus $(x,y) \in \ker(f)$
For the image:
Claim $\operatorname{Im}(f) = 2\Bbb{Z}$
Proof for $\subset$:
For $(x,y)$, $(4x-6y)=2(2x-3y)$
Let $l\in \Bbb{Z}$
$2\cdot(2\cdot(2l)-3\cdot(l))=2l\in 2\Bbb{Z}$
Proof for $\supset$:
Let $k\in2\Bbb{Z}$
Choose for $x=(k)$, for $y=(k/2)$
thus
$2\cdot(2\cdot(k)-3\cdot(k/2))=k\in 2\Bbb{Z}$
Please give your feedback. I know this proof isn't very clear and could be a lot better. I have my doubts on the image part as well.
Comment: I'd say that $\ker f=\{(3n,2n):n\in\mathbb Z\}=\left<(3,2)\right>$.
Answer: The only problem I see is with the proof of $\mathrm{Im}f\subseteq 2\mathbb Z$. It is in fact sufficient to factor out the $2$, writing
$$f(x,y)=2(2x-3y)\in 2\mathbb Z$$
since $2x-3y\in \mathbb Z$.
This must be proved for arbitrary $x$ and $y$, whereas you made a choice restricting them.
Comment: oh yes thank you :)))
Comment: @asddf No problem.


How to set same filter value to be searched to the different filters on the same page?

Question: I am using 3 exposed filter on same page for video, audio and album search, what I want is when I enter filter criteria for one filter all filters should take same filter criteria. Is there anyone who is having an idea to do this?
Answer: You should enter the same identifier for all views, if you want to use one exposed value for all views in current page.


O que são os operadores lógicos e como funciona as operações bit-a-bit na linguagem C?

Question: O que são os operadores lógicos NOT, AND, OR, XOR, em linguagem C?
Também não compreendi estes operadores: ~, &, |, ^, >>, << e o resultado em bits. Tenho o seguinte exemplo de código:
#include <stdio.h>
#include <stdlib.h>

int main()
{
   unsigned char x, y;
   x = 44;
   printf("x = %d\n", x);
   y = ~x;
   printf("~x = %d\n", y);
   y = x & 67;
   printf("x & 67 = %d\n", y);
   y = x | 129;
   printf("x | 129 = %d\n", y);
   y = x ^167;
   printf("x ^167 = %d\n", y);
   y = x <<2;
   printf("x <<2 = %d\n", y);
   y = x >>2;
   printf("x >>2 = %d\n", y);
   system("pause");
   return 0;
}

Comment: @user24857 se não é duplicata, [edite](http://pt.stackoverflow.com/posts/63215/edit) sua pergunta e explique quais são suas dúvidas, "não consigo entender isto" é genérico demais.
Comment: Acho que não...
Comment: Gostaria de uma explicação, não entendi isso. Pq o resultado é ...?
Comment: Acho que ele gostaria de ter uma explicação esmiuçada de cada operador.
Answer: Operações bit a bit, operações com bits ou lógica binária, normalmente se refere a operações lógicas feitas com números binários. Essas operações variam desde operações AND, OR, NOT, XOR, NOR, NAND, simples deslocamento de bits, entre outras operações. Cabe dizer que algumas dessas operações aqui citadas são agrupamentos de outras operações, como a NAND, que é um agrupamento de uma lógica AND com a lógica NOT. Há também coisas interessantes a serem estudadas, como Álgebra de Boole (ou Álgebra Booleana) e os Teoremas de De Morgan.
Operação NOT.
A operação NOT (NÃO), também chamada de "negação" ou "inversão", é a mais simples das operações, pois consiste em inverter o estado dos bits. Tomemos como exemplo o número binário 00111100. Após passar por uma operação NOT se torna 11000011. Em algumas linguagens de programação, como C, se usa o operador ~ para inverter o estado dos bits. A operação NOT segue a tabela verdade:

Tomemos como exemplo o seguinte código em C:
unsigned char x, y;
x = 44;
printf("x = %d\n", x);
y = ~x;
printf("~x = %d\n", y);

Este trecho resulta na seguinte impressão:
x = 44
~x = 211

Você pode verificar o tamanho que uma variável ocupa em C através da chamada de função sizeof(type). Essa função retorna o tamanho da variável em bytes, de forma que é preciso multiplicar o resultado por 8 para obter o valor em bits.
printf("Tamanho do char é de %d bits e %d byte (s)\n", (sizeof(char) * 8), sizeof(char));

Este trecho resulta na seguinte impressão:
Tamanho do char é de 8 bits e 1 byte (s)

Pelo fato do tipo char em C ser uma variável de 8 bits, ao fazer a atribuição de x = 44 o que se está fazendo é atribuir uma variável que contenha o valor 00101100. Ou melhor:
x = 44 é:
128| 64| 32| 16| 8| 4| 2| 1
  0|  0| 1 | 0 | 1| 1| 0| 0

Assim sendo, temos 32 + 8 + 4 que equivale aos 44 já mencionados. Mas quando se passa a operação NOT, você inverte o estado destes bits, ficando:
x = 44 é:
0| 0| 1| 0| 1| 1| 0| 0
y = ~x é:
1| 1| 0| 1| 0| 0| 1| 1 Equivalente a 211

Uma coisa que é interessante notar é que o inverso de 44 em uma variável de 8 bits é 211. Uma variável de 8 bits armazena 256 valores, sendo estes valores de 0 a 255, logo pode se dizer que ao efetuar uma negação, você obtém o valor restante aos 255 (44 + 211 = 255).
Operação AND.
A operação AND (E), também chamada de "conjunção", tem como símbolo o * ou . e retorna 1 quando, e somente quando, todos os bits forem 1 (ou verdadeiros). Na linguagem C essa operação tem como símbolo o & entre duas variáveis. A operação AND (OU) é uma operação que segue a seguinte tabela verdade:

Tomemos agora o seguinte trecho de código:
y = x & 67;
printf("x & 67 = %d\n", y);

Este trecho resulta na seguinte impressão:
x & 67 = 0

x ainda equivale a 44, ou seja 00101100 em binário. Ao efetuar uma operação AND com 67 (01000011 em binário) o que na verdade está se fazendo é:
MSB (Most Significant Bit)
x  & 67
0 AND 0 => 0
0 AND 1 => 0
1 AND 0 => 0
0 AND 0 => 0
1 AND 0 => 0
1 AND 0 => 0
0 AND 1 => 0
0 AND 1 => 0
LSB (Least Significant Bit)

00000000 binário => 0 decimal

Portanto, uma operação AND entre 44 & 67 retorna o número 0, impresso na linha seguinte.
Operação OR.
A operação OR (OU), também chamada de "disjunção", tem como símbolo o +. Esta operação retorna 1 quando qualquer um dos bits for 1 e retorna 0 quando TODOS os bits forem 0. A operação OR é uma operação que segue a seguinte tabela verdade:

Na linguagem C, usa-se o operador | para efetuar uma operação OR entre duas variáveis. Como no seguinte código:
y = x | 129;
printf("x | 129 = %d\n", y);

Este trecho resulta na seguinte impressão:
x | 129 = 173

x que vale 44, ou seja 00101100 em binário, está em uma operação de disjução com 129 (10000001 em binário). Ao efetuar uma operação OR entre 44 e 129 o que na verdade está se fazendo é:
MSB (Most Significant Bit)
x & 67
0 OR 1 => 1
0 OR 0 => 0
1 OR 0 => 1
0 OR 0 => 0
1 OR 0 => 1
1 OR 0 => 1
0 OR 0 => 0
0 OR 1 => 1
LSB (Least Significant Bit)

10101101 binário => 173 decimal

Portanto, uma operação OR entre 44 & 129 retorna o número 173, impresso na linha seguinte.
Operação XOR.
A operação XOR (OU Exclusivo), também chamada de "disjunção exclusiva", é uma operação lógica entre dois operandos que resulta em um valor lógico verdadeiro se, e somente se, exatamente um dos operandos possui valor verdadeiro. Pode ser sintetizado como um detector de diferenças entre dois operandos lógicos. Essa operação segue a seguinte tabela verdade:

A operação XOR é uma maneira interessante de se trocar o valor de duas variáveis sem precisar de uma terceira, como demonstra a excelente resposta dada por Lucas Nunes nesta pergunta.
Na linguagem C, usa-se o operador ^ para efetuar uma operação XOR entre duas variáveis. Como no seguinte código:
y = x ^167;
printf("x ^167 = %d\n", y);

Que resulta na impressão:
x ^167 = 139

Pois 44 (00101100) XOR 167 (10100111):
MSB (Most Significant Bit)
x  ^ 167
0 XOR 1 => 1
0 XOR 0 => 0
1 XOR 1 => 0
0 XOR 0 => 0
1 XOR 0 => 1
1 XOR 1 => 0
0 XOR 1 => 1
0 XOR 1 => 1
LSB (Least Significant Bit)

10001011 binário => 139 decimal

Portanto, uma operação XOR entre 44 & 167 retorna o número 139, impresso na linha seguinte.
Deslocamento de bits.
Na linguagem C usa-se os operadores >> ou << para efetuar o deslocamento de bits entre variáveis para direita ou esquerda. O deslocamento de bits, como o nome já diz, é uma técnica de deslocar os bits para uma ou mais casas. Uma característica interessante do deslocamento de bits é que é possível multiplicar ou dividir o valor daquela variável, mas não entrarei detalhes sobre isto nesta resposta.
O deslocamento de bits funciona da seguinte forma, por exemplo, ao se deslocar uma variável x a esquerda:
int x = 1; // 0000 0001

int x0 = (x << 0); // 0000 0001 Não deslocado
int x1 = (x << 1); // 0000 0010
int x2 = (x << 2); // 0000 0100
int x3 = (x << 3); // 0000 1000
int x4 = (x << 4); // 0001 0000
int x5 = (x << 5); // 0010 0000
int x6 = (x << 6); // 0100 0000
int x7 = (x << 7); // 1000 0000

Agora se deslocar a direita:
int x = 128; // 1000 0000

int x0 = (x >> 0); // 1000 0000 Não deslocado
int x1 = (x >> 1); // 0100 0000
int x2 = (x >> 2); // 0010 0000
int x3 = (x >> 3); // 0001 0000
int x4 = (x >> 4); // 0000 1000
int x5 = (x >> 5); // 0000 0100
int x6 = (x >> 6); // 0000 0010
int x7 = (x >> 7); // 0000 0001

Não vou me aprofundar muito nesta técnica, mas recomendo que leia a excelente resposta de Lucas Nunes nesta pergunta, de onde tirei o exemplo acima. Mas no caso do código que você forneceu na sua pergunta, o que acontece é:
y = x << 2;
printf("x <<2 = %d\n", y);

O trecho de código acima imprime:
x <<2 = 176

Pois:
00101100 em binário é 44 em decimal
00101100 << 2
01011000 //Moveu 1 bit a esquerda
10110000 //Moveu 2 bits a esquerda

10110000 em binário => 176 decimal

y = x >> 2;
printf("x >>2 = %d\n", y);

O trecho de código acima imprime:
x >>2 = 11

Pois:
00101100 em binário é 44 em decimal
00101100 >> 2
00010110 //Moveu 1 bit a direita
00001011 //Moveu 2 bits a direita

00001011 em binário => 11 decimal

Aplicações.
Operações com bits são muito utilizadas quando se programa baixo nível. É possível configurar registradores de microcontroladores e fazer otimizações de código, por exemplo. Também são utilizados em algoritmos de criptografia, pois por se tratarem de operações lógicas são menos custosas ao processador. Em eletrônica digital, são utilizadas a todo momento.
Comment: Farei isto. Pode deixar que detalharei bem a resposta. ;)
Comment: Entendi, bem explicado;
Comment: Olá teria como colocar junto com a devida operação relacionada na pergunta do usuário @user24857?
Comment: Sim, mas não entendi o resultado ~x = 211 nesse operador  ~, que apenas deveria inverter os bits?
Comment: Ainda estou escrevendo sua resposta... tudo será esclarecido. Prometo.
Comment: 101100 em binário inverter dá 211, e em linguagem c como descubro o tamanho em binário?
Comment: São os dígitos ativos do número em binário. Estou adicionado mais conteúdo a pergunta, irei adicionar o porquê disto também.
Comment: Você pode usar o `sizeof(tipo da variavel)` para saber o tamanho dela em bytes. `printf(" %d", (sizeof(int) * 8))` retorna o valor em bits.
Comment: Acho que vou parar de escrever a minha resposta por aqui. Se ficou mais alguma dúvida, por favor, edite a sua pergunta ou coloque nos comentários. Espero ter ajudado.


Debounce method call from BindableObject in SwiftUI

Question: I am new to Swift and even more so to SwiftUI. I started to create a little basic project. I use Github API to fetch repositories list.
So I created a "Search Bar" like since SwiftUI doesn't have a SearchBar component. I would like to perform the fetch operation everytime my Textfield content is changed.
I don't want the fetch method to be called too often. I decided to debounce it. I'm facing a problem, I don't find/understand example.
I tried to implement a debounce solution but it doesn't work, my application just crash.
Here's my BindableObject
import SwiftUI
import Combine

class ReposStore: BindableObject {

    private var service: GithubService

    let didChange = PassthroughSubject<Void, Never>()

    @Published var searchText: String = ""

    var repos: [Repository] = [] {
        didSet {
            didChange.send()
        }
    }

    var error: String = "" {
        didSet {
            didChange.send()
        }
    }

    var test: String = "" {
        didSet {
            didChange.send()
        }
    }

    private var cancellable: AnyCancellable? = nil

    init(service: GithubService) {
        self.service = service

        cancellable = AnyCancellable($searchText
            .removeDuplicates()
            .debounce(for: 2, scheduler: DispatchQueue.main)
            .flatMap { self.fetch(matching: $0) }
            .assign(to: \.test, on: self)
        )
    }

    func fetch(matching query: String = "") {
        print("### QUERY \(query)")
        self.service.getUserRepositories(matching: query) { [weak self] result in
            DispatchQueue.main.async {
                print("### RESULT HERE \(result)")
                switch result {
                case .success(let repos): self?.repos = repos
                case .failure(let error): self?.error = error.localizedDescription
                }
            }
        }
    }
}

And this is my View
import SwiftUI

struct RepositoryList : View {
    @EnvironmentObject var repoStore: ReposStore
    @State private var userName: String = ""

    var body: some View {

        VStack {
            NavigationView {
                VStack(spacing: 0) {

                    HStack {
                        Image(systemName: "magnifyingglass").background(Color.blue).padding(.leading, 10.0)
                        TextField($repoStore.repoUser, placeholder: Text("Search")).background(Color.red)
                            .padding(.vertical, 4.0)
                            .padding(.trailing, 10.0)
                    }
                    .border(Color.secondary, width: 1, cornerRadius: 5)
                        .padding()

                    List {
                        ForEach(self.repoStore.repos) { repository in
                            NavigationLink(
                                destination: RepositoryDetail(repository: repository).environmentObject(self.repoStore)
                            ) {
                                RepositoryRow(repository: repository)
                            }
                        }

                    }.navigationBarTitle(Text("Repositories"))
                }
            }
        }
    }

I tried to use a Timer and schedule and action every 8 seconds but this method cause my application to crash.
More, I don't really know if it's a good practice to declare a function with "@objc" annotation ...
Could someone help me to implement a correct way to debounce a method inside a BindableObject ?
Thank you in advance :)
Comment: Combine already has a debounce operator.
Comment: Thank you, could you be more precise ?
Comment: I'd say watch the WWDC 2019 videos about the Combine framework. They use exactly the same example you're dealing with: a network operation that we don't want to perform too often as the user types in a text field.
Comment: Thank you I will watch it :)
Comment: So I've edited my question with my new code. I've been watching WWDC 2019 but I'm still not capable to call my async method inside "flatMap" instruction. Could you give me some clue / tell me if my code is better ?
Comment: I'm looking for the same solution
Answer: I finally managed to set up the debounce.
If it could helps someone, here's my implementation :
import SwiftUI
import Combine

class Store : ObservableObject {
  private var cancellable: AnyCancellable? = nil
  @Published var searchText: String= ""
  @Published var user: User? = nil

  init() {
    cancellable = AnyCancellable(
      $searchText.removeDuplicates()
        .debounce(for: 0.8, scheduler: DispatchQueue.main)
        .sink { searchText in
          self.searchUser()
      })
  }

  func searchUser() {
    var urlComponents = URLComponents(string: "https://api.github.com/users/\(searchText)")!

    urlComponents.queryItems = [
        URLQueryItem(name: "access_token", value: EnvironmentConfiguration.shared.github_token)
     ]

    var request = URLRequest(url: urlComponents.url!)
    request.addValue("application/json", forHTTPHeaderField: "Content-Type")

    searchCancellable = URLSession.shared.send(request: request)
        .decode(type: User.self, decoder: JSONDecoder())
        .map { $0 }
        .replaceError(with: nil)
        .receive(on: DispatchQueue.main)
        .assign(to: \.user, on: self)
  }
}

extension URLSession {
  func send(request: URLRequest) -> AnyPublisher<Data, URLSessionError> {
        dataTaskPublisher(for: request)
            .mapError { URLSessionError.urlError($0) }
            .flatMap { data, response -> AnyPublisher<Data, URLSessionError> in
                guard let response = response as? HTTPURLResponse else {
                    return .fail(.invalidResponse)
                }

                guard 200..<300 ~= response.statusCode else {
                    return .fail(.serverErrorMessage(statusCode: response.statusCode,
                                                     data: data))
                }

                return .just(data)
        }.eraseToAnyPublisher()
    }

  enum URLSessionError: Error {
      case invalidResponse
      case serverErrorMessage(statusCode: Int, data: Data)
      case urlError(URLError)
  }
}

extension Publisher {

    static func empty() -> AnyPublisher<Output, Failure> {
        return Empty()
            .eraseToAnyPublisher()
    }

    static func just(_ output: Output) -> AnyPublisher<Output, Failure> {
        return Just(output)
            .catch { _ in AnyPublisher<Output, Failure>.empty() }
            .eraseToAnyPublisher()
    }

    static func fail(_ error: Failure) -> AnyPublisher<Output, Failure> {
        return Fail(error: error)
            .eraseToAnyPublisher()
    }
}

struct User: Hashable, Identifiable, Decodable {
    var id: Int
    var login: String
    var avatar_url: URL
    var name: String?

    enum CodingKeys: String, CodingKey {
        case id, login, avatar_url, name
    }
}

Comment: Doesn't that introduce a retain cycle (`cancellable` and `self`)?
Comment: can you please give me full demo of this code or any github link?


Proof by induction for $n\in\mathbb N$

Question: I need some help with the following proof by induction problem:
Prove that for all natural numbers $n\in\Bbb N$:
$$\dfrac{4^{n}}{n + 1} < \dfrac{(2n)!}{(n!)^{2}}$$
first I proof this first for $n=2$, and we got this
$\dfrac{4^{2}}{2 + 1} < \dfrac{(2 \times 2)!}{(2!)^{2}}$ and this meets inequality.
now for $n=k$ $$\dfrac{4^{k}}{k + 1} < \dfrac{(2k)!}{(k!)^{2}}$$ and if this is true so $$\dfrac{4^{k}}{k + 1} +(k+1) < \dfrac{(2k)!}{(k!)^{2}} +(k+1)$$
After that I don't know how follow this problem. Any help would be sincerely appreciated. Thanks!
Comment: Note that in your inductive step you've simply written the exact same inequality, except you've added $k+1$ to both sides. That is, you're just adding the same thing to both sides, so the inequality you've written is *equivalent* to the assumption that the inequality holds for $n = k$. What you need to do is show that if it holds for $n=k$, then it must hold for $n=k+1$. It's the domino effect. If one goes, the next one goes. So: the trick is to substitute $n=k+1$ into the original inequality and show that it must be true only if the $n=k$ inequality is true.
Comment: You misunderstood him. What he was trying to obtain the condition for $n=k+1$ by adding $k+1$ to the hypothesis for $n=k$. This is a common step in proving linear series or inequalities by induction.
Answer: What you need to show is that if the inequality holds for $n=k$, it also holds for $n = k+1$, i.e.
$$
\frac{4^k}{k+1}< \frac{(2k)!}{(k!)^2}\Rightarrow \frac{4^{k+1}}{k+2}< \frac{(2k+2)!}{((k+1)!)^2}.
$$
Answer: Let $P(n)$ be the given statement.
$$P(n):\ \frac{4n}{n+1}<\frac{2n!}{n!^2}$$
For the base case $n=2$,
$$P(1):\ \frac 8 3 < 6$$
which is true.
Assume $P(k)$ is true for some $\mathbb{N}\ni k\geq 2$.
$$\therefore \frac{4k}{k+1}<\frac{2k!}{k!^2}\quad (*)$$
Now, we wish to prove that $P(k+1)$ is also true.
Note that
$$\frac{2(k+1)!}{(k+1)!^2} = \frac{(2k+2)(2k+1)}{(k+1)^2}\cdot \frac{2k!}{k!^2}$$
By using $(*)$, we get
$$\frac{2(k+1)!}{(k+1)!^2}>\frac{2(2k+1)}{k+1}\cdot \frac{4k}{k+1}$$
$$\implies\frac{2(k+1)!}{(k+1)!^2}>\frac{16k^2+8k}{k^2+2k+1}\quad (**)$$
Now, note that $16k^2\geq 4$ and $8k>4k$ for all $\mathbb{N}\ni k\geq 2$.
$$16k^2+8k>4k+4\quad (1)$$
Similarly, we have
$$k^2+2k+1>4k+4\quad (2)$$
Using $(1)$ and $(2)$ in $(**)$, we get
$$\frac{2(k+1)!}{(k+1)!^2}>\frac{4(k+1)}{(k+1)+1}$$
Thus, we have established that $P(k+1)$ is true whenever $P(k)$ is true.
Hence, by the principle of mathematical induction, we conclude that $P(n)$ is true for all $\mathbb{N}\ni n\geq 2$.
Hope this helps :)

Proof by induction for $n\in\mathbb N$


How to wrap smaller elements around larger elements with flexbox

Question: I'm trying to achieve this layout with flexbox:

Is it possible with flexbox? I can't wrap these in separate sections at the moment, so it's just a huge list like so:

2x2

1x1

1x1

1x1

1x1

1x1

1x1

Any input would be greatly appreciated
Comment: It's possible with nested flex containers. But if that's not an option, consider [Masonry](http://masonry.desandro.com/) or, when it has more browser support, [CSS Grids](https://drafts.csswg.org/css-grid/).
Comment: Flex items are arranged in columns or rows. Here the first item would occupy either two columns or two rows, and that's not allowed. Well, with certain assumptions you could manage it in a hacky way, but not recommended.
Comment: I'm playing around without flexbox currently, but it's very... specific : http://codepen.io/yratof/full/mPWYyB/
Answer: If anyone finds this question, too: It was answered here and I successfully implemented it using CSS Grid. The trick is to scale all elements for the "small" grid and manually enlarge to first one to use two rows and two columns.
JSFiddle Example for 6 columns and 3 rows
grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  grid-auto-rows: 50px;
  grid-gap: 10px;
}

grid-item:first-child {
  grid-column: 1 / 4;
  grid-row: 1 / 3;
}

grid-item {
  background-color: red;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
}

answer on stack overflow


10th derivative of a function

Question: I want to find $f^{(10)}(0)$ where $f(x)=\ln(2+x^2)$.
I know that it can be done "by hand", but I believe there is a smarter way.
I think I should use Taylor series and the fact that $f^{(n)}(0)=a_n*n!$ , but I'm not sure how.
Comment: i get $$22680$$
Comment: You're on the right track; so then, what is the Taylor series for $f$ at $x = 0$?
Comment: Maple says $$ 928972800\,{\frac {{x}^{8}}{ \left( {x}^{2}+2 \right) ^{9}}}-812851200
\,{\frac {{x}^{6}}{ \left( {x}^{2}+2 \right) ^{8}}}+290304000\,{\frac
{{x}^{4}}{ \left( {x}^{2}+2 \right) ^{7}}}-36288000\,{\frac {{x}^{2}}{
 \left( {x}^{2}+2 \right) ^{6}}}+725760\, \left( {x}^{2}+2 \right) ^{-
5}-$$  $$371589120\,{\frac {{x}^{10}}{ \left( {x}^{2}+2 \right) ^{10}}}
 $$
Comment: I know the Taylor series for $ln(1+t)$ but I'm don't know how to convert it to $t=1+x^2$ in a way that can be helpful.
Comment: It's certianly larger and more computationally rigorous then considering $f(x)=\ln(-2+x^{2})$; in that example $f^{(10)}=2^{-4}$.
Answer: \begin{align}
f(x) &= \ln(2 + x^{2}) = \ln 2 + \ln\left( 1 + \frac{x^{2}}{2}\right) \\
&= \ln 2 + \sum_{k=1}^{\infty} \frac{(-1)^{k-1} \, x^{2k}}{2^{k} \, k} \\
&= \ln 2 + \frac{x^{2}}{2} - \frac{x^{4}}{8} + \frac{x^{6}}{24} - \frac{x^{8}}{64} + \frac{x^{10}}{160} - \cdots  \\
f(x) &= \ln 2 + \frac{x^{2}}{2!} - 3 \, \frac{x^{4}}{4!} + 30 \, \frac{x^{6}}{6!} - 630 \, \frac{x^{8}}{8!} + 22680 \, \frac{x^{10}}{(10)!} - 1247400 \, \frac{x^{12}}{(12)!} + \cdots
\end{align}
From this series expansion it can be determined that
\begin{align}
f^{(2n+1)}(0) &= 0 \hspace{10mm} \text{for} \quad  n \geq 0 \\
f^{(2n)}(0) &= \frac{(-1)^{n-1} \, (2n)!}{2^{n} \, n} = \frac{(-1)^{n-1} \, (2n-1)!}{2^{n-1}} \hspace{10mm} \text{for} \quad n \geq 1 \\
f(0) &= \ln 2.
\end{align}
Answer: We have
$$
\frac{2x}{x^2+2} = \frac{x}{1+\frac{x^2}{2}} = x\bigg(1-\frac{x^2}{2} + \frac{x^4}{4} - \frac{x^6}{8} + \frac{x^8}{16}+\cdots \bigg).
$$
Then integrating we get
$$
\log(x^2+2)-\log2 = \int_0^x \frac{2t}{t^2+2}\; dt = \frac{x^2}{2}-\frac{x^4}{2\cdot 4} + \frac{x^6}{4\cdot 6} - \frac{x^8}{8\cdot 8} + \frac{x^{10}}{10\cdot 16}+\ldots
$$
Answer: $22680$ :)
Answer: \begin{align}
f'(x)=\frac{x}{1+\frac{x^{2}}{2}}=\sum_{k=0}^{\infty }(-1)^{k}\left ( \frac{x^{2k+1}}{2^{k}} \right )=x-\frac{x^{3}}{2}+\cdots+\frac{x^{9}}{2^{4}}-\frac{x^{11}}{2^{5}}+\cdots
                \end{align}
Therefore if we differentiate this series nine times, we see that $f^{(10)}(0)$ is the constant term, which is $\frac{9!}{16}=22680$

10th derivative of a function


Flutter Web - Google Chrome Marked Web-app as Dangerous

Question: I'm having some trouble determining why Google Chrome is marking my Flutter Web-App as "Dangerous." When I enter my login password, even before hitting the login button, a popup appears:

On the left side of the URL, where the "lock" icon would normally be, then shows the text "Dangerous" in red.

Clicking on this text makes the following appear:

After a few searches, I found a Google site that can give you the status of a URL. I tried using this to help determine what may be wrong, but it doesn't provide any insight as to what my issue is. It looks like I should be able to check each of the pages individually, but this may be restricted, due to the fact that this is a web-app?

Try to trick visitors into sharing personal info or downloading
software

I do not get the issue if I enter just any password - these events are only triggered if I enter a password saved on my Google Account.
The only time that I have NOT received this message, was when I did a full clear of my browsing history. After visiting a few other sites and allowing google to save my password, which is the same I use on my site for testing, the issue reoccurred. I downloaded Firefox and repeated the process of logging into other sites, and the error didn't occur there. I also went as far as to test this on Edge and Opera, but no issues there either. All browsers show the certificate as Valid. The site shows as Secure on all browsers, except Chrome.
I am using Firebase Hosting, with Firebase Authentication, so my site should be secure. Maybe I am just missing something mandatory, such as requesting the user to allow cookies? Many sites I visit have this feature, which my web-app doesn't currently have. Or, maybe there is something else?
Obviously, this looks extremely bad, so I would like to fix this up as soon as possible. In advance, I would like to thank anyone for their input on this.
Answer: I had a similar issue when my website with my custom domain worked as expected, but a test version of the same website on ....appspot.com (Google App Engine's domain) triggered this warning.
I remember I appealed this issue to Google, and it was resolved in 24 hours. The issue had nothing to do with the contents of my website.
Check the status of your site here:
https://transparencyreport.google.com/safe-browsing/search
Comment: Thank you for your response! I will absolutely give this a shot. However, I'm a little curious - you said the issue had nothing to do with the contents of your website. Would you mind sharing the reason they flagged your site then? Perhaps it was just merely a glitch in their algorithm?
Comment: My website at appspot.com is an identical copy of my website at the custom domain. Maybe their algorithm decided that my appspot.com version impersonated my "real" website.
Comment: Very interesting! By chance, do you remember where you went to dispute your page. I'm trying to look now, but mostly finding how to report content to them.
Comment: Try this: https://safebrowsing.google.com/safebrowsing/report_error/?hl=en
Comment: I'm seeing the same thing.  When I check out safe browsing by google it tells me my site is unsafe as follows:

Some pages on this site are unsafe
The site https://crefinancials-fecdb.web.app/auth contains harmful content, including pages that:

Try to trick visitors into sharing personal info or downloading software
Unsafe content might only appear on some pages of a website. Check the URL of the specific directory or webpage you want to visit for more detailed safety info.


A Question About Image Files

Question: I am writing an PHP script to upload image files to the server and I have a few questions?
Is there a way to decrease the size of images in terms of kilobytes?
When I am using those files what is the best practice to embed those images into page? I mean do I always have to download the whole page?
Lastly, When resizing the pages(like 250X250 pixels) what is the pratice in order not to face the resolution problems?
I hope my questions are not too general. Thanks in advance!
Answer: Take a look at this http://www.webmotionuk.co.uk/php-jquery-image-upload-and-crop/ - There are many other free tools out there to convert images after the upload.  The resolution shouldn't be an issue that is usually a problem when you give a size to an image object in html that is huge and not proportioned.
Here is another php resizer I have used this code before to do what you are requesting.
Answer: If you are talking about decreasing the size of the image before is uploaded, you can't with PHP, unless you use something like HTML5/Flash to pre-process the file before being sent.
What you want to do, after a user uploads that image, verify that the file is a real image, then using some library (if you use a framework, it probably has a way to resize images) resize the image to whatever max width or max height or max width and height you are wanting.
This will decrease the size of an image.
For the 2nd question, if I understand it, you are talking about what about when a user uploads a 500x500 and you want it to be 400x250, then you must scale and crop, this way the image is never stretched but a few pixels from the top or the bottom will probably be removed.
Comment: I don't understand if Jay is talking about decreasing the size of the image before being uploaded, or after its uploaded. That's why i added that.
Comment: PHP can process images, with GD, ImageMagick, etc... No need for Flash/HTML5 for this...
Answer:
Is there a way to decrease the size of
  images in terms of kilobytes?

You'll need to create a new image, based on the one you received.
You should first take a look at the PHP GD functions.
For instance: http://ch2.php.net/manual/en/function.imagecreatefromjpeg.php

When I am using those files what is
  the best practice to embed those
  images into page? I mean do I always
  have to download the whole page?

What do you mean by embedding?

A Question About Image Files


How do I set up a verifiable expectation on a mocked async method?

Question: I'm trying to use Moq to test integration between a WebAPI controller and a Redis database, using the StackExchange.Redis client, and cannot work out how to set up a verifiable expectation on a mocked async method that includes a callback or some other assertion behaviour.
Ordinarily, I'd use the following syntax:
const string KEY = "some_key";
var db = new Mock<IDatabase>();
db.Setup(d => d.HashSetAsync(KEY, It.IsAny<HashEntry[]>(),It.IsAny<CommandFlags>()))
    .Callback<RedisKey,HashEntry[],CommandFlags>((key, hash, flags) => {
                hash.ShouldContain(entry => entry.Name == "customerid");
                hash.ShouldContain(entry => entry.Name == "quotenumber");
     })
     .Verifiable();

But this is giving me:

'Moq.Language.Flow.IReturnsThrows<StackExchange.Redis.IDatabase,System.Threading.Tasks.Task>' does not contain a definition for 'Verifiable' and no extension method 'Verifiable' accepting a first argument of type 'Moq.Language.Flow.IReturnsThrows' could be found (are you missing a using directive or an assembly reference?)

If I change db.HashSetAsync to db.HashSet in the Setup invocation, it works as expected. It appears that the setting a Callback on a regular method returns an ICallbackResult but setting a callback on an async method invocation returns an IReturnsThrows - and I'm not sure how you mark one of those as verifiable. Any ideas?
Comment: Why don't you use `ReturnsAsync`? In versions that don't have it you can use `.Returns(Task.FromResult(someValue));`
Comment: Check the duplicate question. The *second* answer says that `RetunrsAsync` is available only for methods that return `Task`. You can still use `.Returns(Task.FromResult(...));`
Comment: You seem to be missing a return from your setup for the call back. what type does `HashSetAsync` return
Comment: @PanagiotisKanavos so far I haven't come across `ReturnsAsync`. Where do I look for that? looks interesting.
Comment: What Moq version are you using? It's available in Moq 4.2. Even before this, you can return a filled Task with `Task.FromResult`
Comment: @PanagiotisKanavos I'm using v4.2.1510.2205
Comment: @PanagiotisKanavos yes now I see. learned something new today. thanks.
Answer: For async methods you need to return a completed Task from the setup before using a callback
have a look here:
Using Moq to mock an asynchronous method for a unit test

You're creating a task but never starting it, so it's never
  completing. However, don't just start the task - instead, change to
  using Task.FromResult<TResult> which will give you a task which has
  already completed:

this works
const string KEY = "some_key";
var db = new Mock<IDatabase>();
db.Setup(d => d.HashSetAsync(KEY, It.IsAny<HashEntry[]>(), It.IsAny<CommandFlags>()))
    .Returns(Task.FromResult<object>(null))
    .Callback<RedisKey, HashEntry[], CommandFlags>((key, hash, flags) => {
        hash.ShouldContain(entry => entry.Name == "customerid");
        hash.ShouldContain(entry => entry.Name == "quotenumber");
    })
    .Verifiable();


What are map files generated during compilation

Question: What info map file contain generated during compilation of project and how i enable /map option in makefile.
Language : c++
compiler : vc6
Comment: http://www.codeproject.com/KB/debug/mapfile.aspx is a decent introduction
Comment: See this closely related question: http://stackoverflow.com/questions/755783/whats-the-use-of-map-files-the-linker-produces
Answer: From Microsoft's documentation for the /MAP linker option:

A mapfile is a text file that contains
the following information about the
program being linked:

The module name, which is the base name of the file
The timestamp from the program file header (not from the file system)
A list of groups in the program, with each group's start address (as
section:offset), length, group name,
and class
A list of public symbols, with each address (as section:offset), symbol
name, flat address, and .obj file
where the symbol is defined
The entry point (as section:offset)


smallest number in the range [l,r] that has maximum number of bits set

Question: We have to find the smallest number in the range [l,r] that has maximum number of bits set .The solution requires some mathematical insight so i posted it on this website instead of stack overflow
The solution simply says this
<code>void solve(){
while((l | (l + 1)) <= r){
 l = (l | (l + 1));
}
printf("%I64d\n",l);
}
</code>
But i coluld not understand as how this solves the problem ? Here l and l means the range [l,r].
Comment: it means we take OR of l with l+1 and we keep doing this till l OR l+1 <=R and when l OR (l+1) is greater than r, we output answer as l
Answer: Adding $1$ to an integer $n$ has the effect of setting the rightmost zero bit in its binary representation to $1$. Thus $n = (n\,|\,n + 1)$ sets the rightmost zero bit in the binary representation of $n$. Therefore, the algorithm is sequentially setting the rightmost zero bits and checking that the result is within the range $[l,r]$. Since at each step the rightmost zero bit is set, $l$ is increasing by the minimal amount possible given that its number of set bits is increasing by $1$.


How do I calculate the derivative of a derivative w.r.t. another derivative?

Question: The question is a bit of a mouthful. In Classical Mechanics by Goldstein I have seen the use of the following:
$$ \frac{d\dot{F}}{d\dot{q}_i} = \frac{dF}{dq_i} $$
where $F = F(q_1,q_2,...,q_n;t)$, $ \dot{F} = \frac{dF}{dt} $ and $ \dot{q_i} = \frac{dq_i}{dt} $ . How would I show this?
The use of this result is used on page 17 of the PDF solutions guide (Page 10 within the derivations chapter) by showing that the transformation $L'(q,\dot{q},t) = L(q,\dot{q},t) + \frac{dF(q,t)}{dt}$ keeps the form of the Euler-Lagrange equation invariant:
http://www.slideshare.net/venuatsrr/solution-manual-classical-mechanics-goldstein
Comment: Can you add some context, like a paragraph that uses this identity?  I don't think it's true in all cases.
Comment: @MatthewLeingang When might it not be true?
Comment: @Jam what happens for example in the case ${\mathrm{d}\dot{x}}=0$, say ${\dot{x}}=0$?
Comment: @MatthewLeingang It was involved in the substitution of $ L' = L + \frac{dF}{dt}$ into the Euler Lagrange equation $\frac{d}{dt} \frac{\partial L}{\partial \dot{x}} = \frac{\partial L}{\partial x}$ to show that the form remains the same.
Comment: @SValera, $\frac{dy}{dt} / \frac{dx}{dt}$ is not$\frac{d\dot{y}}{d\dot{x}}$
Comment: @GCab Actually, it is but that's not what the question's asking.
Answer: In general, this is not true.  For instance, suppose the curve is parametrized by $x=t^2$, $y=t$.  Then
$$
    \frac{dy}{dx} = \frac{\dot y}{\dot x} = \frac{1}{2t} = \frac{1}{2y}
$$
But $\dot y$ is constant, so
$$
    \frac{d\dot y}{d\dot x} = 0
$$
I looked at your reference, and as far as I can tell, your question is about this statement: If $F = F(q_1,q_2,\dots,q_n;t)$, then
$$
    \frac{\partial \dot F}{\partial \dot q} = \frac{\partial F}{\partial q}
$$
The reason for this is the chain rule.
For each $i$, the expression $\dfrac{\partial \dot F}{\partial \dot q_i}$ stands for $\dfrac{\partial}{\partial \dot q_i}\dfrac{dF}{dt}$.  By the chain rule:
\begin{align*}
    \frac{dF}{dt} &= \frac{\partial F}{\partial q_1}\frac{dq_1}{dt}+\dots
                   +\frac{\partial F}{\partial q_n}\frac{dq_n}{dt}
                   +\frac{\partial F}{\partial t} \\
&=  \frac{\partial F}{\partial q_1}\dot q_1+\dots
                   +\frac{\partial F}{\partial q_n}\dot q_n
                   +\frac{\partial F}{\partial t} \\
\end{align*}
Then take $\dfrac{\partial}{\partial \dot q_i}$ of each side.
Comment: @Matt0410: no problem.  You might want to edit your question now that we know what it really is.


Does this sequence of polynomials have a name?

Question: I'm very interested in the function $$f : (0,\infty) \rightarrow (0,\infty)$$ $$x \mapsto - \log(1-e^{-x}).$$
When I use Wolfram alpha to compute the $n$th derivatives of $f$, I find that there exists a sequence of polynomials $P_1,P_2,\ldots$ such that for $n \geq 1$ we have $$f^{(n)}(x) = \frac{e^x}{(1-e^x)^n}P_n(e^x).$$
For example:
$$\frac{d^6}{dx^6}(-\log(1 - e^{-x})) = \frac{e^x}{(1-e^x)^6} (1+26 e^x + 66 e^{2 x} + 26 e^{3 x} + e^{4 x})$$

Question. Is there a name for this sequence of polynomials?

If these polynomials don't have a name, I'd also be satisfied with a name for the variant on Pascal's triangle whose entries are the coefficients of these polynomials.
Comment: That looks like an Eulerian polynomial: https://en.wikipedia.org/wiki/Eulerian_number
Comment: I will conjecture that we can describe the polynomials $P_n$ with a three term recurrence relation.  Have you tried to work something like that out?
Comment: @hardmath, no, but I'm very interested!
Comment: @LordSharktheUnknown, I think you're right!
Answer: Lord Shark the Unknown is spot on.
WA tells us that
$$
\frac{d}{dx}\frac{e^x}{(1-e^x)^n} P(e^x)
=
\frac{e^x}{(1-e^x)^{n+1}} Q(e^x)
$$
where
$$
Q(t)=(t-t^2)P'(t)+((n-1)t+1)P(t)
$$
Therefore,
$$
P_{n+1}(t)=(t-t^2)P_n'(t)+((n-1)t+1)P_n(t)
$$
Since $P_2=A_1$, we have $P_n=A_{n-1}$, where $A_n$ is the $n$-th Eulerian polynomial.


Localisation isomorphic to a quotient of polynomial ring

Question:
Let $R$ be a commutative ring and $A=\{1,a,a^2,\dots\}$ for some $a\in R$. Prove that $A^{-1}R$ is isomorphic to $R[T]/(aT-1)$.

I guess I'm meant to find a surjective homomorphism between $A^{-1}R$ and $R[T]$ and then use first isomorphism theorem. What homomorphism should I use?
Comment: There is no  morphism from $A^{-1}R$ to $R[T]$
Answer: Define a ring homomorphism:$$\alpha: R[T] \longrightarrow A^{-1}R$$ $$r\longmapsto r/1, \mbox{ for $r \in R$} $$ $$T\longmapsto1/a.$$
Clearly $\alpha$ is surjective.
Let's prove that $\ker(\alpha)=(Ta-1)$.
$(\supseteq)$ Clear.
$(\subseteq)$ $h\in \ker(\alpha)\Rightarrow h \in(Ta-1)?$
$h=h(T)$ satisfies $h(1/a)=0 \in A^{-1}R$, that is, $a^nh(1/a)=0 \in R$, for some $n \geq \deg h$. Then $a^nh(T)=G(aT)$, where $G=G(Y)\in R[Y]$ satisfies $G(1)=0$. So $G(Y)=(Y-1)G_1(Y)$ for some polynomial $G_1(Y)$, so that $a^nh(T)=G(aT)=(aT-1)G_1(aT)\Rightarrow a^nh(T)\in (aT-1)$ for some $n$.
Notice $a$ and $aT-1$ are coprime, so that $$a^nh(T)\in (aT-1)\Rightarrow h(T)\in (aT-1).$$
Indeed, $1=aT-(aT-1)$, so that by taking $n^{th}$-powers and using the binomial theorem
$$1=a^nT^n+r(aT-1) \mbox{ for some $r \in R[T]$}.$$
Therefore $h(T)=T^na^nh(T)+r(aT-1)h(T)\in (aT-1)$.
I hope this help you.
Comment: +1 very nice and elementary solution. Thank you for writing.
Answer: The homomorphism $A^{-1}R \to R[T]/(aT - 1)$ sends $\frac{r}{a^i} \mapsto rT^i$.  The way to define it is to first define a homomorphism $R \to R[T]/(aT - 1)$ and then use the universal property of localizations.
I think the easiest way to prove it's an isomorphism is to just define a map in the other direction and prove that the composition either way is the identity.
Answer: This question becomes even easier if you know the universal properties (which some people would call the "right definitions") of localization, of polynomial rings, and of quotients.
$A^{-1}R$ is the universal example of a commutative ring with a homomorphism from $R$ that sends all elements of $A$ to invertible elements. That's equivalent to just sending $a$ to an invertible element.
$R[T]/(aT-1)$ is the universal example of a commutative ring with a homomorphism from $R$ and an element $T$ that serves as an inverse for the image of  $a$.
Since the two universal properties are equivalent, the rings (and homomorphisms) they define are isomorphic.
Answer: What about $\Phi: R[T]\to A^{-1}R$ with $T\mapsto 1/a$?


Portwell motherboard: Boot-time fsck finds "unexpected inconsistency" due to system time

Question: Although this question involves an embedded motherboard, serverfault seemed to me the best stackexchange forum to post to.  My colleagues and I have been investigating this weird Linux boot problem for a few months now, and we're kinda stuck.  Any suggestions are appreciated.
We have a Portwell motherboard (single Atom core with hyperthreading), running Centos 6.4.  A customer has come back to us with a really weird boot problem that we've finally been able to reproduce.
Everything works fine if you do this:

Boot up normally
Halt the system
Unplug power from the system for any period of time
Plug in power
Boot up

However, if you do the following, the usual fsck that is run as a normal part of boot will give us an error:

Boot up normally
Shut down normally
DO NOT DISCONNECT POWER
Wait 8 to 12 hours (shorter doesn't seem to cause the problem)
Boot up again

The error we get is as in the following image:

We can press ctrl-D and reboot as many times as we want, and the error will keep coming back.  But note that there's nothing wrong with the filesystem.
We can get the error to go away this way:

Shut down
Pull power for at least 10 minutes (much shorter, and the problem doesn't go away)
Plug power back in and boot up.

Our hypothesis as of yesterday was that the hard drive might be spun down but not off, and over time, the disk cache might get degraded.  However, that turns out to be false because the following procedure also makes the problem go away:

Get the system to boot up so that it gives the error
Do not disconnect power
Go into the BIOS and change the system date to some time in the future
Boot into Linux.

This motherboard does not have a battery, so when we first power on, it always comes up with the wrong date, some time in January of 2010.  So in the usual case, the date is wrong, but the OS boots up normally.  When the OS comes up, the date is set properly by NTP.  If we leave it plugged in but off for 12 hours, the date gets reset again, but for some reason, fsck now cares about the date and wants to so a manual fsck because it considers that discrepancy to be a major problem.  If we manually change the date to the future, it boots fine.  If we change it back to the past, it errors again.  But if we disconnect power for long enough and boot up, we get no error despite the fact that the date is wrong.
Can anyone help us reason through the various things that fsck might be looking at such that is decides sometimes to error out due to the date being wrong but never if the system date is in the future?
If we can program the BIOS to default to some date in the far future, that might solve this problem, but it's important to understand why it's happening, because we don't just want to stick on a bandaid and hope.
Thanks for any suggestions.
Answer: I found the answer to this here:
https://unix.stackexchange.com/questions/8409/how-can-i-avoid-run-fsck-manually-messages-while-allowing-experimenting-with-s
Apparently, because the system clock is "broken," we have to put broken_system_clock = true in the [options] section of /etc/e2fsck.conf.


determine whether the sequence $f_{n}(x) = n x e^{-nx}$ converges uniformly on the set [0,1]

Question: Determine whether the sequence $f_{n}(x) = n x e^{-nx}$  converges uniformly on the set [0,1].
My trial:
The pointwise limit is zero by L`hopitals rule , but then what how can I find N  so that  $|nxe^{-nx}| < \epsilon$
Answer: Hint: Find the maximum value of $f_n(x)$ on $[0,1]$. Does it approach $0$ as $n\to\infty$?
Answer: Suppose $f_n(x)$ converges uniformly to zero function. Then given  $\varepsilon \gt 0 $, there exists  $n_0\in \Bbb N $ such that  $|f_n(x)-0|<\varepsilon$, for all $n\geq n_0$ and $x\in [0,1]$. Note that  $$f_n\left(\frac1n\right)=\frac1e .$$ Can you now find a suitable $\varepsilon$ which contradicts our assumption?
Comment: @hopefully Yes, $0.1$ will work.
Comment: take $\epsilon = 0.1$ ...... is it correct?
Comment: The supremum is $1/n$ and not zero


Question about estimating the standard error of the regression- notation and intuition

Question: in a standard linear regression frame work:
$y_{i}=\beta x_i + \epsilon_i$
when calculating standard errors, we find an unbiased and consistent estimator of $var(\hat{\beta})$. Assume spherical errors. so typically we need :
$E[\epsilon  \epsilon']$, which is a diagonal matrix.
Now if I understand correctly, the element on the $ith$ diagonal/entry is then $E[\epsilon_i  \epsilon_i']$, with the transpose on the second epsilon. we write this as $\sigma^2$. but when we go to estimate sigma, we usually use:
$e'e/(n-k)$
where e is the residual. Why is it e'e if the diagonal term is $\epsilon_i  \epsilon_i'$? I think the tranpose (') notation is confusing me.
Answer:
Assume spherical errors. so typically we need :
$E[\epsilon\epsilon′]$, which is a diagonal matrix.

It would be nice, but you can never observe $\epsilon$. You assume $E[\epsilon\epsilon′]=\sigma^2I$.

the element on the ith diagonal/entry is then $E[\epsilon_i\epsilon′_i]$, with the
transpose on the second epsilon

$\epsilon_i$ is a single random variable, so it is equal to $\epsilon_i'$.

we write this as σ2 but when we go to estimate sigma, we usually use:
$e′e/(n−k)$ where e is the residual.

Don't be hasty :)
First step: in a standard linear regression framework, $y=X\beta+\epsilon$, $\epsilon\sim\mathcal{N}(0,\sigma^2I)$, $V[y]=V[\epsilon]=\sigma^2I$.
Second step: $\hat\beta=(X^TX)^{-1}X^Ty$, and
$$V[\hat\beta]=(X^TX)^{-1}X^TV[y]X(X^TX)^{-1}=(X^TX)^{-1}\sigma^2$$
($X^TX$ is a symmetric matrix.)
Third step: since you can't observe $\epsilon$, the best you can do is to use residuals.
\begin{align*}
e&=y-X\hat\beta=y-X(X^TX)^{-1}X^Ty=y-Hy=(I-H)y \\
E[e]&=E[y]-E[X\hat\beta]=E[y]-X(X^TX)^{-1}X^TE[y]\\
&=X\beta-X(X^TX)^{-1}(X^TX)y=0\\
V[e]&=(I-H)\sigma^2
\end{align*}
where $H=X(X^TX)^{-1}X^T$ and $I-H$ are symmetric and idempotent matrices. The residual sum of squares is:
$$RSS=e'e=y^T(I-H)^T(I-H)y=y^T(I-H)y$$
The trace of $H$ is equal to the rank of $X$, i.e. $k$, the number of columns. See https://math.stackexchange.com/questions/1582567/proof-that-trace-of-hat-matrix-in-linear-regression-is-rank-of-x). The trace of $I-H$, an $n\times n$ matrix, is $n-k$.
The residual mean square,
$$RMS=\frac{e'e}{n-k}$$
is an unbiased estimator of $\sigma^2$:
\begin{align*}
E[e'e]&\overset{[1]}{=}E[\text{trace}(e'e)]\overset{[2]}{=}E[\text{trace}(ee')]=\text{trace}(E[ee'])\\&=\text{trace}(V[e])=\text{trace}(I-H)\sigma^2=(n-k)\sigma^2\\
E[RMS]&=\frac{E[e'e]}{n-k}=\frac{(n-k)\sigma^2}{n-k}=\sigma^2
\end{align*}
So the estimated variance of $\hat\beta$ is:
$$\hat{V}[\hat\beta]=(X^TX)^{-1}RMS$$
Putting $S=(X^TX)^{-1}$, the standard error of $\hat\beta_j$ is $\sqrt{s_{jj}RMS}$.

[1] $e'e$ is a scalar, so $\text{trace}(e'e)=e'e$.
[2] If $e=(a,b,c)$, then $e'e=\text{trace}(e'e)=a^2+b^2+c^2$, and $$ee'=\begin{bmatrix}a \\ b \\ c\end{bmatrix}\begin{bmatrix}a&b&c\end{bmatrix}=\begin{bmatrix}a^2 & ab & ac \\ ab & b^2 & bc \\ ac & ab & c^2\end{bmatrix},\quad\text{trace}(ee')=a^2+b^2+c^2$$


Wikidata: list every physical objects

Question: I'm trying to get the name of the all physical things (tangible concepts) Wikidata knows about (objects, places, countries, etc), or in other words everything non-abstract.
There are examples close to what I need, but with only a depth of one: all the things that are instances of phone.
I found this example that searches with more depth and I modified the start point to entity:
#Children of Genghis Khan

#added before 2016-10
 #defaultView:Graph
PREFIX gas: <http://www.bigdata.com/rdf/gas#>

SELECT ?item ?itemLabel ?pic ?linkTo
WHERE
{
  SERVICE gas:service {
    gas:program gas:gasClass "com.bigdata.rdf.graph.analytics.SSSP" ;
                gas:in wd:Q35120 ;
                gas:traversalDirection "Forward" ;
                gas:out ?item ;
                gas:out1 ?depth ;
                gas:maxIterations 4 ;
                gas:linkType wdt:279 .
  }
  OPTIONAL { ?item wdt:P40 ?linkTo }
  OPTIONAL { ?item wdt:P18 ?pic }
  SERVICE wikibase:label {bd:serviceParam wikibase:language "en" }
}

I still get no results.
Comment: This seems a too general question. I have tried several combinations querying for "physical object (Q223557)" and "entity (Q35120)" but I always get a timeout. Could you break down your query into separate pieces that make sense conceptually?
Answer: As mentionned in a comment, your question is too broad and you'll end up with too much answers
You look for the A that are instance of a subclass of B
so the query you point to is the right one
SELECT DISTINCT ?item
WHERE {
   ?item wdt:P31/wdt:P279* wd:Q35120
}

the problem is the size
wd:Q35120 has a lot of subclasses
You can check that this way
SELECT ?a ?aLabel WHERE { ?a wdt:P279 wd:Q35120.
             SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}

SELECT ?a ?aLabel WHERE { ?a wdt:P279/wdt:P279? wd:Q35120.
             SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}

SELECT ?a ?aLabel WHERE { ?a wdt:P279/wdt:P279?/wdt:P279? wd:Q35120.
             SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}

And so on : you'll see that there are already 40'000+ at forth level which is huge
You could also huge this nice tool to have a more precise view
https://tools.wmflabs.org/bambots/WikidataClasses.php?id=Q35120&lang=en
Comment: That is actually what I needed, I want millions of answers. I just need to do batching or use local copy of the data in order to not overload their server. Thanks!

Wikidata: list every physical objects


Is it possible to rename a path componet of files in Cloud Storage?

Question: I'm using Cloud Firestore and Cloud Storage using the Firebase SDKs.
I'm making a similar app with 'yelp'.
I wonder when a store name is changed if storage's object name could be changed.
My structure is like this.
<code>[bucket]
+ [store name1]
    + pic1
    + pic2
+ [store name2]
    + pic1
...
</code>

EDIT
client
I want to change the cafe, starbucks's name.
So, send a request to a server to change the cafe's name to starbee.
Storage
Each of objects name is same as cafe's name.
so the structure is like below.
<code>[bucket]
+ [starbucks]
    + picture 1
    + picture 2
</code>
My problem is that even though I already changed cafe(starbucks)'s name to starbee, the starbucks object in my bucket still remain its name cause I didn't send any request to my storage.
So, my question is how to handle this situation. I have no idea how to send a request to change the name of object in storage.
Also, what am I suppose to do for the correct storage structure?
Comment: Could you edit the question to explain in more detail?  Your second paragraph is confusing to me. Showing code usually helps.
Comment: @DougStevenson I added more detail. I'm not sure if code could make you understand my situation better, and it's not code issue in my case.
Answer: You can't rename a path component in Cloud Storage like you would in a typical desktop computer filesystem, as there are actually no "folders" present.  What you would have to do is iterate and rename each individual file under that path component to match what you want.
Comment: Yeah exactly, so my question was if there's no way then how to handle this issue every time user want to change the name? because storage object name follows the object's name in db. I mean, when to save files into the storage, should I name the object's name in bucket as id number?
Comment: You might want a random immutable ID for this that is not the display name that the user chooses.
Comment: I'm afraid of that way cause another issue like because of a name as ID, access to data would be difficult. Whenever I want to access data, I should know the ID value. To know the ID, I have to make a request again. Do I miss anything about this?
Comment: No, you know what you need to do.


Add year/month/day to an UNIX timestamp with just hour/min/sec in python

Question: The range of my timestamp is from 34200 to 57600, so it covers a part of one day from 9:30 AM). I want to add a specific year/month/day to this timestamp. How can I do that in python? Suppose that my timestamp is 34201.054427731004. I want a timestamp with information about year/month/day (for example, 3/2/2017) as the output. So here, the UNIX output is a full timestamp not just the hour/mean/sec.
Comment: Unclear how either 34200 or 57600 "cover a 24h day", or what the expected result is.
Comment: It does not cover 24h : `34200` is 9hours and 30 minutes and `57600` is 16 hours
Comment: @deceze I edited the question.
Comment: Yeah, still not much better. Instead of describing what you think you have or want, *show* us what concrete values you expect to get here.
Comment: Yeah, not seeing how `34201.054427731004` relates to "3/2/2017" at all.
Comment: @deceze I want to know the structure of adding these values. This is just an example.
Comment: So, `34201` represents "9:30", and you want to get the UNIX timestamp of "Feb. 3rd 2017 9:30", or `1486110601`…?!
Comment: I want to know the UNIX version of "Feb. 3rd 2017 9:30". I know that this time (34201) is related to "Feb. 3rd 2017" (this information is in another file).
Answer: Make a datetime object with the date, which will initialise hours and minutes to 0, and add a timedelta with the seconds to it:
from datetime import datetime, timedelta

date = datetime(2017, 2, 3) + timedelta(seconds=34201)
print(date.timestamp())

Comment: Is this consider `.054427731004` part of timestamp?
Comment: If you add them (`seconds=123.456`), yes.


Window object default variable

Question: hello can I change the client window object via server node js ?
example :
window.hello
This will be the default variable in the broser window. When I code console.log(hello), the results will appear
Answer: No.
A JavaScript program running on Node.js is a completely different program running in a completely different environment (and probably on a completely different computer).
If you want to set a property of the window object in a webpage, then you need JavaScript running in that webpage to do it. (Usually you would load that JS with a

Window object default variable