Huge database - challenges

Question: I have recently started a new job that will include lots of db related tasks. There is no document describing the various db tables/columns. I will need to do some BI and I am extremely stressed out by the thought that nobody can help me find my way around the database. There is no  db dictionary available. The db is huge, with ~1000 tables, some of them have ~800 columns.
I already have 5 tasks, and I have no idea where to start. There is 1 contractor that works on optimizing the db, but has no knowledge of the business.
Please throw at me some coping strategies. How can I create this db dictionary? Maybe there are tools that I can use?
Thank you!
Comment: What are your 5 tasks? If we know that we'll be able to provide you with better guidance.
Comment: Also, what is your previous experience with SQL Server and what is your new role?
Answer:
Get Visual Studio if you don't have it already.
Get Oracle SQL Developer 4.1.3.
Install the SSDT add-in for visual studio.
Install a local instance of GIT for version control.
Install the MS GIT Plugin for Visual Studio.
Create a SQL Server Database project in Visual Studio for your database.
Make all database modifications using the SQL DB Project going forward.
Use the Datamodeler tool that comes with Oracle SQL Developer to build a relational model of your MS SQL Database so that you can visualize it - yes, this will work, and it's free.

Other Notes:

Don't include security roles or users in your SQL Database Project.
Do include Linked Servers, and Schema definitions.
Getting a handle on this is not going to happen over night, so don't beat yourself up.
It would be a lot better to have a remote git repo with a local copy that you replicate - but a local repo is better than nothing, and I suggested it because it's faster to get up and running.
Comment: How is this supposed to help OP? It sounds like he has larger concerns than just visualizing the data structures...
Comment: One has to start somewhere - how can visualizing the database, implementing source control, and putting a process around deployments *not* help OP?
Comment: My main concern is that your answer is a very specific set of instructions based on your preference for Oracle SQL Developer and GIT. OP has concerns about coping with the challenges of his/her new role so I think this proposed answer may have been a bit premature without more of an effort to uncover the type of help she/he is actually looking for.
Comment: That's a perfectly valid opinion, however, OP did say, "and I have no idea where to start."; my answer isn't based on my preferences - I don't even like git, but it's easy to setup. The Datamodeler in Oracle SQL Developer is by far the best and most comprehensive **free** modeling tool I've ever used.  DB projects are easy to setup within VS, and are purpose build for DB development and deployment.  I do understand your concern, but to be fair I don't see how my suggestions are inadequate - if they're not right for you then don't follow them, and if you have a better suggestion then offer it.
Answer: Welcome to IT and the marvellous world of undocumented databases.
Yes, it goes against all good management principles, but you will (if you stay with DBA/BI work) find that this won't be the first undocumented system you come across :-)
Start by talking to your colleagues - get the most important tables documented.
Explore the system using tools like SQLDeveloper.
800 fields  is probably excessive for a table - mind you, I once worked on a system with 35,000 (yes, that's thirty five thousand). I would be considering a redesign with that many fields.
I think that you should try and leverage any skills that you have! Do you programme in Java? Use that then - or whatever your language is! What BI tools have you used?

Don't include security roles or users in your SQL Database Project.

I  would not be doing this! Make use of the capacities of your database. The database is the ultimate fortress for your data. If that's breached, you're up the creek without a paddle.
Plus, if you put it into the database, no mistakes in external code, no stupid/ignorant programmers can mess it up and you'll likely be able to implement trails/logs. The database is the place to implement data security. By all means, use other techniques (belt and braces), but do it in the DB first!
Your question is a bit broad, so I would (if I were you) get back to us here when you run into specific issues - point back to this post and ask your more specific question.
You should also answer the comments about what the tasks are, and what is  your experience with databases/SQL Server?
Answer: YOu can start by running the MS SQL Profiler tool to see which tables are used by the applications that use the server
Answer: Step 1:  Don't panic. Before you do anything else, remember. Don't. Panic.
tools:  SSMS, Sql Trace, Excel, Notepad, and will power.
First thing I do with any new database is look at the primary and foreign keys for naming patterns. I also check to see if the database is a case specific system or not.  Then I run a query to get the INFORMATION_SCHEMA column list and dump it into Excel so that I can sort the column names to look for patterns.  Some will be obvious and other's not so much.  Sometimes, I'll sort the columns ASC and DESC by name, then table and name, then type and name, then name and type, etc.  The main point is to get familiar with the names and types and sizes.
From that point, I update the excel document with notes about what each column looks to be doing.  Then, using that data, I start writing functions in excel to set the MS_Description property for each column based on quick descriptions.  These steps typically get me about 20%-50% of the way thru the system and, by the end of this point, I've usually got a good grasp of how the person/people that built up the tables do their thing.
For anything I don't have a definition for, I'll write custom select statements to look at the top 10-30 DISTINCT value for specific columns.
This will usually get me to 70% of the way. By this point, I will know if the system was haphazardly thrown together (honestly, most systems are identified just before I create the excel document) or has some pattern to all or part of the system.
Now, I start creating a list of procedures, views, and functions to begin looking at the relationships between objects.  I usually open SQL Trace and start it then open up the 'View Dependencies' for one of each type of object ranging from Table to Function to capture what SSMS creates.
Then, I copy those queries out (I actually maintain several queries to use on the go now) then update them based on specific objects so that I can see what is using undocumented items and, randomly, some documented ones.
At that point, it's just brute forcing my way thru the information to describe the database system as a whole.
Granted, this is what works for me.  Might not be for you.  But, the point is, start somewhere and don't freak out.  Identify a piece/table/column and focus on it then go to the next piece, rinse, repeat.

Huge database - challenges


Hosting free comics on my website

Question: I have paperback comics which I legally bought. I was wondering, if I scanned them into PDFs and uploaded them on my website for people to VIEW for free, not DOWNLOAD, would it be illegal? I'm in the UK, and if it is illegal, is there a way to get around that? Thanks in advance
Answer: It would be illegal because only you are allowed to view the comic you purchased. Creating a copy of your comic (e.g photcopying, scanning etc) is not allowed, and showing others a copy of your comic is also not allowed
Answer: You want to research "Fair Dealing" in the United Kingdom.  (I'm most familiar with how it is applied in the US as "fair use", which is similar, but more broad than the UK law.)

If you are excerpting sections of the comic for academic purposes, you are probably protected

For instance, if I wanted to use a page from from the Sandman comics for an essay about Neil Gaiman and modern adaptation of mythology, that would likely pass muster.
I could see this potentially getting complicated if it was an article on a private blog which hosted advertisements, because the UK law seems to prohibit this practice for commercial gain...

Criticism & review is protected with certain caveats. [See Section 30(1) of the 1988 Copyright, Designs and Patents Act ]

Motive seems to be a major factor in the UK in determining if use is "fair"--if your intent is personal financial gain, or if your reposting economically harms the copyright holder, you could be in hot water.  (In the US, a "cease & desist" letter often precedes legal action, due to the high cost of litigation.)
Again, this comes with the caveat that I have no experience with this issue in relation to UK policy, and thus this answer does not constitute advice on whether to repost, but merely serves as a pointer to the relevant legal concept in the UK, with some very basic context.
In other words, take what I say with a grain of salt--the statutes and precedents are what's important.
In the US, all statutes are available online from the relevant governmental agencies, and this also seems to be the case in the UK.  I'd recommend:

Looking at the statutes
Reading legal review articles relevant to your region
Looking at relevant rulings that may relate to your project

Post Script: Based on the description of what you want to do, although your intent is not personal profit, the reposting would likely be seen as resulting in economic damage to the copyright holder in that they might lose sales if people are able to read for free online.  For this reason, you probably want to accept @Shazamo Morebucks answer.

Hosting free comics on my website


How do we measure the temperature of vacuum?

Question: Afaik. temperature is in relation with the kinetic energy of the individual molecules. In vacuum there are only a few molecules so measuring their kinetic energy is very hard, because vacuum has a very little heat capacity and the thermometer with much higher heat capacity will interfere with measurement. I guess the heat transport will be slow too, because heat conduction and convection will be negligable and only heat radiation will transport energy between the wall of the vacuum container and the thermometer. Is there a better way to measure temperature in vacuum?
Answer: The temperature of a true vacuum would be a measure for the energy distribution of the photon gas in that vacuum. You can derive the occupation of the electromagnetic modes in a volume with Bose-Einstein statistics, which is essentially what Planck did to describe the emission spectrum of a black body.
However, you don't need to do understand the details of this derivation, because the photon gas will be in thermal equilibrium with the vessel walls. So, stick a thermometer with a high-emissivity surface (e.g., glass) in the vacuum vessel and wait until it has equilibrated with the walls by radiative energy exchange.
This will even work if the walls are very far away, or not there at all, like in outer space. The thermomemeter has temperature $T_t$ and will radiate with a flux $\sigma T_t^4$, where $\sigma$ is the Stefan-Boltzmann constant; at the same time, it will receive a flux $\sigma T_e^4$, where $T_e$ is the temperature of the photon gas in vacuum. The temperature of the thermometer will gradually approach the temperature of the photon gas.
Comment: Is there a way to measure the temperature directly on the vacuum and not on the walls? E.g. how do we measure it in the space, where there are no walls? :-)
Comment: Updated answer.
Comment: And be careful to isolate your vacuum vessel from radiation coming from the outside environment!
Comment: @valerio92: huh? Under what circumstances would that result in the temperature measured inside the vessel to be different from the "true" temperature of the vacuum?
Comment: I just wanted to point out that if the walls are non-adiabatic they will eventually thermalize with respect to the outside environment, so you will be actually measuring the temperature of the outside environment. But you are right, the mechanism would still be the same and you still would be measuring the temperature of vacuum, so maybe my observation was useless. Just wanted to point out that the "temperature of vacuum" in a vessel would depend on the outside environment unless the walls are adiabatic. Peace!


How safe is this?

Question:
I'm wondering how safe this is to make and to build into my setup. :P
A bit afraid of it exploding.
http://www.apartmenttherapy.com/make-your-own-batterypowered-u-100359
Comment: It's probably safe, nothing will explode, but there are more efficient and cost effective solutions. Approximately half the capacity in the battery is dissipated as heat.
Answer: There is no danger in the circuit apart from mis-wiring it or creating a short that can feed the 9v of the battery to a 5v USB device and destroy it.
The circuit is just a simple linear regulator (seems like a LM7805) connected to the battery, if the input is >=7v then the output will be 5v.
Possible improvements include the addition of a capacitor to the output, refer to the datasheet.
Note that the output of the regulator has short circuit protection.
If you intend to charge a cell phone you will not get much of a charge becasue the 9v battery has very low capacity.
Answer: Mechanically there is a risk of shorting.
If it gets hot under discharge as hot-melt glue, which they use, may soften and allow movement.
Shorting the battery terminals will probably not cause a fire, but may.
Explosion is very unlikely.
If you short 9VDC or even >> 5VDC to a USB port it MAY kill the device being charged.
Electrically it is marginal as there are no capacitors used with the regulator but it will probably work in some cases. See the circuit here that robomon cites. Regulator is IC2 at top left. Note the added caps. A 0.1 uF on input will probably be enough. Much larger is useful when battery is low.
The regulator type is not specified (that I could see) but is probably a '7805' / LM340.
This will stop working when the battery reaches about 7V.
Other regulators with the same pinout are available that will operate down to Vbattery < 6V, when the battery will be fully exhausted if an Alkaline battery is used.
Use with a NiCd or NimH battery will not allow all the battery energy to be used in many cses as Vbattery falls too low while there is still energy left in it.
The energy capacity of a 9V PP3 battery is low. This would act as an emergency supply for eg a cellphone but would not fully charge even a very small cellphone battery. Maximum current will not be enough for some larger battery-capacity devices.
As they say, some (or many) USB charged devices require additional resistor dividers that provide selected voltages to the USB data lines to signal charger capability to the charged device. Many Apple devices need these.
Search for "MintyBoost" as a possibly superior DIY alternative. One example of many here and commercially From Sparkfun and from Adafruit. Also many many other versions via here
Answer: There is no issue in building this circuit. There won't be any issues of explosion.
Similar circuits is being used in many places. For example: Arduino development board has a 5V regulator which can be fed using a DC barrel jack. The source connected to this DC barrel jack can be a 9V battery similar as yours. This setup is used to run Arduino in battery mode.
Project link - http://arduino.cc/en/Main/ArduinoBoardSerialSingleSided3

How safe is this?


UVs don't display on one specific part of the model

Question: The UVS on the foot for my model display no texture. It is just flat gray. It should look half blue half gray from where the UVs are in the texture. If I move them they are still just gray. I tried duplicating them, recalculating normals, adding more faces. But nothing will get the faces to display the texture. I'm using Blender and Substance Painter the UVs were auto unwrapped by Substance and the foot is a duplicated and modified version of the hand. Any ideas to get the texture to display?
Comment: Alexandre Marcati I actually found the problem there were two materials on the model. One of them on the foot. When I deleted the second one the foot started displaying correctly.
Comment: Could you post a screenshot of the whole UV map?
And if you could post another screenshot with sync selection on, and select the feet in the mesh, it could also be useful.
Answer: There was an extra material on the foot. Once I deleted that material the texture then displayed correctly.


Possible to speed up server clock?

Question: I want to run an interactive simulation and have time pass at 12x real time.  There is more than one solution to this, but is there a way to make the server clock run 12x faster?
Comment: Linux - current server is Ubuntu Hardy
Comment: Which server OS are we talking about here?
Answer: Related question here (although Java-based). Even if you could speed the system clock up you'd break various of things (logging, timestamps on files, time-based kernel stuff to name but three) so it would seem better if your code could be made independent of "real" time.
Perhaps you could invent a new unit of time, equal to 1/12 of a second, and code your app in terms of that?
Answer: I suppose a script that changes the clock (starting waaaay back) and every second adds +12 seconds won't be good, will it? Somewhat I suspect the application is not using gettimeofday, but has an internal counter and timers.
What simulation is that?
Comment: It will be a django system with people trading with each other.  Can fudge it, but just wondering if it's possible to make the server solve the problem.
Comment: Must admit no familiarity with Django trading systems :)
I suspect it would not help, since it involves other peers (do you plan to adjust their clock as well?). Again, sorry for not being of much help - best thing would be tweaking the simulation for that purpose, assuming it's possible at all.
Comment: It does seem possible to tweek the clock - see adjtime - but maybe not advisable!
Answer: Try adjtime
Comment: This looks fun and will play with it - but am heading advice of answer above that warns of all the things I'll screw up if I mess with the click.  Still if I use an new Amazon instance for each test that wouldn't matter....  Thanks for finding this.
Comment: `adjtime` is not that helpful in your case, because it applies its changes over a long period of time. It's more suited to sync'ing the system clock to an external time source.

Possible to speed up server clock?


Mod_rewrite syntax with query strings

Question: Embarrassing as this may be, I've hit a wall with mod_rewrite trying to come up with what seems to be a simple rule.
I'd like to accomplish the following mapping:
/cat/subcat which may have a "?PageId=123" afterwards
should become
/cat.php?cid=148 or (/cat.php?cid=148&PageId=123)
So for example, the following 2 mappings would occur:
/cat/subcat => /cat.php?cid=148 (the 148 part can be ignored, it's taken care of)
/cat/subcat?PageId=2 => /cat.php?cid=148&PageId=2
Note that there's an & in the second clause...  The parameter will always be PageId
Can this be done?
Thanks so much in advance!
Answer: Apparently a little elbow grease worked (after 5 hours)...
Ends up the rule is just:
^/cat/subcat /cat.php?cid=148 [QSA]
I was missing the QSA component...
-Adam

Mod_rewrite syntax with query strings


Custom Font Complications (Wordpress)

Question: I've been developing a site for a client who upon review wanted the font changed. I found a free plugin on line and added the font. There's an anomaly in my header as a result. Items in my menu aren't positioned next to each other. Can anyone help please.
Comment: Can you reproduce the error you are getting? **BTW:** using a plugin to add a font is just an "overkill".
Answer: Why would you use a separate plugin to change a font?
You should add the font directly in your theme's header and adjust the CSS accordingly.
For example, using Roboto from google fonts - https://fonts.google.com/?selection.family=Roboto:
In your theme's header.php add this line before </head>:
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">

In your theme's style.css add the font to your elements, as needed - for example:
body {
  font-family: 'Roboto', sans-serif;
}

If you need more help understanding how this works, I think this resource could be a good place to start: https://developers.google.com/fonts/docs/getting_started

Custom Font Complications (Wordpress)


Move a tmux pane to another session

Question: Short of doing this, is it possible to move a running command in a pane to another tmux session?
Comment: For people landing from Google: in recent TMUX versions, there's a much more easy way than the accepted answer (which is 7 years old). See [the answer by @MacMartin.](https://superuser.com/a/1575736/598957)
Answer: Yes it's pretty easy, use the move-pane tmux command. For more info run
man tmux | less -I '+/move-pane'

The tricky part is just knowing how tmux references sessions, windows and panes in the commands to manipulate panes etc.
Step one
Move into the pane you want to move to the other session
Step two
Get the name of the target session by running <prefix>s.
On my system that produces:
 (0) + 0: 8 windows (attached)
 (1) + 1: 1 windows
       ^
       |
    This is the session name. It could be different
    on your system and it could be a word (not just a number).

Step 3 - run command
<prefix>:move-pane -t <session_name>:<window number>
                      ^^^^^^^^^^^^^^ the name from above goes in here

So on my system I moved into the pane with the running process, ran
<prefix>:move-pane -t 1:1

and the pane with the process in it moved to window one on the session 1.
It gets inserted as a split, so usually you would want to run window  on the other session as a throwaway window.
Note: it seems that the target window does need to exist, else the move-pane command will issue an error.
For more background on the format for specifying sessions, windows and panes within a tmux command, see the section COMMANDS in man tmux.
Comment: There's a simpler procedure: mark the pane with `m`, go to the destination window with `w` and move the marked pane there with `join-pane`.
Comment: I like the way you referenced the manpage, but why didn't you just use `man tmux | less '+/move-pane'`?
Comment: Even if it's not relevant, just want to add that you can also move whole windows by just replacing 'move-pane' with 'move-window'.
Comment: Sadly it seems there is no such way (using marks, without naming it explicitly) to move a window.
Answer: Tmux has the shortcut: <prefix>. (a dot)
<prefix>. then input 6<enter> - move current window to position 6 (in the current session)
<prefix>. then input 2:6<enter> - move current window to position 6 in session 2 (see als session names/numbers with <prefix>s or <prefix>:-ls<enter>
(also new for me: <prefix>! to move a pane (from a split) to a new window)
tested for Version: 2.3 on Debian9/Manjaro and 1.8 on RHEL 7 (thx @HEGX64)
Comment: I messed around with this for a bit and discovered that you don't need to specify the destination window position.  That is to say: `.0:` moves the current window into session 0 at the next available position.  Very handy.
Comment: This also works for me on tmux version 1.8 on RHEL 7. I doubt many people are using older versions that that so you can probably remove first sentence if you want to.
Answer: I can't comment, so I will place it here: for tmux 2.1-3build1~precise the command should be:
<prefix>:move-pane -t session_name:window_number
-- you need a "-t" before session name (not necessarily a number), and the window with a given number must exist.
All the rest is as described by the_velour_fog in his answer.
P.S. If you type only a session_name without window_number like so:
<prefix>:move-pane -t session_name:,
then your pane will be moved into current window of destination session (and this window will be split).
P.P.S. If you just want to move your window (and not just your pane), then there a good answer on how to Move window between tmux clients:
<prefix>:move-window [-d] [-s src-window] [-t dst-window]
(alias: movew)
where src-window and dst-window have the form session:window.pane.
Answer: I have two sessions running, each in their own iTerm. All I needed to do to move the pane from one session to another was
select the pane
<leader>s <session>
where <session> is a number inside square brackets
tmux 2.7
Comment: That doesn't actually move the pane from one session to another. That just changes the session you're viewing from the current terminal. It's equivalent to disconnecting and connecting to the other session. I want to actually be able to move panes between sessions with multiple other panes open.

Move a tmux pane to another session


Why does a surface always exert force normal to it?

Question: In whichever angle an object is thrown at a surface, the surface always exert force normal to it. But why? According to Newton's third law, if an object hits a surface at an angle, the reaction force provided by the surface must be equal and opposite to the applied force by the object. But why  does the surface always exert force normal to it?
Answer: The force is normal to the surface only if no friction is present. If we have some sort of sticking between the thrown object (e.g. ball) and the surface (e.g. earth), there will be a non-normal component of the force.
Just think of an ball which slides (w/o friction) on the surface of the earth. As there is no friction, there can not be a force.
Now go back to the original question.  Let's consider the motion of the ball as a  superposition of two motions:

The vertical motion, which is in normal direction (say y-direction), and
the horizontal motion (say in x-direction).

If we consider the horizontal motion to be frictionless, there can not be a force in x-direction. Hence, we are left with a normal force, which reflects the ball.
Once you include friction to the problem, you will get a superposition of two forces. From that you can derive the direction of the total force. In general it will not be along the moving direction of the ball.
Comment: //In general it will not be along the moving direction of the ball.//  Why isn't it? Can you please, clarify?
Answer: Force of contact is often called the normal force. It's really the force of electrostatic charges in each body acting on the other, but if we model the field around the ground as a plate made of particles each of some charge, they make an electric field that nets only directly away (i.e. normal, hence "normal" force) to the surface. The reason they push away is these are largely electric charge forces from electrons and like charges repel.
The reason the force is only normal is if we assume the particles are all the same in the body and they they are equally distributed across the surface, then some particle in a body has a field that pushes outward in every direction, but the particles all around it push back in every direction they come from, and none of the particles come from the normal direction, or else that wouldn't be the surface. I made a poor diagram, but it gets the job done. It has red lines to show how forces cancel to $0$ and the green lines show how they cancel to make a new total force in the direction of the green arrow. Notice that it only exists on the surface and points the direction that points least in the direction of every point on the plane, which is a property of the normal direction. This is why it pushes in a normal direction.

$$
% I wanted the spacing, if you are capable of making better diagrams please do, and also tell me what software you use to diagram, mine are always awful
$$
If we look at a ball, we just say that for a small of region/zoomed in enough, it is locally linear and the same as the ground, which is a plane. So a ball has a field that pushes directly away from the surface, which means it must pass through the center of the ball. And if the ball is a perfect sphere, then contact between the plane and the ball is only at one point and the plane is tangent to the ball. It is a property of tangent to be normal to the radius. So if the plane is tangent, and the force coming off of it is normal, then the force of contact (the normal force) acts along the radius of the ball. This can be seen in the following diagram.

$$
% Again, I wanted the spacing, also again, if you can make better diagrams, please do and let me know what you use to make them.
$$
So when the ball comes into contact, the plane pushes on the ball completely away from the plane. Since the ground is a horizontal plane, it's normal force is completely upward so the ball must interact with the ground going completely upward. Interestingly, the plane feels the opposite, a ball comes along and pushes it down, but it's in the exact opposite direction. This is known as Newtown's Third Law, or the Weak Law of Action and Reaction. It states, "Every action has an equal and opposite reaction." It is weak as in it does not hold up in all cases, you could also research the strong law if you like, it covers some magnetic forces, which do not behave how Newton predicted.

However, all of this ignores friction. Friction is what happens when we realize that those electric fields are not perfect, there's little regions where the forces can't cancel perfectly to only go upward because the surface isn't perfectly flat. When we include friction we get some neat things happening, most interesting is that we can get things to spin around when they strike the ground, really useful on the basketball court if you want to show off. Push the ball off your hand with a lot of spin and you can get it to change spinning direction after it comes into contact with the court, if you do it right you can get the ball to return to you if you push it away spinning toward you, but there's a limit on how hard you push it away from you, the ball will eventually need to spin too quickly to get back to you and will end up sliding. But sliding friction is smaller than static friction and that means the ball won't get be pushed back to you as hard and might not be able to change direction.
For a better description of friction, the first thing to point out is that in the old scenario we had a perfect ball, and a perfect ball wouldn't deform at all, which you won't find in the universe, but let's say that we can approximate the atomic structure to not change position. When the surfaces come near contact, the electric fields cause the force of contact to increase, slowing the ball's fall until it pushes it back up. This would take at least some period of time. And if we go with our frictionless model, then that means the ball must have traveled sideways as it pushed into the surface because nothing stopped it from going sideways, therefore it must have continued going on its way for that period of time. So it needed to slide on the frictionless surface. This alone is enough to continue on and describe how friction works, but we can add a little better explanation of it if we let the ball and/or plane bend a little bit or deform when they come into contact. The contact between a perfect ball and plane is a point, this is how we define tangency, but if it squishes, then we'll get a small area of a likely irregular shape. This area can have defects of its own, unlike the perfect ball. So here's a picture of one surface coming into contact with another surface. The big one is the overall force felt by the ball.

Notice how we get multiple little forces pushing in non specific directions? These are what cause friction. Friction is essentially the amount of force that describes the overall effect of these little forces. For the most part, the forces on the ball will come directly off the plane in the big vector, but these small surface defects will also have an effect, the former is the contact force, or normal force, the other is called friction. From this image, we can see that both of these are contact forces, but it's easy for us to say that the ball comes into point contact with the plane, but there will be also be a force that wants to make the ball both slow down and rotate. It's more difficult to describe the normal force as a function of the two surfaces, I have to define these two surfaces and how they bend when they come into contact. At the end of the day, the second case will need to be put into a coordinate system and if you choose a pair of axes that lie on the surface normal and the surface tangent, you'll get those two forces, normal and friction.
Answer: A reaction force can surely be angled.
And it can then be split into a tangential part and a perpendicular part. The tangential part is called friction, and the perpendicular part normal force.
So, the reaction force is not at all always perpendicular - but there always is a perpendicular component (the one called normal force). This arises because, since the wall doesn't break, it must be holding back. A normal force is a "holding back" force that objects create when being pushed upon to avoid breaking.
Comment: @Yashas Thank you, but that is what I am saying in the answer. I have added some words now to make it clearer. Please let me know if anything is still unclear here
Comment: The reaction force can act at an angle but the normal force for a finite surface must act perpendicular to the surface.
Answer: From a purely Newtonian-dynamics perspective the origin of the normal force (or any force) is not explained. Instead, we infer the existence and direction of the normal force by observations of acceleration: if you see two solid objects not sinking into one another despite the influence of gravity, they must be exerting a relative force upon one another that counteracts gravity - otherwise the net force would be nonzero, so there would be a relative acceleration.
What generates that force microscopically? Well, it's a bit complicated, depending on the details of the structure of the matter in question. At the end of the day this question requires a detailed explanation of the structure of matter, since for example liquids, solids, and gasses will exert different "normal forces". But roughly, it is a combination of electrostatic repulsion and Pauli exclusion between electrons in matter.
Answer: The word "normal" in normal force is not referring to ordinary or commonplace. The "normal" here refers to perpendicular. This is because the normal force, usually represented with $F_n$ or just $N$, is a force that is directed perpendicular to the two surfaces in contact. It makes sense that the force is perpendicular to the surface since the normal force is what prevents solid objects from passing through each other. Surfaces can also exert contact forces in the direction parallel to the surfaces, but we would typically call those forces frictional forces (since they work to prevent the surfaces from sliding across each other) instead of calling them normal forces.
Example of this: when you stand still on the ground, you are pushing the floor down. This is a force due to gravity. Some may think that's the only force acting on you, but if that were true, you would be free falling through the floor. Why are you not falling? Because the floor is pushing you up! When you are standing still, the floor is pushing you up just as much as you are pushing down on it, which gives a net force of zero.
Normal force happens when 2 bodies with mass (usually one is a wall or floor but can be any body with mass) come to contact and have a force towards each other.
Also, friction is dependent on the normal force. Won't go into detail but friction always opposed the motion of a body of mass.
Answer: Let us put some symbols. We will call the velocity of the particle $\vec{v} = (v_x, v_y)$ and momentum $\vec{p} = (p_x, p_y) = (mv_x, mv_y)$. Let us supose that the collision is frictionless, to simplify, but losing some generality (not much, your satement would be false if instead of the particle we would have a rigid body with rotation and friction).
Then the question is: ¿Why $\Delta \vec p = (0, \Delta p_y) $? and $\Delta p_x =0$
We will formulate a theory for collision of a particle with a surface. What parameters descrive the system before the collision. This migh be for example the momentum $\vec p$ (or velocity $\vec v$) of the particle.
The angle of collision, that is, the angle between the normal vector to the surface $\vec n = (0,1)$ and the trajectory of the particle is guiven by the volocity on the moment of impact, so it is not an independent parameter. The angle of collision will be given by $\tan(\theta) = v_x/v_y$.
Knowing this, we will change our inertial frame, to one comoving in the $X$ axis with the particle, that is with velocity $(v_x,0)$, so in the new reference frame the momentum will be $(0,p_y)$ and the angle of collision will be $\theta =0$. The situation is completly symmetric (initial conditions and forces), thus the solution must be also symmetric (think this argument, is important in physics), so there can't be change in momentum in the $X$ axis, so $\Delta p_x = 0$.
But as Newtonian physics is independent of the inertial frame, we have that this is true in our original frame also, so all the change is in the $Y$ axis.
Change of frame and symmetry arguments are comom in physics, and simplify the arguments, nice to use them.
EDIT: Added an explanation for the angle
Comment: When we walk, we exert force to the surface at an angle and the surface also exerts a reaction force on us at an angle (in the opposite direction of our applied force). But when I throw a ball at an angle to the ground, the bal doesn't come back following the opposite direction. Rather, it jumps off the ground at angle. Why the direction of normal force different in these two cases?
Comment: In the walking case there is friction!, this is what gives you the forward "force" ( in reallity walking mechanics are really complicated and entire articles about it). The normal force is the same, but walking has an aditional friction force, so the total force has non-normal direction
Comment: Why does a ball exert force on the ground straight downwards even the ball is thrown to the ground at an angle?
Comment: Because we can choose to not care of the angle (changing reference frame), so this means it must be irrelevant.

I changed the question a bit to clarify this.
Comment: @Hisab The thing is that when throwing the ball on the ground, the normal force is strong enough to push the ball back (the ground doesn't break), but the friction is not that strong. It merely slows it down. (In reality the ball might start spinning and the ball might be elastic, which will change the situation a bit). This is a good question, but different from the one you have asked above. You could ask it as a new question, if you are not satisfied here.


Java Development Kit (JDK) from ftp?

Question: I need to download specific JDK version but from console in Linux. I have not lynx/elinks etc linstalled. Where can i download Java Development Kit (JDK) from ftp ?
Comment: What linux distribution do you use? Many distributions have jdk packages in their repositories.
Comment: Debian - Ubuntu
Answer: You can also use wget to download files over http.
To install Sun JDK, do the following...
Add this line to /etc/apt/sources.lst
<code>deb http://archive.canonical.com/ maverick partner
</code>
Then sudo-apt-get install sun-java6-jdk will install it.
Assuming Ubuntu 10.10, here...
Comment: I can not use sudo (permissions). I just need to get (wget) jdk zip/tgz/bz2.

Java Development Kit (JDK) from ftp?


What security exist when sharing files via an external USB drive?

Question: We have several external sources that send us data via an external hard drive. What security risks are we exposing ourselves to?
Answer: Next to none, as long as you do not run any programs from these sources.
There is no autorun in Ubuntu, so drives attached to the system will not trigger execution of any executable files found on the drives.
Moreover, the drives are automatically mounted for a given desktop user, which makes the scenario of automatic infection of the system unlikely, even in the case that a user runs one of the programs from the drive.
One can imagine the following scenario: someone hides an executable and calls it "portrait.jpg". The user opens the drive, ignores the fact that Nautilus indicates executable (rather than a jpeg), and when the binary asks for password, the user happily types in the password...
Well, you can always make sure that mounting is done with the noexec bit. But then, what is to stop the user from copying data from the hard disk to home directory and running it?
Comment: Can Nautilus be made to crash with a specially crafted file system on the external drive? How can this be detected? And what are the risks?
Comment: No idea. Probably yes; if you need to be very cautious (for some reason), then the data would have to be mounted, checked and copied by another subsystem (e.g. a script called from udev), and automatic mounting by gvfs should be disabled. I don't think that it is a real danger, though, given that it is hard to craft a such a filesystem which would work on all the existing versions of Nautilus and would work for longer than until the next daily update.
Answer: As far as I know, there is currently no generic malware targeting desktop Linux systems. However, it is definitely possible. An example has been shown by Jon Larimer at Shmoocon 2011.
By default, Ubuntu auto-mounts inserted USB drives and opens a Nautilus window to show the content. It may also generate thumbnails for pictures found on a drive.
This can be disabled, or it can be configured to do more automatically.
In Ubuntu 12.04 you want to check these options:

System Settings: go to System / Details and check the actions for "Removable Media"; you may want to select "Never prompt or start programs on media insertion".
Nautilus preferences: the "Behavior" tab (the "Executable text files" part!)
Nautilus preferences: the "Preview" tab, and if paranoid, disable "Show thumbnails"

You can also check your settings from a command prompt:
gconftool -S "*autorun*"
gconftool -S "*executable*"

In short, apply the same precautions with Ubuntu as with Windows or Mac:

disable all autorun mechanisms
don't give admin rights to normal users
educate the users to not click "yes" on messages they don't understand


Good base converter or using gbase?

Question: Could you suggest a good base converter that also does "signed" conversions? Either gbase does not do it, or I can't see how it's done. What I want to do is give the program an integer, say, -100, and I need to know the binary byte representation of it (in the example, 1 byte, first bit set to 1). I could possibly calculate this number by hand, but I got to do 1000s of them, and bigger than a single byte.
Comment: There's probably something missing in your question: the binary representation of a negative number is just the binary representation of its opposite with a `-` tacked on at the beginning. Do you mean you want the *unsigned* representation modulo N? Please clarify your question.
Answer: According to the manpage, gbase has a parameter -s to enter signed numbers.

Good base converter or using gbase?


Is my rental house safe even if the electrical is not grounded at all?

Question: Just found out when the electrician came today that the entire house I am renting is not grounded.  I really like this place and real estate here is a nightmare.  But, we have some iridescent lights he said need to be grounded to work properly.  I called the leasing agent right when we moved in because when we initially started plugging cords in a few outlets sparked and one smelled hot. We have three prong outlets, but apparently they are not properly installed.  We also have outdoor fixtures and switches that do not work because they are not protected from the weather. I knew it was an older house, but I was told by the agent before I leased the property that they had just had the entire electrical system checked.  Turns out that there is no way that could be the case.  The electrician wouldn't add much more information when I asked him what we should or shouldn't do currently to stay safe because of liability.
What needs to be done for my family to be safe?  What are my options as a renter in Hawaii?
Comment: If you have ungrounded 3-prong outlets (that aren't protected by an upstream gfci), that's a code violation. Your local building permits office might be able to help. (Though of course, action like that will make you very unpopular with the landlord.)
Comment: Hello, and welcome to Stack Exchange. What are "iridescent" lights; do you mean "fluorescent"?
Comment: What tools do you have to investigate this?
Answer: Maybe there is someone you can contact at the local council.  In England, it's the local council's environmental health department that would deal with it.
Strikes me as terrifically unsafe, anyway, but we have 240V mains, which kills you.  If you have 110V, there might be different regulations.
Comment: The 110/120 circuit is still deadly.  Typically anything 50V or higher is considered dangerous.  A 48V power supply is the standard maximum you would use and still consider it safe if anyone touched it.  I would be a little cautious around 48V but 24V is routinely worked on without extra protection.
Answer: I agree with Aloysius. Many homes in the U.S. Are 2 wire when the 3 wire outlets were added each circuit should have been protected by a GFCI and the outlets marked no equipment ground. Other that "touch lamps" I don't remember seeing lights that required the ground to work.  The hot smell is not a good thing make sure you are not overloading the circuit. I would guess that the electrician only checked the polarization of the outlets with a outlet tester like this or one with a GFCI test button.  If the circuits are GFCI protected with a GFCI outlet on the first outlet in the circuit or a GFCI breaker the system would meet code. The second tester cost ~10$ and you could verify the polarity and push the test button to see if there is protection.


tell if last command was empty in PROMPT_COMMAND

Question: In bash, from inside PROMPT_COMMAND, is there a way to tell if the user just hit 'return' and didn't enter a command?
Answer: Check whether the history number was incremented. A cancelled prompt or a prompt where the user just pressed Enter won't increment the history number.
The history number is available in the variable HISTCMD, but this is not available in PROMPT_COMMAND (because what you want there is in fact the history number of the previous command; the command that executes PROMPT_COMMAND itself has no history number). You can get the number from the output of fc.
prompt_command () {
  HISTCMD_previous=$(fc -l -1); HISTCMD_previous=${HISTCMD_previous%%$'[\t ]'*}
  if [[ -z $HISTCMD_before_last ]]; then
    # initial prompt
  elif [[ $HISTCMD_before_last = "$HISTCMD_previous" ]]; then
    # cancelled prompt
  else
    # a command was run
  fi
  HISTCMD_before_last=$HISTCMD_previous
}
PROMPT_COMMAND='prompt_command'

Note that if you've turned on squashing of duplicates in the history (HISTCONTROL=ignoredups or HISTCONTROL=erasedups), this will mistakenly report an empty command after running two identical commands successively.
Comment: This solution is based on the assumption that duplicates are saved in the history (which is OFF for me). Hence this solution does not work as expected for repeated commands while duplicates are not saved in the history.
Comment: Thanks, Gilles. I'm missing something here. This never seems to run, as putting 'echo hello' on the first line of the literal function doesn't work, though PROMPT_COMMAND='echo hello' does. I thought it might be the HISTCMD_previous vs HISTCMD_PREVIOUS issue, but no dice. I'll keep poking, but I'm commenting as your bash fu is clearly leagues beyond mine.
Comment: @user I fixed more typos, in particular the `${HISTCMD_previous%%$'[\t ]'*}` bit was missing the `$'…'` and ended up truncating after `\`, `t` or space instead of after tab or space, but bash prints a tab.
Answer: There is a workaround, but it has some requirements:
You need to set $HISTCONTROL to save ALL commands, also duplicates and spaces. So set:
HISTCONTROL=

Now define a function to call as $PROMPT_COMMAND:
isnewline () {
  # read the last history number
  prompt_command__isnewline__last="$prompt_command__isnewline__curr"
  # get the current history number
  prompt_command__isnewline__curr="$(history 1 | grep -oP '^\ +\K[0-9]+')"
  [ "$prompt_command__isnewline__curr" = "$prompt_command__isnewline__last" ] && \
    echo "User hit return"
}

Now, set the $PROMPT_COMMAND variable:
PROMPT_COMMAND="isnewline"

See the output:
user@host:~$ true
user@host:~$ <return>
User hit return
user@host:~$ <space><return>
user@host:~$

Comment: I don't understand why you're using a temporary file here. The variable `last` is preserved from one invocation of `isnewline` to the next (only pick a less generic name like `prompt_command__isnewline__last` to avoid clashes).
Comment: @Gilles You're right, I changed it, thanks for your suggestion
Comment: Thanks, chaos. I used the same idea for the following, which is a bit easier to parse.

`HISTCONTROL=""
function last_was_blank {
 local last_command="$(history 1)"
  if [[ "$last_was_blank_PREVIOUS_LINE" = "$last_command" ]] ; then
   echo "true"
  else
   echo "false"
 fi
 export last_was_blank_PREVIOUS_LINE="$last_command"
}
PROMPT_COMMAND=last_was_blank`
Answer: I don't know of a way to do that, per se.
But you can get the same effect by using
trap some_command_or_function debug
This will causes the some_command_or_function to be called
any time you run a command.
The tricky thing is, it will not be called if you just hit Enter —
unless you have a PROMPT_COMMAND defined,
in which case hitting Enter invokes the PROMPT_COMMAND,
which, in turn, triggers the trap.
Perhaps the simplest way to achieve the result that you want
is to define a debug trap function instead of using a PROMPT_COMMAND.
But I can't tell, because I don't know what result you want.
If you want something to happen when you just hit Enter,
and something different/additional to happen when you type a command,
then (AFAIK) you need to use a debug trap and a PROMPT_COMMAND.
See this answer and this one
for a way to make the two mechanisms play together nicely.
Answer: (This would have been a comment to the accepted answer if I had been allowed to add comments...) @schlimmen, you may set HISTTIMEFORMAT to something like HISTTIMEFORMAT='%F %T ' and then save and compare history 1. It's because with erasedups at least the timestamp of the (possibly repeated) last command changes every time --- and with HISSTIMEFORMAT appropriately set, history 1 will display the timestamp (unlike fc), and thus differ even between the repeated commands.


isUserInRole source code or HttpServletRequest

Question: Where can I find the source code for isUserInRole? All I find are only interfaces or calling to super.isUserInRole
Comment: Note: J2EE is replaced by Java EE over 4 years ago. Based on your question history you're using Tomcat 6 (Servlet 2.5, part of Java EE 5.0) and even JSF 2.0 (part of Java EE 6.0 and backwards compatible up to Java EE 5.0 only), so I don't expect that you're actually using J2EE and I fixed the tag.
Answer: You can find it in the concrete implementation. As you see, Java EE is an abstract API, it exist of almost only interfaces. It has the benefit that you can deploy your webapplication on whatever server you want.
The concrete implementations are called application servers and/or  servlet containers, like Sun Glassfish, IBM WebSphere, Oracle Weblogic, Apache Tomcat, Eclipse Jetty, etcetera. You need to check if your server implementation is open source and then download the source from the vendor's homepage.
Tomcat 6.0 for example is open source, you can download it here (check the Source Code Distributions links at the bottom). It is in the org.apache.catalina.connector.Request class.


Is 1/4" overlap, front door to door frame enough to prevent break-in?

Question: In my Mom's gated community, there were some break-ins by robbers who stole jewelry, etc. In both cases, the robber(s) broke in the front door. The police department had a meeting with residents about preventing break-ins, and a deputy recommended having the front door reinforced, or to have it replaced with a metal door. There is 1/4 overlap, wood door on doorframe. Is that enough? I thought if you had a deadbolt, which we do, it was almost impossible to break in through the door.
Comment: "*There is 1/4 overlap, wood door on door frame. Is that enough?*" What does that mean ? How do you think the "overlap" is a security feature ?  "*I thought if you had a deadbolt, which we do, it was almost impossible to break in through the door*."  **The dead bolt is only as strong as the wood door jamb that it is in**, easy to kick in if the plate is not secured with long screws into framing, added reinforcement is recommended. I think you need to do some research on how to make an entry door more secure. And your question should be  "How to make an entry door as secure as possible?"
Comment: A picture sure would help.
Comment: Enough for what? No residential door is break-in proof. Even deadbolts can be jimmied.
Comment: @AlaskaMan, the question you suggest is highly opinion oriented and would likely get closed because of it. A better question could be "What are some options that can make an entry door more secure."
Comment: @computercarguy can you explain the difference between "*How to make an entry door as secure as possible?*" **AND** "*What are some options that can make an entry door more secure*"  What is "more" secure ? More secure than what ?
Comment: @AlaskaMan, the difference, I think, is that your version asks more about what other people would do to secure their doors, and my version asks what devices are available, without the opinion of whether it would work or not. It also avoids the "put 3 deadbolts, 2 chains, 3 slide locks, a bar across the door vertically and horizontally, and don't forget to wedge a chair under the knob" kind of "answers". And "more secure" would have to include a description of what the OP already has so there can be a baseline to compare with.
Answer: There is no such thing as an "impossible to break in" door short of something like the NORAD facility in Colorado.  That sort of thing would be quite impractical for the average home.
The best choice, however, is a door sturdy enough to discourage the garden-variety OPPORTUNISTIC thief.  Generally they will move on if they can't get in quickly and the best thing you can do is make gaining entry difficult enough they will go somewhere else.
A steel-clad door with a steel frame is an excellent choice but you need to ensure that the frame is well anchored into the wall of the home.  A proper installation may take some construction work and if you aren't familiar with this kind of construction you should hire a qualified installer.
Keep in mind that thieves also look for other weak points to enter like windows, sliding doors, hidden keys (they know ALL the spots), etc.  So check and reinforce those as well.
Thieves like to come back to places they have hit after a few months looking for insurance-paid replacements so don't think that just because you were hit that you are in the clear.
Comment: Just watch home alone and set traps at all the weak points.  Culkin does a good job of covering them in his movie.


Best way to log clicks on a link of a custom content type

Question: I have a custom content type (bundle, drupal 7) which has a link (rules link module) and I want to log the number of clicks on this link. At the moment I've an integer field in the bundle and I use rules to increment it and save the node every time the link is clicked.
I think this method is not efficient and has also security implications so I ask you suggestions on how to do it better.
I considered writing a small custom rule (module) which increment the value directly in the field table which probably would have less overhead but I think it would still not be very secure as I don't know how to handle a large number of clicks in a short time.
Thanks for any help.
Answer: A possible alternative to "record the clicking of such link" is to use the Message module to create a message like so:

Date = date the link was clicked.
User target = the user who clicked the link.
Message type = something like "Link of custom content type clicked".
Message text = whatever you want and possibly using "Replacement tokens" to have any of the tokens that you have available in your rule also included in your message text (should you have any such need).

Since messages are entities, you could add any additional fields you may need to complete such custom logging.
With this approach, you've reduced your question to (eg) creating an appropriate view (and/or chart?) of all such messages that got created.


Scripting github commands with no SSH Key password

Question: If I do not set a passphrase for the SSH Key generation what risks do I run?
The reason I am choosing not to use a password is ease of configuration for scripting git pull and push events on a windows laptop with python.
Comment: I never really set up a passphrase when setting up SSH Keys, never had an issue.
Answer: The risk that if someone gets a hold of your key (Via malware, for instance) they can impersonate you, check in to your repo, etc.
That said, I would really nervous about leaving a non-passworded key on a Windows machine. I do it all the time on unix (including OS X) machines I control, but I feel much better about the security of those systems.
Answer: You have to balance between the security and ease of use. I have seen that passphrase-less ssh keys for git access are pretty common, mainly because of the convenience. I would rather have a passphrase-less one than try to use some hacky means of trying to script the push and pull.
Just make sure the keys are only kept within your $HOME folder on Windows and you should be pretty secure.
If someone has access to your private folder, you will have bigger problems to deal with anyway.


Is there a CRM like tool for managing offline social personal (non-business) use?

Question: Lately I found the need to more and more to take notes of my offline social interaction so I can go through them later. People's name, their child, what they do, hobby, etc. Just like CRM in business. Are there any webapps + iphone app that can help me with this?
Comment: Saw Bento before it looks to me more like a modern simplistic Ms Access. I think it could work, but I kinda wish something smarter that integrates with social networking sites when possible. But thanks for reminding me about Bento. Will give it another shot
Answer: Sugar CRM is a free CRM but you'll need to set up and apache server with php and mysql. You also have mobile apps for it. Check it out, it may be what you're looking for.
http://www.sugarcrm.com
Answer: Seems so far the closest fit that I could find on a Personal Relationship Management is Nibble http://www.nimble.com/


How to write a list of citations

Question: I am applying for a job and I have to submit (among other) the list of all my citations (excluding autocitations of course). I wonder how the list should look like. Should it look like references at the end of any scientific paper? I guess not since then you could not tell which papers of yours were cited?! Is there any standard way how to do this?
Comment: This post may be helpful: http://academia.stackexchange.com/questions/42845/mentioning-times-cited-f1000-citations-in-cv
Answer: The aim of the document is to have a verifiable version of your citation count, which is commonly used for filtering out some applicants in an application process. It should provide a list of your papers together with their citation counts, and it needs to back this up by data (such that it is verifiable). This means listing for each of your papers which other paper cites it.
There seems to be only one reasonable way to structure such a document, to  first list all of your papers with the citation counts, and to then use seperate sections for each of your papers with the biliography entries for the papers citing your paper. In this way, you give the information that is mainly useful for verifying your citation count later in the document, while giving the important information first.
I doubt that there is any "official" information on how to format such a document. After all, scientists know that citation counts are a bad way to evaluate a researcher's output. So there is no urge to stress the importance of these documents by providing additional formatting requirements.
Answer: Like @DCTLib states, I also don't think there is an official format. See this link, which I also mention in the comments, for a fairly good discussion of this general topic.
Web services like Google Scholar may be the best solution. By providing a link to your Google Scholar profile (or similar), anyone can look at your citation counts or anything else in real time. This also has the benefit of not being overwhelming or confusing to follow, which is a real concern if you try to print or list explicitly all of your citations and the citing papers (especially if there are many).
Comment: The thing is that Google Scholar grossly overapproximates your citation count (by counting self-citations, citations from lecture slides, ect.) - sometimes this may be sufficient, but using the result as part of your application looks a bit suspicious, as it is very easy to improve your "Google H-Index".
Comment: Fair point. If someone was really concerned about that, it's fairly easy to get an "adjusted" count by seeing how many citations the person has, then limiting the count to those published by the author. Once you have those 2 numbers, it's an easy subtraction, although if you're interested in article-level counts (instead of global counts), this may be a tedious process. Overall, I think this is a tedious task no matter how you slice it.

How to write a list of citations


Create/update templates through API

Question: I've been searching through the Fuelsdk docs and I can't work out how templates can be created/updated.  It feels like I'm missing something obvious here, but how can I create a new template and insert html using the API?
Answer: The Template object is not currently exposed via the SDK, it is accessible by using the SOAP API directly.
Details on the Template object:
https://help.marketingcloud.com/en-US/technical_library/web_service_guide/objects/template/
Example SOAP Request:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://exacttarget.com/wsdl/partnerAPI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="https://exacttarget.com/wsdl/partnerAPI">
   <SOAP-ENV:Header>

   <SOAP-ENV:Body>
      <CreateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
         <Objects xsi:type="par:Template" xmlns:par="http://exacttarget.com/wsdl/partnerAPI">
            <PartnerKey xsi:nil="true"/>
            <ObjectID xsi:nil="true"/>
            <TemplateName>API Created Template5</TemplateName>
            <LayoutHTML><![CDATA[

@@headerContent

@@layoutContent

<custom name="opencounter" type="tracking">]]></LayoutHTML>
            <BackgroundColor>ffffff</BackgroundColor>
            <BorderColor>000000</BorderColor>
            <BorderWidth>1</BorderWidth>
            <Cellpadding>0</Cellpadding>
            <Cellspacing>0</Cellspacing>
            <Width>600</Width>
            <Align>center</Align>
            <ActiveFlag>1</ActiveFlag>
            <CategoryType>template</CategoryType>
            <OwnerID>38626</OwnerID>
            <Layout>
               <ID>1</ID>
            </Layout>
         </Objects>
      </CreateRequest>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Answer: Pretty sure you can't create Email Templates using the SFMC APIs.  The whole re-publishing templated email scenario is a complication that I don't think they have overcome.
You can certainly update Content Areas in templated emails or update HTML Paste emails with the API.
Comment:  tags to allow content blocks don't seem to work when an email is created through the API, but they do work if the same html goes in as a template then an html is created from it.  That's why I'm asking about templates - should a  tag work in an email that isn't based on a template?
Comment: When you are creating the Email via the API with content blocks, does the request have IsHTMLPaste = false and EmailType = Normal?  Those should be the default values so if they are undefined then that should work too.
Comment: I've checked and the email is being created with IsHTMLPaste = false and EmailType = Normal, also I've retrieved the campaign to check these.  What I can't work out is whether an email being from a template a precondition of making the  tags work?  If not, what other properties might be important - what does IsActive mean - and where is it documented?
Answer: @Mac's answer is correct at the most basic level. It's possible to create and update Templates, however the API doesn't have access to the ContentAreas, the "Layout" object referred to in the documentation (updated URL: https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/template.htm) says that the Layout object contains ContentAreas, it does not.
There is a Laravel Version of the FuelSDK, i've added "createTemplate" and "updateTemplate" methods to the ET_Client, and I am using these in production.
https://packagist.org/packages/ariad/exacttarget-laravel
I very badly need to update that documentation.
The Layout Object: https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/layout.htm
states "reserved for Future Use" and also does not have ContentAreas.
The only thing that can implement a ContentArea, is HeaderContent which is type: ContentArea    description: Contains content used in header of template.
This only provides the ID and ObjectID to a ContentArea Object which you can update if it exists, it appears to be missing the key and content which you would need to make this work in the content tag, I don't think you can create these independently as they have a CategoryID of 0 (they belong to a Template, not in My Contents).
Bottom line, The Template Object from the API perspective is VERY broken. Basic Templates can be created, but you'll need to go into the Marketing Cloud website and fix them if you are using any of their more powerful features.

Create/update templates through API


Why does converting the_geom into lat/long gives me more than 1 coordinate?

Question: I'm converting my the_geom into lat/long coordinates but I only want a single coordinate since I'm gonna use the coordinates to draw a polyline in google maps.
Attached is the picture of the result of my query.
Answer: Your result is the line strings needed to draw the actual route. This is probably what you want, but if needed you could break them down in to individual points by hand.
Comment: Please read the manual page about https://postgis.net/docs/ST_DumpPoints.html.
Comment: thanks for the answer, that cleared things up. but is there a way to convert them into a point(lat,long) rather than in a linestring? I'd appreciate any suggestions.


What is the semantic difference between 'thing', 'object', 'piece' and 'item'?

Question: I'm editing an article which talks about early terms for artefacts in the Russian language, but the article is in English. Both Russian and English have a diverse field of synonyms for 'thing' - I was wondering if anyone can spot any semantic differences between 'thing', 'object', 'piece' and 'item'? Be as subjective as you please!
Answer: Thing and object are a classic example of terms of Germanic origin versus Latin (or Norman French) origin, therefore informal/formal, domestic/intellectual (or legal) type of distinction. Does Russian have formal and informal registers?
Piece and item are both parts of a larger group, but items feel like they are complete in themselves, whereas piece feels incomplete. (Jigsaw puzzles have pieces, not items, whereas collections tend to items rather than pieces) In usage of course this is not always so, as piecework tends to mean being paid for items.... And concerts have items, but you tend to practise them as pieces.....
You did say to be subjective....
Comment: I agree on those characterizations of item and piece -- 'thing' is most general but also mostly outside the standard academic register.
Answer: I have no actual research backup for this, but I tend to see "thing" as being more amorphous.  "Object usually means a discrete object, and I tend to imagine it as small unless otherwise specified, but that may be personal.  "Piece" implies that it's either part of a whole or there are multiple items.  "Item" ... I guess pretty similar to "object" - if I had to make a distinction, I'd say that I use 'object' for something just lying around and 'item' for something deliberate - an item in a shopping trolley or on a list or something.
That's all pretty personal, though.


QTP Code for permanently enabling MACROS

Question: I have a QTP script which opens an excel sheet and update some of my results in the excel work book, but the excel has macros, so everytime when i runs, the alert box asking whether to enable macros pops up.
So i need a QTP script which will premanently enable macros.
Kindly help.
Answer: You can't use QTP script to enable macros permanently. Another work around for this is to go for trust center settings in Excel. Here you have option to enable or macros or you can disable macros without notification. Once this is done excel won't show any notification to enable macros. You may need to check the "Trust access to VBA project object model"
Assuming that you are using Excel 2007: To access the trust center settings click the office button >> Excel Options >> Trust Center >> Trust Center Settings >> Macro Settings
Note: Its not recommended to enable macros permanently as it may compromise your security.
In addition you can open excel files in background using QTP. Try doing that and check whether the enable macro pop up create problems.


Is it acceptable to use "to ever happen" in future time, like "I don't want this to ever happen"

Question: this is my first time posting here so excuse me if this is not the place to ask. I wanted to use the "She didn't want it to ever fade", but I'm not sure if this is grammatically proper. I have considered using "She didn't ever want it to fade" instead, but felt that in this case the meaning of "ever" includes the past, present and the future while in the previous example the meaning of "ever" is implied to only include the present and onwards. The meaning I'm going for is that of present and onwards because the thing spoken about (She didn't want it to fade) is a feeling previously unknown to the character, and thus including the past would not make sense.
I have two questions then:
1. Is the sentence "She didn't want it to ever fade" grammatically proper?
2. Is there an (implied) difference in the meaning of the word 'ever' between "She didn't want it to ever fade" and "She didn't ever want it to fade"?
I hope I had made myself clear, and I'll be happy to clarify if not.
Comment: There's no difference between ***want it ever to** [end]* and ***want it to ever** [end]*, but [the former was always more common](https://books.google.com/ngrams/graph?content=want+it+to+ever%2Cwant+it+ever+to&year_start=1800&year_end=2000&corpus=15&smoothing=3&share=&direct_url=t1%3B%2Cwant%20it%20to%20ever%3B%2Cc0%3B.t1%3B%2Cwant%20it%20ever%20to%3B%2Cc0)  (the two are now about equally common though, as per that chart). Much the same applies to *I don't **ever** want it to end*, which effectively means the same anyway.
Comment: @OreOS - " Is there an (implied) difference in the meaning of the word 'ever' between "She didn't want it to ever fade" and "She didn't ever want it to fade"? - In the first,  'ever' applies to the fading (she hoped it would never fade); in the second, 'ever' applies to her wanting (she never felt a desire that it should fade).
Comment: @FumbleFingers That is interesting to see, thank you for your reply. I'll try to use this tool in the future as well before asking, now that I know of it.
MichaelHarvey, this is a brilliant way to put it in words, thank you for your help!

This question can be closed as far as I'm concerned.
Comment: @Michael Harvey: That's really a "syntactic" distinction that I think *in practice* doesn't actually affect the meaning, as pointed out in my first comment. Anybody saying ***I don't ever want her to leave me!*** isn't likely to be trying to convey the fact that of all the things he might want in the future, ***her leaving him*** would never be one of them.
Comment: @FumbleFingers - it's the sort of thing I notice and am careful to avoid. "I don't ever wish Grandma to die" seems to have a more sinister and less creditable air about it than "I don't wish Grandma ever to die".
Comment: @MichaelHarvey: It's not obvious to me that "left-shifting" the word ***ever*** would make wishing Grandma was immortal sound *sinister*. But according to [this NGram chart](https://books.google.com/ngrams/graph?content=don%27t+ever+want+to%2Cdon%27t+want+to+ever&year_start=1800&year_end=2000&corpus=15&smoothing=3&share=&direct_url=t1%3B%2Cdo%20not%20ever%20want%20to%3B%2Cc0%3B.t1%3B%2Cdo%20not%20want%20to%20ever%3B%2Cc0), Anglophones in general are enthusiastically adopting that style, over recent decades.
Comment: I thought it would be sinister for someone to deny ever wishing Grandma dead.
Answer:
Is "to ever fade" grammatically proper?

Prescriptive style guides are usually fine with it. 18th century erudites like Samuel Johnson were known to dabble in it. This Grammar Girl post provides a fair summary of several grammarians. Even Strunk and White seem okay with split infinitives that improve the sentence's meaning. "To ever fade" is functioning much like other accepted split infinitves like "to boldly go" (Star Trek). So the split infinitive is not as much a matter of being proper as it is a matter of taste.

What's the difference between your two examples?

The literal difference is what ever is modifying: want or fade.

"She didn't ever want it to fade"

Ever modifies the verb phrase did not want. In this sense, it is her desire that is unyielding.

"She didn't want it to ever fade"

Ever modifies the infinitive to fade. In this sense, the important idea is that it never fades.
Taking one more step with either example illustrates how close these two meanings are in practice. What did she not want to happen? It to ever fade. What about it never fading? She doesn't want that. Because most readers don't apply adverbs so strictly that it would affect the meaning here, what we're really debating is small shades of meaning. Either is reasonably clear.
I take your point about whether the items refer to the past, present, and future. I think the first one ("She didn't ever want it to fade") sounds more likely to come from a narrator poised to describe how one's mental state (what she wanted) persisted across time. I think the second one ("she didn't want it to ever fade") could come from any narrator, but would especially be appropriate for describing someone's then-current state. So I agree with you, with the caveat that this is a slim distinction.
Comment: Thank you for the thorough explanation, it really did help me understand the difference between the two better. I'm glad to hear that it is accepted because I personally try my best to pay attention to these slim details (especially when writing) because I do think it can be used to enhance the meaning of a sentence.


Will not display in list box VB

Question: So, I'm trying to display the statistics for a soccer teams points scored.
At the time this is being executed, the arrays have been already filled and what not.
When this form opens, I'd like it to display the maximum, minimum, and average scores....
I want it to get the players name and score for max and min. For example:
    Maximum: John scored 9

    Minimum: Joe scored 2

Like, i'd be getting the value at strPlayers(i) for the name and intScores(i) for score.
I'm pretty sure I had the functions correct, but, for whatever reason, I can not get it to display anything in the list box upon loading the form!
Public Class frmDisplayStatistics

Function FindMaximum() As String
    Dim max As Integer
    Dim i As Integer = 0

    ReDim intScores(intNumberOfPlayers)

    max = CInt(intScores(0))
    For i = 0 To intNumberOfPlayers
        If max < intScores(i) Then
            max = CInt(intScores(i))
        End If
    Next

    max = strPlayers(i) & " scored maximum points of " & intScores(i)

    Return max

End Function

Function FindMinimum() As Integer
    Dim min As Integer
    Dim i As Integer = 0

    ReDim intScores(intNumberOfPlayers)

    min = CInt(intScores(0))
    For i = 0 To intNumberOfPlayers

        If min > intScores(i) Then
            min = CInt(intScores(i))

        End If

    Next

    Return min

End Function

Function FindAverage() As Double
    Dim average As Double
    Dim i As Integer = 0

    average = total / intNumberOfPlayers

    Return average

End Function

Private Sub frmDisplayStatistics_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim max As String
    max = FindMaximum()
    lstStatistics.Items.Add(max)
    lstStatistics.Items.Add("Minimum: " & FindMinimum())
    lstStatistics.Items.Add("Average: " & FindAverage())

End Sub

Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
    Me.Close()
End Sub
End Class

The reason maximum returns a string and minimum and average return a number is because I was trying a different approach, that also did not work. :/
Comment: What value do you get for variable max in the form load event?
Comment: I have no clue because it doesn't display anything.
Comment: I'm pretty sure the functions return correct max and min values, I just don't know how to display them in terms of the arrays!
Comment: ok so its returning you array. i think you cant add array like this. You need to loop them
Answer: Assuming you are getting array in the variable max in the form load event. Then you should loop the array. Like below
for i = 0 to max.count -1
     listbox.item.add(i)
 next

Also you need to declare variable max as array. Hope you got my point
Comment: The arrays are  strPlayers(intNumberOfPlayers) and intScores(intNumberOfPlayers).

max, min, and average are integer values representing the max, min, and average of the players scores.
Comment: You said that it is returning you array. I asked what value you get in variable max

Will not display in list box VB


Outlook Email via a Webpage

Question: I have a web application developed with ASP.net and C#  that is running on my companies' intranet.  Because all the users for this application are all using Microsoft Outlook without exception, I would like for the the application to open up an Outlook message on the client-side.  I understand that Office is designed to be run on the desktop and not from a server, however I have no trouble creating a Word or Excel document on the client-side.
I have code that instantiates the Outlook object using the Microsoft.Office.Interop.Outlook namespace and Outlook installed on the server.  When I try to run the code from the server, I get a DCOM source error message that states "The machine-default permission settings do not grant Local Activation permission for the COM Server application with CLSID {000C101C-0000-0000-C000-000000000046} to the user This security permission can be modified using the Component Services administrative tool."  I have modified the permissions using the Component Services tool, but still get this same error.
Is there a way to overcome this or is this a fruitless exercise because Outlook cannot be opened on the client side from the server-side code?
Mailto will not work due to the extreme length that the emails can obtain.  Also, the user that sends it needs add in eye-candy to the text for the recipients.
Answer: You cannot open something on the client from server side code. You'd have to use script on the page to do what you're wanting (or something else client-side like ActiveX or embedded .NET or something)
Here's a sample Javascript that invokes an Outlook MailItem from an webpage. This could easily be injected into the page from your server-side code so it executes on the client.
http://www.codeproject.com/KB/aspnet/EmailUsingJavascript.aspx
Answer: (hint: formatting in your question)
I'm not understanding what's wrong with a mailto link or a formmail-type page.
Answer: If everyone in the company uses Outlook, then just using a standard "mailto" link should always open Outlook.  It sounds like you're over-engineering this.
Answer: Do you want to open an existing E-Mail or create a new one?
Perhaps I misunderstood your question; could you provide a link like:
<code>mailto:email@example.com?subject=This%20is%20the%20subject&body=Hello%20there!
</code>
When the user clicks on that a link, a new Outlook-E-Mail will be opened and the:

Recipient: recipient@email-tld
Subject: This is the subject
Body: Hello there!

All these fields are already filled from the link.
Answer: I'll just throw this out there cuz it's been asked.
Mailto has a lot of disadvantages; mainly size.  Since the sender needs to do alot of formatting on the email text, the html code generated can take up a lot of space that fails when using mailto.
thanks for the suggestion though.
Comment: Can you clarify this (possibly in the question itself)?
It's not clear to me why a mailto: link should take up more "space" than anything else. Is the body of the mail completely auto-generated?
Comment: @Oliver Giesen, it's not that mailto "takes up too much space". Mailto has certain length limitations, if your message is too long it will be truncated.

Outlook Email via a Webpage


Is the laptop's power adapter output negative terminal grounded?

Question: Today I find my lenovo laptop power adapter's output negative terminal is not grounded (the input ground terminal is not connected with output negative terminal, measured with DMM). But another old one is just opposite, the output grounded. Why? There is any standard for power adapter? If the laptop is not grounded, is it safe?
Answer:
If the laptop is not grounded, is it safe?

Some laptop adapters don't have an earth pin and therefore they can never have a grounded output. It's not a problem providing that the insulation and clearance/creepage distances inside the adapter are adequate.
If a laptop uses a grounded adapter and the adapter is unplugged from the laptop then, the laptop isn't grounded - it's clearly safe in this scenario and, just as safe as when plugged into a properly designed and manufactured adapter that doesn't need an earth pin in the AC plug.
Comment: I find some of them the input ground connected with the output negative terminal, but some not. Are there any standard for this? Which is better? It's weird the input has a ground pin, but the output negative is not connected with it.
Comment: That said, when used in lab environments and/or with (other) grounded peripherals, it may be marginally better to have one that is physically grounded to reduce or eliminate common mode fiddlyfoops (tm).
Comment: @diverger In the EU I don't believe there is a specific standard other than meeting the low voltage directive and EMC directive but this applies (as a minimum) to any electrical goods plugged into a wall socket.
Answer: My experience is that the power supplies for the older laptops in which the backlight was CCFL were usually grounded on the DC side as well. I suspect it was because of the high-voltage inverter needed for the CCFL (approx. 600V DC output), but I'm not entirely certain that was the determining factor.  There's a concrete example of an older HP I have that does have minus grounded; details on that in this superuser post.
The newer laptops with LED backlight tend not to have the minus pin grounded. There can be static buildup and leakage currents on the non-grounded laptops [the latter particularly on metal cases] which can be irritating to some people. See this discussion on MacBook and this video of an actual measurement; he only measured AC voltage from case to ground as 78V AC with no grounding, which is probably enough to feel a slight tingle on a leakage current. A better test would have been to measure the leakage current as well... but I guess you need to try harder finding EE pros among Mac fans.
Comment: Note that in the US there's a [very confusing terminology promoted by the NEC](http://www.eetimes.com/document.asp?doc_id=1272972) in which the neutral is "grounded" and the earth is "grounding"; above I just mean earthed by either term. No laptop power supply is going to connect DC minus to the neutral because the phase and neutral can be swapped easily with some plug styles.
Comment: Yes, my two laptops both have 3 pins input plugs, so I don't mean the the neutral pin.
Answer: The first thing to understand here is that the AC ground coming from the wall, does not serve the same purpose as the DC ground going to the laptop.
They both typically sit at 0V and are often physically connected, but they serve different purposes. The DC ground is used to complete the circuit so power can flow, the AC ground is used for saftey, the power flows between live and natural and, under most circumstances, won't touch ground at all.
The AC ground is used when there is a fault. For example, say the live wire came loose and touched the casing of a metal microwave. If anyone touched the microwave, the AC power would flow through them and most likely kill them. To prevent this the casing is connected to the ground wire, so as soon as the live  wire touches the casing, a massive current flows through the ground, which blows the fuse / trips the breaker, isolating the device.
This ground connection is not necessarily needed if the device is suitably insulated. Phone chargers often don't have a ground pin (or for me in the UK, they have a plastic one) because if a wire did come loose, there is very minimal chance of shock as the whole device is insulated.
In your example of the laptop charger, the AC side of the charger often has a ground pin. I'm not sure if this is required or if some manufacturers are just being extra careful. However the DC side of the charger does not require one, as it is insulated very well from the AC connection, if the live wire came loose inside the charger, there is no way it could make your whole laptop live, so there is no need to ground your laptop.
Some times the manufacturers simply ground the whole ground plane within the charger, which the negative terminal of the charger is connected too. This is why sometimes you see a connection, and sometimes you don't, it's not needed at all, it just happens sometimes due to every 0V being connected together.
Comment: The AC ground isn't just there for faults - it's also a vital connection for the reduction of EMI. Also, on a lot of older designs the AC ground IS the same as DC ground i.e. it IS connected. Maybe you are a little behind the times on UK legislation - the use of RCDs now largely protects against severe shock in households. Earthing of metallic objects containing mains wiring is required if not using reinforced insulation and that is maybe what you refer to?
Comment: Ah, thank you, completely forgot about EMI. I guess I wasn't quite clear enough the with the difference between AC and DC ground, I meant that they perform different functions, I.e. cutting the AC ground won't turn the device off, but cutting the DC ground will.


MODIS MOD10A2 snow product

Question: I have extracted pixel value ( pixel value=200 for snow) from MOD10A2 snow product for my study area.
Since MOD10A2 product is distributed every 8-days. i.e., 9th Jan, 17th Jan, 25th Jan,2nd Feb,.... I need to have daily snow cover area to input for the model.
However, some papers have mentioned about the linear interpolation technique to determine the snow cover area of missing days between to give date.
I am looking for your kind help to solve my problem, so I have the snow  cover area on daily basis to get snow depletion curve.
Answer: It is quite tricky to interpolate based on the MOD10A2 because this is a maximum extent product (1 snow observation and seven non snow observation is flagged as snow). I would rather recommend you to use the daily products.
Comment: I have read some paper that MOD10A2 is better than MOD10A1 ( daily) as earlier deals with cloud coverage.I even used daily product to generate SCA but the depletion curve doesn't look like that I see in some papers , specially in terms of shape. Hope you got what I mean to express.

MODIS MOD10A2 snow product


Display data in dataview webpart horizontally

Question: I need to display images in a list horizontally one after other.
How can this be done in a dataview webpart in SharePoint 2010?
Answer: The easiest way I know of to do this is to put each image in a div and then use css to float those divs left.  SharePoint already has a float:left class you can tie into: "image-area-left".  So your item style in xsl would look like this:
<xsl:template name="dvt_1.rowview">

</xsl:template>

Note: in order to have the divs work, you'll have to probably remove the table that wraps typical DVWPs in 2010.  I don't have a working 2010 environment to test on, but if you paste your XSL in here I can certainly help.


How would a society whose existence depends on faith deal with non-believers?

Question: I am currently building a world where most of the realm is primordial and extremely hostile to human life with humans worship of an angel(With each angel being specific to that settlement.) warding off the darkness and keeping things solid. If the faith of the community falters then the protection bestowed upon them also falters which can result in a breach. How would such a society deal with someone who is found out to be a non-believer whether it be through their diary being revealed or them loudly complaining?
Comment: *"If there arise among you a prophet, or a dreamer of dreams, and giveth thee a sign or a wonder, [...] whereof he spake unto thee, saying, let us go after other gods, which thou hast not known, and let us serve them; thou shalt not hearken unto the words of that prophet, or that dreamer of dreams. [...] And that prophet, or that dreamer of dreams, shall be put to death; because he hath spoken to turn you away from the Lord your God."* (Deuteronomy 13.) (And the pagans were not necessarily better: see the [trial of Socrates](https://en.wikipedia.org/wiki/Trial_of_Socrates) for impiety.
Comment: If there is a direct evident and proven correlation between protection and worship, why is it still called 'belief'?
Comment: Hello Maiko. I apologize that I felt I had to vote to close this question, even though you quickly accepted the one answer provided. As asked, this is not a worldbuilding quetsion, but I believe it's a storybuilding question. Had you asked us to help develop the beliefs and rules of a religion, it would have required you to explain what you had so far about the religion and your goals for unbelievers based on the beliefs. As written, any answer will do (exile, excommunication, burning at the stake, ignore them...) and they're all equally valid, which is prohibited by the [help/dont-ask].
Comment: Hmmm... this raises a few questions. Are the angels actually real? or is it the communities sense of faith that powers them? If they are real, do they care about the humans? Would they be willing to intervene, for example, to try to convert the unbelievers? Is it the number of faithful that empowers protection, or the number of infidels that disempowers it?
Answer: The obvious answer is exile. You don't believe? OK, pack your things and fend for yourself outside in the darkness.
The problem with your idea however is that any unbeliever who wishes to can simply mimic whatever cycle of prayer or ritual the community requires while personally having no commitment whatsoever to its ideals at all. And of course unless they are very careless no-one will ever know. Given the potentially severe punishment they face no unbeliever is going to talk about their agnosticism/atheism let alone leave written evidence of it for others to find.
The only circumstances where such might be possible would be where there is an organized 'network' or secret society of unbelievers who are hiding within one or more of the communities. That however would require some kind of backstory on your part to explain why it exists in a world where apparently faith is essential for mankind to survive. Perhaps for example they secretly worship the darkness because they believe (rightly or wrongly) that generations ago a pact was made by their ancestors with the darkness on the promise that if they could undermine the faith of the communities to the point where the towns collapsed they and their descendants would be spared/rewarded.
Comment: Given that angels in the setting described are pretty real (mundane vs spiritual, or manifested), they can also possess powers of knowing which human of their pastry does not contribute faith, thus detecting unbelievers might be way easier.
Comment: @Vesper Given the way the question is phrased it would appear the opposite is true. If the Angels could detect who amongst their worshipers did and did not have faith there would not be a problem to begin with because the Angels in charge of each community could simply point out to that towns leaders who was and was not a believer. That means either (A) the angels can detect a diminution in a towns total level of 'faith' but cant detect the source or (B) they can detect the unbelievers and know who they are but cant communicate the information to anyone.
Comment: Sorry for the late response. As Mon stated angels in my setting do not have the ability to follow individual level events and while they can bestow some power to mortals(Turning them into what is essentially a cleric.) said mortals are not omniscient .
Answer: Just look at theocratic regimes on earth over the centuries.
Most will shun unbelievers at the very least, many will actively persecute them and either exile them, forcibly convert them, or kill them (often the same religion will do all three at different times and places).
And the true believers are excellent religious police, just make it a holy duty to weed out the heretics and either kill them or turn them over to the inquisition. You might even create a system where a new convert has to prove his faith by killing say 10 heretics for you, or by serving in a function in the armed forces where there is a very high risk of death for those who aren't true believers (I assume your deity grants special protection to his faithful on patrols in the wilderness and will withhold that protection from the unbelievers).
Answer: Frame challenge: there are no non-believers
In such a setting you can probably very directly prove the existence of angels. And very directly prove the existence of needing their protection. Assuming a non-believer exists, they can be convinced of real actual presence of all the supernatural things.
Such a society would most likely reinforce this by having demonstration of the reality of all of this.
Example of this:
Each year young adults (e.g., around 12-14 year-olds) might be sent to live out for a few days outside where there is no protection. This would be as much as a religious ritual as an actual practical example of an angel and their power existing. Adults can also be sent out to watch over the children and rotated each time. This both reinforces their belief and also they can serve a guides. When they leave the city, they need to make their way to the local shrine. Once there, they provide a prayer to the angel. This immediately stops the darkness seeking to creep into the shrine demonstrating this power. They live there for a couple of days maintaining the rites for honouring the angel. Once they leave, the darkness is back in full force. It is a dangerous journey but does show everybody involved that everything is real.
A non-believer later in life might be enrolled in the group. That should be enough to convince them that they are being foolish. Or they can even be made to make the journey by themselves and come back. A faithless one will surely perish. If they do have faith, they would return and be a fully functioning member of society. Win-win.
If there are a lot of non-believers, then perhaps the journey outside can be made traditional, so you go more often. And even if you do not, most other people would be thoroughly convinced of the reality of the religion. It would be hard to deny it when not only other people believe, they also can present concrete proof. And you can go see the proof yourself.
Answer: Show them the angels!
Since the angels are, (judging by the question), real, then the obvious answer would seem to be to show the angels to the non-believers, and quickly make believers of them!


How to use and define CRUD?

Question: I want to use more than one CRUD in the same Use Case diagram. Can I define a name for each CRUD? How can I distinguish them?
Otherwise both would be named CRUD.
Thank You.
Answer: It depends on the Use Case Diagram Level of Description that is in use in your model. For example, a simple high level (say 1) CRUD case use name for some entity, could be "entity management" (by example "User management").
I recommend the usage (in the high level) of words like "administration" or "management" instead CRUD.
CRUD is too technical and the use case diagrams and descriptions are artifacts to improve the communication between stakeholders.

How to use and define CRUD?