Rigging a pendant to a breathing nose

Question: I am trying to rig a pendant to a nose. I want to apply wiggle to the nose while nostrils expand and contract, making pendant move at the same time being also affected by physics.
I have given two parented bones, one called hook the other drop to the pendant which is comprised of two moving parts. the hook(tours object) is right in the center of where the nose cow piercing should go, the drop is the hanging pendant. I parented the objects to their corresponding bones selecting empty groups. Having the armature in edit mode i've duplicated a bone and extruded it several times around the nostrils.
Problems are: bones  only rotate in pose mode. When they rotate they don't morph the surface but rather move the entire object and finally the hook and drop bones are parented to a single bone that when other bones move the hook gets left behind because it parent is fare away.
Thank you
Comment: Is it possible to give the pendant its own rig parented to a vertex group on the nostril?
Comment: Thank you for that idea. I will look into vertex group and write about it once I figure it out
Answer: To fix the issue I had with bones not morphing objects surface I simply deleted the armature and added it again and parenting the object to the armature with automatic weights. Regarding the so called hook (which is a torus) I un-parented it but I still have issues leaving it in place

Rigging a pendant to a breathing nose


Providing a ground to old 2-wire connection in a detached garage

Question: I just moved into a house built back in 1961.  The house was totally rewired in 2018 so is up to code.  The garage is detached and has two old 2-wire, 15 amp 120 volt circuits with no ground wire coming from the 100-amp main panel in the house. To bring the garage up to code with a ground wire, can I simply add a ground rod next to the garage and use that as my AC ground?
Comment: Are the circuits to the garage in conduit?
Comment: Yes, do you know what wiring method was used to run the garage circuits?
Comment: .. and if those circuits to the garage happen to be in _metallic_ conduit, can you verify it is electrically continuous end-to-end? If you're comfortable with removing the "dead front" face of the circuit breaker panels at the house and detached garage, share a few photos of their interior and immediate surroundings with us. That'll help us provide suggestions tailored to your circumstances.
Comment: If you install a GFCI breaker per circuit (2?) in the house panel then you'll be good to go; hopefully they're not MWBC'd. You'll notice in your house panel that your neutral and ground is bonded so I don't believe your ground rod idea is up to code.
Answer: The Code says you can simply replace the receptacles with GFCI's, but you can't connect to a ground or interconnect the grounds:

406.4(D) Replacements (2) Non–Grounding-Type Receptacles. Where attachment to an equipment grounding conductor does not exist in the receptacle
enclosure, the installation shall comply with (D)(2)(a), (D)(2)(b), or
(D)(2)(c).
(a) A non–grounding-type receptacle(s) shall be permitted to be
replaced with another non–grounding-type receptacle(s).
(b) A non–grounding-type receptacle(s) shall be permitted to be
replaced with a ground-fault circuit interrupter-type of
receptacle(s). These receptacles or their cover plates shall be marked
"No Equipment Ground." An equipment grounding conductor shall not be
connected from the ground-fault circuit-interrupter-type receptacle to
any outlet supplied from the ground-fault circuit-interrupter
receptacle.
(c) A non–grounding-type receptacle(s) shall be permitted to be
replaced with a grounding-type receptacle(s) where supplied through a
ground-fault circuit interrupter. Where grounding-type receptacles are
supplied through the ground-fault circuit interrupter, grounding-type
receptacles or their cover plates shall be marked "GFCI Protected" and
"No Equipment Ground," visible after installation. An equipment
grounding conductor shall not be connected between the grounding-type
receptacles.
Informational Note No. 1: Some equipment or appliance manufacturers
require that the branch circuit to the equipment or appliance includes
an equipment grounding conductor.
Informational Note No. 2: See 250.114 for a list of a cord-and-plug-
connected equipment or appliances that require an equipment grounding
conductor.

404.6(D)(2)(a) doesn't apply because (D)(3) says receptacle replacements must be GFCI where the code elsewhere requires protection, and receptacles in garages now require protection.
If a route exists you could instead add a ground wire back to the grounding electrode system for the house, and then a ground wire would exist and then you could connect the grounds.

250.130(C) Nongrounding Receptacle Replacement or Branch Circuit Extensions. The equipment grounding conductor of a grounding-type
receptacle or a branch-circuit extension shall be permitted to be
connected to any of the following:
(1) Any accessible point on the grounding electrode system as
described in 250.50
(2) Any accessible point on the grounding electrode conductor
(3) The equipment grounding terminal bar within the enclosure where
the branch circuit for the receptacle or branch circuit originates
(4) An equipment grounding conductor that is part of another branch
circuit that originates from the enclosure where the branch circuit
for the receptacle or branch circuit originates
(5) For grounded systems, the grounded service conductor within the
service equipment enclosure
(6) For ungrounded systems, the grounding terminal bar within the
service equipment enclosure.

Any splice must be in a junction box.
Answer: If the connection for the garage subpanel is in metallic conduit, that serves as the ground.  Visually inspect the connection from the main panel that leads to the subpanel, and the connection that comes up into the subpanel.
If they are PVC or something other than metallic conduit then it's not grounded.
If there is metallic conduit on both ends then you need to do a continuity test with a multimeter to verify a continuous ground path.  Sometimes people will stub up with rigid conduit and changeover to PVC underground because it's cheaper and allowed by code if a ground wire is ran.
Continuity test.  Turn off all power to the subpanel and follow proper safety procedures when working in a live panel.  Pick a wire that heads out to the subpanel and disconnect it from both ends.  On one end secure the wire to the ground bar. Turn multimeter to resistance/continuity/ohm symbol.  On the other end, touch one lead to the wire you disconnected and the other to the ground bar.  If there's a continuous path then the meter will chirp.  Reconnect the wires and turn power back on.


Can a simple cable convert HDMI output to VGA?

Question: One may buy a simple HDMI-to-VGA cable, or an HDMI-to-DVI cable.  Example: on Amazon. However, my vague knowledge is that these cables only work for video cards that have special support for this function. Does the Raspberry Pi support such things?
Is there any easy way to use the Raspberry Pi on a screen that only takes VGA input without a converter box? What kind of conversion to other video outputs would the Raspberry Pi hardware support, and what cables or other equipment would be necessary for this?
Comment: I remember reading somewhere on Wiki that passive HDMI-DVI adapters should work but HDMI-VGA requires an active converter.
Comment: @Jivings - That's odd, HDMI is just single link DVI-D with a different connector. Are you sure it's not your monitor failing to sync to the resolution used by your RPi?
Comment: Would a composite-VGA be a better option?
Comment: I think the product you linked to is designed to connect a PC's VGA *output* to a monitor's HDMI *input*, i.e. the opposite direction to what you want.
Comment: I think I'm finding a lot of products incorrectly sold as a HDMI to VGA cable, although as @finnw points out, a closer reading of the specs shows that this is backwards.  This helps to clear up the situation.  More expensive true converters can be found.
Comment: @MarkBooth Could be. I'll experiment a bit later on.
Comment: Might be worth looking [here](http://raspberrypi.stackexchange.com/questions/484/what-are-the-pros-and-cons-of-connecting-to-a-vga-monitor) for more info on connecting to VGA.
Comment: Here's a [quick tutorial](http://www.youtube.com/watch?v=1BTfSp6RnsM) explaining exactly how to enable VGA output via a $5 cable I brought.
Answer: No.
The reason a DVI-to-VGA adapter works on your PC & laptop is that DVI includes analog (RGB) pins.  The adapter is passive; It just connects the red analog output of the PC to the red analog input of the monitor, ditto for green and blue.  They are included on most PCs and laptops for backward compatibility.
HDMI-to-DVI cables are also passive, but they carry digital signals only.  The analog RGB signals are missing, but that does not matter as the DVI monitor does not need them.
HDMI contains no analog signal so it is not possible for any combination of passive adapters and/or cables to convert it to VGA.
Active adapters work because they use DSPs and DACs to convert from one standard to the other, but of course they are more expensive than passive cables.

Related forum thread: http://www.raspberrypi.org/phpBB3/viewtopic.php?f=30&t=8125
Comment: @AlanSE - The important thing about that [Amazon item](http://www.amazon.com/dp/B004S5H30I) is the **NOTE: Your Video card must support digital signal output through VGA port function**. I don't know of any video cards which support outputting VGA over pins of a HDMI connector, and a quick google search couldn't find any.
Comment: @AlanSE, dedicated HDMI to VGA cables will work, as they contain the necessary circuitry.  But I assumed that was not what you meant because you said "simple cable."
Comment: Good answer, want to select it.  One small bit: what *is* an HDMI to VGA cable and why will it not work with the Raspberry Pi?
Comment: What I meant is a simple cable like the one I linked to in the question.  This cable does not contain the necessary circuitry.  It works for some graphics cards and people are going to keep being confused about it unless it's clear what makes those different and why that does not apply for the Raspberry Pi.
Comment: Got a TV receiver that has a passive VGA trough HDMI mode, guess it just puts VGA signals trough the cable with an HDMI connector on one end and a VGA connector on the other.
Comment: What about adapters like these, are those active, even if they dont require a power supply? https://www.amazon.de/Splaks-Vergoldete-Konventer-%C3%9Cbertragung-Chromebook/dp/B01IEH8FES/ref=sr_1_9?ie=UTF8&qid=1550710988&sr=8-9&keywords=hdmi+vga+adapter
Answer: The Neewer HDMI to VGA converter lead from Amazon does indeed work with the RPi but as has been reported elsewhere you have to do a bit of fine tuning in the /boot/config.txt file.
I still cannot get my Samsung 943N to see anything but a simple Dell generic 15" VGA monitor works fine. One problem seems to be that the default output signal level is not sufficient so setting config_hdmi_boost=4 seems necessary. The monitor also complains that it wants 1024x768 at 60Hz which is hdmi_mode=16.
The article at http://elinux.org/RPi_config.txt also suggests that the hdmi_group values documented should be 0 and 1 not 1 and 2 and indeed I needed to change hdmi_group to 1. So my current file looks like:
hdmi_drive=2
config_hdmi_boost=4
hdmi_group=1
hdmi_mode=16
hdmi_force_hotplug=1
disable_overscan=0

Modification for Dell 15" Monitor with Debian GNU/Linux 6.0 OS
I found that it would only work with:
hdmi_group=2
Raspberry Pi User Guide by Eben Upton has the video modes in the appendix.
The user guide lists the hdmi_group values as 1 or 2.
Comment: You write that it needs some tuning? Does it need that in order to work at all, or does it need the tuning just to get a better picture? I am trying to connect my laptop/Raspberry to a monitor with a similar active adapter, and there is simply no connection.
Answer: The "simple" HDMI to VGA cables will not work quite simply because HDMI signals are pure digital and VGA is analogue. I made the mistake of buying a very cheap cable from Amazon which did not work for reasons that are clear to me now. I am awaiting the delivery of a "Neewer Black HDMI Input To VGA Adapter Converter For PC Laptop" from Amazon which I am confident will do the job. It was less than £15. I will post my findings here.
Comment: Has that 'cable' arrived yet? It has been some years now....
Answer: I am using this cable to connect my Raspberry Pi to an HP monitor (with DVI input).
A couple of notes: You can not then connect another cable or adapter to change this to a VGA input. Secondly, if converting the Raspberry Pi's HDMI to DVI be careful of the DVI connector; there is more than one type and one size does not fit all (I learned this lesson the hard way).
Comment: What type of DVI input did you have (like DVI-D) and was it a single link or dual link cable?  I have an HP monitor myself and will need to get a cable for it.  Is the selection based entirely on the monitor, or does the RasPi HDMI specs have anything to do with it?
Comment: @AlanSE The DVI adapter was a DVI-I, and the monitor wanted a DVI-D. The specs for the pi had nothing to do with it simple problem of pin/connector geometry. The cable I linked to in my answer works like a charm and was far cheaper than most local alternatives even with the expedited shipping included.
Comment: I still don't understand something.  Why would you get a DVI-I adapter?  And since the cable to your DVI monitor should have a male connector, and since the DVI-I has more connections than the DVI-D, you shouldn't physically be able to plug it in.  The Amazon link you give isn't clear in the description, but the picture looks like DVI-D.  This discussion might be better suited for a DVI question, but I'll see about giving an update when I do this myself.
Answer: It may be a problem with your configuration file. Try deleting it, and if that doesn't work try changing it to this.
# config.txt
hdmi_group = 2
hdmi_mode  = 4

A list of available properties for the Raspberry Pi can be found here.
Comment: probably because it will not work.  The OP is (if I understand correctly) asking about a combination of a HDMI->DVI cable and DVI->VGA adapter.  Your solution will work only for a DVI monitor.
Comment: I had in mind more of HDMI->VGA as opposed to HDMI->DVI->VGA although that's not important.  Your claim that it can use a DVI monitor with passive cables is useful and relevant to the question, as well as the claim that it can not work with a VGA monitor without conversion equipment.  I think we are close to consensus on that.
Comment: Why is this downvoted?
Answer: It is important to not just give up when the adaptor/converter doesn't seem to work out of the box.  Most probably there will be converters which won't work and VGA displays which won't be supported, but my feeling is most of them work just fine - with some extra steps.
If you want to check whether yours has chances, use an empty /boot/config.txt file and add hdmi_safe=1 to it.
While this won't give you the best resolution, it probably will get you to the login prompt.
After that you can start with tweaking it further until you get the most out of your monitor capabilities.
You can get some useful information about your monitor by entering these 3 commands:
/opt/vc/bin/tvservice -m CEA
/opt/vc/bin/tvservice -m DMT
/opt/vc/bin/tvservice -s
Use the Raspberry Pi Video Modes reference link to yield the above results and finetune.
After rebooting the Pi, your monitor firmware might show errors like 'out of sync' or 'resolution not supported'.  Lower the resolution and/or refresh rate and try again.
After testing I got good results even with small Chinese $3 adaptors connected to the cheapest monitors available in the shop.  Out of the box the converter gave a blank screen with the monitor going into powersave mode seconds after.  After following the above steps my /boot/config.txt now shows:
hdmi_group=1
hdmi_mode=16
Answer: No +5v supply from setop box like tatasky dishtv  hd box in hdmi output so converter not work. it can work properly after supply +5v in pin no.2of hdmi port.
Comment: Can you expand on this answer please?  I don't understand what you're trying to say.


Capillary tube of insufficient length

Question: I was wondering if we have a very thin glass tube placed in a tub of liquid and the portion of the tube outside the liquid is lesser than the height to which the liquid can rise because of capillarity, what will happen? Will the liquid overflow?
Comment: Duplicate of: http://physics.stackexchange.com/q/89223/
Comment: Related: [How is the water meniscus at the edge of a capillary tube?](https://physics.stackexchange.com/q/89223/238167)
Answer: No, it won't overflow.  That should be obvious since doing so would create a constant flow, constantly using energy, but without any energy input.  Put another way, that would be a perpetual motion machine, one you could actually extract free power from.
The same force that pulls the water along the inside of the capillary tube also holds it there when it reaches the end.  This force doesn't just pull upward, it pulls the water along the glass.  At a certain height, the weight of the water column ballances this pull.  In that case the pull is upward since there is water below but not above.
In your case, there is nothing to pull the water column higher when it reaches the end of the tube, so it just stays there.  The pull only exists at the boundary between water and not-water.  The bulk of the water in the tube isn't being pulled any particular way.
Answer: It is explained very nicely by Olin Lathrop.
The surface tension is an inter-facial force. The surface tension force pulls the liquid tangential to the wall of the capillary. When a capillary is dipped in water, it starts rising up due to pulling force from the solid-vapor interface. If the capillary has insufficient length, as the water rises it accelerates till the end of the capillary. When it reaches the edge of the capillary, water would gain some kinetic energy and due to inertia it slightly overshoots the edge of the tube. Then water surface bulges out due to which the tension at the solid-vapor interface turns downward which tries to pull the water column downward.
The liquid column will make some oscillations and finally after sometime the oscillations dampen out due to viscous effects. At steady state, the water column will fill the entire capillary and the radius of curvature of the minuscus will be just about adjusted such that the vertical component of surface tension force would balance the weight of water column.
Answer: The equation for capillary rise can be represented as
$$h=\frac{2T}{rρg}\cosθ$$
if the height of the capillary tube is less than the height calculated by this equation,the water comes up to the height of the capillary tube and stops there.then the value of $θ$ (angle of contact) keeps changing until the equation balances out, i.e., the meniscus of the liquid becomes more convex until it attains equilibrium.
Answer: In the formula for capillary rise only θ is a variable. So when the capillary tube of insufficient length is kept then the θ will change accordingly so that capillary length h comes out to be height of the capillary tube. Limiting case is when θ = 90 degrees when height of capillary tube is 0. This is meaningless so this is not possible. Concluding thing is the angle increases a bit to adjust accordingly..
Hope it helps
Answer: As if you will see that a capillary tube kept in a beaker filled with water,so the water level rises but if the length of the capillary tube is insufficient than the angle of cos theta will be of 90 it means that its just impossible,and the surface tension force will be just stopped.
Comment: I don't really think this adresses the question well at all.
Answer: The water will never overflow . if the tube is of insufficient length , the radius of curvature of the liquid meniscus goes on increasing , making it more and more float till water is in equilibrium.
Answer: As soon as fluid reaches maximum height it's angle of contact changes  this leads to change in shape of meniscus it may or may not overflow depends upon fluid
Comment: Please, read the answer of @olin-lathrop and if you state that it can overflow, put arguments, why he is wrong with the energy conservation concept

Capillary tube of insufficient length


Is there any Lumiosity City map?

Question: I'm searching such map with avenue names and stuff like cafes, houses and everything interactive. I'm too often lost in this city...
Comment: When you enter Lumiose city, you can see a big map of the city in the upper left corner of the upper screen. The highlighted part is where you're at. That's the closest I've found to a map. It disappears quite quickly, but you can make it reappear by changing your location on the map, like switching between alley and outer ring, for instance.
Answer: Found a Lumiose City Map. Looks pretty complete.

Large Version
Answer: Lumiosity City
Short baisic things list
South Boulevard

Pokemon Lab
PR Video Studio
Coiffure Clips
Route 4 and 5

North Boulevard

Battle Institute
Hotel Richissime
Lumiose Station
Route 13, 14 and 16

Vernal Avenue (South)

Botique Couture
Friseur Furfrou
Herboriste
Cafes
Stone Emporium

Estival Avenue (South)

Loto-ID Station
Cafe with Roller Skaters (Tricks)
News

Autumnal Avenue (North)

Poke Ball Botique
Juice Shoppe
Restaurant Le Yeah (Two Stars)

Hibernal Avenue (North)

Restaurant Le Wow (Three Stars)

Centrico Plaza

Prism Tower
Phil the Photo Guy

Map description

Orange is big route without name.
Black are shortened avenues.
Other colors are Plazas.
Comment: I think it's actually Rouge (French for Red).
Comment: Definetily because the rest are all colors as well.
Comment: I think it's the word Rogue taking revenge for all the times it was misspelled as Rouge.

Is there any Lumiosity City map?


Install Elementary OS on existing duel boot system

Question: I currently duel boot another LInux Distro with Windows 10. I want to replace the existing Linux distro with elementary OS 6.  Elementary OS doesn't appear to see the duel boot setup.  What's the best way to install elementary OS over the existing Linux distro and maintain my Windows 10 duel boot.  Below is a screenshot of my current partitions.
Answer: TL;DR Backup your important files, then install the OS to your custom partitions. If the elementary OS install wizard cannot configure the boot loader correctly, try installing and  running Boot-Repair from a live boot session.

From your screenshot, it looks like the former Linux install was likely on /dev/sda6, and your PC was previously prepared with a UEFI partition, but it might not be in use right now (it doesn't have the 'boot' flag toggled.)
Before proceeding, make sure that you back up anything important on your hard drive, and confirm whether or not your device supports UEFI and has it enabled. Also, please note that since you're using MBR with an extended partition, I'm not sure whether any of the following I have to say applies or not. As of late, I always use GPT where I can instead of MBR.
When booting from the elementary OS 6 disc, I think you'll want to perform a custom disk install and target /dev/sda6 at the / mount point. If you don't target a specific partition for /boot /swap or /home, then I believe it'll just install everything into one simple partition just fine.
/dev/sda5 can remain mounted to /boot/efi, but you may need to toggle the 'boot' flag on it before starting through the elementary OS installer.
For my own Dell laptop reinstall from elementary OS 5 to 6—also a dual-boot system with Windows 10—I custom configured /boot, /, /home, and /swap partitions and ensure that I linked them appropriately during the installation wizard.
The installer appeared to finish copying over all of the OS contents to the okay, but it failed to write the boot loader correctly. I had UEFI enabled and Safe Boot disabled. Post OS install and a reboot confirming that the boot loader didn't write correctly, I ran Boot-Repair from another live-boot disk, fixed it up automatically, and rebooted, and now everything works fine.


Setting web.config properties during build (not through publishing)

Question: I'm trying to deploy an app using a Web Setup Project. The problem I'm running into is that the web.config file is never transformed. According to this post it's by design that transformation only takes place during a publish. How do I get the web.config properties to update correctly if building the Setup Project in turn calls the other assemblies build command?
Answer: I fixed it by adding a dummy web.Template.config file like Andriy K suggested in this post, and then calling TransformXml during my BeforeBuild event like so:
<code><Target Name="BeforeBuild">
<TransformXml Source="$(WebFolderName)Web.Template.config"
              Transform="$(WebFolderName)Web.$(Configuration).config"
              Destination="$(WebFolderName)Web.config" />
</Target>
</code>
Answer: The simplest option is to install a command-line xslt utility and launch it in the post-build action of your project. You could also use one of the many MSBuild XSLT tasks and add it into the .csproj file. (It's just an MSBuild script file; there are comments already in there near the bottom explaining how to customize the build.)
You could also perform either of these steps in the pre-build action of your setup project, instead of the post-build action of your web application. If you also use the publishing wizard, this second option may work better as it won't interfere with the normal XSLT transforming going on in the publisher.
Microsoft XSLT command-line utility: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=2fb55371-c94e-4373-b0e9-db4816552e41&displaylang=en
Example MSBuild XSLT Task: http://www.arlt.eu/blog/2007/10/01/msbuild-xslt-task/


Django: How to reuse Custom user model - inherit or extend?

Question: I have different apps in my django project. I want to keep an independent app for auth&auth that is reused in all apps. The auth&auth app is one app with my basic custom user model. This user needs to log in with email so I am inheriting from AbstractBaseUser instead of extending the User class. Now in all apps the login is same way, basic user attributes are same; but some apps add additional fields like 'salary', others use the model as is. So what is the best way to reuse the Custom User model I created in my login app? If I inherit the concrete class, I'll have 2 tables. If I declare the Custom User class abstract, how will I use its functionalities, roles and permissions?
Comment: It sounds more like you need to modify the authentication login step than your user models.. is that an option?
Comment: Thanks for responding Sayse, I'll have to say no its not though, since then I'll have to define the user model everywhere, just for one or two extra columns in few places.
Comment: define your user model somewhere and import it everywhere else ?
Answer: I think the best way to achieve what you are asking for is:
class Learners(models.Model):
    user = models.OneToOneField(settings.AUTH_USER_MODEL, on_delete=models.CASCADE, unique=True)
    nick = models.CharField(max_length=12, unique=True)
    #Many to Many relationship with course
    courses = models.ManyToManyField(Course, blank=True)

    def __str__(self):
        return self.user.get_full_name()

Where the AUTH_USER_MODEL is set to the Custom User model, inheriting from AbstractBaseUser, that you created, like this : AUTH_USER_MODEL = 'courseSystem.MyUser' in settings.py for the main Django project. In my example courseSystem.MyUser is the Custom User Class defined.
I am sharing this from a similar situation you have described above, that I am working on.
In the above example, if you were to make the custom MyUser class as abstract and then inherit the Learners class from it:
class Learners(MyUser):

then Learners class would no longer be a models.Model type class but the concrete User class for that app, and in each case i.e., for each such class ineheriting from the abstract MyUser class, you would have to overload the necessary members of MyUser required for a concrete user class for Django. Also since you are using AbstractBaseUser and not extending on default User class, you would have to define custom User forms, and User Managers for your custom user class. So if you have a concrete MyUser class, as in the example above, you can define the custom User Manager and User Forms for MyUser once, and keep one-to-one relationship to it from your models in different apps. But if you make the MyUser class as abstract, you wouldn't define User Forms and User Managers for MyUser, but separately for each of your apps where you form a concrete user class by inheriting from this abstract Custom User class.
https://docs.djangoproject.com/en/1.9/topics/auth/customizing/


How to store orginal frame of UIView subclass loaded from storyboard automatically

Question: I have a subclass of UIView which is has a property called originalFrame.
I want this class to store the original it's original frame value after it loaded from the storyboard it is apart of.
I have overridden the awakeFromNib method:
-(void)awakeFromNib
{
    self.originalFrame = self.frame;
}

This works if the view of the view controller it is apart of is not resized right after to fit the screen size.
However, the view controllers in my storyboard are all for the iPhone 4-inch screen, so when the app runs on an iPhone 3.5 inch screen, awakeFromNib is called before the view controller's view is resized to fit the 3.5 inch screen. If my subview is not anchored to the top, then the originalFrame property won't reflect its frame after the resize.
I was able to override layoutSubviews to get the frame property after the view controller's view was resized, but this method is called other times too and I have no way of knowing if it is for the initial resize to fit screen, or something else.
Is there any way to do this without having to set this property manually on a case by case basis in the viewDidLoad method of the view controller?
Answer: You can check if the value is already set if you set it in awakeFormNib to CGRectZero and check in layoutSubviews if it is CGRectZero. Only set the frame in layoutSubviews if it is CGRectSubviews.


How to validate a drop down list

Question: How can I validate a drop down list?
I have a "Material Requested" column and a "Issued" or "Returned" column.
If a item gets requested we choose issued.
I want to make sure the Item is returned before it get issued again.
Basically, I want to enforce unique values on the "Material Requested" Column
Answer: That means, you want a "Material Requested" to be able to be issued only after it is returned.
You can enforce unique values for "Material Requested" column. This feature prevents users from duplicating data.

If user wants to issue/return the existing "Material Requested", he can only edit the item and modify "Issued/Returned" column to set the status. So that, user cannot issue "Material Requested" again before it get returned.
Comment: The "Material Requested" is a multiple choice, Drop down.
When I enforced the unique values it doesn't let me issued anything unless I returned the previous material.

How to validate a drop down list


When does a logistic regression model have a unique solution?

Question: Mathematically speaking, for which data does a logistic regression model have a unique solution?
Comment: Though I don't have it handy, I believe that Agresti, *Categorical Data Analysis*, 2nd ed. provides references to the literature on uniqueness of logistic regression coefficient estimates. As the answers point out, if your design matrix is not full rank, there is no hope. On the other hand, such situations arise often in applications of logistic regression, and often simple reformulation of the model can eliminate these redundancies.
Comment: I don't understand the ambiguity.  Are you saying "data" might be independent or dependent (response) variables?  To me it is both.  A logistic model is a model trying to minimize error between a function of independent variables and the response.  All of those are data into the model.  Please clarify the different interpretations you are seeing.
Comment: What do you mean?  There's an infinite number of possible data sets that could give rise too any arbitrary logistic regression model.  When you get a probability out of a logistic regression model, this is only unique when you have one feature.
Comment: while it may seem annoying to require a more verbose question, in general, being explicit will lead to faster and more accurate responses.
Comment: @M. Tibbits is correct, as the various replies and comments show: several quite different interpretations of your question are possible.  Please clarify, because an ambiguous question has little value and would need to be closed.
Comment: @cardinal do you have a reference in Categorical Data Analysis where the uniqueness is discussed?
Answer: The solution of logistic regression is a solution of maximization of certain function, namely log-likelihood:
$$\sum_{i=1}^ny_i\log p_i+(1-y_i)\log(1-p_i),$$
where
$$p_i=\frac{\exp(\beta_0+\beta_1x_{1i}+...+\beta_kx_{ik})}{1+\exp(\beta_0+\beta_1x_{1i}+...+\beta_kx_{ik})},$$
and $(y_i,x_{1i},...,x_{ki})$, $i=1,...,n$ is the data.
So mathematically speaking the unique solution of logistic regression exists for given data set if the log-likelihood has a unique maximum. If I am not mistaken full rank of matrix $X=[1,x_{1i},...,x_{ki}]$ is necessary for that. For more mathematical conditions you might look into iterative reweighted least squares, since maximisation of log likelihood function for logistic regression is a special case of IRWLS.
Comment: (+1) I'm not sure I would call maximization of the log-likelihood in logistic regression a special case of IRLS. Certainly, though, IRLS can be used as a method for performing the maximization. Logically, it seems, the maximization of the function and the *algorithms* for achieving this are logically different concepts.
Comment: Calculate the hessian of the log likelihood. In order for solution to be a maximal solution, the hessian needs to be negatively defined. Rank condition for the design matrix would translate to rank condition for hessian, i.e. hessian would not have a full rank if the design matrix does not. That is a general idea.
Comment: The log likelihood in logistic regression is a concave function of the parameters.  A consequence is that the set of $\beta$ that maximizes the likelihood form a convex set. Even if the matrix of covariates has full rank, depending on the values of the *responses*, I think in some cases it may turn out that the log likelihood is not *strictly* convex. In that case, unless you have strict convexity at a point of optimality, the solution may not be unique.
Comment: It seems to me this reply does not answer the question, which is to characterize the *data* for which the solution is not unique.  (I suspect a succinct characterization is not available, but one can say some simple things that characterize certain kinds of data that are sure to have non-unique solutions.)
Comment: @whuber: It seems to me this response (and @Nick's) gives at least a *partial* answer to the question. The structure of the design matrix certainly plays a role in uniqueness or lack thereof of the coefficient estimates. As I think we both allude to, I'm pretty sure it's not a *full* characterization though, as the observed responses should also play a role.
Comment: how is this different from how uniqueness is induced in least-squares or ridge regression? There it seems clear what the conditions are and why, but the log and the sigmoids make it very unclear to me how the rank plays any role at all...can you clarify this?
Comment: Why is full rank necessary for a unique minimizer?
Answer: I believe you are looking for the concept of orthogonality of the covariates. As soon as one of the covariates can be written as a linear combination of one of the others, you will not have a unique solution.
As an extreme case: say you have 2 covariates, and one is (in your dataset) always the double of the other, then both
$$logodds(outcome)=\beta_0+\beta_1 X_1$$
and
$$logodds(outcome)=\beta_0+\frac{1}{2}\beta_1 X_2$$
Will yield the same results (regardless of $\beta_1$), and of course there are lots of other solutions.
Comment: Instead of "orthogonality", the concept you are describing is usually referred to as *linear (in)dependence*.
Comment: (+1) Nice simple demonstration of an example of when uniqueness doesn't hold.
Comment: how is this different from how uniqueness is induced in least-squares or ridge regression? There it seems clear what the conditions are and why, but the log and the sigmoids make it very unclear to me how the rank plays any role at all...can you clarify this?
Comment: The claim here is that if covariates are linearly dependent, then the solution will not be unique. That is interesting. Is the converse also true, that if the covariates are linearly independent, then the solution is unique?
Comment: Note this claim (linear independence) is equivalent to the one in the @mpiktas's answer: full rank of the matrix X. (I think that's the design matrix.)
Answer: I think an interesting point is, that when the data is separable there should be infinite solutions. But if u use GD you converge to the max-margin solution (intuition I have is that GD for linear regression when its overparametrized converges to pseudo-inverse which is min-norm which is max margin since margin is sometimes related to 1/w). So in a way, its like having a unique minimizer. Even though we never truly get there, we do converge to it. You can check this out here:
[1710.10345] The Implicit Bias of Gradient Descent on Separable Data (https://arxiv.org/abs/1710.10345)
intuitively if you look at the gradient:
$$ \nabla_w l(w) = \frac{1}{N} \sum^N_{n=1} \frac{y^{(n)} x^{(n)}}{ 1 + e^{y^{(n)} w^\top x^{(n)}} }$$
since the weights increase so does the score and thus the denominator of the above. But the weights increase "sort of linearly" while the decrease in the size of the of the gradient is exponential (as seen above). So GD stops updating "pretty soon". Or at least thats the ay I sort of understand it at a high level. For real answers, refer to the paper of course.
Therefore if the data is separable and you use GD you converge (approach) to the max-margin solution for unregularized logistic regression, which is unique.


How to inspire tears in davening?

Question: Rebbe Nachman said that it is especially powerful to allow tears to flow during the Amidah. How does one come to tears? What thoughts should one have while davening to allow tears to flow in order to open The Gates?
Comment: Rebbi Nachman also says to make sure to not try to force tears rather let them flow naturally or if they don't come to let it be.
Comment: לענין התבודדות ושיחה בינו לבין קונו ואמירת תהלים ותחינות ובקשות, טוב מאד כשזוכין לאמרם בלב שלם באמת, עד שיזכה לבכות לפני השם יתברך, כבן הבוכה לפני אביו. אבל אמר, שכשהאדם אומר תחנות ובקשות וחושב בלבו ומצפה שיבכה, זאת המחשבה אינה טובה, והיא מבלבלת גם כן את דעתו, כי מחמת זה אינו יכול לומר הבקשות בלב שלם בשלמות.
Comment: Is this _R' Nachman_ of Breslov? You might wish to [clarify in the question](http://judaism.stackexchange.com/posts/5489/edit).
Answer: I remember hearing a story about the six day war when the Kosel was recaptured by the Israeli army and some people went for the first time in years. There was a soldier there crying. His friend who was with him asked him why is he crying. He answered "Ani Boche Al Ze Sheaini Yodea Al Ma Livkot" I am crying since I do not know why to cry.
Answer: Remebering your Aveiros the Churban of Yerushlayim and the multipile other Churbonos the Multiple sick Children, with cancer and the like, trying to relate to The Scheinahs Tzar in Golus and all of Human suffering in General.
Comment: But during _sh'mone esre_ one should be concentrating on what he's saying, no? Or did you mean "your Aveiros" while saying "_ki chatanu_", "the Churban of Yerushlayim" while saying "_uv'ne osah b'karov_", "the multipile other Churbonos" while saying "_r'e na v'onyenu_", "the Multiple sick Children" while saying "_l'chol makosenu_", etc.?
Comment: ...And animal suffering.
Answer: I typically try to focus on the level of humility described in the Gemara (Masekhet Hullin 89A):

I bestowed greatness upon Abraham, yet he said to Me, "I am but dust and ashes"; upon Moses and Aaron, yet they said: "And we are nothing"; upon David, yet he said: "But I am a worm and no man".

If these giants of Jewish history were "dust and ashes", "nothing" or "[worms and not men]", how much less significant am I, in all of my puny mitzwot / 'aveirot, compared to these indescribably righteous figures? This typically brings me to/near tears and awakens in me a newfound love of HaShem for having given me the free gift of life.

How to inspire tears in davening?


ASP.NET MVC authentication using custom database instead of ASPNETDB?

Question: I already have a User table in my primary application database with an email address (which will act as the user name) and a password. I would like to authenticate using my database instead of the default authentication database (ASPNETDB).
Questions:

Is this a bad idea? Is it a huge can of worms to use my own DB for authentication?
How much work am I adding by doing this? I already have code for hashing the password and a query that will check if the email and password match the DB. So, I wouldn't be starting from scratch.
What would I need to do to use my database instead of ASPNETDB? I'm hoping this can be described in a few simple steps, but if not, could you point me to good source?

Update
I'm still looking for a little more detail here on my third question. Do I need to write my own MembershipProvider? What changes do I need to make to my web.config file? Will the [Authorize] attribute still work if I write my own solution? Can I use the automatically-generated AccountController with some minor modifications or do I basically need to rewrite the account controller from scratch?
Answer: It's quite simple, you need to derrive MembershipProvider and implement the ValidateUser method. Take a look at this post. I'm using custom membership provider with Postgres and MVC just fine.
Comment: I read in another stackoverflow post that we need to implement IActionFilter to do custom authentication.Which is the correct way?
Comment: @James FWIW here is a google cached link: http://webcache.googleusercontent.com/search?q=cache:-Os-ZJxfa_QJ:www.hurryupandwait.io/blog/implementing-custom-membership-provider-and-role-provider-for-authenticating-asp-net-mvc-applications+&cd=1&hl=en&ct=clnk≷=in
Answer: I'll answer your updated questions:

Do I need to write my own MembershipProvider?

If you (a) want to continue using Forms Authentication, and (b) have an authorization table structure that doesn't follow the same conventions as the ASPNETDB, then yes.  If you don't need FormsAuth (see below), then you can do away with the MembershipProvider entirely, but I wouldn't recommend it. Or, if you're using the exact same security tables as ASPNETDB but just want to point it to a different database, you can continue using the default provider and simply change its configuration.

What changes do I need to make to my web.config file?

If you are using your own custom MembershipProvider, then you need to register it in the <providers> section of the <membership> element and change the defaultProvider property.  If you are using the standard AspNetSqlProvider then you probably just need to change the connection string.

Will the [Authorize] attribute still work if I write my own solution?

Yes, if you stick to Forms Authentication (either use the AspNetSqlProvider or write and register your own membership provider).  No, if you abandon Forms Authentication (again, not recommended).

Can I use the automatically-generated AccountController with some minor modifications or do I basically need to rewrite the account controller from scratch?

You should rewrite the AccountController anyway - don't leave demo code in a production app.  But if you must - yes, the AccountController will work under the same conditions as above.
Comment: `Authorize` ***attribute*** or `UserAuthenticationFilter : ActionFilterAttribute, IAuthenticationFilter` ? _Custom Membership_ using *custom SQL Server* for `Forms Auth` ? Maybe `custom Role Provider` ?
Answer:
No.  And I would suspect most people do not trust that cruddy mechanism
Not much at all, especially since you have the table already.
Take a look at this for example: http://forums.asp.net/t/1250726.aspx
Comment: Thanks for your answer, but your answer for #3 is a forum post about authentication using ASP.NET webforms, not ASP.NET MVC. Are there any differences I need to be aware of in the process for MVC?
Comment: It's the same mechanism for both MVC and webforms.
Answer: Hi ,
Just follow these simple steps :
First, you can delete the .mdf file in App_Data folder. Since we don't need any of these tables.Then, we need to update the default connection string in the web.config to point to our database.
<connectionStrings>
    <add name="DefaultConnection" connectionString="Data Source=SERVER\INSTANCENAME;Initial Catalog=DBNAME;Integrated Security=True" providerName="System.Data.SqlClient" />
  </connectionStrings>

Third, Open Nuget Package Manager and write the following commands:
Enable-Migrations
Add-Migration Init
Update-Database

Check out your database, all ASP.NET membership tables with Prefix Asp have been create and then you can test it out by running your application and execute membership actions such as Signing up or Signing in to your application.
Created tables after running above commands:

AspNetRoles
AspNetUserClaims
AspNetUserLogins
AspNetUserRoles
AspNetUsers
__MigrationHistory

Source : https://blogs.msmvps.com/marafa/2014/06/13/how-to-create-asp-net-mvc-authentication-tables-in-an-existing-database/
Answer: We're doing exactly this in one of our applications, and find it quite simple.  We have an authentication service (called from the controller) that handles the mechanics of hashing the entered password to see if it is a match, then simply returns a bool for a method we call "IsValidLogon".
In our case, the purpose was to keep the management of what should be a pretty trivial task as lightweight as possible.
We bascially ignored ASPNETDB entirely.  If we get a valid response from our user/password check, we simply call the standard FormsAuthentication.RedirectFromLoginPage(username, createCookieBool);
Hope that helps.
Comment: authentication service called (`IsValidLogon`) from ***each controller*** ?  `FormsAuthentication.RedirectFromLoginPage(username, createCookieBool);` called in any Controller ?
Answer: just building the same, so answer to 1 must be NO :)
I'm using the standard  asp.net forms authentication, where i use the FormsAuthentication.RedirectFromLoginPage(username, createCookieBool) method to log a user in.
I gave a user a unique guid (you can use any other user id) and i'm storing it in the UserName parameter along with the username (to display on the masterpage: Html.Encode(Page.User.Identity.Name.Split("|".ToCharArray())[1]))
In each controller/method in which i must know which user is logged on (via User.Identity.Name, split the string and get the userguid).
Also i decorate those routines with the  [Authorize] attribute.
Comment: do you use  _Custom Membership_ using *custom SQL Server* ?`FormsAuthentication.RedirectFromLoginPage` in  each ***Controller*** or ***Filter*** ? store in `UserName parameter`, which object ?


Can Crizalk 250mg cause extreme forgetfulness?

Question: For an ALK positive (anaplastic lymphoma kinase) lung cancer, is extreme forgetfulness or any other memory related issues a recognised adverse side effect of treatment with Crizotinib?
Comment: Questions requesting personal medical advice are off-topic here. Nobody here can properly address your health issues. Such questions should be taken to your personal physician who can examine you and access your full medical records.
Answer: Crizotinib is an oral receptor tyrosine kinase inhibitor indicated for the treatment of patients with advanced or metastatic non-small cell lung cancer.  The common side effects do not include forgetfulness.  If one experiences memory issues, then one should look for another cause such as the non-small cell lung cancer itself, or, paraneoplastic manifestations, as well as simply depression.


Can I use the 'Present Perfect Continuous' if the day is not over yet?

Question: Yesterday, my English teacher told me that if you use present perfect continuous, you need to have a connection with the present.
So, my question is, if it's 10pm, is it wrong If I say to my wife:

What have you been doing all morning?
Answer: Yes, you need to have a connection to the present. We use Present Perfect Continuous to show that something started in the past and has continued up until now.
Example:

You have been reading this book for two hours?

This means that the person is still engaged in reading the book.
if you are asking her this at 10AM, you are actually asking her what she has been doing, let's say, from 7AM till the point of your asking.
If you are asking her this at 10PM, this tense would be wrong.
The correct tense would be Past Continuous which we use to talk about some action going on at a certain time in the past.

What were you doing all morning?
Answer: Indeed, the present perfect simple is also used to connect the past event with the present, but its main difference is that it's a completed action. When using the continuous form, it's an action that began in the past and is still in progress in the present, hence, not yet completed.

Present perfect continuous
We use the present perfect continuous

for actions that have been happening recently and repeatedly.
We've been playing a new computer game recently.
I've been working hard this term.
with dynamic verbs to say how long an action has been in progress. (We use for, since or how long.)
Jake has been watching TV for three hours.
To explain a current situation in terms of recent events.
I'm tired because I've been playing tennis.

Note that the continuous form emphasises the action, compare:
I've been reading The Hobbit = I'm half away through.
I've read The Hobbit = It was great.
Comment: Also the present perfect continuous is also used for recently completed actions: *I've been jogging the past hour. (But now I'm at home.)* Point 3 possibly refers to this but your statement *it's an action that began in the past and is still in progress in the present, hence, not yet completed* is not correct regarding this usage.
Comment: If you are quoting something  can you please cite what you are quoting and give a link?
Answer: Language is much more robust and flexible than patterns learned in a textbook. Your sentence is fine if you want to imply that 10pm is still part of your wife's morning. Even if she gets up at 7am but does nothing all day  one could ask at 10pm What have you been doing all morning? This might be rather harsh and possibly insulting  since you are basically saying that at 10pm it is still the "morning" for your wife. At any rate  that is the connection to the present that allows the use of the present perfect continuous.
Also, In addition to usernew's statement that "We use the Present Perfect Continuous to show that something started in the past and has continued up until now", we also use the present perfect continuous to refer to a recently completed action:

A: Where have you been?
  B: I've been running for an hour.

B will say this after he has (recently or just) finished running and is now back at home or wherever.
Answer: here is what is found in oxford Advanced learner's dictionary
The present perfect is used:
to talk about something that happened during a period of time that is not yet finished
example:
The train has been late three times this week.
He still hasn't visited her.
So I think completed action is not the difference

Can I use the ‘Present Perfect Continuous’ if the day is not over yet?


Minecraft testfor XP Gained?

Question: I am working on a new map on Minecraft and I was wondering if anyone knew how to testfor XP gain. For example if I gained 10 levels it would output a signal, and if I gain another 10 levels, it would output another signal. Does anyone know how to do this?
Comment: Have you made any attempt to solve this yourself? Arqade works better when askers show effort to solve their own problems; we see that you have a problem you've worked on, and answerers respond to that. You also get a more specific answer that's tailored exactly to the part you're stuck, and Arqade gets a very specific question. Everybody wins!
Answer: You can use the selector l, lm to test for experience levels. l means maximum  experience level, lm means minimum.
To test for a player with at least 10 levels of experience:
/testfor @a[lm=10]

If you only want the testfor to succeed once for each player, add a tag to the player:
/scoreboard players tag @a[lm=10] add xp10

And change the command to:
/testfor @a[lm=10,tag=!xp10]

Answer: Maybe you need scoreboard, the level criteria.
Record the previous level, compare it with the current level. If a-b is larger or equal to 10, then output signal, and set the score to the current level.

Minecraft testfor XP Gained?


What is the difference between 2x2 factorial design experiment and a 2-way ANOVA?

Question: What is/are the difference(s) between 2x2 factorial design and 2-way ANOVA? Do they have the same assumptions?
Answer: A 2x2 factorial design is a trial design meant to be able to more efficiently test two interventions in one sample. For instance, testing aspirin versus placebo and clonidine versus placebo in a randomized trial (the POISE-2 trial is doing this). Each patient is randomized to (clonidine or placebo) and (aspirin or placebo). The main effect of aspirin and the main effect of clonidine on the outcome of interest can be assessed using a two-way ANOVA.
This trial design is useful to detect an interaction (this is where the effect on the outcome of one factor (e.g. aspirin) depends on the level of the other factor (i.e. whether or not the person gets clonidine)), but one must be careful, as many factorial trials are not powered to detect an interaction. Therefore, one runs the risk of falsely declaring that there is no interaction, when in fact there is one (a type II error).
Therefore, I wouldn't say the two have the same assumptions, as one is a design and one is a statistical method. That being said, the two-way ANOVA is a great way of analyzing a 2x2 factorial design, since you will get results on the main effects as well as any interaction between the effects.
See http://udel.edu/~mcdonald/stattwoway.html for more information.
Comment: I like the answer except for the point about the interaction.  A 2x2 factorial design tested via a 2-way ANOVA is actually an excellent way to test for an interaction.
Comment: +1, thanks for the edit. Note that there is nothing in nature that requires interactions interactions to be harder to detect than main effects. The power of the analysis to detect an interaction depends on its magnitude & the N used for your study. It may well be, however, that the interactions that people care about in your field tend to be smaller than the main effects, & this makes them seem less tractable.
Comment: @rolando2 is exactly right. Would you mind editing your comment about interactions? Very often the primary motivation for running a 2x2 experiment is to see if there is an interaction.
Comment: @rolando2 I have amended the answer to address interactions. Thanks.
Comment: @gung do I read this comment to say that in order to determine power (and sample size) for a factorial, one only needs to look at the smallest effect size (which could be a main effect or an interaction) and find power for that comparison - thus setting the total sample size to the total needed to find the smallest comparison of interest (ignoring multiple testing?). I had just asked a similiar question but I think this response suggests it is correct: http://stats.stackexchange.com/questions/253281/power-analysis-2level-factorial-design-logistic-regression


Average Velocity ($\vec{\bar{v}}$) Intuition and Analogy for Non-Uniform Acceleration

Question: Background
So I was trying to make as much sense out of kinematics through intuition after having taken my first semester of university physics, and I've stumbled onto a dillema that I can't seem to work around.
Specifically, I'm stuck on the issue of average velocity. From what I understand, in kinematics, there are two definitions through which everything else can be derived ($\Delta{t}\neq 0$):
$$\begin{align}
\vec{\bar{v}} &= \frac{\Delta{\vec{x}}}{\Delta{t}} \tag{1}\label{1}\\
\vec{\bar{a}} &= \frac{\Delta{\vec{v}}}{\Delta{t}} \tag{2}\label{2}
\end{align}$$
There are, if my knowledge doesn't fail me, several methods of deriving equations past this point. One is via calculus; integrating to solve for equations describing displacement in terms of a constant acceleration, for example.
The other is via the assumption that, whenever $\vec{\bar{a}}$ is constant (in magnitude and direction, correct me if I am wrong), that:
$$\vec{\bar{v}} = \frac{\vec{v}(t)+\vec{v}_i}{2}\tag{3}\label{3}$$
Through this you can combine equations algebraically to arrive at the same equations you would otherwise attain via calculus.

Question 1
That got me thinking, however - what's the intuition behind this uniform acceleration-specific equation \eqref{3}?
If my Cal I doesn't fail me, for any given function's interval, the average value is:
$$\bar{f} = \frac{\int_{a}^{b}f(x)dx}{b-a} \tag{4}$$
If we apply such idea to average velocity (assuming we can extend the logic to vectors), we get the following:
$$\vec{\bar{v}} = \frac{\int_{t_1}^{t_2} \vec{v}(t)dt}{\Delta{t}} \tag{5}\label{5}$$
(Note: not sure if average velocity is considered a function of time, if so, I'm assuming it's denoted $\vec{\bar{v}}(t)$. Again, correct me if I am wrong, please.)
From \eqref{2} we can solve for $\vec{v}(t)$ and plug into \eqref{5} (otherwise the integral reduces to \eqref{1}).
As a result, we get:
$$\begin{equation}\begin{aligned}
\vec{\bar{v}}
&= \frac{\int_{t_1}^{t_2} (\vec{v}_i+\vec{\bar{a}}\Delta{t})dt}{\Delta{t}}\\
&= \frac{\vec{v}_i\Delta{t}+\frac{1}{2}\vec{\bar{a}}\Delta{t^2}}{\Delta{t}}\\
&= \vec{v}_i+\frac{1}{2}\vec{\bar{a}}\Delta{t}
\end{aligned}\end{equation}\tag{6}$$
By replacing $\vec{\bar{a}}$ with \eqref{2}, we end up with \eqref{3}, which is exactly what we intended to begin with.
But why does this work?

Question 2
My second inquiry involves whether a similar equation exists for average velocity beyond \eqref{1}, preferably in terms of $\vec{v}_i$ and $\vec{v}(t)$ with non-uniform acceleration. Either specifically in the case of jerk, defined as
$$\vec{\bar{j}} = \frac{\Delta\vec{{a}}}{\Delta{t}}\tag{7}$$
or, even better, generalized to any velocity function $\vec{v}(t)$!

Progress so Far
I've thought of three different possibilities for finding that elusive generalized average velocity function, each hypothesis less desirable than the last. The first is that perhaps it is of the form
$$\vec{\bar{v}} = \frac{\vec{v}(t)+\vec{v}_i}{k}$$
where k is a unitless constant that might depend on the specific velocity function of the particle or object at play.
The second is that it's a lot more complicated, likely not of the aforementioned form and perhaps not expressable without adding more variables (like $\vec{a}_i?$) into the mix.
The last is that no such function exists, I'm guessing maybe due to $\vec{v}(t)$ not being linear, as $\vec{a}(t)$ is no longer constant (zero included).
Help would be greatly appreciated! Additionally, please feel free to correct any and all of my notation, as this is my first time posting and I need improvement.
Answer: Well,
$$\int_{t_1}^{t_2}v(t)\text dt=\Delta x$$
so that's why that all works.
In general
$$\int_{t_1}^{t_2}\frac{\text df}{\text dt}\text dt=\Delta f=f(t_2)-f(t_1)$$
so this works for any function and its derivative.
Usually in physics we deal with instantaneous values with derivatives rather than average values with difference quotients.
$$v=\frac{\text dx}{\text dt}$$
$$a=\frac{\text dv}{\text dt}=\frac{\text d^2x}{\text dt^2}$$
This is how to handle scenarios where the acceleration is not uniform.
Comment: @Naganite that's because in the constant acceleration case, velocity is a linear function of time (constant slope). This means the instantaneous slope at each point is equal to average slope between two points.
Comment: @Naganite:  *"no extension of that function in terms of the initial and final velocity would be possible with for example jerk because the curve is quadratic?"* Indeed!
Comment: Yes, this all makes sense, but I still fail to understand why it happens to be that when acceleration is a non-zero constant function of time, the average velocity is equal to the average between its initial and final. Is there no extension of said formula to non-uniform acceleration?
Comment: @SuperfastJellyfish Ah, so then no extension of that function in terms of the initial and final velocity would be possible with for example *jerk* because the curve is quadratic?


How does a wheel balance itself during circular motion?

Question: A wheel (or any ring of considerable mass) hardly balances itself when it is placed vertically on ground, but when we roll it along the ground it balances itself. What causes this effect? I guess its because of the centrifugal force generated by the circular motion of the wheel that makes the outer surface of the wheel rim to stick to the ground, but I am unsure whether this is the correct explanation.
Comment: possible duplicate of [Why doesn't a bike/bicycle fall if going with a high speed?](http://physics.stackexchange.com/q/506/)
Comment: I don't think he's referring to bicycles. More like: if you were to role a lone tyre down a hill, there is some sort of stabilising effect.
Comment: It is called conservation of angular momentum. Once a wheel starts turning it acquires angular momentum which has to be conserved . It is the reason why the earth does not stop turning on its axis or around the sun,, etc
Comment: But what is causing the wheel to remain vertical. Angular momentum just conserves the rotational motion... @annav
Comment: angular momentum is a  vector and retains the direction , all tthree components
Answer: Just like Anna V said, Conservation of angular momentum. It's sort of like how on Motorcycle races the racer's can do extremely sharp turns with their knee's almost touching the the ground. Once it's gained enough speed it begins to just well, support itself. (I understand that is a very bad word to use for this question but it's hard to explain)
Answer: Physics is the accumulation of observations, the devising and fitting mathematical models to these observations and study of the predictions of the mathematical models to validated them.
In the progress of time, the mathematical models become theories, i.e. derived from a few postulates, also called laws, that define the framework for physical problems , and there can be very general predictions from these mathematical models, called conservation laws.
There is the conservation of energy, the conservation of momentum and the conservation of angular momentum in kinematics problems that are directly provable mathematically starting from the laws of mechanics.
Ultimately conservation laws are directly dependent on observations and experiments. They are the distillation of innumerable observations, fitted mathematically.
In this sense asking why a wheel does not fall is like asking why is there conservation of energy.
The wheel does not fall because the angular momentum it has gained has to be dissipated/transferred by interactions , and the interactions of a wheel are with the ground at a very small point which can absorb by friction only small quantities of angular momentum. (air is not very efficient in braking unless of hurricane force). In a similar way a rolling ball even on a flat ground, can travel a long way because it can  only lose momentum and energy through the small point like area with the ground.


Hiding text as entered

Question: Is there a way to hide all text that is being entered, just as passwords are hidden? so that the cursor moves but the output is æquivalent to spaces, until the function is turned off? Variants of this function might leave the letter or word under the cursor visible.
Comment: @Wildcard - I only presumed the OP wants to hide text from people *looking* at his monitor.
Comment: I doubt it. *But*, with **g**Vim, you can have a function/command/key combo that changes the font (`set guifont=...`) to some symbols, wing-dings, non-latin alphabet - and back.
Comment: Since the password (or whatever) would be stored in plaintext in the file itself, how would that function be useful?
Comment: Did you want this in Insert mode, or in the command area? I've answered with a proof of concept for Insert mode.
Comment: @VanLaser Why change the font? Isn't changing the colour enough?
Comment: @Carpetsmoker - it probably is. I was aiming more for a ... Matrix effect :)
Answer: In Insert mode, we can intercept each inserted character, and replace it with a *.  Here is a quick proof of concept:
autocmd InsertCharPre * let v:char='*'

But that one-liner is undesirable, because now it's difficult to turn off that autocommand.  You need to restart your Vim to get back to normal!
The tidy way:
augroup MyPassListener
  autocmd!
  autocmd InsertCharPre * if s:RecordCharacter(v:char) | let v:char='*' | endif
augroup END

You will need to implement your own RecordCharacter function, and perhaps build up a secret string:
let s:pass = ""

function! s:RecordCharacter(c)
  let s:pass .= c
  " Maybe do something special here if the character is a carriage return
  return 1
endfunction

When you are finished, and want to go back to normal, clear the event listener group you defined:
augroup MyPassListener
  autocmd!
augroup END

Notably the technique above won't store the typed characters in the buffer.  A load of *s will be added to the buffer instead.  The secret characters will be available only in the s:pass variable.
If you want the characters that were typed to exist in the buffer, you will need to hide them, rather than replace them.  Two possible options are:

Set the foreground and background highlighting to the same colour.  This should make the text invisible (provided the characters are not highlighted in bold, which can render differently in terminals).  (There might also be issues when the cursor is hovering over a character.)
Use the conceal feature to hide or overlay the characters in the buffer.

Hiding text as entered


Why are objects rotation rotated a little bit when they are set to 0?

Question: I have a simple python script that tells me an objects rotation (a property reads the rotation). I have a static object with its rotation set to (0, 0, 0); however, when I load up the scene, the property reads a long decimal with a value very slightly higher than 0. This shows that the object has very little rotation. Is there a way to fix this other than changing the objects rotation with a script? In other words, keep the rotation at 0 at scene start? Thanks!
Answer: All terms of the orientation matrix are expressed in float values (floating point numbers). These numbers have a specific precision. This means when you calculate with them you get very small, but existing deviations from the "ideal" number.
This is especially noticeable around zero. Therefore you might print something like -0.0. This seams illogical but it means you have a number that is smaller than the precision of the formatter.
Unfortunately you did not include any further details such as what term you are reading and what the value is or what your code is.
My own investigation shows me:
<code><Matrix 3x3 ( 1.0000, 0.0000, 0.0000)
            ( 0.0000, 1.0000, 0.0000)
            (-0.0000, 0.0000, 1.0000)>
</code>
The [2][0] value is indeed -0, but it has no further consequences. You will not notice that in your scene.
Comment: Thanks for the answer, and, what if I'm getting 0.0006?
Comment: In that case I would like to see your demo file.
Comment: Ah. I just noticed its parent is dynamic. However, the parent is *directly* above the ground, and is not affected by anything other than  gravity. Do you think gravity would of caused the small rotation? Its always the same thing.
Comment: Gravity is a force (0,0,-9.8). It can result in linear and angular velocity -> changes to location and orientation especially when colliding with other objects (e.g. with the ground).
Comment: Ah. I thought it was something else as it always rotates to the same extent. Thanks ;)


Coherent sheaves and holomorphic vector bundles

Question: For a complex manifold $M$, I'm trying to understand (from a differential geometry point of view) what its category of coherent sheaves is. If I understand correctly, then the sheaf of holomorphic sections of a complex vector bundle is a coherent sheaf for $M$. Is there some case when the category of coherent sheaves is equivalent to the category of holomorphic vector bundles? In other words can I just forget about the algebraic geometry and understand the definition in terms of complex geometry? Or alternatively, can one somehow "generate" the category of coherent sheaves from the category of holomorphic vector bundles
Comment: Locally free sheaves don't form an abelian category, and the abelian category "generated" by them is the category of coherent sheaves.
Comment: The  shaves of holomorphic sections of  holomorphic vector bundles can be identified with the  locally free sheaves. Any coherent sheaf  admits a locally free resolution, and in this sense they are determined by vector bundles.
Comment: Dear John, coherent sheaves are locally cokernels of holomorphic maps between two holomorphic vector bundles. That is, $F$ is coherent if and only if locally on $X$, $F$ is the cokernel of a map $O_X^a \to O_X^b$ between two (trivial) vector bundles of finite ranks $a$, $b$. Hope this helps.

Comment: Think of a complex submanifold $N\subset M$ and the trivial bundle $O_N$ on $N$, thought of as a sheaf on $M$. This is a coherent sheaf on $M$, but of course does not come from a vector bundle. Another example: the ideal sheaf of $N$ (sections of the trivial bundle $O_M$ on $M$ which vanish along $N$) will not be a vector bundle if $N$ has codimension $>1$, but will still be coherent.
Comment: the use of coherent sheaves in several complex variables actually preceded its use in algebraic geometry.  it was apparently introduced in the Cartan seminars in 1951-2, to systematize the work of K. Oka from the preceding 15 years.  A textbook source is the classic by Gunning and Rossi from 1965, chapter 4.
Comment: @Liviu: Thanks for the comment. So if you take the derived category of the locally free sheaves, what would the corresponding subcategory of the Fukaya category under mirror symmetry?
Answer: There are two approaches to this question, one by Toledo and Tong (using Cech covers or hypercovers) and one by Block (using the Dolbeaut algebra). Block's paper is at https://arxiv.org/abs/math/0509284
Answer: I think the general idea of "coherent sheaves are what you get what you try to make the category of vector bundles into an abelian category" is a good intuition to have, and this is true for arbitrary ringed spaces. Since, however, your question specifically mentions complex manifolds, let me say a few words about what happens in this setting, since there is some subtlety in what "the" category of coherent sheaves might even mean.
The relationship between coherent sheaves and vector bundles is much more delicate in the holomorphic case than in the world of algebraic geometry. For example, if $X$ is a (smooth Noetherian) scheme, then any coherent sheaf on $X$ can be resolved by (i.e. is quasi-isomorphic to) a complex of vector bundles. The analogous fact in the holomorphic world is not true: there exist "many" coherent analytic sheaves for which we cannot resolve by vector bundles (a famous example of such a coherent sheaf is due to Voisin). This leads to a lot of problems, and is indirectly related to other similar non-existence theorems (e.g. holomorphic vector bundles "rarely" admit holomorphic connections).
One specific example of this is when you try to define what "the" category of coherent analytic sheaves should be. As is standard in geometry, we want to say that this is given by the derived category of the category of bounded cochain complexes of coherent sheaves, denoted $D^\mathrm{b}(\mathsf{Coh}(X))$. However, the category that seems to arise more often "in practice" is that of coherent cohomology, $D_\mathrm{coh}^\mathrm{b}(\mathsf{Sh}(X))$, which is the subcategory of $D^\mathrm{b}(\mathsf{Sh}(X))$ spanned by complexes whose internal cohomology (i.e. kernel of the differential quotiented by the image of the previous differential) is a coherent sheaf in each degree. Again, in the algebraic case, if $X$ is a Noetherian scheme, then these two categories are equivalent: $D^\mathrm{b}(\mathsf{Coh}(X))\simeq D_\mathrm{coh}^\mathrm{b}(\mathsf{Sh}(X))$ (this is found in SGA 6, §II, Corollaire 126.96.36.199, for example); but in the holomorphic case, whether or not these two categories are equivalent is, as far as I am aware, an open question (apart from the case where $X$ is a compact surface, in which case they are known to indeed be equivalent).
Comment: Those two categories are not equivalent in case of a very general 3-dimensional complex torus (and are probably not equivalent for any complex variety with "wrong" Picard group, i. e. not satisfying Lefschetz). This result is not yet published. It's somewhat independent result of A. Bondal and myself; I'm currently working on description of Verdier quotient of bigger category by the image of inclusion.
Comment: Oh, this is exactly the setting in which Voisin builds the example of a coherent sheaf with no locally free resolutions — I wonder if this is related. But either way, I am very excited to read about this. Is there a preprint available?
Comment: No, this is is _strongly unpublished_, i. e. still in filling the gaps and writing down state. Of course, this is based on Voisin's example of non-resolvable sheaf.


What are the avenues for attack in Sanctuary Hill?

Question: I've only just started the settlement here and I'm wondering what the possible attack angles are. I would wager that the bridge is one potential attack direction but are there more? There's another significant gap between some bushes that seems like it warrants defending but I want to make sure before expending resources to do so. I'm especially worried that attackers will ignore the pseudo-moat and attack from any direction...
Comment: Considering that you don't get back all the resources you use to build, I'd be interested in this too so I don't waste resources.
Comment: I took about 60 hours to play through the game on Normal, and Sanctuary was *never* attacked. I kept the defense >= to the food + water pretty much the whole time. About halfway through a playthrough on Hard, I still have never had an attack on Sanctuary. Get your defense number up, and you probably don't need to worry too much.
Comment: I've never been particularly worried about getting attacked (my defense is over double the cumulative total of my food/water), I asked the question so I can focus defenses in particular places instead of blanket-turreting my entire settlement (which I have done at this point).
Answer: I believe there are 3, the Bridge for Raiders, the Vault path area for Supermutants, and Water for mirelurks. I've only got around 15 hours in the game so there may be more. It's worth noting that on my first character I was never attacked there, it only happened after I bumped the difficulty up.
Comment: Have you managed to gather any more insight into this? If you can confirm that there are the three you mentioned (plus the one that Li Jiru mentioned) I will go ahead and mark this the answer.
Comment: I've seen a few comments around the net saying the same thing, the two bridge approaches and near the Southern bridge (towards Red Rocket) across the shallow water. My experience in over 100 hours of gameplay bears this out.
Walls/fences are mostly a waste, as NPCs can 'teleport'. I've had them appear inside the walled area very frequently. Protect your resources and settlers with elevated turrets. The Wooden 'bridge' is great for this. Turrets 'scan' about 120 degrees, so three of them can 'see' 360 degrees. Once an enemy has been detected, the turrets can track them all around.
Answer: Too add to what was said there seems to be another route. Coming out of your original house to the left side of sanctuary. Was literally just attacked moments ago by ferals coming from that direction
Answer: You can be attacked from anywhere TECHNICALLY. However, if you put up your defences correctly you will only be attacked in the previously mentioned area. Put up a ring of guard outposts and turrets. If you do this you will only be attacked in the conventional routes. Then make a focus of turrets and traps in the previously mentioned routes. Also, put bells next to the stands. Place spotlights on these previous mentioned places as well. MAKE SURE TO HOOK UP YOUR TRAPS TO A SWITCH! Every time they are used they have to be repaired. If you just hook them up to power they go off immediately.
Answer: I built a wall around the entire settlement except the bridge and nothing attacks me
Answer: Really if you have enough defense then you won't be atacked but i suggest making a wall around the house with the workshop and set gates and watchtowers with turrets a nod then you will be prepared for any stack from any direction


Live Tweet Maps in CartoDB

Question: This page [https://cartodb.com/cartodb-for/twitter-maps/] seems to indicate a live tweet map is possible with CartoDB, but the interface forces me to define a time span and doesn't allow me to define beyond the current date. Does anyone know how to create a Tweet map in CartoDB that will update live as new tweets meet the search criteria?
Answer: CARTO UI does not allow to define real time twitter maps. As you correctly say they are defined once using a time span. To have near real time twitter maps you need to contact CARTO sales team as this is something custom we need to prepare on a case by case basis.

Live Tweet Maps in CartoDB


Koi fish injury from a Blue Heron

Question: My Koi fish was attacked by a Blue Heron about 2 months ago. I chased the Heron off and it dropped the fish. I put the fish back in the pond but it had a couple of puncture wounds. It is still alive, but stays mostly on the bottom and when it tries to swim, it is kind of on its side and goes in circles. It also has difficulty getting to the surface and cannot stay there more than a couple of seconds before it sinks to the bottom again. I have been hand feeding it every day to keep it alive. It will hungrily take the food from my hand if I put it up to its mouth, but can't feed itself otherwise. Is there anything I can do to help it heal, or is this all I can expect? I have seen no change after two months.
Comment: You can expect the heron to come back. I have too many trees for herons, but I have heard putting a rubber snake at the pond helps to keep them away.  Move it every few days.
Answer: To treat wounds on koi you can use surface painting (applying it directly on the wound of your fish). This is first aid to your fish to avoid infection of the wound; in addition to this, you have to make sure the water parameters are good to be sure you give the fish the best chance of surviving.
You can buy potassium permanganate solution in any pharmacy and use a Q-tip (cotton bud) to apply this directly on the wound of your fish. Using this is the best solution in my experience.
Potassium permanganate is a powerful antibiotic and antifungal remedy and it has a natural part in every first aid kit for both human and for use on pets.
If you do google potassium permanganate, you will find lots of information about the use of it - everything from desinfecting garden ponds to treating wounds in people and pets.
Very little can be done if it is an old wound, but try talking to a vet and ask if it is possible to put in an suture to close the wound. Try to keep an eye out for signs of infection in the wound and try to keep the water parameters as good as possible.
Answer: I had a fish do that after hitting a rock. Sounds like the swim bladder was injured. He lived a couple years just fine but then a blue heron showed up :(. He was easy prey since he liked to rest on top of the rocks because he couldn't float. So just keep that in mind for protection. Now this morning, my favorite koi was injured by a heron. It dropped her but she has a big injury. Trying to research what I can do for her. She seems to be swimming ok right now but only time will tell.
Comment: first part is actually an answer to the question. Second part not so much. You might want to keep your answer on point. And / or Ask a Question yourself for the second part.

Koi fish injury from a Blue Heron


privatemsg and services fully integration

Question: Does there exist any module even sandbox or starting point module (not ublished on drupal.org) to help achieve privatemsg crud operations over services module.
Answer: There exist a sandbox project pm services clone comand
<code>git clone --branch 7.x-1.x    https://git.drupal.org/sandbox/deminy/2413647.git privatemsg_services
</code>
cd privatemsg_services
also  pm services(profile2) but it needs profile2 to be enabled beore
Comment: I have written this command

` $ git clone --branch 7.x-1.x http//git.drupal.org/sandbox/deminy/t 13647.git `

and Got this Error

` fatal: repository 'http//git.drupal.org/sandbox/deminy/t' does not exist`
Comment: @Sara I added the full clone command as the first one was encoded  and my be broken, Try keda!
Answer: The current discussion on integrating Privatemsg for Drupal 7 and Services can be found here.


Salesforce cloning and integration

Question: We have multiple salesforce orgs for multiple non profits. All of them need to have same functionality but different organization. Is there a way to clone all these organization? If I make changes, including Apex and schema, it should reflect on all the orgs. Although we are eligible for 4 free non profit accounts with 10 users each we are not allowed to have all 40 users in a single account. This is the only workaround we can think. All the orgs must have exact copy of data, tasks, custom objects, triggers and workflows.
Comment: The migration tool might be worth looking into. You could at least do deployments identically to all four orgs with a single command.
Answer: Using a multi-org model is usually not recommended by implementation partners. They'll note that though the annual cost is lower, the implementation cost is MUCH MUCH higher. If you have a dedicated developer and admin on staff at each org though, you might be able to get away with it.
In general, you're going to want to package up your code (likely as an unmanaged package) from one instance that is the official and blessed metadata provider. All other organizations can then install it. Those other orgs will have the ability to edit their own instance, though, and tracking those upstream changes could be VERY challenging. That's why this isn't recommended.
Similarly, you can use Salesforce to Salesforce to set up data sharing between the orgs (notice, this is completely separate from metadata). S2S has a lot of limitations and caveats, but its the best tool out there. Organization Sync may also be handy, but it also comes with limits and severe considerations. Talk to your AE for details.
Ultimately, you're going to run into a lot of issues running as a multi-org, especially if you want ALL data to be shared. Look out for RecordType ID issues, field name issues, and more. Be ready for data to be out of sync, and come up with your plan to resolve those issues. This isn't going to be fun. The NPSP isn't built for this one bit.
Answer: you can always uses unmanaged package or managed package to deploy/migrate the components.

Salesforce cloning and integration


Royal Enfield classic 350cc Gun Metal grey BS4 engine stop in between ride not with 5 liters above reserve

Question: It's been so frustrating to have issues with the Royal Enfield classic 350cc gun metal grey BS4 engine. My issue is that it stops all of a sudden while riding for a little while. Most of the times it miss fires many times. Unbelievable how these guys became so successful even after so many faults. I found out a hack for this issue once the bike stops i open the petrol tank for few seconds and close it then it's fine for about 10-15 kms then again this issue repeats. Heard it's due to the new charcoal canister from a few other threads. Any idea what I should do with this issue? What should I ask the service guys to fix? Aren't the Royal Enfied guys ashamed to release a bike thats not been tested on our roads and climatic conditions and made sure it works fine?
Comment: This must be India? Producing anything to run in those conditions is a challenge for any company... Have you serviced it? Changed the fuel filter?
Comment: If it's so hard for a company this big then they shouldn't release anything here. I'm also an engineer we test out our products under every circumstances where ever we release our products.
Comment: Does true bike run faultlessly for many miles if you leave the petrol filler cap open? Do this when it's quite empty of petroleum and you're going to be riding smoothly with no abrupt stopping and starting, to prevent fuel from splashing out
Comment: So you don't have a returns department or anything under warranty as your products are perfect... so you have Six Sigma AAA+++
Comment: Did you do any servicing or check or replace the filter?
Answer: Vehicle fuel tanks have small vents, so that as the fuel is consumed and the fuel level drops in the tank, air is admitted to the tank above the fuel level. If air isn't allowed to enter the tank, the amount of fuel coming out of the tank will reduce and stop.
The behavior you describe is commonly seen when the fuel tank's vent is obstructed. You'll find a vent either in the fuel cap, or separate from the cap. Make sure the vent is operating, and that air can pass through whatever vent hose or one-way valve or other plumbing is provided.
Comment: I have seen the vents. But, how on earth can I check if air is flowing? 1st service is done. They told it would take a week for them to find out and fix. I thought I would investigate on the issue and find out what is to be fixed and ask the service guys to fix the particular problem rather than fixing the miss firing and stopping problem by taking loger than required.
Comment: I am unfamiliar with your machine, and don't know how its tank venting is arranged. I suggest you search the net for "check motorcycle fuel tank venting" for ideas on how to diagnose the issue.


Visual Studio alternative for PHP

Question: I have earlier worked on Visual Studio and am pretty much comfortable in using that.
But now I have some programming work in PHP.
Is there any plug in available that I can install on Visual Studio 2008/2010 and program in PHP/MySQL.
Answer: Commercial you have:
Zend Studio wich is pretty powerfull.
Aptana is pretty good too
Of course Eclipse (Zend Studio is built on it). Now free!
Netbeans is lighter but very fast and practical I love it.
There are much lighter editors out there like textedit but if you want something like visual studio Zend/Eclipse is a good bet.
As for pluguins I guess I was wrong and there is http://www.jcxsoftware.com/ as pointed out by Sem Dendoncker. Seems pretty interresting I am downloading the trial now. But I am a cheap and love my free editors.
Comment: I am not mad at the downvote but what is bad with my answer? So the other one is more popular so vote for it. I think I posted a perfectly valid opinion offering options that are valid. Anyways.
Comment: Isn't Zend Studio built on Eclipse, like Aptana? Anyway, the last version I tested ZS 6.x was terrible - full of bugs. Like it was done without any QA. I'm not sure they improved it much since then. Make sure you test it thoroughly before purchasing.
Comment: @Vikash yeah I am a BIG netbeans fan. Becoming an evangelist too. :)
Comment: well, you get a +1 from me to even thigs out for recommending NB :)
Answer: Try Codecharge Studio 5 which supports code generation, php and javascript events and direct connectivity with artisteer's templates.
There is also a CMS based on Codecharge Studio that supports most of contemporary CMS functions. You can use Codecharge Studio to add more functions or just use its free version and build your own site. Visit www.krisonav.com
Answer: I've been using Devsense's PHP for a couple of months and it has been a live saver. Breakpoints, debug, variable visualization all within that familiar and fast environment of VS. It's a bit buggy, doesn't visualize SimpleXMLElements real well, at times won't scroll through inline javascript but it's helped me so much.
Notepad++, even with debug is a far cry from VS.  Notepad++'s autocomplete is very slow, VS does pretty good.
I'm using it for WordPress and it does fine, with the exception that (for speed) I've excluded the WP core from the project.

Visual Studio alternative for PHP


Is this cancellation argument used to find the sum of a geometric series correct?

Question: Here is a common argument used to prove that the sum of an infinite geometric series is $\frac{a}{1-r}$ (where $a$ is the first term and $r$ is the common ratio):
\begin{align}
S &= a+ar+ar^2+ar^3+\cdots \\
rS &= ar+ar^2+ar^3+ar^4+\cdots \\
S-rS &= a \\
S(1-r) &= a \\
S &= \frac{a}{1-r} \, .
\end{align}
I am sceptical about the validity of this argument. It feels like there is something amiss about a proof involving infinite series that makes no mention of the fact that they are typically defined as the limit of their partial sums. The third line involves 'cancelling' all of the terms other than $a$. This makes it seem like an infinite series is actually an infinite string of symbols, rather than a limiting expression. If $a+ar+ar^2+ar^3+\cdots$ is simply a shorthand for
$$
\lim_{n \to \infty}\sum_{k=0}^{n}ar^k \, ,
$$
and $ar+ar^2+ar^3+ar^4+\cdots$ a shorthand for
$$
\lim_{n \to \infty}\sum_{k=1}^{n}ar^k \, ,
$$
then I am struggling to see how the terms actually cancel. Perhaps the third line can be written more formally as
\begin{align}
S-rS &= (a+ar+ar^2+ar^3+\cdots)-(ar+ar^2+ar^3+ar^4+\cdots) \\
&= \lim_{n \to \infty}\sum_{k=0}^{n}ar^k - \lim_{n \to \infty}\sum_{k=1}^{n}ar^k \\
&= \lim_{n \to \infty}\left(\sum_{k=0}^{n}ar^k - \sum_{k=1}^{n}ar^k\right) \\
&= \lim_{n \to \infty}\left(a +\sum_{k=1}^nar^k - \sum_{k=1}^{n}ar^k\right) \\
&= \lim_{n \to \infty}a \\
&= a \, .
\end{align}
There is another concern I have. Geometric series only converge when $|r|<1$. However, the argument used above seems to apply regardless of whether $|r|<1$, which would yield nonsensical results such as
$$
1+2+4+8+\cdots = -1 \, .
$$
So is the argument rigorous, and if so, why are my fears misplaced?
Comment: In the second summation, for $ar + ar^2 + ar^3 + ar^4 + \cdots \,$, the upper bound should be $n+1$.
Comment: Typo $n+1$ in the third line, invalidating what follows.
Comment: @YvesDaoust I can't see where the typo is, sorry.
Comment: @YvesDaoust Could you please point out where I made a mistake?
Comment: @A.J. Thanks for pointing it out. I'm wondering if this issue can be circumvented in the following way, though. If the partial sums are equal to
$$
P=ar+ar^2+ar^3+\cdots+ar^{n+1}
$$
then I agree that
$$
P=\sum_{k=1}^{n+1} ar^k\, .
$$
But then, $rS$ can be given by
\begin{align}
\lim_{n \to \infty}P&=\lim_{n \to \infty}\sum_{k=1}^{n+1} ar^k \\
&= \lim_{n+1\to\infty}\sum_{k=1}^{n+1}ar^k \\
&= \lim_{N\to\infty}\sum_{k=1}^{N}ar^k \, .
\end{align}
Since $N$ is a dummy variable, we may relabel it as $n$. Is this reasoning valid?
Comment: I believe your argument will be valid if you presuppose that the two individual series are convergent; certainly it would not work without that assumption. However, I think a better approach would be to keep the upper bound at $n+1$.
Comment: $$\begin{align}
S-rS &= (a+ar+ar^2+ar^3+\cdots)-(ar+ar^2+ar^3+ar^4+\cdots) \\
&= \lim_{n \to \infty}\sum_{k=0}^{n}ar^k - \lim_{n \to \infty}\sum_{k=1}^{n+1}ar^k \\
&= \lim_{n \to \infty}\left(\sum_{k=0}^{n}ar^k - \sum_{k=1}^{n+1}ar^k\right) \\
&= \lim_{n \to \infty}\left(a +\sum_{k=1}^nar^k - \sum_{k=1}^{n}ar^k - ar^{n+1}\right) \\
&= \lim_{n \to \infty}\left(a - ar^{n+1}\right) \\
&= a
\end{align}$$

The final step would of course only be true if $|r|<1 \,$, which would underscore the idea that the proof would be invalid for $|r| \ge 1 \,$.
Answer: I think the proofs generally start (or at least they should) with something like "Suppose an infinite geometric series converges to the sum $S \,$", after which all the steps would be justified.
The 'cancelling' you mentioned can be avoided by including an extra step:
\begin{align}
S &= a+ar+ar^2+ar^3+\cdots \\
rS &= ar+ar^2+ar^3+ar^4+\cdots \\
rS + a &= a+ar+ar^2+ar^3+\cdots \\
&= S\\
S-rS &= a \\
S(1-r) &= a \\
S &= \frac{a}{1-r} \, .
\end{align}
Also, since the proof assumes the existence of $S$, it clearly will not apply if $|r| \ge 1 \,$.
Answer: Let
$$S_n=\sum_{k=0}^n ar^n.$$
Then
$$(1-r)S_n=S_n-rS_n=a-ar^{n+1}$$ and
$$S_n=a\frac{1-r^{n+1}}{1-r}.$$
This is absolutely rigorous for any $r\ne1$.
And from this, for $|r|<1$,
$$S=\lim_{n\to\infty}S_n=\frac a{1-r}.$$
Now, for $|r|\ge1$, the infinite sum diverges as does the limit of $r^{n+1}$, so there is no paradox.
Answer: Your argument is rigorous if you know that your series converges. Namely you first should know that the series converges and afterwards you may use that method to compute its limit. Prior to know that the series converges the method is wrong since, if the series diverges, in the first step you are subtracting two infinities ($S-rS = \infty - \infty$). Your fears are indeed justified.


Why is the_content() (and get_the_content()) unstyled in my WordPress page?

Question: I'm absolutely new to WordPress theming but I decided to learn on the job and I really want the site to go live within the next week or so. I've stuck to a simple index.php (no templates or template-parts). I'm able to receive the contents in the proper format which they were published (with inline images, line breaks, etc.) but the css styling is absent. What could I be doing wrong?
<article <?php post_class(); ?> id="post-<?php the_ID(); ?>">

         <?php

              $content = wpautop(get_the_content());
              echo $content;
          ?>

I realize there is a difference between the singular view and the list view (the loop). The list view doesn't actually style the content by default. Could that be where my problem lies, and if so, what's the best way to get around this problem?
EDIT
Essentially, I want the singular view (singular.php) within the index.php.  When you visit the site you're greeted by an entire article, not previews and listings. So I don't actually need the loop for now. I simply retrieve the post and display the contents on the index page.
That is literally the only thing keeping my site from going online right now. I just need that article to be styled as it's supposed to be. There are only two files in my theme: index.php and style.css. I've already tried the_content(), I've also tried apply_filters('the_content', get_the_content()), to no avail. wpautop(get_the_content()) was the closest thing to styled I could get. I am retrieving the post using the_post() for now, could that be the issue, and if so, which is the best way to retrieve a post?
I have tried retrieving the post in various ways and it's still unstyled, so I decided to inspect the elements in the browser and found that WordPress is indeed attaching a class to the elements but just where on earth is that class? I read somewhere about a css reset being the possible cause -- how does one bypass any css reset issues?
Answer: It turns out it was just a header issue. Solved by adding:

    <?php do_action('wp_head'); ?>