credible interval in bayes are higher than the nominal level

Question: When I fitted the nonlinear regression using the openbugs, and calculated the 95% credible interval of the coefficient through the high density interval, I found that the total number of the credible interval including the true vales is higher than 95%, about 98%. What is the probably reason for this ?
Comment: Are you asking about the frequentist properties of your credible region?
Comment: @innisfree  I have read some books about the bayes, and it says the credible interval should match the nominal level to evaluate the method. So I tried to do this.
Answer: I have seen this sort of behaviour before when you do simulations and the assumed true value for the simulations is in the centre of reasonably informative priors (e.g. you have a regression coefficient with a N(0, 1) prior and simulate it as being 0). In contrast,  if you sample simulation scenarios from your priors, you should on average get a coverage frequency that matches the nominal level. I.e. the reason is likely that you "sample" (or just fix them) parameter values from a much more narrow distribution at/ close to the centre of your prior.
Comment: So you mean that the the true value is in the centre of my prior distribution? I will try some different true value. It is true that my prior distribution is narrow because I know that one of the regression coefficients is from 0 to 1, and it's impossible to be lower than 0 or higher than 1. So I restrict it's prior distribution to be uniform distribution(0,1) so that I can get a posterior distribution that is between 0 to 1. Does this influence its credible interval? And does this affect the  coverage frequency? If it cannot match the nomial level, can we say the method is right?
Comment: Yes, i would guess that a true value of 0.5 would give you above nominal coverage, and of course a true value of 1.001 should get you 0% coverage for that particular parameter. As said, simulating with parameter values sampled from the prior should give you exact coverage - that's what you can and should have. In a sense above nominal coverage is not a problem,  is it? If course,  at the edge of the prior you might get below nominal coverage.
Comment: I always thought I need to set the true value to be fixed for the simulation. So you mean I can sample the true value from the prior each time and generate data, calculate its coverage interval?But that will be difficult to explain it because I don't know the true value. I am confused with the situation when the coefficient in the real world is restrict to a range. And you are right, I get below nominal coverage at the edge of the prior.
Answer: There is a nice posting that contains this already on Stack Exchange.  Credible intervals are not confidence intervals.  Read What's the difference between a confidence interval and a credible interval?.
Bayesian credible intervals can have better or worse coverage properties than confidence intervals.  Good priors are equivalent to adding to the sample, which makes the intervals narrower and improves coverage.


How delete a model instance and the instance from the OneToOne relation

Question: I have these two models in django rest:
class CustomUser(AbstractBaseUser):
    email = models.EmailField(max_length=255, unique=True)

class Teacher(models.Model):
    user = models.OneToOneField(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)

How can I delete the CustomUser instance related when deleting a Teacher instance?
I tried this code but it gives this error "maximum recursion depth exceeded while calling a Python object"
@receiver(pre_delete, sender=Teacher)
def delete_user(sender, instance, **kwargs):
    instance.user.delete()

Answer: The issue is that you're using the pre_delete signal, and as such, it deletes the CustomUser first. The CustomUser's deletion cascades and deletes your Teacher, but before deleting your Teacher the signal is called again, causing an infinite cycle.
Change pre_delete to post_delete on your @receiver.
Answer: In Your settings.py, write this code line after INSTALLED_APPS.
AUTH_USER_MODEL = 'your_app_name.CustomUser'

Models.py:
class Teacher(models.Model):
     user = models.OneToOneField(CustomUser, on_delete=models.CASCADE,blank=True, null=True)

View.py or If you have separate Signals.py:
@receiver(pre_delete, sender=CustomUser)
def delete_user(sender, instance, **kwargs):
    user = Teacher.objects.get(user=instance)
        user.delete()

Try This Code.


Can't find 'blender' module?

Question: I'm using Blender V2.7, and I want to run a Python script which imports the blender module, but the console window outputs error: can't find Blender module.
This error does not occur in V2.49.
Comment: The `blender` module was removed in the API overhaul in 2.5. 2.4x scripts are not compatible with 2.5+
Answer: It's a bit hard to find good links about this unfortunately, partially as it happened so long ago and there doesn't seem to have been a lot of documentation about it :/. The best guide I could find was this blog post about porting BGE scripts.
Suffice it to say that the python API underwent a major change as part of the 2.4x to 2.5x transition, and the blender module no longer exists (the modern equivalent is bpy).
Here is the latest blender python api documentation.
Comment: [This page on archive.org](http://web.archive.org/web/20091124180508/http://www.blender.org/development/release-logs/blender-250/) may be what you're looking for.
Answer: As has been mentioned there was major python changes between 2.49 and 2.50 (2.50 was released 5 years ago), even adding bmesh in 2.63 made significant changes to manipulating mesh data in python. I don't think much was written about converting scripts between 2.49 and 2.50, mainly because it was such a big change, partly because using python before 2.50 was much less popular than it has become over the last couple of years.
I would recommend you discard any 2.49 tutorials you may be looking at and find new ones written specifically for 2.6x or higher.
If you have a 2.49 specific script that you want to update, you should learn to use python in 2.72, then look at what the old script is doing and re-write it for 2.72. If the script is specific to creating or importing data and you need to use it now, you could run it in 2.49, save the blend file and then open it in a new version. You shouldn't have any trouble with mesh data, materials should still be ok in Blender Internal, armatures may need some cleanup and simulations could also need work.

Can't find 'blender' module?


How can I show wp blog post in html site?

Question: I have a website that is built with HTML and Bootstrap and have a blog with WordPress (here is the link https://satisfyhost.com/blog/. Now I want to show my blog posts last 3 or 4 on my main website. Is there any way to embed or show it perfectly?
Example:
Comment: WordPress provides a REST API (normally located at `example.com/wp-json/wp/v2/`). It's documented here: https://developer.wordpress.org/rest-api/ You should be able to pull the most recent `{n}` posts using that.
Answer: Yes, you can do that no problem.
One way is to use an iframe and point it to a page in the wordpress site.
I am assuming that you want the same look and feel from the wordpress site without any extra work. Best to set up a page in wordpress that has no header and no footer but does contain the content you wnat to display. This way it keeps the styling, java scripts, and all other features from the wordpress that are already build in.
Creating a custom page template in WordPress without a header or footer is a straightforward task. You can then embed this page in your non-WordPress site using an iframe. Here's how you can do it:
Create a Custom Page Template:
Go to your WordPress theme folder. You can access it via FTP or File Manager in your hosting control panel.
Create a new PHP file for your custom template. You can name it something like custom-template.php.
<?php
/*
Template Name: Custom Page No Header Footer
*/
?>

<!DOCTYPE html>
<html <?php language_attributes(); ?>>

    <meta charset="<?php bloginfo( 'charset' ); ?>">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="profile" href="https://gmpg.org/xfn/11">

    <?php wp_head(); ?>

<body <?php body_class(); ?>>

<?php wp_footer(); ?>

Create a New Page in WordPress:
Go to your WordPress admin dashboard.
Create a new page (Pages > Add New).
On the right-hand side under 'Page Attributes', select your custom template from the 'Template' dropdown menu.
Publish the page after adding your desired content.
Embed the Page Using an Iframe:
On your non-WordPress site, you can embed the WordPress page you just created using an iframe. The HTML code will look something like this:

Make sure to replace https://yourwordpresssite.com/your-custom-page/ with the actual URL of the custom page you created in WordPress. Adjust the width and height attributes to fit your layout.
This approach allows you to maintain the CSS and JavaScript of your WordPress site on the custom page while excluding the header and footer.
If there are links in the wordpress content it might try to stay in the iframe window, you can jQuery to control things like that. You can make any link in that window go somewhere on your site instead of the wordpress site, etc.
Good Luck!


Animation in GeoServer

Question: I would like make an animation in GeoServer using three shapefile.
I looked this page https://docs.geoserver.org/stable/en/user/services/wms/time.html#specifying-a-list-of-times but I didn't understand how I can create a "time specification".
How can I do this?
Comment: What specifically don't you understand? Please also provide more details on the data you are trying to animate. Are the times instances or ranges? Are all the features in your shapefiles representative of a single instance/range or multiple?
Answer: Time series in GeoServer tend to be collections of rasters or single vector files.
So you need a single shapefile with a date column in it, the animation will then allow you to show the various features in the layer that match the time settings.

Animation in GeoServer


"Inlet" and "Intake": Synonyms?

Question: Currrently both inlet and intake have a fair amount of questions. Neither had a tag wiki and the questions on both seem to have the same subjects. Is there any reason they shouldn't be made synonyms?
Answer: On this NASA page on inlets it says:

In England, inlets are called intakes, which is a more accurate description of their function at low aircraft speeds.

So it depends on SE's manual of style, I'm not sure if it's been discussed before, but I think AmE is used for tags (e.g. horizontal-stabilizer with a z). In this case intake, despite being more descriptive, can be the synonym.
Answer: I don't know if I'd really say they are the same. They are used interchangeably, but "intake" generally makes me think of an engine, whereas "inlet" makes me think of a smaller opening for something else, like for the a/c packs or something. Inlet sounds odd for the engine intake. The suffix "-let" is a diminutive, usually indicating a smaller version of something else. Like "piglet" or "winglet." I've heard people use "inlet" for engines, but it doesn't sound right to me.
Interesting side note: I found out from @mins that "winglet" is basically the English equivalent of the French "aileron."
Comment: You have a good point from the language perspective but in my experience it would be the other way around.
Comment: @fooot I see it on here a lot, but it never sounded right to me

"Inlet" and "Intake": Synonyms?


Minecraft: Playing on older PE server

Question: I want to play on this server called SkyBlockMc, but it runs on (Bedrock) 1.12, and I'm on 1.13. How (if possible) can I join the server?
Answer: You either have to download and use an old version of Minecraft, or petition the server admin to update their version.
Answer: I dont know if the option is on mobile but on PC you can request to run another version of Minecraft.
If it isn't there; well you don't have much option else but to ask the server admins to update their server to work with your version and wait for them to do.
EDIT: For @brododragon, let me explain the point. I'm no Minecraft server expert but here's how I understand it.
A game server will expect the connecting game client to have a particular game version (or maybe range of versions, if possible). That could be seen in early PUBG days, where if you tried to login too soon before or after an update, your client would be a different version than what the server expected, and it wouldn't let you log in.
Why is that? Well, if you are a couple versions in front of the server version, you could have/craft some items that are not in the server registry, and if you are a couple versions behind the server version, well the server could make you loot items/encounter mobs that you have no data on. Both would probably make your client or the server crash, and would at least be such an hassle that it would just be easier to force everybody on the same version.
So with the fact that the server is expecting the client to be a particular version number on the table, the asker now has 2 options in front of him.
A- Force/Update his client to conform to the expected version of Minecraft and its mods
B- Request the server admins so the Minecraft/Mods versions of the server confirm to his client.
Comment: It doesn't work like that
Comment: Added detailed explanation of my answer to give more context on how I got to my answer.

Minecraft: Playing on older PE server


Horizontal Scaling of CometD java clients

Question: Can we scale a cometd java client horizontally?
I.e if I have a container subscribed to cometd, can I have one more clients running as docker containers for load balancing? If yes, how to make sure that each client receives unique data and doesn't duplicate.
Comment: You need to clarify what you mean by "container" as it is not clear. A "container" is not subscribed to CometD channels, a CometD client is.
Answer: Theoretically, you can have as much clients as you want. Its all bout if the load balancer and server can keep up with the load.
In my company we do load test through CometD WebSocket. Sometimes we have up to 2000 parallel clients.
Comment: Yeah, that is indeed possible, but my question is, how to load balance among clients without data duplication.
Comment: Why do you need data that is not duplicated? And why do you need to load balance the clients? You should be more specific. Do you want to load balance the broadcasting from the server to the clients or the other way around?
Comment: Suppose the client is part of some application, may be say that its part of some email sending application. I would like to scale my email sending application for performance. So, each instance should be listening and responding to only one message, as the mails shouldnt be triggered multiple times.
Comment: So basically your client application is a consumer. You need to implement some kind of global queue, that each client with pull data from, or some global orchestrator, I would personally go with global queue. You need something like https://hazelcast.org/ implemented globally, on a separate JVM that has a queue, and you can set up your clients to read from that queue.
Comment: The actual purpose is for load balancing and resiliency. If I go for hazelcast, then again i come to the same scenario, where only one client is receiving data from the server.


How to make changes to the Oslo Site Layout

Question: I am using the Oslo Site Layout on my site. I need to be able to remove the "Home" link that is currently the "Page Title" in the default homepage. How can I remove this?
Answer: Not sure whether you wish to hide the page title or the "Home" from the navigation row, but either way here are the CSS for those:
Hiding the page title:
h1#pageTitle {
display: none;
}

Hiding the "Home" from the navigation row:
ul#zz15_RootAspMenu li:first-child {
display: none;
}

Comment: I tried to upload a screenshot, but it wouldn't show. I'm referring to the "Home" link that appears in the body of the page when using the Oslo site layout.
Comment: Can you tell me where to edit the CSS for this particular item?
Comment: @cbbrown If you want to make the change to only one page of your site, you should use e.g. a Script Editor Web Part or a Content Editor Web Part to embed the snippet including the CSS. Remember to wrap it with ``-elements. If you want to make the change on site-wide, you should use the CSS as a separate file referred in your custom master page.


How many clusters I should choose using spectral clustering?

Question: I tried to cluster my data using spectral clustering algorithm. Before applying clustering algorithm, I used PCA on the data, which gave me 4 PC accounting for 95% of variation. After that I plotted eigenvalues for the clusters for two datasets (as I need to analyse them separately). From the plots it's not so obvious that 4 clusters is the right choice (index is a number of clusters). What would be your recommendation for choosing the number of clusters? Also, what is the best approach in choosing number of neighbors considered?Thank you.
Answer: You said you're doing spectral clustering. This means you're constructing a similarity matrix, a graph Laplacean, etc. If you don't see the sharp drop in eigenvalues at 4, then maybe you should alter the parameters of your similarity matrix (i.e. if it's a Gassian kernel, alter the bandwidth; if it's KNN, alter the k, etc).


Why is the number of independent elements of a stiffness tensor 21?

Question: I think that the dilatation of an elastic material is proportional to the hydrostatic pressure.
That is, ${\rm{tr}}(\boldsymbol\sigma)=3k\ {\rm{tr}}(\boldsymbol\epsilon)$ for small strains.
If so, there is a stiffness tensor of the constitutive relationship between deviatoric strain and stress.
However, the stress deviator tensor satisfies ${\rm{tr}}(\boldsymbol s)=0$ for arbitrary deviatoric strain of ${\rm{tr}}(\boldsymbol e)=0$.
[Edited]
If the deviation stiffness tensor is represented by a block matrix of four 3x3 blocks, the number of independent elements is decreased from 6 to 4
in the upper diagonal block $C'_{11}$ and from 9 to 6 in off-diagonal blocks $C'_{12},\ C'_{21}$.
The strain deviation tensor can be diagonalized to the principal stress state by rotating the coordinate system,
and the stress deviation tensor for the new coordinate system can be obtained from the above two blocks.
Then the stress deviation tensor of the original coordinate system can be obtained by re-rotating the coordinate system.
As a result, the number of independent elements of a stiffness tensor is $1+4+6=11$.
Is the above correct?
Comment: What is "deviatoric strain"?
Comment: See, paragraph "Strain deviator tensor" of entry "Infinitesimal strain theory" in Wikipedia.
Comment: Please note that the tensor in elasticity =/= the tensor in fluid mechanics, they are functions of different things, this had me stumped for years until I tried to implement my own shallow water equation implementation.
Answer: I am answering the question in the title of your post rather than the text, as I do not understand what you are getting at in the with the ${\rm tr}(e)$ stuff.
I'm also not sure what a "stiffness tensor" is, but  the tensor of elastic constants $c_{ijkl}$ such that $\sigma_{ij}=c_{ijkl} e_{kl}$ has the symmetries
$$
c_{ijkl}= c_{klij}, \quad c_{ijkl}= c_{jikl}=c_{ijlk}.
$$
In the absence of these symmetries there would be $3^4=81$ independent  coefficients. Taking the symmetries into account one has 6 possible equivalent pairs $ij$, similarly for $kl$,  so the total number of independent coefficients  is the number of independent entries in a 6 by 6 symmetric matrix. This is 6 for the diagonal entries and $(36-6)/2=15$ for the off-diagonal entries, making a total of 6+15=21.
This count is  due to George Green of the "Green function" fame, a codiscoverer of the Cauchy-Green strain  tensor $e_{ij}$.
I image that the "stiffness" tensor mught be an inverse of the elastic constants tensor, so it will have the same symmeties and hence the same number of independent entries.
Comment: Thank you for your answer.
When an elastic solid loses shear stiffness, it turns into a  fluid. Then elastic anisotropy can be thought of as due to anisotropic shear stiffness. It was my mistake to think that pure-shear strain or divergence-free deformation causes divergence-free stresses. I forgot that pure-shear strain can cause dilatancy or hydrostatic pressure can causes shear strain.
However, I think that there is a linear relationship of the first invariants between the stress and the strain tensor, and the number of wave velocities in a linear elastic solid is much less than 21.
Comment: There is an account of the waves in a general linear elastic solid in *Imaging Phonons (Acoustic Wave Propagation in Solids)*
by James P. Wolfe. Lots of pretty pictures too. The theory is similar  to, but more complicated than Fresnel's theory of crystal optics: https://en.wikipedia.org/wiki/Wave_surface
Answer: This will depend upon your constitutive equation.  Under generalized hooks law you begin with a total of 81 constants.  If the strain energy function has the commutative property this reduces to 45 due to the fact that $C_{ijkl}=C_{klij}$ (diagonal). If the loading is non polar that is $\sigma_{ij}=\sigma_{ji}$ and infinitesimal strain $\varepsilon_{ij}=\varepsilon_{ji}$ and use of $C_{ijkl}=C_{klij}$ then it becomes 21 constants.  Look at Reddy Continuum mechanics


Are references from an employer in an unrelated field useful when applying for graduate school?

Question: I am applying for grad school and a bit confused about taking references. Should I take a reference from my employer where I had worked on an unrelated field for one and half year? Or Should I prefer taking it from academia from a Prof. with whom I have worked on unrelated field again.
Comment: @ElmerVillanueva In the linked question, the OP's industry manager knows the OP was working on the same field while the OP in this question has both rec letters on un-related field. In my opinion, it's not an exact dup.
Comment: This question appears to be a duplicate of https://academia.stackexchange.com/questions/81039/choosing-between-two-letters-of-recommendation
Answer: You need a recommendation that will convince a committee that you will be able to rise to the occasion (i.e. be successful in your coursework, exams, research, thesis and thesis defense) if they admit you to graduate study in their department.  Choose letters that will have as close an effect to that as possible.
You haven't given us enough information about your employment to enable us to provide an opinion about that potential letter.
Note that if someone asks for one reference, and you have two references which, combined, give the desired picture of you, then the thing to do is submit both letters.
Also note that there are threads here that provide advice to those who don't currently have any suitable references (e.g. take another class, do an internship -- something to garner a new reference).
After you've read some of the related Q&A threads, feel free to edit your question, giving additional information about your situation, and pointing out how yours is different from the others you read about.
Comment: My academic recommenders can vouch for my work in that field. I have a few papers with them. My industry recommender can stress mostly on my soft skills and characters. Mostly he can stress on my work ethics, cooperation etc. Is it a wise to do that or instead take recommendation from a Prof with whom I have worked but on an unrelated field. Also note I am currently working in the industry.
Comment: @UG_ - How about both?
Comment: Some schools allow only 3 reco, wherever possible I am going for both.
Comment: *"My academic recommenders can vouch for my work in that field"* -- glad to hear it.
Answer: In the U.S., you'd almost surely need at least 3 letters, so you'd want both of those. Much as @aparente001 says, the point of the letters (in the U.S.) is to convince the admissions committee (in the department to which you're applying) that your future potential is sufficient to get you through that grad program, and to be a contributing member of your professional group thereafter (or else possibly be a blot on their reputation). Pointedly, it's about the future. Relevant past accomplishments are a very good predictor. Dubiously relevant past accomplishments less so. What's the dividing line? Not so clear, perhaps, but it is amenable to rational reflection.
Comment: Good point that it's likely that multiple letters will be needed.  But is that a significant enough contribution to warrant writing a separate answer?  Or is there more of a difference between our answers than I'm seeing?


How do I make C-x b (switch-to-buffer) ignore some buffers?

Question: I want C-x b (i.e. switch-to-buffer) to ignore some buffers. For example, I want to ignore *Ibuffer*. In other words, when I press C-x b, I should not see Switch to buffer (default *Ibuffer*): . *Ibuffer* should be skipped. Is there a way to make C-x b ignore particular buffers?
Comment: See:  https://stackoverflow.com/questions/19989072/exclude-hated-buffers-from-switch-to-buffer-list
Answer: Command switch-to-buffer is designed to do just what it does. You can advise it to do something different, but typically if you want different behavior for a given key sequence then you are better off using a different command.
(This is all the more true in the case of switch-to-buffer, which is used not only as a command, i.e., interactively, but from Lisp code in many places, including in the core Emacs code.)
What you're interested in is the interactive part: the part that reads a buffer name from you. That's realized for switch-to-buffer by function read-buffer-to-switch. But that function is hard-coded to exclude only the current buffer. That function in turn is defined using function read-buffer, which, fortunately, offers more possibilities.
You can define a command that uses read-buffer in a way that provides only the buffer-name choices you want, and then bind that command to C-x b.
C-h f read-buffer tells you that there's a PREDICATE argument that filters the list of available buffers to present only some of them.  Use that.
This code reuses the interactive spec from switch-to-buffer, except that it uses read-buffer with a predicate that excludes buffer *Ibuffer*:
(defun my-switch-to-buffer (buffer-or-name &optional norecord force-same-window)
  "Switch to another buffer, besides `*Ibuffer*'."
  (interactive
   (let ((force-same-window
          (cond
           ((window-minibuffer-p) nil)
           ((not (eq (window-dedicated-p) t)) 'force-same-window)
           ((pcase switch-to-buffer-in-dedicated-window
              (`nil (user-error
                     "Cannot switch buffers in a dedicated window"))
              (`prompt
               (if (y-or-n-p
                    (format "Window is dedicated to %s; undedicate it"
                            (window-buffer)))
                   (progn
                     (set-window-dedicated-p nil nil)
                     'force-same-window)
                 (user-error
                  "Cannot switch buffers in a dedicated window")))
              (`pop nil)
              (_ (set-window-dedicated-p nil nil) 'force-same-window))))))
     (list (read-buffer "Buffer: "
                        (other-buffer (current-buffer))
                        (confirm-nonexistent-file-or-buffer)
                        (lambda (name.buf)
                          (not (string= "*Ibuffer*" (car name.buf))))))))
  (switch-to-buffer buffer buffer-or-name norecord force-same-window))

(global-set-key (kbd "C-x b") 'my-switch-to-buffer)


H2 database growing out of control quickly

Question: Hi hopefully someone can help me, I am currently running a H2 database that when cached grows out of control quickly. After completing the cache I found it should be about 32MB but after a small stretch of time it has grown to be nearly 5GB. I have created a copy and dropped the tables one at a time to try and determine what is causing this and it had no effect, leading me to believe it is storing metadata or something else automatically that I can't see but I still can't figure out how it could grow exponentially. Any advice would be greatly appreciated!
Answer: You could create a SQL script to check what the database contains (using the SCRIPT statement).
If there is not much data in the SQL script, it could be a long running open transaction that prevents the transaction log from shrinking. To analyze this, run the Recover tool and check if there is an open transaction (see the "transaction log" section).


Do TP-Link bulbs provide any API support?

Question: I have a TP-Link LB120 bulb and configured with Kasa app. Now I able to control the bulb using Kasa app. Like turn on, off, change the colour of the light etc. So I need to set up the same things via an API. So let me know TP-Link provides any API support for controlling the light operations. I have found some node modules, but I don't know whether the modules are officially published by TP-Link.
Comment: Why do you need them to be officially supported by TP-Link if they work?
Comment: There is no documentation. So by using this NPM we can get an access token by passing the account credentials. How do I know the expiry time of the access token? If we have a perfect documentation, we don't block with these type of scenarios. This is just an example. Also how long these APIs are work?
Comment: hubitat has had an unofficial cloud & local integration for kasa that uses a cloud or local API (reverse engineered). you can check them out on the hubitat forum.
Answer: A really quick google (tp-link bulb api) turns up a npm module that claims support: https://www.npmjs.com/package/tplink-lightbulb
They are unlikely to be officially supported by given there is discusion of reverse engineering the protocol, it even includes a wireshark plugin to help decode the network protocol.
The only way to get a definitive answer will be to ask tp-link directly (or find the documentation on their website)
If on the other hand you are asking for support for things like Alexa/Google Home then a quick search of the Alexa skill catalogue shows a TP-Link Kasa skill and a similarly named entry in the Google Home list.
Comment: Anyway, I have integrated my TP-Link light into my app and able to control the lights via an API called 'tplink-cloud-api'. This is an un-official npm. Actually, I don't know how long it should work.


raspberry pi connected to wifi but not responding

Question: I am following this tutorial to convert my rpi 4 into an access point. I followed all the steps except installing node, Go and resizing the image.
After entering the credentials to my wifi in the login page, the raspberry pi got connected to my wifi, but when I tried to ssh into it, it didn't respond. I tried to ping to my rpi's ip address but it showed request timed out. Can anyone please help me sort this out.
EDIT:
Here what I did

Flashed raspberry pi os lite on my sd card
SSHed into my rpi and added a new user and gave him some permissions as per this link and deleted the pi user.
created ssh key pair using putty
updated the os and installed basic libraries
installed turnkey as per the link above
installed hostapd
Then on rebooting the pi, I connected it to the access point 'ConnectToConnect' and went to the login page.
There I entered the credentials to my mobile hotspot and submitted it.

After that my rpi is not responding to the mobile hotspot connection. I am using windows 10 pc
Thank you
Comment: @Milliways What foundation tutorial are you reffering to? If possible please attach a link to it. thank you
Comment: I am not sure why you would want to follow some random tutorial (for an old OS - which contains some questionable steps), rather than the Foundation tutorial. Either way you need to explain **in detail WHAT YOU DID**.
Answer: The Foundation has extensive documentation
See Access Point


Could a photosynthetic plant form a symbosis with fish in an oceanic environement to get nutriets from the sea bed?

Question: On Earth their are thousands of animals with symbiosis with plants such as honey bees and flowers. However for this question I'm focusing on a very specific kind the one that leaf-cutter ants have with fungus. These ants bring all the necessary nutrients to the fungus in the form of leaves. So I'm looking for something similar to happen in the sea. A plant-like organism is in the middle of the ocean with a sea bed thousands of miles under it. It needs nutrients essentially it needs iron which would be lacking near the surface where it needs to stay in order to photosynthesize. So it forms a symbotic relationship with colonial organisms similar to fish that bring nutriets to the plant in return for food and shelter. These organisms would have to find a way back to the plant-like organism which i know some salmon can find their way back to their home river through magnetic feilds and scents. However on such a large scale I'm not quite sure If this would work. I also understand that these colonial organisms would have to be able to withstand pressure changes similar to what a whale has to do while diving. But what kind of adaption in its body would it have to account for this? I'm working on an ecosystem based on a water world planet with very sparse islands. Life has evolved on these islands, but the deep oceans are barren. So this plant-like organism with the help from the colonial organisms move from the shallow waters to the deeper oceanic water. These plant-like organisms will then become the basis of a oceanic ecosystem where they bring up nurtriets from the deep that feed MASSIVE herbivores that feed even bigger predators! I kinda got this idea from subnautica and thinking how the large predatory organisms got their nutriets.
Comment: Ocean thousands of miles deep would run into problems with physics before it runs into problems with biology.
Comment: I agree, the physics of an animal diving in an ocean to thousands of miles is implausible. Thousands of feet might work, and I could come up with some plausible scenarios for that.
Comment: @void_ptr brings up a good point if *reality* is that important to you. But, it's worth reminding folks [to not get too distracted by the back story](https://worldbuilding.meta.stackexchange.com/q/8008/40609).
Comment: Wouldn't the plant already be food for the fish, it would have to be some really special substance they create as well as the fish being reasonably intelligent compared to the average fish.
Answer: I'm going to answer your question, but before I do, I need to make a point about how this Stack works:

actually feasible

That's a question that doesn't really make sense here. After all, our purpose is to help you create an imaginary world... But! If you use the science-fiction tag, we'll create answers that reflect science but only use it as a guide to develop creative new ways of solving the problem. If you use the science-based tag, we'll stick closer to science and give you answers that reflect similar solutions to what we know. If you use the hard-science tag, you'll only get answers that really are "feasible," meaning they can happen on Earth because here's the mathematical equations and four scientific paper citations to prove it.
In other words, "feasible" is something you understand. It's not something we understand without reading your mind... or if you delete one of the tags and use one of those I just mentioned.
Now, back to our story.
I give you: the humble mosquito!

Courtesy The Verge. Click to enlarge.
This is the kind of symbiosis I recommend. Drink the fish's blood! It's full of lovely iron, doesn't require your plant (or, less believably, the fish) to travel thousands of miles to the sea floor, and the mosquito sets a precedent for an existing natural solution.
This also allows you the option of developing a more complex biome, if you choose, to rationalize the transfer of iron all the way from the sea floor thousands of miles below to the surface. You'd need a series of hungry critters, each moving the iron a little higher in altitude.
Mosquitos... it's probably their only practical use other than feeding bats. I like bats.
Answer: Monster Filters, Anchor Kelp, Muck Fungus, and Diver Packs:
It takes an ecosystem to make this make any sense. First, thousands of miles is out of the question - the logistics of things living at those depths is tricky, let alone things DIVING up and down those distances. I'll assume a shallower ocean. But ecosystems are complex and take time, so bear with me!

PROBLEM 1 - buoyancy: The sea supports a lot of weight. very few things in the sea need to use anything but water to transport materials, so fish are not generally required. Species can reproduce by dumping thousands of offspring into the sea, and survive by a numbers game of having huge volumes of tiny individuals.
SOLUTION: Your world has some frightening filter feeders. While small species exist, these beasts are absurdly efficient at cleaning them out. Plant and fungoid species must hook a ride on fish to move their offspring to new areas.
PROBLEM 2 - solubility: Water is very good at dissolving iron and minerals like it. The ocean works because these minerals are mostly dissolved in the water and free to whatever species is willing to put in the effort of extracting them.
SOLUTION: Your ocean is mineral-poor. Fungoid-like species make their living digesting any organic material that reaches the bottom and holding on to dear life to those minerals.

Those are your worldbuilding issues needed to set up our scenario. Now your species need to evolve the behaviors.

PROBLEM 3 - plants need minerals: Your plants need minerals to survive in this mineral-poor ocean, but the minerals are bound up as fungi at the bottom.
SOLUTION: The anchor kelp create weighted pods that sink to the bottom. The earliest ones sank, absorbed minerals or adhered to fungi and sought to parasitize. Then they floated to the surface and began a photosynthetic life. The pods need to be fairly big to avoid the filters. They don't drift far, and are vulnerable to being eaten. Eventually, these anchors start to develop symbiotic relationships with the fungus - minerals for calories obtained in photosynthesis.
PROBLEM 4 - predation: Your pods are eaten as they sink, and are eaten as they rise. Pods must be fairly caloric going down (like fruit) and nutrient-dense going up. This makes them vulnerable.
SOLUTION: Get fish to swim as diver packs to the bottom with the pods, eating little fruiting bodies that ripen just as the fruit sinks. The fish fight off rival species to defend their food. The same or different species are attracted by chemical signals when the pods are ready to come up, and the fish similarly defend the pods on the way up, nibbling them like a salt block.
PROBLEM 5 - the filters stop plants & fungus from spreading
SOLUTION: Your plants and fungi have become dependent on fish for protection of their pods. With the close relationship of the plants and fish, the plants begin sticking seeds & spores  on these fish, and the fish carry the seeds around the filters. Now the fish act like pollinators, but closer.

Now all you need to have a species working like leafcutter ants is for the fish to escort the pods to the bottom and eat fungus instead. The pods get covered in fungus, the fish escort the pods to the surface to eat the fungus there. The fungus is fed, the pods follow their pattern to get minerals, and all species spread together on the backs of the mobile fish.


Using the Kramers-Kronig (Hilbert) transform in Python

Question: I am trying to use the Kramers-Kronig algorithm to transform the real and imaginary contributions to the anomalous scattering factor from a diffraction anomalous fine structure (DAFS) experiment.
I have fit a smooth curve to my experimental data using the lmfit package, and the following function:
def intensity(en, phi, beta, I0=1, slope=0, Ioff=0, fprime=-1, fsec=1):
    costerm = np.cos(phi) + beta*fprime
    sinterm = np.sin(phi) + beta*fsec
    return I0 * (costerm**2 + sinterm**2) + slope*en + Ioff

I have found minimised values of the listed parameters in the function and used them to calculate an initial guess for f' according to:
def f1_guess(f2, I, I0, phi, beta, Ioff):
    f1_guess = (1/beta) * (np.sqrt(((I-Ioff)/I0) - (math.sin(phi)+(beta*f2))) - math.cos(phi))
    return f1_guess

I am now trying to use the Kramers-Kronig relation to transform this initial f' guess to an f" that can then be put back into the lmfit process to model the intensity, and subsequently calculate the fine structure. I have tried a few things, including the scipy.fftpack, as well as the scipy.integrate and sympy.integrate packages.
The issue I am facing is that I need to calculate the KK transform over a finite energy range, I.E. instead of the following:

I should do something more like the function below, by taking out the known atomic lineshape f"a(E) and integrating over my experimental energy range:

However, I am struggling to distinguish between E' and E (or omega' and omega) - I don't know how they are different from each other - and so I am unsure of how to specify these values in script format in such a way that I can accurately evaluate this integral.
Does anyone know how I might be able to transfer my f' to f", and iterate through my lmfit model until the 4 parameters (I0, Ioff, beta, phi) and the f"/f' fine structure functions stabilise?
Any help would be much appreciated, and also happy to link any relevant papers I have been reading on the topic if desired.
Answer: Not sure if this would resolve your issue, but Python (SciPy) has a Hilbert transform functionality (see here).
Being that the Hilbert transform is the core for the Kramers-Kronig relations (with some additional scaling by a constant), perhaps this can be useful to you.


Why does ultrasonic ranging only work with ultrasound?

Question: I've read a lot about ultrasonic ranging (measuring distance with an ultrasonic sensor), but I haven't been able to determine why such methods only work in the ultrasonic range. Why not infrasonic? Or audible range? Since were just dealing with sending out waves and measuring the time it takes to come back, why can't we do this at any frequency?
Answer: the maximum possible accuracy of any sound-based imaging scheme depends on the wavelength of the sound relative to the size of the things you wish to detect with it. This is because an object is poorly-coupled to a sound wave if its dimensions are less than the wavelength of the sound. High spatial resolution for imaging or distance measurement hence requires the shortest possible wavelength, so ultrasound is used.
For example, if you want to locate something to an accuracy of 1 centimeter, you need sound waves at least that small, and preferably smaller. This means frequencies of at least 34 kilohertz, or higher.
Answer: A first reason is because of distance resolution. Ultrasonic ranging works by sending pulses and listening for the echos. A pulse includes at least one wavelength of the sound, and typically a few, with some damping as a function of time. The shorter the pulses, the more precise the time of flight estimations. With higher frequencies, the pulses are shorter.
Another reason is because of range. Since your usually are using the same transducer to send the pulse and detect the echo, you would want your transducer to stop emitting before you look for the echo. This means that you can determine the range of closer objects only if the frequency is large enough as you need basically all of your pulse to have left the ultrasound transducer before it gets reflected and back to you. Using an emitting and receiving transducer may be difficult at the emitted signal is very strong and a receiving transducer may be blinded easily by this strong signal while it is emitted.
Another factor is lateral resolution. To get a good distance measure, you must have most of your signal coming from a specific distance. Lower frequencies will have longer wavelengths and the wave will be reflected from a laterally larger space, which may not all be at a single distance.
If you want to look for objects that are farther, you can use other frequencies. SONAR works in the audible range.


One seed phrase for multiple currencies on HW wallet

Question: If I use a hardware wallet with multiple cryptocurrencies, then I guess it uses multiple addresses to store them, right?
Now I'd like to back up this wallet on a piece of paper in case it's destroyed. Can the 24-word sentence created by the hardware wallet once initialized be used to recreate all these addresses, across all currencies on the device?
Answer: BIP32 and BIP44 define a standard for Hierarchical Deterministic Wallets with Multi-Account Hierarchy. While these are originally Bitcoin standards, they can be adopted by wallets for other cryptocurrencies and are especially useful for hardware wallets that are meant to be able to work with many different cryptocurrencies at once.
To answer your question, yes, these standards are indeed able to deterministically generate all your addresses for multiple cryptocurrencies from a single master seed (usually with the use of a BIP39 mnemonic phrase).


Providing personnel shock protection, AFCI VS GFCI

Question: House built in 1960's, upgraded to 200A service with new panel in 2009. Original wiring (2 wire w/not ground) and  wall plugs are without ground prong provision and were not replaced.
I want to provide personnel shock protection, but GFCI's trip immediately. AFCI's don't trip. If I install all AFCI's, will they provide any personnel shock protection (as well as fire protection)?
Will a dual AFCI/CFCI have the same tripping problem?
Comment: Do GFCIs trip immediately in *any* branch circuit position, or just a few of them?
Comment: GFCI and AFCI are *adjectives* which cannot be used alone, they must operate on a *noun*. Example of nouns are "circuit breaker", "receptacle" or "deadfront device".
Comment: Is your panel a GE by chance?
Answer: AFCI does nothing for shocks --- Hold on.
I gather you are inside your service panel trying to fit GFCI or AFCI breakers.  There are prerequisites to GFCIs being fittable.
Fix your multi-wire branch circuits
Search all the entering cables for cables that have 3 conductors (disregarding ground).  Modern cables would be black white red, no idea on older cables.  You are looking for cables where the neutral goes to the neutral bar, then there are 2 hot condutors each going to a circuit breaker.
On each and every one of those, no exceptions, the two circuit breakers need to be pulled and, the two hot wires landed on a 2-pole circuit breaker, and that reinstalled in your panel.
A 2-pole breaker will occupy 2 spaces.  It is not to be confused with a duplex/twin/tandem/double-stuff breaker, which squeezes 2 circuits into 1 space.  A defining characteristic of a 2-pole breaker is that both "sides" must trip together.
Once you have corrected all your multi-wire branch circuits as I describe, it will now be possible to contemplate GFCI breakers on those circuits.  You will need 2-pole GFCIs for those circuits.
Search for promiscuous neutrals
When wiring the equipment safety ground, it's perfectly normal and common for grounds to spiderweb, loop, or interact among circuits.  Say you have a basement lighting circuit, and an upstairs lighting circuit that brings a 3-way switch to the bottom of the stairs, in the same junction box as the basement lighting.  Can the grounds from both cables intermix? Sure.
Not so for neutrals.  Neutrals must remain entirely with their partner hots at all times.  In the basement case, if you wanted a smart switch at the downstairs 3-way location, but the smart switch wanted neutral, you cannot steal it from the basement circuit.  Not allowed.
Why is that?  Neutrals aren't a big old spiderweb like grounds are.  They are the normal path for returning current.  Currents need to be equal in each cable or conduit, so what goes out must come back the same way. What's more, neutrals don't have fuses so if a neutral inadvertently returns current for 2 hot wires, it could overload, and you'd the neutral wire on fire!  (The MWBCs above intentionally balance the circuit on opposite poles, and the 2-pole breaker enforces this.)
So you have to scour the circuit for places like this.  I find them via careful inspection.  The only formulaic way I can think of is to identify a circuit and plug a load (I love dollar store nighlights) into every socket. Then for the circuit under test, turn off every circuit, lift the circuit's neutral off the neutral bar, and power up all its hot(s). If anything powers up, it is powered by this hot and is poaching neutral from another circuit.   The problem is, this tells you nothing about whether another hot is poaching from this circuit's neutral.. So you need to repeat the test for each circuit.
Hunt down actual ground faults
If the above methods don't make a GFCI happy, then you have something with a bona-fide ground fault.   The place you start is plug-in appliances. Unplug everything, then plug things in one at a time until the GFCI trips.  That's the problem appliance.
If all that does not fix it, then you have a genuine ground fault in the wiring, and you will need to find the middle of the circuit, disconnect it there, see if it clears, and continue to divide and conquer.
Comment: I suspect he has some low-level ground faults in his wiring -- either that, or he has a GE panel, because those are the only two ways he could get the results he's getting (AFCIs being happy but GFCI's tripping consistently all over the place)
Comment: @ThreePhaseEel I thought newer AFCI devices only listened to the hot, and didn't care about ground faults or promiscuous neutrals, i.e. They don't even take a neutral wire.  Am I mistaken?
Comment: the current gen GE AFCIs are the only ones that are this way
Answer: Holy cow ! AFCI protection does NOTHING to prevent shocks! GFCI'S do, wether an outlet or a breaker. On 2 wire systems the national electric code allows 3 prong outlets because less than 6 ma  imbalance in the hot to neutral will trip the circuit removing the hazard. The only requirement is the down stream outlets need to be labeled " gfci protected , no equipment ground". All the gfci outlets I have purchased for years has these stickers. Arc fault is looking for an arc and they would not see an imbalance unless a dual function. Go with GFCI if you are worried about shocks either breakers or outlets to protect from hazardous shocks.


Rational orthogonal matrices

Question: ``everybody knows'' that an integral orthogonal matrix is a signed permutation matrix, so there are exactly $2^n n!$ such matrices in $O(n).$ Now, what if we ask for the enumeration of elements of $O(n$ with rational elements, where all the denominators are equal to $q$ (where $q$ is an arbitrary integer, though if the question is much easier for $q$ prime, that's fine too...)? I would suspect this has been studied... (one can ask the same question for arbitrary algebraic groups/number fields, of course).
Comment: Should that be "integral" in the first line?
Comment: Faint heart never won fair theorem.
Comment: I would be surprised if there is as nice a closed as for $q=1$ form since this question is strongly related to finding the number of ways of writing $q^2$ as a sum of exactly $n$ integer squares; the functions describing these counts are not simple functions to describe. Furthermore, an easy enumeration would seem to be further hindered by the fact that these are not subgroups of $O(n)$ in general, only subsets except in a few special cases. But then again, maybe all these difficulties cancel out in some nice way.
Comment: Following Allen's comment, the rational orthogonal $2 \times 2$ matrices have a natural few-to-one correspondence with Pythagorean triples, and there are more than 8 of them.  The power series enumerating $2 \times 2$ matrices with fixed denominator is the square of a Jacobi theta constant, and is a modular form of weight 1.
Comment: Except that for each orthogonal A, one gets many more representatives AB for each orthogonal B that has q=1.  While finding sums of squares is important, I see enumerating tuples of orthogonal vectors given one fixed vector as the issue.  If you have M such vectors, there wil be at most M choose n possibilities which will be cut way down through orthogonal relations.  It would not surprise me if the choice for representatives A had cardinality O(M^sqrt(n)) asymptotically.  Checking the combinatorics lierature on orthogonal designs may help. Gerhard "Then Again It Might Not" Paseman, 2012.12.12
Comment: Yes, of course, the first line should be "integral". Will fix.
Comment: @Scott: is there a reference for your theta commentary?
Comment: @Arupinski: an asymptotic result would be of interest -- I suspect that a closed form might be too much to ask for (though a closed form for a generating function, as suggested by @S.Carnahan for $n=2$ is not too implausible...)
Comment: Calculate some small cases and look it up at the OEIS?
Comment: @Gerry: Even the small cases are nontrivial to compute for $n>2...$
Answer: Boris Venkov asked this question, once, in the coffea room of the Maths Department of the university of Geneva.
Here are some things that relate to the case $q=2^m$.
Let $I_n$ be the 'euclidean' $\mathbf Z$-module of rank $n$, and $A\mapsto G_n(A)$ the group it defines.
Let us write $a(n,m)$ for the number of matrices in $G_n(\mathbf Z[\frac{1}{2}])$ all of whose coordinates have $2$-valuation at least $-m$.
First note that $G_n(\mathbf Z[\frac{1}{2}])$ is finite for $n<5$.
In fact, one even has $G_n(\mathbf Z[\frac{1}{2}])=G_n(\mathbf Z)\simeq\mathbf Z/2^n\rtimes S_n$ for $n<4$ and $G_4(\mathbf Z[\frac{1}{2}])=Aut(D_4)=G_4(\mathbf Z)\rtimes \mathbf Z/3$, where $D_4$ denotes the sublattice of elements of even length in $I_4$. The $\mathbf Z/3$ is generated by
$$ \begin{bmatrix}
-1/2 & 1/2 & 1/2 & 1/2\\\
-1/2 & 1/2 & -1/2 & -1/2\\\
-1/2 & -1/2 & 1/2 & -1/2\\\
-1/2 & -1/2 & -1/2 & 1/2
\end{bmatrix}$$
Thus in this case, you have $a(4,0)=384=2^7*3$ and $a(4,1)=1152=2^7*3^2$.
Next, note that $G_5(\mathbf Z[\frac{1}{2}])$ is an amalgamated sum : $A\star_C B$ with $A=G_5(\mathbf Z)$, $B=Aut(I_1)\times Aut(D_4)$ and $C=A\cap B\simeq \mathbf Z/2\times G_4(\mathbf Z)$.
This decomposition comes from the action of $G_5(\mathbf Z[\frac{1}{2}])$ on the Bruhat-Tits Building of $G_5(\mathbf Q_2)$ : a tree whose vertices are 5-valent and 3-valent.
The number $\frac{a(5,m)}{\vert G_5(\mathbf Z)\vert}$ counts the $5$-valent vertices that are at (combinatorial) distance less than $2m$ from a fixed one. Thus
$\frac{a(5,m)}{\vert G_5(\mathbf Z)\vert}=10*\frac{8^m-1}{7}+1$.
Things are becoming more complicated in higher dimensions since the Bruhat-Tits building is not a tree anymore ($n\geq 6$) and the action of $G_n(\mathbf Z[\frac{1}{2}])$ on the vertices of a same type (say corresponding to unimodular lattices) is not transitive anymore ($n\geq 9$).
You may adapt the same method to obtain similar results for small values of $n$ and $q=p^m$ : the Bruhat-Tits building is a tree for $n=3$, the action of $G_3(\mathbf Z[\frac{1}{p}])$ is transitive on one type of vertices (but rarely on maximal simplices) ...
Answer: This is not a complete answer, but it's a start.
In the $2 \times 2$ case, the act of choosing the first column and clearing denominators describes a two-to-one map from orthogonal matrices to primitive vectors in the lattice $\mathbb{Z} \oplus \mathbb{Z}$.  In particular, there are twice as many orthogonal matrices with denominator exactly $q^2$ as there are primitive vectors of length $q$, and there are twice as many orthogonal matrices with denominator dividing $q^2$ as there are vectors of length $q$.  The latter quantity is enumerated by the theta function of the lattice, which is a modular form of weight 1, and its coefficients grow logarithmically.
In higher dimension, I guess the generating function comes from successively choosing vectors in orthogonal complements, so it should be at least related to modular forms.

Rational orthogonal matrices


How to write a noisy state as a separable operator

Question: Bipartite operators close enough to the identity are separable.  But how does one compute the product operator terms of the separable expansion?  In particular, if $\left| \Phi \right> = m^{-1/2} \sum_{i=1}^n \left| i \right> \otimes \left| i \right>$ is the $n$-dimensional Bell state then $I \otimes I - \left| \Phi \right>\left< \Phi \right|$ is separable.  But how do I write this as a sum of positive product operators $\sum A_i \otimes B_i$?
Answer: The operator I gave is proportional to $\int_{\psi} \left|\psi\right>\left<\psi\right| \otimes (I-\left|\psi\right>\left<\psi\right|)$.  This can be written as a sum instead of an integral by using a complex projective 2-design.  I am curious if there are any simpler solutions.


UML: Going from Use Case to Class Diagram

Question: In simple steps how can one make the transition from a Use Case diagram to a Class diagram?
Comment: Greetings. I would highly recommend you look into 'Crc Cards'. Also would recommend reading 'UML Distilled'. Its a nice intro with some examples
Comment: @Martin Wickman: OK, I agree that approach may work for extremely simple systems. But real-life, complex, business-critical systems (not to mention life-critical or avionics, for example) are *not* that simplistic. You really want a solid method that takes you from a user-centred, functional description such as use cases to a solution-centred, structural specification such as a class model.
Comment: Is this a rhetorical question? Otherwise, my answer would be to skip the class diagram for now and write an automated acceptance test from the use case. Then write code until the test pass. Then refactor your design. *Then* generate a class diagram from the working code.
Comment: @Martin Wickman: I imagine you are kidding, right?
Comment: Assuming the use case is short enough to be captured in a few tests, no. This is a valid approach where you derive the OO design through tests and refactoring. The idea is that creating working software is more important than producing designs.
Comment: Use Case Diagrams have little information. They're akin to a table of contents of a book. The details are in the text of the use cases (scenarios, alternate flows, stakeholders, interests, etc.).
Answer: Here is my suggestion:

rent a good software designer with some years of experience
let him/her read the documentation of the use case diagram
explain him any questions he/she has (or let this be done by someone who knows the domain well)
let him/her make the class diagrams for you

And don't expect that the process "use case diagram -> class diagram" can be described here on SO in-depth in a few sentences. That's like "I have a picture of a car, please explain how I get from there to a blueprint of the engine".
Comment: My CSE undergrad focused an entire course on software design.  It was software programming for a quarter without the programming aspect.  Focus was put towards project design, documentation and specifications.
Comment: Funnily enough I was thinking of doing this on oDesk ;) . This is for a end-of-studies project though and I'm a bit tight on resources. I'll definitely give it a go later on as being in contact with someone experienced definitely helps.
Comment: If not the definite answer, you can get some pointers, the point of SO is not to be Wikipedia for programmers:)... Btw. getting a fish and fishing are two separeate things;)
Answer: Last year I gave a talk at ICSOFT 2010 that addressed that particular issue. The answer is not simple and I cannot describe it here in full, but you can download my presentation here. Scroll down to slide 23 "Moving from functional to structural models" for this topic.
The OPEN/Metis white paper contains additional information to complement the presentation.
The basic steps to obtain a class model from use cases are:

Create a service model for each use case.
Define operations for each service and busy state in your service models.
Determine the responsible class for each operation, adding new classes when necessary.

I will be happy to extend this answer with additional details if you have further questions.
Comment: The diagram type is a *service state diagram*. You can find it documented in the OPEN/Metis White Paper (http://www.verdewek.com/openmetis/Download/OPENMetisWhitePaper.zip).
Comment: This is one specific way of doing so.
Comment: Thanks for sharing César. What is the type of diagram used for the service model?
Comment: @Gabriel Ščerbák: Yes, it is one specific way. But it is the only specific way that I've found to be systematically successful after 15 years of trying alternatives. Do you know of any alternative ways of doing it?
Comment: @CesarGon I mention some in my answer. I don't think your approach isn't good, I just say it isn't "the one thing" that obviously everybody does.
Comment: @Gabriel Ščerbák: Fair enough. :-)
Answer: The question is one of 'object discovery'; the process of investigating a system requirement and identifying the 'objects' that could implement or be involved in the operation of such a system.  There are a number of techniques for object discovery, one of the most productive and communicative is the class-collaboration-responsibility (CRC) card technique.
Despite its name, CRC is primarily about object discovery, not class discovery, and perhaps (ORC would have been less confusing if you ever work in communications systems where CRC means something entirely different), but the latter follows from the discovery of the former, and this should always be object oriented design not class oriented after all.
Either way, by using CRC to generate candidate objects, and then using them to 'walk through' use case scenarios, you can refine your set of candidate objects (discarding unused ones, and creating new ones as necessary), and refine their responsibilities and collaborations as you go.  When you then have a stack of cards that satisfy all the use case scenarios, you can use them to identify classifiers and class hierarchies. Often one card will become one class, though it may have represented several objects in the walk-throughs, you may even see that several objects have similar responsibilities and are in fact one class or sub-classes if a common super-class.  All this informs the relationships and classes for your class diagram.
The collaborations discovered during the CRC exercise form the relationships in the class diagram, the nature of the collaboration may determine the use of aggregation, composition or otherwise, but that is often a detailed design or implementation issue and may not be obvious or even desirable at the use case level of design, which is generally more of an essential or requirements modelling exercise than an implementation modelling exercise.  Use case -to-implementation is usually too large a step, especially if you have to verify your model with stakeholders with perhaps domain expertise, but not software architecture expertise.
Comment: In my experience (see slides referred to in my answer on this page), a large proportion of classes in the system are nothing to do with the application domain. And CRC is good at finding application domain classes, but quite bad at discovering classes beyond that. For this reason, CRC is not enough, and I think that alternative techniques are necessary.
Comment: @CesarGon : Agreed, but use cases *are* application domain. For developing requirements models it is eminently suitable. For implementation models less so.  I think I pretty much said that in the last paragraph.  That said architectural modelling, the first step of mapping requirements to a solution, and modelling sub-sets of a solution CRC might still be useful, but at the detail level often you will often be involving too many staff in something that need not be that collaborative.
Comment: Yes, CRC is useful, no doubt about that. My point is that you need something else *in addition to CRC* whenever you want to move past certain point into detailed design.
Answer: Do you only have a Use-Case Diagram or do you have the scenarios to go along with the Use-Cases? If you only have the Use-Case Diagram then I would recommend creating the scenarios to go along with the Use-Cases. I like english sentences but activity diagrams work fine also.
After you have the scenarios, the next step is to create sequence diagrams.  Assuming your scenarios were done properly then your domain classes will fall out of your sequence diagrams straight-forwardly. You can then optimize your domain classes to meet whatever criteria you deem is important in your system.
In any event, IMO, you absolutely don't come up with the classes first, despite some methods that suggest otherwise. It will only result in fitting square pegs into round holes. Let the classes identify themselves and they'll do that quite nicely in the sequence diagrams if you take the time to learn to do a sequence diagram properly and not just for hand-waving purposes.
Comment: This is a great answer because Use Case Diagrams have little information. They're akin to a table of contents of a book. The details are in the English of the use-cases (scenarios, alternate flows, stakeholders, interests, etc.). UML is not a methodology.
Answer: What I do is to use classes with actor, usecases etc..  as stereotypes in my usecase diagram then drag and drop the same classes into my class diagrams. It does the job and it is pretty efficient.
Answer: This is a very good and intersting question without definite answers. There are many methodologies and practices encouraging similar yet different approaches. You can find one in another answer. Others include use case realizations and analytical modeling (UP), domain modeling (DDD), CRC cards (RDD) and many more. What I consider to be similar to these approaches is looking at steps in use case descriptions (use case diagrams are not of a much value per se) and identifiying input and output data and their relation to the problem domain. From there on it is mostly intuition I guess. Overall use cases aren't primary source of the OO design, they are important as specification of behaviour of the system and for managing requirements.
Comment: I have to agree with Cesar. I have also successfully been using Use-Cases to drive everything for years. The software requirements through the design on through system's testing. I can't think of much that doesn't tie back to the Use-Cases. Although, I agree the Use-Case Diagram itself is just a step above useless, but the Use-Cases themselves are essential.
Comment: @Dunk: +1 for "the Use-Case Diagram itself is just a step above useless".
Comment: Well, I (and a few teams and organisations) have been successfully using use cases as *the* primary source of input for OO design for over 15 years. The presentation and the white paper that I mention in my answer here on this page contain the details.
Comment: @CesarGon & @Dunk: Don't get me wrong, I have nothing against use cases, I think they are very useful. I just wanted to stress that there isn't a direct straightforward mapping between them and e.g. the class hierarchy, therefore there are many techniques to evolve the design from use cases.
Comment: @Gabriel Ščerbák: I agree that there is no trivial mapping between use cases and classes. But forward and backward traceability can be achieved (see materials referenced in my answer), and I find it's often necessary.
Comment: @CesarGon I consider myself a MD*/DSL guy, so traceability is understandable, as said before, establishing the first relations is the hardest part:)


What is the difference between /bin and /usr/bin/?

Question: I am using Mac OS X 10.11 (El Capitan) and wanted to know what the difference is between /bin and /usr/bin/? Apparently /usr/bin/ seems to have more binaries in it like grep etc.
Answer: Before large disks became common, /bin (being in the root "/" partition) would be mounted first, and /usr/bin possibly a little later, to allow for disk-checking, other system maintenance.  The root filesystem could be a smaller disk (with fewer programs).
That is no longer the case (large disks are common), and on some systems (Red Hat), /bin is just a symbolic link to /usr/bin.  OSX is not one of those systems.
Further reading:

Difference between /bin and /usr/bin
Answer: In general, /bin just contains the binaries that are probably needed for performing the most critical operations, like the "mount" command that allows a person to mount other "mount points" including the /usr "mount point".
For details, see the man page for "hier", which describes the filesystem hierarchy.  Such a man page may be particularly prone to differ between different operating systems.  (e.g., since you're mentioning OSX, I can refer to Apple's man page for hier).
There have been some efforts to standardize how different directories are used.  The most popular standardization is the Filesystem Hierarchy Standard.  Linux-based systems may be a bit more prone to follow that FHS more closely than some other operating systems.  The hyperlink from Thomas Dickey's answer provides some additional comments and references, and may be good for learning some more generalizations.  However, the "operating system"-specific "hier" man page is more likely to provide details that accurately reflect how things are typically done in a specific operating system, and so that man page should generally be trusted more than documentation that is less specific.


can we have a phase transition from superconductor to the normal only by applying magnetic field?

Question: for superconductors we have a phase transition diagram. according to that phase diagram in a  temperature below Tc, we can only increase the applied magnetic field to make a superconductor a normal. but when i ask it from a prof. he said that we can not do that just by increasing the applied magnetic field because the applied magnetic field does not increase the velocity and so the copper pairs can not be broken. so is his reasoning right or wrong?
Comment: You can definitely kill the superconductivity by applying magnetic field. Your professor's reasoning does not make any sense at all.
Comment: forgot about him as being a prof. he says that the change from superconductor to normal phase is due to the difference in the kinetic energy of the cooper pairs. so as the magnetic field can not increase the velocity, it can not (alone) break the superconductivity...
Comment: you know, the question here come is that why should increasing the magnetic field increase the kinetic energy of the super electrons? we say that magnetic field can not do work. and just changes the direction of the charged particle. but here we see that increasing the magnetic field increases the kinetic energy, as far as i know.
Comment: Comments deleted here and on an answer below. Keep it impersonal and focussed on the physics, folks.
Answer: Superconductors have both a critical temperature, at which they transition to the normal phase, and a critical applied magnetic field value.  Once the applied magnetic field is at the critical value, a transition to normal occurs, regardless of the fact that the superconductor is below its critical temperature.
The critical value of the applied magnetic field varies with temperature, from a maximum at absolute zero temperature, to lower values as the critical temperature for superconductivity is approached.
If an applied magnetic field is above the critical value, the Meissner effect no longer functions to exclude the magnetic field from the superconductor.  A magnetic field stronger than the critical value induces a high electric current that breaks superconductivity.  The energy of electron interaction which forms Cooper pairs is quite weak, and can be broken either by high temperature or by a strong magnetic field.
See this summary: http://hyperphysics.phy-astr.gsu.edu/hbase/solids/scbc.html.
Comment: @P.A.M. While it's true that a magnetic field can not change a particle's kinetic energy, a magnetic field can change the direction of the particle's velocity by exerting a perpendicular force.  This accelerates the particle without changing its speed.  As the Cooper pairs have a very small binding energy, a strong enough applied magnetic field will exert enough torque on the electron spins to break up the pairs.  Here's an explanation: http://socratic.org/questions/does-magnetic-field-change-an-object-s-kinetic-energy
Comment: @P.A.M. Scroll down to the bottom of this link, and see "Spin Alignment vs Electron Pairs": http://hyperphysics.phy-astr.gsu.edu/hbase/solids/meis.html
Comment: you know, the question here come is that why should increasing the magnetic field increase the kinetic energy of the super electrons? we say that magnetic field can not do work. and just changes the direction of the charged particle. but here we see that increasing the magnetic field increases the kinetic energy, as far as i know.
Comment: although  your answer did not explain the problem but it helped a lot. thanks. :)


Multiple residencies along with multiple citizenships

Question: Can a person have multiple residencies and each one in the country he/she is a citizen of? And can he/she have these residences printed each one in the respective country he/she is a citizen of? For example if one has a property/house in his/her name in every country he is citizen, is it internationally possible?
Example to clarify: Let's say I'm a citizen of Kuwait, Belgium and Morocco.
Is it legally possible to put, as residence, Rabat in Moroccan passport, Kuwait city in Kuwaiti passport and Bruxelles in Belgian passport IF I have three houses and each one in one of those cities. Can it create me troubles when it comes to travel?
Comment: Your question is not very clear and is not exactly about travel. It may have more to do with tax law etc. You can be a dual tax resident. You could also conceivably be a resident of two countries IF they don't require you to spend at least half the year there.
Comment: Aren't taxes based on income? So I have to pay taxes just for owning something in a land, haven't I?
Comment: I'll clarify. Can I have a residency in every country whose I have a passport? If I own a house in country A and likewise in B and C, can I put that I live in A in passport A, in B in passport B and in C in passport C if I own a house in A, a house in B and a house in C????
Comment: The question of what residency you list in passport A depends on how residency is defined in the laws of country A.  The question of what residency you list in passport B depends on the laws of country B.  Those laws don't all have to be the same, nor even consistent with one another.  This question cannot be answered in general.
Answer: Your question is a little unclear, so let's try to answer what I believe you are asking, staring with "Can someone be a resident of more than one country?".
In principle to be a 'resident' of somewhere means that you live there, and in most cases it is assumed that you live in only one place. But that doesn't have to be the case legally.
Every country has their own definition of what it means to be a 'resident', (Each one may in fact have multiple definitions of 'resident' - one for tax, one for healthcare, one for legal immigration status etc.) By using these definitions carefully it is possible to  be resident in more than one country, or to be resident in none. For example if two countries define 'resident' as someone who spends more than five months in the country, then by carefully watching how long you stay in each one you could be resident in both places at once. Alternatively you could arrange to b resident in neither.
Having a 'residence' (i.e. owning a house) in a country does not necessarily make you a resident of that country. It's usually about how long you stay in the country.
Being or not being a resident of a country makes a difference to how you can travel, but mostly in small ways. As an obvious one, most countries do not allow you to 'reside' there without permission (a visa) over and above what a visitor would have, but since you are talking about countries where you are a citizen that's not an issue. Being a resident elsewhere does not prevent you from visiting a country of your citizenship (with some exceptions regarding places that don't allow dual citizenships).
Most countries have different regulations about what you can bring into the country depending on your residency. They also can have different tax and healthcare laws depending on residency, but those aren't directly related to travel.
Comment: It's also worth noting that most people try hard to *avoid* residency in multiple places simultaneously, since that can cause a lot of tax pain.  I suspect the OP is actually asking about the *right* to reside (permanent residency) in multiple countries simultaneously.
Comment: Except that his example only talks about countries he is a (theoretical) citizen of.


How hard is Ocram compared to other bosses I know?

Question: I'm getting ready to fight Ocram on the console version of Terraria. I've played on PC and mobile before, so I'm familiar with the bosses in the other versions. How does Ocram compare? I want to know so that I can be properly prepared.
Comment: Are you asking because you're getting ready to fight Ocram and are trying to get a feeling of how tough the fight will be? Or some other reason? (This probably got downvoted because without context it seems like a very random question, so I'm trying to figure out what the real context is.)
Comment: @iMAGEbox It is important to say such things in the question when you submit it. Asking a question without context makes it hard to help, and it makes it more likely to get downvoted or closed, because we don't know *why* you're asking the question.
Comment: im asking because i know all other bosses but now i bought console version so i want to fight him so i want to know is he stronger then other bosses to know what to use in fight
Comment: I'm guessing 1.1 bosses < Ocram < 1.2 bosses.
Comment: @SevenSidedDie ok. is question clear now?
Comment: Well yeah. You can tell because it's not closed anymore.
Answer: Disclaimer I have not played Terraria on the PS3, so this answer is not first hand.
If you can beat the Twins and Skeletron Prime you should not have much of a problem with Ocram, assuming you put some time into crafting weapons/armor from the best available tier.
LevelSave - The Toughest Bosses In Terraria claims that he is actually easier than both The Twins and Skeletron prime when you its possible to fight him. Ocram is #4 on his list. The Twins and Skeletron prime are #3 and #1 respectively.

While compiling my list there were many factors that came into
  consideration. Should all the bosses be considered on the same scale?
  Should they be considered equal on all fronts? In my mind that isn't a
  fair way to rank them, while one is playing in normal mode the gear
  and weapons are clearly inferior to those available in hard mode. That
  being said I decided to consider the bosses in the time that a player
  would first face them.

Some more anecdotal evidence:
A post on the Terraria forums

Masamune1004 write:
I can defeat him by standing in one place holding R1 and aiming up
  with a harp in full hallowed armor, with heart statues but without
  using meteorite/hellstone. Usually no potions either, sometimes one
  greater health potion if the servants don't feel like dropping hearts.
  So basically he can be defeated afk (or afc in this case :p).
Answer: Ocram isn't too much harder than Prime until his second stage. In this stage his damage will be increased,he will shoot lasers a lot faster,and will blast you with demon sickles. I recommend at least Adamandite armor before fighting him.


Is it fine to ask questions about Deep Web?

Question: This is the only forum which could address so many questions that one might have about deep web. Are they are off topic?
Comment: Could you maybe give an example of what type of questions do you have in mind?
Comment: What's the "Deep Web"?  Do I even want to know?
Comment: Tor enables users to access Deep Web, and from what I know it is the only channel which does so. There are things like why does the web addresses look so bad, which is the webpage with best index of websites, etc.
Comment: @weasel-PeterPalfrader: :-) By "Deep Web" we usually mean the web which is not being indexed by standard search engines like Google, Yahoo, ask.com, Bing etc. BTW Tor is not the only channel to access Deep Web (DW). Web servers running as Tor hidden services are just a part of DW. Another part of DW is accessible directly by a normal browser without additional tools, you just have to know the addresses.
Comment: Semantics aside, there are many resources that aren't available directly from the Internet. Generally, each requires some gateway. Such gateways include Tor, I2P and Freenet clients, for example. But there are also various peering arrangements with and among alternate address spaces, isolated (I gather) in various ways from the Internet. For example, one can imagine networks of hidden services. Are they (if they exist) part of Tor? They might be Freenets or Tahoe-LAFS grids. Semantics get complicated here.
Comment: I have mentioned a few things in the first comment. How legitimate are the weapon selling websites, how silk route delivery system never gets caught, but I know by myself these will be off topic. How anonymous one is while surfing deep web is I think synonymous with anonymity while using Tor.
Comment: New, related meta discussion: http://meta.tor.stackexchange.com/questions/90/is-it-fine-to-ask-questions-about-deep-web
Answer: I think that it is OK if is related to Tor. Tor gives access to Deep Internet, but not every questions about "that second network" are on-topic here. You can ask for example about "how to access deep web using tor", but questions about Deep Web in general should be closed. That page is for Tor issues and issues to Tor related.


What to do with dry skin?

Question: I have very dry skin. Specially in winter season I faced this problem alot. I used lotion daily but it is not effected too much. What home remedy should we do for this.
Answer: If your skin is very dry apply a body/facial oil on top of a moisturizer. If your skin is too dry the oil won't absorb.
Apply the moisturizer/lotion/serum and allow it to soak in for ~2 mins, then add 4-10 drops of oil and massage into skin.

What to do with dry skin?


Is a server absolutely safe if the attacker don't know unknown bug?

Question: If a server installed all patches for known bugs and the attacker can't do a 0-day attack, then is the server absolutely safe?
Comment: misconfigurations, default passwords, default code, poorly written code all can be leveraged by attackers and have nothing to do with patches or zero days
Comment: @KDEx Thanks! I think there are many other loopholes this kind. Let's say if the goal of the attacker is to gain control of the server and there is nothing like "default passwords" that people with basic security knowledge would avoid to use...
Answer: The question itself relies on some pretty critical, and invalid, assumptions:

We know who the attacker is.
We know what the attacker does and does not know.
We know that the attacker does not know about zero-day vulnerabilities in our system.
The attacker's level of knowledge and skill is static.
A system can be absolutely safe.

We cannot assume to know who the attacker is.
With very rare exception, if any, it is impossible to know who will be attacking your system in the future. Chances are, you don't even know everyone that's attacking your system now. Therefore, you must do what you can (within reason) to prepare for all possible attackers.
We cannot know what the attacker does or does not know.
The second assumption is very much reliant upon the first to begin with. Even if you do know who's attacking you though, it is the very nature of human beings that one person does not comprehensively or authoritatively know everything that another person knows.
We cannot know whether an attacker knows about zero-day vulnerabilities in our system.
The very nature of zero-day vulnerabilities is that we, as defenders do not know about them. That's why they're called "zero-days" - as long as the attacker is the only one with knowledge of a vulnerability, defenders have had "zero days" to develop or apply patches or configuration changes necessary to mitigate them.
Attackers are always learning and developing new skills, tools, and techniques.
Even if you do know who your attacker is and what he knows, and that his knowledge is limited to only the vulnerabilities that are patched on your system, that does not mean that he will not learn something new in the future. If an attacker has studied your system, and realizes that he does not know of an exploitable vulnerability for the software and updates you have installed, the next thing they'll probably do is start to Google for other vulnerabilities that do apply. If nothing turns up there, they may try analyzing the system and software themselves to develop whole new exploit vectors.
No system can be made absolutely safe.
This is just the raw nature of security. No matter what, there will always be something that can compromise your system. It's our job to just make sure that that "something" requires extraordinary effort or resources, so that potential attackers are dissuaded from even trying. We should also put monitoring and alerting systems in place so that we can see when an attacker is successful and respond quickly and appropriately.
Comment: I understand that there is no invincible shield...I don't know much about security, let me change my wording. If I know 10 bugs, and all of them are fixed on a server, then I can't gain control of the server right (unless there is something like "default password")?
Comment: @shidangai Really, the question is not even valuable in the first place because it is so far separated from reality. See my update to the answer - it also would address your suggested revision.
Answer: Nothing is "absolutely safe" there will always be a way to crack into any system given enough time and resources.
If you have patched all the latest software that's awesome! But that doesn't mean you still don't have to take precautions against weak passwords, spear phishing attacks, or weak code that doesn't prevent vulnerabilities such as SQL injection.
Additionally, you're relying on the premise that there are no 0-day exploits available which misunderstands the concept of what 0-days are. By definition, there is no solution for a 0-day because it is a weakness in a system that remains undiscovered.
Instead of trying to get absolute security, aim to mitigate attacks and develop processes which allow rapid and effective responses to attacks or breaches.
Comment: No worries! Sorry if I posted after a little redundantly, I think I started writing before you accepted a best answer.


What does an atom radiate: a wave packet or a single photon?

Question: What does an atom radiate: a wave packet or a single photon?
Comment: The usual quantum answer is *"Yes?".*
Comment: Sergio, can you please clarify? Do you mean "a wave or a particle"?
Comment: @Sergio:  A wave that exists for a finite time is going to be a wave packet, anyway--the Fourier transform of a wave is only a delta function (i.e., the wave is "single frequency) if the wave has an infinite extent.
Comment: A 'wave train'?
Comment: I think you make a bit of confusion between a photon and a whave PACKET. I don't understand your question fully
Comment: I guess it should be 'wave' or 'wave front'
Comment: I mean "wave packet" - a wave with frequency distibution, or "photon" - single frequency wave.
Answer: An excited atom radiates off a wave packet, that is, an oscillatory pattern of EM field which is effectively localized in space and time. It certainly does not emit the strictly monochromatic plane wave (which is infinite in space and time), nor a pointlike object (a pointlike distribution of a field includes Fourier components with arbitrary large energy). One can even speak of the "shape" of this wave packet: it typically has a sharp front and an exponentially decaying tail.
A separate question is what is the photon? I guess there is no universal answer; the actual thing that we call "the photon" depends on the situation.
When we quantize electromagnetic field, "the photon" means the excitation of the EM field with a fixed energy and momentum. (To be more precise, we introduce a regulator function that decays off at infinity, but then we consider everything in the limit when the regulator function tends towards identical unity. So, for all purposes we still can think of the monochromatic excitation). But when we discuss the normal modes of EM field with non-trivial boundary conditions, for example in a resonator inside a laser, the photons although being monochromatic are not spatially infinite plane waves anymore.
When we talk about emission and absorption of light quanta, which always proceeds in more or less localized wave packets, we usually call these wave packets the photons. In certain cases, for example in astrophysics, we can even speak of the time when a photon was emitted (although this is not a momentary act!).
All these subtle differences become even more delicate when discussing neutrino oscillation. There has been and still is a lot of confusion which originates from unjustified assumptions of how a neutrino is produced and detected (wave packets vs. plane waves, the moment and the position when the neutrino is emitted, etc.). Luckily, the EM field do not mix (at least in vacuum).
Comment: "an oscillatory pattern of EM field which is effectively localized in space and time"? I don't know if "localized in time" is the right expression here, do you mean "for ever time"?
Comment: ''What is a photon?'' See the collection of
articles explaining different current views is in:
    The Nature of Light: What Is a Photon?
    Optics and Photonics News, October 2003
    http://www.osa-opn.org/Content/ViewFile.aspx?Id=3185
Answer: When with "radiate" you mean the radiation emitted from an excited state of an atom decaying into the ground state, then you have a single photon, but its frequency is not known in advance because of the spectral broadening of the transition.


Error installing TeamViewer on Ubuntu 16.04 64-bit

Question: I was trying to install TeamViewer v11.0.67687 (deb 32-Bit / 64-Bit Multiarch) then I got all the i386 dependency error message.
Then installed all the packages manually
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -f

But there is a package that didn't download called libpng12-0, when I try to install it with
sudo dpkg -i Downloads/teamviewer_11.0.67687_i386.deb

it says
Selecting previously unselected package teamviewer:i386.
(Reading database ... 219696 files and directories currently installed.)
Preparing to unpack .../teamviewer_11.0.67687_i386.deb ...
Unpacking teamviewer:i386 (11.0.67687) ...
dpkg: dependency problems prevent configuration of teamviewer:i386:
 teamviewer:i386 depends on libpng12-0.

dpkg: error processing package teamviewer:i386 (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 teamviewer:i386

So I tried downloading TeamViewer with wget but not working.
wget http://download.teamviewer.com/download/teamviewer_i386.deb

Also tried using apt-get instead of dpkg but neither is working
sudo apt-get install ./teamviewer_i386.deb

Even tried to install that f*** library with gdebi but still not working
sudo gdebi teamviewer_i386.deb

Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading state information... Done
This package is uninstallable
Dependency is not satisfiable: libpng12-0

Help :'(
Answer: Not sure if this is too late. You need to fix up all dependencies before installing TeamViewer. The following command fixed my problem:
sudo apt --fix-broken install


A Collection of Custom Post Types Displayed In a Submenu

Question: I have WordPress 4.6.1.  I now have experience with creating custom post types and see them stacked up in the admin UI console.  But how can I create a stack all of my custom post types in a menu so that when I go to wp-admin, I see on the left, a button called My Post Types, and if I hover over it, it shows me all of my custom post types displayed in a list format.
Answer: I'm going to assuming when you say that you "hover over it, it shows custom post types displayed in a list" you mean submenus. The below uses admin_menu to create a blank Parent Menu then we loop through the public post types to display them as submenus:
/**
 * Add an Admin Menu which contains submenus of public post types
 * - https://codex.wordpress.org/Plugin_API/Action_Reference/admin_menu
 * - https://developer.wordpress.org/reference/hooks/admin_menu/
 *
 * @return void
 */
function wpse_q_241760() {

    $post_types = get_post_types( array(
        'public'    => true,
    ), 'objects' );

    if( ! empty( $post_types ) ) {
        add_menu_page(
            'Post Types',           // Page Title ( doesn't matter )
            'Post Types',           // Menu Title
            'edit_posts',           // Capability to view this menu item
            'javascript:void(0);',  // URL ( slug )
            '',                     // Callback Function
            'dashicons-book',       // Dashicon
            24                      // Menu Position
        );

        foreach( $post_types as $type ) {
            add_submenu_page(
                'javascript:void(0);',      // Parent URL Slug
                $type->labels->name,        // Page Title ( doesn't matter in this case )
                $type->labels->name,        // Menu Title
                'edit_posts',               // Cability to view
                "edit.php?post_type={$type->name}"  // URL ( slug )
            );
        }

        remove_submenu_page( 'javascript:void(0);', 'javascript:void(0);' );
    }
}
add_action( 'admin_menu', 'wpse_q_241760' );

The above add_menu_page() needs to be passed some sort of link - since we would have nothing to show at that link ( there's no post_type tied to this page, it's a dummy page ) I've opted to link to javascript:void(0); instead which tells our browser not to navigation anywhere. This allows us to instead hover the menu item and click one of the Post Type links. It also added a submenu of the same name but we don't need it so we remove it at the end of the function call.
The get_post_types() function has a few parameters to filter on if public doesn't work for your case.
Comment: @blackhawk I've updated my answer with a bit more description. I Think the important thing is to view the functions and what needs to be passed to them. The top menu parent "Post Types" is really just a placeholder link to house the actual Post Type submenu links.
Comment: Thank you Howdy, can you give a breakdown of the code, this way I can grow into the knowledge for other future customizations needed.  what I am unsure about is why so  many javascript void actions taking place.  thanks


Videos taken with an iPod Touch (or iPhone 4GS) play upside down on my Windows PC

Question: Anybody has an idea why videos taken with an iPod Touch (or iPhone 4S) play upside down on my Windows PC with Windows Media Player? However with QuickTime, videos are oriented correctly.
Answer: Windows Media Player is either ignoring or misinterpreting the orientation information in the video's metadata.
Since QuickTime better supports the format that your iPhone records in, it makes sense that it's doing a better job.
If you want to use Windows Media Player, your best bet is probably to convert the video into another format that WMP supports better. One app that allows you to do this is HandBrake.
Otherwise, you should be fine using QuickTime, iTunes, or a Mac.
Comment: That's not quite correct. The issue is that Apple uses a non-standard orientation tag in the metadata of the video file. If Apple used the standard properly this issue would not occur. You can buy Quicktime Pro and just export the video.


How are services started in Ubuntu 14.04, Upstart, SysV or a combination of both?

Question: I  have these 2 webservers installed on a development machine and because they both bind to port 80 only one can be running at any given time.
I would like to be able to modify the init startup process so that I can choose which one starts and which one is disabled.
In order to know what I need to do to effect this, I am trying to work out what is actually controlling the startup of these services.
My understanding was Ubuntu 14.04 startup scripts were handled by Upstart and that upstart init scripts were in /etc/init.
But nginx doesn't have a nginx.conf entry in /etc/init it instead has an entry in /etc/init.d - does this then mean Nginx is managed by SysV and not Upstart?
Does that also mean that by default Ubuntu 14.04 (prior to the move to systemd on 15.04) possibly uses a combination of upstart and initV?
Or is it that important system processes only are started by Upstart and individual packages like Nginx may choose either upstart or systemV init?
Answer: Ubuntu 14.04 uses Upstart only, but Upstart runs SysV init scripts, too. See /etc/init/rc*.conf for the Upstart jobs that are responsible for this.
A lot of Ubuntu packages still use SysV init scripts to minimize the differences to Debian.
Comment: thanks for the response. So does that mean Upstart is PID1 - and therefore managing the overall process of script executions -  some tasks/scripts have been replaced by upstart jobs - some are still initV scripts - and in order to get all the things done - Upstart uses both upstart jobs and runs initV scripts?
Comment: Yes, Upstart is PID 1, and is comes with a few jobs which start and stop SysV init scripts when the runlevel is changed, just like a SysV init would do.
Comment: nice one, its pretty cool to understand more about how Ubuntu gets everything running! thanks.


Sharepoint Document Library -- Document Set

Question: How do I save a folder hierarchy in document library in sharepoint server 2010?
Answer: Not sure if you are trying to do this via code or via the user interface. When using the User Interface the easiest thing to do is to click the 'Open in Windows Explorer' option in a document library and drag and drop the folders you need to copy.