Backing up PCI data outside of the cardholder data environment

Question: Assume a cardholder data environment (CHDE) is segregated appropriately, data in the environment is encrypted at rest and in transmission. We have a backup service that sits outside the CHDE. If we create an ACL to allow the backup service to run backups in the CHDE, this would potentially allow an admin to bypass multi factor authentication into the environment, by using the same ACL from the backup server/service. Am i right in thinking the only way to do this is to create a service inside the CHDE to run the backups, then push those files out of the CHDE to a remote storage???
Comment: It may depend on what the backup service is.  If you're using something-over-ssh, then there's concern an administrator could use it for regular ssh and avoid normal controls.  But if you're using a backup agent with a proprietary protocol over a weird port, that's not as much of an issue.
Comment: With PCI - always check with your QSA assessing you as interpretations may vary. You may want to consider something which encrypts the data in the CHDE and then pushes the encrypted backup out of the environment. You should also be able to disable interactive login of the account and put in other restrictions, perhaps some type of mutual key based auth so the auth only works between the remote service and your backup job.
Answer: When you create an ACL and allow your backup environment to access your CDE, it means your backup servers and the flow on the way to those servers are also in PCI scope. You can either create another big workload to yourself for auditing this new scope and creating MFA for this flow or you go with the option you think.
I would go with a service inside the scope and make sure data is stored in a safe and different place from the other backups. (check PCI v3-2-1 requirement 9.5.1)
Link: https://www.pcisecuritystandards.org/documents/PCI_DSS_v3-2-1.pdf


K-means : choose Optimum number of clusters based on graph

Question: I've come into a situation where I dont understand How to choose the number of clusters. The WithinSS increases suddenly after 6. How/What do I interpret of this graph ?
Background : I've applied PCA on the data set and used 4 PCs. The clustering is done on the PCs. I'm using K-means cluster algorithm in R.
Answer: "The within-cluster sum of squares is a measure of the variability of the observations within each cluster. In general, a cluster that has a small sum of squares is more compact than a cluster that has a large sum of squares. Clusters that have higher values exhibit greater variability of the observations within the cluster."
Source here
There are a lots of methods that you can use to identify the right number of clusters,
 here a great topic.


When tracing how do I tell if I hit a wall or floor?

Question: I perform a trace and when it hits the world I get a location and the surface normal.  Does anyone have a good way to find out if I hit a wall or a floor?
Comment: This is pretty vague... How are you performing the trace? 2D or 3D? How is the world data stored?
Comment: The normal from the surface can tell you. If it is pointing up or down, it is a floor or ceiling. If it is pointing left/right/forward/backwards, it is a wall.
Comment: @byte56 By "trace" I'm guessing he means raytrace. And since this question is tagged "udk" I'm assuming he means 3D.
Comment: @jhocking Yep, it wasn't tagged anything but `programming` when I asked. Though it's still fairly vague.
Comment: @Byte56 I added the UDK tag because he mentioned he was using it in a comment. I figured it added needed context.
Answer: What Thomas said in his comment: the surface normals on the floor are pointed up, while the walls are pointed sideways.
(I'm leaving my response about the dot product because that will work too and helps explain how to work with 3D vectors, but phillips comment points out a simpler approach I didn't think of)
Just check the normal's Z component. So, if you wanted "floors" to be surfaces with normals < 45°, you could check if the Z value is > 0.707 (because sin(45°)=0.707). In fact, this is how Unreal checks if the Pawn is on a "floor" -- it compares the floor's normal Z value to WalkableFloorZ, which is 0.7 by default.

What you should probably do is get the dot product of the surface normal and a vector pointed straight up: if the trace crossed the floor then the dot product will be near 1, while if it was a wall then the dot product will be near 0, and if it was the ceiling then it'll be near -1
The threshold of how near is a value you can tune to see what works for your level:
<code>var threshold = .1;
if (abs(1 - dotProduct) < threshold) {then...
</code>
Comment: That will work. However, it would be cheaper to check the normal's Z component. So, if you wanted "floors" to be surfaces with normals > 45°, you could check if the Z value is > 0.707 (because sin(45°)=0.707). In fact, this is how Unreal checks if the Pawn is on a "floor" -- it compares the floor's normal Z value to WalkableFloorZ, which is 0.7 by default.
Comment: Ah, I was looking at the wrong way.  I was using the surface normal with the dot of the current orientation of the camera.  Using the an up vector make much more sense.  Thanks
Answer: Without knowing more about your implementation, a simple way to determine if you're hitting a wall or a floor is by taking the direction your body is moving into consideration.

If you're moving left or right, and a collision occurs, then you've hit a wall.
If you're moving or falling down, and a collision occurs, then you've hit a floor.

So you can use the velocity of your entity to determine the nature of the collision.
Comment: This is UDK so 3D Vectors.
Comment: He said he's performing a trace, so there is no body in motion.
Answer: As "Zack The Human" said, you should consider which way your character is moving. Another idea is to check which side of your player/object collided. If the bottom of your character collide you either hit the floor or an object you can stand on. Another method is to provide a pointer/reference to the object you collided with and conclude from that what you collided with.
Each of them has there perks in different situations, and they can all be implemented together. For example if I'm making a platformer I check the direction my player is moving and where the object I collided with is located. This way I can conclude if my player was moving down and collided with an object under it, that is hit the floor or a platform. Same goes for walls, if my player is moving left and hits an object to the left of it, stop moving left.
You should really learn 2D before 3D. Its easier to learn the concepts.


How can a 10th level Wizard travel to other planes?

Question: I already know that there's the Plane Shift spell, but it needs a 7th-level slot that I don't have at 10th level. Are there any other ways — spells, magic items, or something else — that I could use at 10th level to travel to other planes, or a way I could gain access to a 7th level spell slot to cast Plane Shift with?
Comment: A little late, but welcome to the site! Take the [tour]. This question's 2 votes from closure, but more information may keep it open. Level and class were a good start, but it'd be useful to add a longer list of the resources that can be devoted to the project (e.g. time, money, manpower, magic, allies, feats). Also, including the *reason* for wanting to travel across planes would be helpful (that is, folks might be able to solve the actual problem *without* the wizard needing to hop planes). The more information provided, the better the answer. Thank you and have fun.
Answer: In Faerûn, yes you can!
On p153 of City of Splendors: Waterdeep is the 5th level spell Halaster's fetch II, which is a conjuration (calling) spell whose description says:

As summon monster II, except called creatures do not disappear at the end of the spell's duration. However, they become free-willed and outside the control of the caller after the spell expires.

On p130-2 of the Planar Handbook is the ur'epona which can plane shift 1/day as a 9th level caster. According to PlH p134, the ur'epona can replace the celestial riding dog on the summon monster II list.
So you can get there with a 5th level spell. That is, if you have access to the PlH, and your DM is willing to allow you to summon an ur'epona, as the PlH suggests.


Garry's Mod maximum amount of addons/mods

Question: Is there a limit to the amount of addons/mods I can have installed in Garry's Mod?
Answer: As far as I know, the only limit is your computer's performance!
EDIT: As @Codingale pointed out in his answer, there is in fact a limit.
Comment: I think you didn't enough research at the time there was enough information and even an discussion that I've touched about in my answer. However not many people hit the limit, so it's understandable.
Comment: I said "As far as I know" because I used to play GMod 2 with tons of mods but I haven't encountered any issue. You seems right tho.
Comment: What do we do now? The current answer isn't correct and I doubt the original asker is around anymore.
Comment: I edited my answer.
Comment: ive found that (at least with me) if i install more than 100 addons onto a dedicated server it breaks the server and just makes everything seem very black and you spawn with nothing, it is not anything to do with my computer as my computer has plenty of extra memory when the game runs.  but again it could just be me
Answer: Yes there is somewhat, not a limit of what content or anything however there is a limit on how many Lua files may be loaded at once.
https://github.com/Facepunch/garrysmod-issues/issues/1058#issuecomment-46835256

The current limit seems to be 4096. I doubled it so it should now be 8192. If that didn't change anything let me know, maybe there's another hardcoded limit within the engine and it might be a bit more tricky to remove.

So you can have as many addons so long as the number of Lua files does not exceed 8192.


User control with viewstate enabled but placed inside page with viewstate disabled.How can i access?

Question: I have a user control, with viewstate enabled. i am using it on a page with viewstate disabled.How can I access viewsate info?
Comment: Does the __VIEWSTATE hidden field render?
Comment: What do you mean by accessing viewstate info?
Comment: @yildizm85:-Reading viewstate values
Answer: If you disable ViewState on the page, no rendered controls on that page will have ViewState information available.
If you want to disable ViewState just for some controls but not all, your best bet is ControlState as seen here.
Answer: As I know the ViewState property is a protected member of the Control class so it not accessible from other objects.
If you just write "ViewState" in a Page declaration, it is actually the member of that Page object which in your case is disabled.
However you should be able to reach your user control's ViewState within your User Control.
See this explanation:
http://msdn.microsoft.com/en-us/library/ms972976.aspx#viewstate_topic5
But anyway, this doesn't look like a good way of storing state information on a web page.


Sending to Subset of Users in Room/Channel with Socket.IO

Question: I'm building a web application with Node (Express) and Socket.IO that has chat functionality. Because opening a new tab on a page establishes a new socket connection, I need to group all instances of a single user into their own room based on the Express session ID to enable all messages aimed at said user to appear in all duplicate tabs. This is in addition to any other room/channel they might already be logged into. At a minimum, users are subscribed to two chatrooms: the actual "real" room, and their own channel using the sessionID.
The problem is that all of the sockets for my sessionID are also in the more general room (and need to be to get messages from other users). When I send out the general chat message I'd like to omit any sockets corresponding to the sending user, as they have already received the message through their own channel. I've gone ahead and made a hash of arrays containing lists of socketIDs for that session, keyed on the sessionID. I've seen a few different syntaxes for specifying exception lists, but none seem to work for me.
The relevant code, with certain parts omitted for brevity:
<code>var sessionSockets = {};
io.sockets.on('connection', function(socket){
    if(!io.sockets.manager.rooms["/" + sessionID]) {
        sessionSockets[sessionID] = [];
        //send message indicating log on to all sockets except for my session
    }
    socket.join(sessionID); //create private channel for all sockets of the same sessionID
    sessionSockets[sessionID].push(socket.id);
    socket.on('chat', function(data){
        var payload = {
            message: data.msg,
            from:    data.user
        };

        //send back as personal message to all sockets for this session
        io.sockets.in(sessionID).emit('me',payload);

       //send to everyone else as regular message; WHAT SYNTAX?
       io.sockets.in('').except(sessionSockets[sessionID]).emit('chat', payload);
    }
}
</code>
tl;dr: How can I send a message to a subset of users in a channel/room without manually doing a comparison of arrays?
Comment: Why send the message to yourself first? Why not just broadcast to every socket that's is not the original socket (just what broadcast does). This way every other tab you yourself have will receive the message, as expected, I suppose...
Answer: use socket.join('room') and then emit to the room by using socket.in(socket.room).broadcast.emit.
This is how you can group clients in a room and emit a perticular example to room


Grammar: missing dagesh forte in "yitzok"

Question: The word yitzok (יִצֹק), meaning he shall pour, which appears in Leviticus 14:26 and  Numbers 5:15, should, by the rules of biblical grammar have a dagesh forte in the second letter (צ) because the previous letter is vocalised with a short vowel, namely chirik. But in both cases the dagesh is absent. Why?
Answer: I suspect that it's something like this: The root begins with a yod, and the word also deserves a yod with chirik ("yi") prefix for future tense, masculine. So really, it should be written יִיצֹק. For whatever reason, the second yod isn't printed explicitly, but we act as if it's there, making the initial syllable's vowel a chirik gadol, which allows that syllable to stand on its own without the closure that a dagesh chazak in the next letter would afford.
One suggested reason for this omission is found in Joüon/Muraoka's grammar, where they write (section 7c): "Often, as a measure of economy or aesthetics, the mater lectionis is omitted when a ו or י occurs in the same word. Thus גּוֹיִם "peoples" is almost always written for גּוֹיִים, ..."
Here's another example of the same form: The root ישר appears around Tanach in future/perfect, masculine, sometimes with a second yod, sometimes without, in each case without a dagesh in the shin:

Num. 23:27 יִישַׁר
I Sam. 18:20 וַיִּשַׁר
I Sam. 18:26 וַיִּשַׁר
II Sam. 17:4 וַיִּישַׁר
II Chron. 30:4 וַיִּישַׁר

Further examples: וי(י)צר in Gen. 2:7 vs. 2:19; וי(י)רא in I Sam. 12:18 vs 18:12; וי(י)שר in I Sam. 18:20 vs. II Sam. 17:4; וי(י)קץ in Gen. 41:4 vs. I Kings 3:15; וי(י)בש in I Kings 17:7 vs. Psalms 102:5; י(י)רש in Gen. 22:17 vs. 24:60; י(י)טב in Gen. 12:13 vs. I Sam 24:5.

Hat-tip to magicker72 for the J/M reference and many examples.
Comment: On re-reading the answer of @Issac Moses, I think the answer to my follow-up question is that the different treatment of yidor is that the first letter of the root is a נ not a י as in yitzok.
Comment: This is not so much a comment as a follow-up question, which should really have been included in the original question. but it is also relevant to Isaac's answer that we imagine an extra yod so that the chirik is treated as a long vowel. That answer is plausible, but if so, why is יִצֹק any different from yidor (יִדֹּר), meaning he will vow, which occurs in Numbers 6:21 and 30:2 with a dagesh chazak in the middle letter (ד).


How to promote my own apps with AdMob after August 2016

Question: I use AdMob to promote my apps.
Right now, in AdMob management board I have a Promote tab and it is way too easy to add a new ad by specifying an ad image of my own app and that ad will be advertised in Google's network.
Plain and simple.

However, I got a notification about the retiring of the Promote tab and its replacement will be the Campaigns.
I still intend to promote my own apps so I checked what to do.
I got confused as the Campaigns seem to be consisting only of lending my ad units.
I can set goals (click or percentage - I don't even understand how a percentage could help me promoting my apps...) and specify my ad units in my apps. What if I don't have an app with an ad unit? Then I can't create a campaign?
It seem, I can't continue unless I select one of my ad-containing app.
Why?

Why did they take away the promotion? What should I do about this? Should I select my other apps?
Answer: Google now suggests using Adwords for paid campaigns

Paid ad campaign creation has been removed from AdMob. We suggest using AdWords, Google's online advertising programme, to create new paid ad campaigns.


Statistical thermodynamics

Question: Entropy of indistinguishable particles $S$ is
$$S = k\ln W,$$
but in some places notation is different:
$$S = k\ln Q + \frac{U}{T}$$
Can you explain, please?
Answer: The only time I've ever seen that second notation is when referring to the substitution of the Helmholtz energy, as A = U-TS and therefore A = -kTlnQ. If you want an in depth explanation of how the thing is derived I suggest looking at Chapter 10 of Biomolecular Thermodynamics: From Theory to Application by Douglas E. Barrick.
Here are some photos of the key parts:
Answer: The second formula you quote follows directly from the first. Starting with $W=N!/(n_1!n_2!\cdots)$ for $N$ distinguishable particles spread over set of $i$ energy levels with energy $\epsilon_i$, then $\ln(W)=\ln(N!)-\sum\ln(n_1!)$. Using the Sterling  formula for factorials the entropy  becomes, after some fiddling around and simplifying,  $\displaystyle S=-Nk_B\sum \frac{n_i}{N}\ln\left(\frac{n_i}{N} \right)=-Nk_B\sum p_i\ln(p_i)$ where $p_i=n_i/N$ is the chance that the $i^{th}$ state is occupied. This fraction is also $p_i=e^{-\epsilon_i/k_BT}/Z$ where $Z$ is the partition function and $Z=\sum_ie^{-\epsilon_i/k_BT}$ then $\displaystyle \ln(p_i)=-\frac{\epsilon_i}{k_BT}-\ln(Z)$ and substituting gives
$$S=-Nk_B \left(-\frac{1}{k_BT}\sum(p_i\epsilon_i)-\ln(Z\sum p_i)\right)$$
which becomes $\displaystyle S=\frac{U}{T}+Nk_B\ln(Z)$
after evaluating the terms $\displaystyle \sum p_i=1$, the probability over all states is one and the total energy $\sum p_i\epsilon_i $ is  $\displaystyle \sum p_i\epsilon_i=\frac{U}{N}$ where $U$ is the internal energy.
This approach is only valid for solids because in some way the atoms in a solid can be identified. In a gas this is not possible and the number of microstates must be divided by $N!$ because after exchanging atoms/molecules  the state of the  gas  still  it indistinguishable. For a perfect gas it is found that  $\displaystyle S=\frac{U}{T}+Nk_B\ln(Z) -Nk_B(\ln(Z)-1)$

Statistical thermodynamics


AS3 - Can I detect change of value of a variable using addEventListener?

Question: Is it possible to use EventListener to Listen to a variable and detect when the value of that variable changes? Thanks.
Answer: This is quite easy to do if you wrap it all into a class.  We will be using getter/setter methods.  The setter method will dispatch and event whenever it is called.
(Note: Setters and Getters are treated like properties). You merely assign a value, as opposed to calling a method (e.g someVar = 5 instead of someVar(5);  Even though setters / getters are functions/methods, they are treated like properties.
//The document class
package
{
  import flash.display.Sprite;
  import flash.events.Event;
  import flash.events.EventDispatcher;

  public Class TestDocClass extends Sprite
  {
    private var _model:Model;

    public function TestDocClass():void
    {
      _model = new Model();
      _model.addEventListener(Model.VALUE_CHANGED, onModelChanged);
    }

    private function onModelChanged(e:Event):void
    {
      trace('The value changed');
    }
  }
}

//The model that holds the data (variables, etc) and dispatches events. Save in same folder as DOC Class;
package
{
  import flash.events.Event;
  import flash.events.EventDispatcher;

  public class Model extends EventDispatcher
  {
    public static const VALUE_CHANGED:String = 'value_changed';
    private var _someVar:someVarType;

    public function Model():void
    {
      trace('The model was instantiated.');
    }

    public function set someVariable(newVal:someVarType):void
    {
      _someVar = newVal;
      this.dispatchEvent(new Event(Model.VALUE_CHANGED));
    }
  }
}

Comment: Yeah - I would love to see a working example of this. I'm trying to incorporate a hit test. When the user is over an item, there is an ENTER_FRAME listener registering a constant "hit" value, but when they're off, the listener changes to register a constant "off" value.  How would this scenario apply to your model?
Answer: @BrianHodge: How do you actually use your example? How do you call the set  function? How do you refer to it? Where do pass the variable to be changed..?
Let's say if I want to change the wrapped variable with a button click, for example.
I have to confess that I tried some other codes and example (getter/setter) type, with dispatchEvent or without,and I can't get over it! But your example seems to be exactly what I need, just can't make it work.
I get the The model was instantiated when I set the function as document class. That's all.
I found out, at last, for people like me who are loosing time with this dispatch thing!
In my case the _someVar variable has to be data typed as a String (same thing for fornewVal).
OnceTestDocClass is set as your document class; you refer to the Model instantiated like this:
_model.someVariable="new stuff";

I was trying to change the value like this:
_model.someVariable("new stuff");

You can add some trace actions in the Model class to have a clear demo in the output panel:
package
{
  import flash.events.Event;
  import flash.events.EventDispatcher;

  public class Model extends EventDispatcher
  {
    public static const VALUE_CHANGED:String = 'value_changed';
    private var _someVar:String = "default";

    public function Model():void
    {
      trace('The model was instantiated.');
    }

    public function set someVariable(newVal:String):void
    {
      trace ("before " + _someVar);
      _someVar = newVal;
      trace ("after " + _someVar);
      this.dispatchEvent(new Event(Model.VALUE_CHANGED));
    }
  }
}

It's not much, but these things can cost some people a whole lot of time =)
Answer: You used to be able to do something similar in AS2 using Object.watch.  I don't see a direct equivalent, but it looks like mx.binding.utils.ChangeWatcher will give you similar functionality for any variables that are bindable.
I don't know of a way to do it in AS3 for non-bindable variables, but if the variable you want to watch is bindable (or if you can modify it to be binadable) then ChangeWatcher might give you what you want.


'less' width issues

Question: I'm connecting to my Linux boxes (primarily Debian Squeeze) using Putty for Windows.  Whenever I run a 'less' command, e.g. on an aptitude search, less truncates the listing to much less than my window size.  I've looked to see how I can override this but haven't come up with anything.
Answer: Are you sure it's less doing the truncation and not aptitude? I notice that aptitude truncates to 80 columns by default when you redirect its output. Try aptitude search foo | cat and see if your output is truncated.
When you filter the output of a command, it's debatable whether it's best to truncate at the terminal width, at 80 columns or not at all. In fact the command can't know whether its output is eventually going to the terminal, so truncating to the terminal width is dubious.
You can run aptitude --disable-columns to make aptitude not truncate at all, but it won't align its output either. If your shell is bash or zsh, you can obtain the terminal width from the COLUMNS shell variable and pass it to aptitude:
aptitude -w $COLUMNS search foo |less

Comment: that's the exact thing. Passing $COLUMNS bypasses the issue (even locally).  --disable-columns is too messy to look at.  Time to create more aliases :)
Answer: What terminal is putty reporting to your linux boxes? echo $TERM to find out. You might try setting this to xterm-color (can be set in the putty session configs) for best results. Several character and behavior issues get straightened out when it thinks you have a capable terminal.
Comment: I'll have to check that when I get back to my office tomorrow.  I'll keep you posted.

'less' width issues


Monit process aliasing

Question: I have Monit checking a process whose name is just "python", but would like a more informative name (e.g. "webapp") in status, emails, etc. Is there any way to declare an alias, or would I have to change the process's name to achieve this?
Answer: The name argument directly after CHECK PROCESS is freeform and can be anything. The name is supposedly only used internally inside Monit for purposes of notification. As long as you specify the pid file, monit does not care what the name of the process is.
See their docs (search for procmatch):
http://mmonit.com/monit/documentation/monit.html

Monit process aliasing


What's the difference between "most of the time" and usually? Also what's the register of those two?

Question: I was wondering about the register of each of those phrases and the difference between them. I've been told that when the expression is broken down in tiny pieces, has an informal register.
Comment: 'Most of the time' is less formal.
Comment: They probably both suggest 70-90% of the time.
Comment: They are virtually interchangeable in meaning, however I think 'usually' might refer to something more within control, and 'most of the time' a bit more for something that "happens" in a more random but just as probable way. *I usually go to bed at 10 pm. Most of the time I fall asleep right away. The driver is usually on time. Most of the time there is an empty seat  on the bus.*  It might be too subtle to really be a rule.
Comment: A teacher that said "Usually this student hands in his homework on time" I think it implies more respect than "Most of the time this student hands in his homework on time". Also "he's usually polite" suggests better habits than "most of the time he's polite." There is another meaning beyond the frequency in how the exceptions are considered that is hard to explain exactly.
Answer: In the U.S. I wouldn't say there is necessarily a formality or informality register to the usage of either one. I'll explain my thoughts on this.
As for the first part of your question: They basically mean the same thing: typically, under normal condition, often...
As for how to use them in speech or writing?

"Most of the time" - I think (in the U.S. anyway) this may have a tinge of less formality than "usually" but can actually have more impact than "usually". The reason is the use of the superlative "most".
"Usually" - Probably ever so slightly more formal, and it's the more formal word in writing, but can tend to have less emphasis on how often something is happening; because it does not use any superlative like "most".


Transparent background on my logo

Question: Hiya I am fairly new to illustrator. I have made a logo for my client, which is all vector and ready to handover. I've saved a pdf version and an .ai version to give to him and these are good, but they seem to have a white background on them. I have saved one as a 24bit .png but I seem to lose the vector quality can somebody help me please? what do I need to give him and how? P.S he will use these both for web and print. As he wants tshirts made and obviously no white background!
Comment: Possible Duplicate: http://graphicdesign.stackexchange.com/questions/30434/pdf-has-white-background-when-exported-from-illustrator
Comment: Hi Andria, welcome to GDSE and thanks for your question. If you want to know more about the site, please see the [help] or ping one of us in the [chat] once your reputation is sufficient (20). Keep contributing and enjoy the site!
Answer: If you don't have any white background on your Illustrator file, then there will not be any background on your .ai or .pdf.
If you want to test this and make sure there's none, open your .ai created from your Illustrator software in Photoshop. You should get only one layer with the logo on it only and no background. If you see some gray and white checkerboard pattern in the background, that means it's transparent!

If you want more opinions and suggestions on what kind of files to provide for your logo, here is a question about it.
You can give to your client the .ai and .pdf for the t-shirt project. I suggest you provide some web and high resolution files and not only vectors. This way your client won't need to optimize these files himself and the result might be way better if YOU do it since you're the expert, after all!
Answer: You should send your client an .svg file, which will save the vector qualities, have a transparent background and canne uploaded to a website as an svg, therefore be live as a vector
Answer: You should export an SVG from Illustrator. It is scalable and will always be a good way to show an icon on the web.

Transparent background on my logo


Chrome: can't access Trac projects

Question: I can easily access my Trac environments with Firefox, but when I do it with Chrome it asks me to authenticate, but doesn't let me in. Only the authentication dialog appears again and again. What might be the problem?
Answer: Could it be something as simple as mistyped password?
I just tried to login to my Trac environment in Chrome. It will display authentication dialog each time you type in the wrong password (or user name). When user name/password is OK, you're logged in without problems.

Chrome: can't access Trac projects


Is maximin a machine learning algorithm?

Question: Is maximin a machine learning algorithm, or simply another concept which is used for increasing the probability of winning?
Answer: Machine learning usually uses sets of past data to create patterns and predictions on future data. For instance, manually categorizing previous letters that people have drawn in the training stage in order to detect what letter someone is drawing.
As far as I know, maxmin doesn't have any sort of training based on past data, so wouldn't really fall into machine learning. (This sounds like a homework question though, you might want to check your text book's definition of machine learning to be sure).
Comment: I think it's considered to be an AI algorithm.
Answer: Maximin (if it is the same as minimax?) involves creating an objective function based on possible payoffs, i.e. you have the objective of minimizing the maximum possible loss.
I could imagine a classification scenario where there are payoffs associated with each actual target label/prediction label pair, and you use the maximin critieria to build an objective function that is minimized by the learning algorithm..., but I have not seen this before.  Usually the payoff structure is +1 for correct 0 for incorrect, which results in maximizing the probability that the predicted label is correct.  However, I am sure there are plenty of real world examples where a maximin type of objective would make more sense.
However, I am not sure how many standard machine-learning algorithms are adaptable to correspond to this type of optimization criteria...


Maintenance of oleander plants?

Question: I have a few oleanders and was wondering what I should be doing to keep the plant in its best condition?  All I do is feed it compost once or twice a year.  Anything else?
Comment: Just for clarification: you have yours planted outside permanently? Where I live, oleander needs to be in pots and moved inside during winter. I guess the advice differs somewhat for those two cases.
Answer: It looks like there is broad information about this over the Internet: http://www.gardeningknowhow.com/ornamental/shrubs/oleander/oleander-growing-tips.htm

Even in the garden, oleander shrubs require minimal care. Although the shrubs are drought-tolerant, they look their best when they are watered during dry spells. However, take care not to over water them. Yellowing leaves indicate that the plant is getting too much water. If the soil is poor, feed the plant lightly with a balanced fertilizer during its first spring. Once established, oleander shrubs don't require routine fertilization.

However, from http://homeguides.sfgate.com/trimming-caring-oleander-bush-71563.html

Water newly planted oleanders regularly and deeply to establish a deep, wide-spreading root system.
Oleanders are fast-growing and need annual trimming to shape the plant and to keep it to the desired size.
Comment: The article is very useful.  It says expect flowers to bloom between April and September.  My experience has been that the flowers bloom in early spring (Mar-Apr) and then I don't see any flowers.  I must be doing something wrong
Answer: Your plant looks as if it could do with a good prune, it's got a bit 'staring', that is, too much stem and not enough leaf. I grow these in London, UK, outdoors in sheltered spots, and the one I saw last week is now so bushy, thick with leaves and large, despite a good prune last year, it could do with pruning now - but it's about to flower. It's in this condition despite technically being too tender for outdoors in the UK, and having come through what passed for winter this year, so it'll be twice the size it is now in 3 months. I don't feed it at all, nor give it compost - but it's planted with its roots in shade, behind a low wall, and its upper parts in sun, which means it's probably always got access to moisture deep in the soil under the wall and paving. I'm guessing yours probably could do with a lot more water from late spring throughout summer to get good, bushy, green growth and more bouts of flowering. When pruning, don't get the sap on exposed skin - some people have a strong dermatological reaction to it. If you decide to prune, you can either do it now and sacrifice the early flowers, or wait till the usual, early crop of flowers is over.
UPDATED ANSWER
In response to your comment, I almost mentioned the fact that your plant appears to be a 'standard' but I find many people don't understand the term even in the UK, and it confuses the issue! So what you're describing as 'a long step' means you have a straight stem with all the growth coming from the top, often grafted at that point, on the top of the stem, but sometimes a plant is simply trained to grow that way, and that is called a standard. A half standard is similar, but has a shorter stem. I can't see from the pic whether there's a graft at the top of the stem, but either way, you can't cut back past the top of that stem, so shorten all the growth down to 5 or 6 inches if you want, always cutting just above a leaf node, but no lower than that. This might encourage more unwanted growth elsewhere because yes, when you have a 'standard', you do remove any growth coming from the ground or off the long straight stem, to keep the form and shape. Even so, if you rub out or remove the unwanted growth as soon as it appears, the topgrowth should still grow thicker and bushier.
Comment: Just for clarification, my oleander is not like the one's that grow from the base.  Mine has a long step (the main stem you see) with growth on the top.  I was told to prune all the suckers coming out from the root part so the growth is mainly in the top.  Does that make sense or am I confusing things?
Comment: See edited answer...

Maintenance of oleander plants?


Make the Information part better in a cat profile

Question: Hello guys im creating a site for a cat breeding company. The site is 95% users on mobile web browsers. How can I make the Information section more beautiful. Do you see any other things I could change on the page?
Answer:
Increase the contrast on your greys (darker text).

Probably don't italicize the main title.

Use some iconography for easier visual skimming. ♂ Male, etc. (Ideally an icon font rather than emojis since the latter will look different on different devices.)

Avoid unnecessary labels for data if possible. Words like "male" and "fertile", especially when supported with icons, are self-explanatory without a category word. In other words, instead of "Fertile: Yes", just " Fertile" or "❄ Infertile". You can always keep the information via title text or more accessible tooltip-style things, e.g. a little  that when you hover or click on it shows text like

This cat is fertile. It can contribute DNA to kittens.

Where you do have categories, differentiate them in the typography. That can be through bold, underline, italicize, capitalize, font choice, font size, etc. Or it can be through spacing — I particularly like to use a single width for my labels for a cleaner look. (This can contradict the above about dropping labels; you'll have to play around to find out what looks best.)

A couple of hasty mockups to get you thinking...


Easy way to do roll up reporting in Google Analytics?

Question: Is there an easy way to do roll up reporting in Google Analytics when you have multiple domains and each has at least 2 subdomains?
Answer: So far as I'm aware you can't, you'd need to download the relevant data and crunch it manually.
You can follow the instructions here, which walk you through the process of structuring  a rollup account to generate reports:-

No need to panic. This post aims to offer an approach to help you plan
  your Google Analytics accounts setup in a structured fashion to help
  with clarity. I hope that by following the approach and the technical
  steps, you will be able to collect and manage all your data, make more
  sense of it, and most importantly, ensure what you are reporting on,
  trending, dashboarding and analyzing is based on accurate data.

Some further reading is available in google groups


Django static files once again not working

Question: I know this question appeared like a milion times, also I'm not a newbie django coder still recently I'm having terrible problems gotting static files work in django projects. Last time I worked around this by using 1.3 but now I'm working on 1.2.5 version and none of the solutions works.
So basically I have statics worknig only in admin section and nowhere else around the site.
Static files are in K:/project/media, I'm using window, python 2.7 and django 1.2.5 and the development server.
Settings :
MEDIA_ROOT = path.join(path.abspath(path.dirname(__file__)), 'media')
MEDIA_URL = '/static/'
ADMIN_MEDIA_PREFIX = '/admin_media/'

URLconf :
urlpatterns += patterns('',
    (r'^static/(?P<path>.*)$', 'django.views.static.serve',
        {'document_root': 'K:/project/media/', 'show_indexes': True}
    ),
)

Now when I open http://127.0.0.1:8000/static/ instead of static files list I'm getting TemplateDoesNotExist at /static/. And imports in template return similar error instead of 404 : TemplateDoesNotExist at /static/css/global.css/ . What am I missing here ?
EDIT
Full URL conf
from django.conf.urls.defaults import *
from django.views.generic.simple import redirect_to
from p.globals import views
from p.newsevents.feeds import ReleaseFeed
import filebrowser

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

feeds = {
    'releases': ReleaseFeed,
}

urlpatterns = patterns('',

    (r'(?P<reqPath>[\w\-,.]+)$', redirect_to, {'url': '%(reqPath)s/'}),

    (r'^admin/filebrowser/', include('filebrowser.urls')),
    #(r'^admin$', redirect_to, {'url': '/admin/'}),
    (r'^admin/', include(admin.site.urls)),
    (r'^tinymce/', include('tinymce.urls')),
    #(r'^about-us/$', redirect_to, {'url': '/about-us/our-story/'}),
    (r'^feeds/(?P<url>.*)/$', 'django.contrib.syndication.views.feed', {'feed_dict': feeds}),
    (r'^get-your-look/', include('p.getyourlook.urls')),
    (r'^about-us/', include('p.aboutus.urls')),
    (r'^our-services/', include('p.services.urls')),
    (r'^news-events/', include('p.newsevents.urls')),
    (r'^promotions/', include('p.promotions.urls')),
    (r'^careers/', include('p.careers.urls')),
    (r'^locations/', include('p.locations.urls')),

    (r'^$', views.home),
    (r'^(?P<reqPath>[\w\-,.]+)/', views.globals_views),
)

from django.conf import settings

urlpatterns += patterns('',
    (r'^static/(?P<path>.*)$', 'django.views.static.serve',
        {'document_root': 'K:/Kuba/Webdesign/hair/media/', 'show_indexes': True}
    ),
)

Comment: what do your apache logs say? usually tells exactly what path its searching for.
Comment: how does the rest of your URLconf look like?
Comment: I'm using it locally, there's no apache server
Answer: I guess it`s because of this:
 (r'^(?P<reqPath>[\w\-,.]+)/', views.globals_views),

It will intercept all request to static, and will call that view, which will cause TemplateDoesNotExist  error.
Put a static url before this or change this( and in urls that it refers to) regex.


Very complicated query is suddenly taking 35 minutes to finish in SQL Server 2014

Question: I have a very complicated query that produces correct results slowly but ok in SQL Server 2012. After upgrade to SQL Server 2014 and after setting compatibility mode to 2014 (120) for the database, it is suddenly taking 35 minutes to finish. I have uploaded the actual plan on SQL Server 2014.
Comment: Why not just keep in in the old compatibility mode?
Answer: SQL Server 2014 with compatibility level 120 uses the new CE. SQL Server 2012 uses the legacy CE. The new CE uses a fundamentally different model for cardinality estimation that is expected by Microsoft to result in better performing queries for most workloads. However, they acknowledge that some workloads or queries may perform worse with the new CE. It is possible that is the situation that you're in.
When investigating a query that isn't finishing quickly enough, one of the first things I try to determine is why the query is slow. Your query is slow because over four billion rows are read from a single index seek operator:

You can verify that this is the most expensive part of the query by looking at the actual time statistics shown at the operator level. The index seek uses 222360 ms of CPU time and the overall query uses 224382 ms of CPU time. The most straightforward way to get better performance is by improving the index on the RSTReclassedJournalEntries table. This table only has 127787 rows, so it's unlikely that the additional maintenance required for a better index would be a concern. Creating an index with key columns Posted and ReclassedJRNENTRY should suffice.
The IX_RSTReclassedJournalEntries_1 index already exists on the table and is a covering index, but you want a index that can filter on Posted and ReclassedJRNENTRY as seek predicates instead of as filter predicates. With such an index SQL Server will read a maximum of 34646 rows from the index instead of 4382443766 rows. This will dramatically improve performance.
The index change that I'm recommending addresses the symptom of the problem instead of the root cause, but sometimes that's enough to meet the business need. The root cause appears to be a join cardinality estimation problem with [SOLMQ].[dbo].[AAG30000].[AK2AAG30000]. Addressing that is likely to be more difficult than making the suggested index change, although it's possible that you'll get lucky and updating statistics on that table will fix the problem as well.
Answer: I would suggest to keep the new compatilblity level and  use traceflag 9481 -

If it is just one query, use query hint OPTION (QUERYTRACEON 9481).
if you are seeing a lot of queries being regressed, enable the traceflag as server wide option - dbcc traceon (9481,-1) or just add it as startup parameter so it gets persisted after reboots.
make sure that you have proper indexes and stats are up-to-date.
Comment: This looks like a view. Can't really do the trace flag hint.
Answer: Your execution plan is reporting some estimation issues (e.g. Index Seek on AK2AAG30000 is estimating 1.12 rows and actually returning 79204 rows). Try updating statistics as that may help the optimizer make better estimates and therefore produce a better plan.
There are also some missing indexes being recommended which may eliminate the clustered index scan in favour of a seek. These recommendations may not have been made by the old optimizer, so look at testing these new indexes in a lower environment.
Also, for testing purposes, you can use query options (OPTION (QUERYTRACEON 9481)) to use the old cardinality estimator and compare the two plans to identify differences.
The execution plan is serial as Maxdop has been set to 1. If the server has multiple CPUs, try using OPTION (MAXDOP 2) to see if a parallel plan is able to perform better. It may perform better or worse.
Lastly, you may need to look at refactoring your code. While it works, it may be inefficient and as you have stated it wasn't fast in 2012, just acceptable, your best performance gains may come from rewriting your view code.


Salesforce 1 versus Touch

Question: Can someone please tell me if the new Salesforce 1 product is a replacement for Touch as a mobile app.  Specifically, 'OUT OF THE BOX', without any configuration.  Also curious if the Android version of SF1 is the same, or more limited than the IPAD version.  I would appreciate any and all the insight I can get.
Answer: Bruce, please read through the release notes for Mobile. Salesforce1 now subsumes Touch. see link here
...Salesforce Touch is upgrading to the new Salesforce1 experience. The new app gives you the same Salesforce Touch features you've come to expect, in an updated interface that makes it easy for users to find what they need and get their work done faster. On top of that, Salesforce1 gives you more, with many new enhancements...
Also, re. Android is the same as for iPhone, see here
Comment: Thanks Reaper!  However, on my new Galaxy 3 tablet (android?), the SF1 experience is not very good ... I can't edit any records or fields (or I don't know how to).  Plus the download app ICON is the same as the Chatter Icon, so I'm not sure I have the right app.  Any thoughts?
Comment: @Bruce if you're still seeing the old chatter icon it means your on an older android system.  Salesforce1 requires the latest android version and some phones haven't gotten that update yet.  A colleague had to manually upgrade his phone to get it working.
Comment: @Bruce sounds like you have not updated your app to Salesforce1 correctly, your app icon should be Salesforce1 and not chatter-like. I'm not Android-proficient, so I can't say exactly what you should be seeing although it is not much different to the most recent Chatter app except for additional object availability and functionality but generally speaking the interface stays the same. You should be able to select for example a customer record and see the edit button and then be able to edit any field that your permissions allow.
Answer: Based on some of the sessions I attended at Dreamforce, Salesforce 1 is the replacement for Touch. Salesforce 1 is a merger of Chatter and Touch. Eventually Touch will reach it's end of life and no longer be supported. As for Android, the Salesforce.com Mobile team focused first on the iOS version of the app, and then the Android version. I don't have an Android device so I don't know how close they really are feature for feature. They did state that both will have the same capabilities. You can checkout http://www.salesforce.com/mobile/sell/ as a starting point.
Comment: I have the android version on my nexus 5.  It doesn't seem lacking at all.  Note that according to the [documentation on the play store](https://play.google.com/store/apps/details?id=com.salesforce.chatter&hl=en) you need to have at least Jelly Bean (4.2), otherwise you get the old Chatter Mobile when you install.
Answer: Salesforce 1 is combines both Salesforce Chatter and Touch into a unified mobile experience with some additional goodies.
If you've upgraded on an android device and you're still seeing the old chatter icon it's likely you're running on a slightly old version of the android OS.  Salesforce 1 requires at least v4.2 (Jelly Bean).
I had a colleague who downloaded Salesforce 1 and noticed it had the old Chatter icon.  After manually upgrading his android os (as his mobile provider hadn't pushed the update yet) he got the full featured Salesforce 1 experience.
Comment: Yup.  You need at least 4.2 (Jelly Bean) which is stated in the Play Store. I actually pulled it up in my mobile browser by going to the /one/one.app URL after logging in through my mobile browser to SFDC. I did this on a Gingerbread phone and was able to see it in some sort of fashion, but that experience is definitely not supported. :-) I now have KitKat on my nexus and it works fabulously.

Salesforce 1 versus Touch


size problem when i tried to render large dimensions video with AE

Question: i've been asked to make a 5 sec video for a street advertising screen 4*2 meters (11339 * 5669 pixels)
but that produced a very large file size and i really need to reduce it
when i render as AVI file size was 22 GB!!! and with quicktime it was 3 GB
other AE's codecs resize the video's dimensions or give me settings miss match
so my questions is how can i reduce file size and keep the dimensions and quality?
Comment: Have you seen if this has been asked on [video.se]?
Comment: Have you determined the "virtual pixel size" of the the screen? In many cases the physical makeup of the screen is *not* the desired setup of the files to be displayed on it.
Answer: It almost certainly doesn't need to be that big. You're recording detail that no one is going to see unless they have their nose to the screen. Especially with a moving image. In an outdoor ad in particular, they'll be glancing at it as they walk by.
Ask what format the advertiser expects. I wouldn't deliver anything more than 4K (4000px on the longest side), and even that's huge.
As @Confused mentioned, you probably want a more efficient codec, like H.264 for a smaller file size. MPEG Streamclip works, but if you have a recent version of after effects, you  have Adobe Media Encoder, which is fast and works directly from After Effects.
Answer: Your Quicktime file, try to export it from MPEG Streamclip with H264, at 50% quality, with these settings:

MPEG Streamclip is free, and worth a million times that ;)


Does CFT in AdS/CFT live in flat spacetime?

Question: As the title says, does CFT in AdS/CFT live in flat spacetime, or is it only approximately flat?
Comment: Conformally flat $\neq$ flat, in case you were wondering.
Comment: The conformal boundary of $AdS_n$ is conformally flat. This means it can be mapped to a flat spacetime by a conformal transformation. It does not mean it is flat.
Comment: The "boundary" of AdS in $d+1$ dimensions can be taken to be any conformally flat $d$-dimensional manifold. See https://physics.stackexchange.com/q/81131/
Answer: The CFT in AdS/CFT lives on the asymptotic boundary of the AdS space. The asymptotic boundary is a conformal manifold associated to any "visibility manifold". See this paper of Eberlein and O'Neil (1973), section 1. They define points on the asymptotic boundary as equivalence classes of geodesic rays where geodesic rays are considered equivalent if their distance is asymptotically bounded from above.
One can thus think about the tangent space of the asymptotic boundary to be the normal directions to a geodesic along which nearby geodesics can diverge. This lets one define a conformal structure. There is clearly no natural Riemannian structure on the boundary (and reparametrizations of the geodesics act like Weyl transformations) so if the boundary theory is to be defined in terms of the bulk, it has to be conformally invariant.
However this classical picture breaks slightly when quantizing, and in the end we do have to choose a metric to regulate our theory (this is the case with almost all CFTs). Then we get some mild dependence on the chosen metric through the Weyl anomaly.
Comment: Hm. Yoy can't turn the generic conformally flat metric into the flat one by the *conformal transformations* - those are diffeomorfisms and won't change tensor quantities like $R$. What you need is the *Weyl transformation*. When we talk about 2d CFT the Weyl anomaly is proportional to the central charge $\langle T\rangle\sim c R$. So to not distinguish between various conformal metrices we need $c=0$. But when we look at AdS3/CFT2 the SUGRA limit in AdS corresponds to very large $c$  so the Weyl invariance in CFT is actually broken very strongly. Or do I misunderstand something?
Comment: @OON Thanks, it's a good point. I would say the trace anomaly is quite mild compared to true symmetry breaking. One still has Ward identities for a CFT with $c \neq 0$. You can find a description in this physics paper https://arxiv.org/abs/hep-th/9806087 around eqn (3) "the metric Gˆ
µν does not induce a unique metric g(0) on the boundary". Boundary metric comes about by choosing a finite-radius cutoff in AdS.


Which sugar for brining?

Question: I've come across various brining solutions that include sugars: white sugar, brown sugar, raw sugar, etc. Are these sugars interchangeable? Is one sugar more desirable for a certain kind of meat over the other?
Answer: For a brine, no it doesn't really matter, except that granulated sugar will dissolve more nicely than raw sugar.  The sugar is for flavor more than anything else, though it does help the brine some. It also promotes browning of the meat.  If you change one kind of sugar for another, I'd use a 1:1 swap by weight rather than volume so you don't have to worry about crystal sizes.
Though the sugar does help the brining action some, the salt is the important component.
From Cook's Illustrated:

How does brining work? Brining promotes a change in the structure of
  the proteins in the muscle. The salt causes protein strands to become
  denatured, or unwound. This is the same process that occurs when
  proteins are exposed to heat, acid, or alcohol. When protein strands
  unwind, they get tangled up with one another, forming a matrix that
  traps water. Salt is commonly used to give processed meats a better
  texture. For example, hot dogs made without salt would be limp.
In most cases, we add sugar to the brine. Sugar has little if any
  effect on the texture of the meat, but it does add flavor and promotes
  better browning of the skin.
Comment: Thanks for the insight. What would you say is the optimal salt to sugar ratio for brining chicken?
Comment: I use a 1:1 ratio by volume with Kosher salt (3/4 c of Kosher salt plus 3/4 cup granulated sugar) for chicken breasts.  If I recall, Alton Brown does the same by weight (1 pound Kosher salt, 1 pound sugar) for his turkey brine.

Which sugar for brining?


How to install aircrack

Question: Can I get help installing aircrack-ng-1.2-beta3/aircrackng-1.1 in a detailed form? Im using Ubuntu 14.04.
Answer: Aircrack-ng 1.1 is in the official Ubuntu Repository
Open a terminal by pressing Ctrl+Alt+ T
Then copy and paste the following command in the terminal.
Then press Enter.
sudo apt-get install aircrack-ng

Edit :
To resolve your problem, run a update before installation.
sudo apt-get update

Comment: That's one of the many commands that I tried looks like aircrack is no longer in the universal reposotories.
Comment: Sorry and thanks for the help it did work looks like i tried more complicated codes.
Comment: @user298130 welcome.
Comment: Ok so now that ive installed it i cant seem to find an icon or anything to run the program any suggestions?
Answer: As mentioned in the answer by BillGates, Aircrack-ng 1.1 is in the repos.
To install 1.2-beta3, you need to download the source:
wget http://download.aircrack-ng.org/aircrack-ng-1.2-beta3.tar.gz

Extract it:
tar xzf aircrack-ng-1.2-beta3.tar.gz

Change into the directory:
cd aircrack-ng-1.2-beta3

Make sure you have the build-essentials package installed to be able to compile programs. Then start compiling:
make

You might encounter some missing libraries along the way, for example you might see something like this:
common.mak:85: *** Cannot find development files for any supported version of libnl. install either libnl1 or libnl3..  Stop.

To solve these errors, install all missing development libraries, for example, libnl-3-dev for this one.
When it's done, you can run Aircrack from this directory or install it system-wide:
sudo make install

Comment: Seems somme libraries are needed, in my case :
    sudo apt-get install libnl-3-dev libnl-genl-3-dev libssl-dev
Answer: I formatted my computer and obviously I had to reinstall all programs. When installed aircrack-ng again, I realized that there are more dependencies to install, some are suggestions and others are installed by default.
sudo su

enter your password,
then install all dependencies, Here the list
apt-get install build-essential libssl-dev libnl-3-dev libnl-genl-3-dev
dpkg-dev g++ g++-4.8 libc-dev-bin libc6-dev libstdc++-4.8-dev zlib1g-dev
debian-keyring g++-multilib g++-4.8-multilib gcc-4.8-doc libstdc++6-4.8-dbg
glibc-doc libstdc++-4.8-doc libalgorithm-merge-perl libssl-doc
libalgorithm-diff-xs-perl

after that, update your system
apt-get update

when this install is done you can start the aircrack install, like this
wget http://download.aircrack-ng.org/aircrack-ng-1.2-rc4.tar.gz
tar -zxvf aircrack-ng-1.2-rc4.tar.gz
cd aircrack-ng-1.2-rc4
make
make install

and you will get aircrack-ng up and running. Now the success is guaranteed
Answer: To install Aircrack-ng 1.2 rc3-4 from the official Ubuntu Repository,
you have to install the source of  wily, xenial, or yakkety
to check the current source list:
cat /etc/apt/sources.list

to add xenial source list:
cat >> /etc/apt/sources.list

in the new line copy and past the following line
deb http://archive.ubuntu.com/ubuntu xenial main restricted universe multiverse

then press on ctrl+J and ctrl+D, for new line and to finish editting
then update the repository
sudo apt-get update

then install aircreack-ng 1.2 rc3-4
apt-get install aircrack-ng

Comment: This a very bad way to add `xenial` repo. It is harmful if done on another ubuntu version. It is also harmful on Xenial.
Comment: you can remove the repo after installing aircrack-ng

How to install aircrack


What is the benefit for a sort algorithm to be stable?

Question: A sort is said to be stable if it maintains the relative order of elements with equal keys. I guess my question is really, what is the benefit of maintaining this relative order? Can someone give an example? Thanks.
Comment: This video has some examples: https://www.youtube.com/watch?v=KJuxI1BBLyQ
Answer: It enables your sort to 'chain' through multiple conditions.
Say you have a table with first and last names in random order.  If you sort by first name, and then by last name, the stable sorting algorithm will ensure people with the same last name are sorted by first name.
For example:

Smith, Alfred
Smith, Zed

Will be guaranteed to be in the correct order.
Comment: Its useful when you don't know the conditions ahead of time.  Envision a listview where the user clicks on a column to sort, and then clicks on another column to sort further.
Comment: Why not include this first and last name in the comparison predicate? Then you have to sort only once.
Comment: This answer should be accepted.  I just spent a half an hour looking at other answers that explain the technical definitions (which are easy to Google) without leaving a clear representation of the bottom line for using stability.
Answer:
A sorting algorithm is stable if it preserves the order of duplicate keys.
OK, fine, but why should this be important? Well, the question of "stability" in a sorting algorithm arises when we wish to sort the same data more than once according to different keys.
Sometimes data items have multiple keys. For example, perhaps a (unique) primary key such as a social insurance number, or a student identification number, and one or more secondary keys, such as city of residence, or lab section. And we may very well want to sort such data according to more than one of the keys. The trouble is, if we sort the same data according to one key, and then according to a second key, the second key may destroy the ordering achieved by the first sort. But this will not happen if our second sort is a stable sort.

From Stable Sorting Algorithms
Comment: Upvoted; a concise quote and a link to the reputable source is better than a lot of answers floating around this place.
Comment: I didn't downvote, but all you did was copy data from a website. Others actually went to the trouble to explain the issue, so perhaps that's why. Doesn't seem worth one to me, but others might think so.
Comment: That, IMO, is not reinventing the wheel and also quoting with proper attribution. YMMV.
Answer: A priority queue is an example of this. Say you have this:

(1, "bob")
(3, "bill")
(1, "jane")

If you sort this from smallest to largest number, an unstable sort might do this.

(1, "jane")
(1, "bob")
(3, "bill")

...but then "jane" got ahead of "bob" even though it was supposed to be the other way around.
Generally, they are useful for sorting multiple entries in multiple steps.
Comment: with correct compare logic this wont happen. (i.e compare strings as well)
Answer: Not all sorting is based upon the entire value. Consider a list of people. I may only want to sort them by their names, rather than all of their information. With a stable sorting algorithm, I know that if I have two people named "John Smith", then their relative order is going to be preserved.
Last     First       Phone
-----------------------------
Wilson   Peter       555-1212
Smith    John        123-4567
Smith    John        012-3456
Adams    Gabriel     533-5574

Since the two "John Smith"s are already "sorted" (they're in the order I want them), I won't want them to change positions. If I sort these items by last, then first with an unstable sorting algorithm, I could end up either with this:
Last     First       Phone
-----------------------------
Adams    Gabriel     533-5574
Smith    John        123-4567
Smith    John        012-3456
Wilson   Peter       555-1212

Which is what I want, or I could end up with this:
Last     First       Phone
-----------------------------
Adams    Gabriel     533-5574
Smith    John        012-3456
Smith    John        123-4567
Wilson   Peter       555-1212

(You see the two "John Smith"s have switched places). This is NOT what I want.
If I used a stable sorting algorithm, I would be guaranteed to get the first option, which is what I'm after.
Comment: upvoted; no one else mentioned, preservation of "relative" ordering.
Answer: An example:
Say you have a data structure that contains pairs of phone numbers and employees who called them. A number/employee record is added after each call. Some phone numbers may be called by several different employees.
Furthermore, say you want to sort the list by phone number and give a bonus to the first 2 people who called any given number.
If you sort with an unstable algorithm, you may not preserve the order of callers of a given number, and the wrong employees could be given the bonus.
A stable algorithm makes sure that the right 2 employees per phone number get the bonus.
Answer: It means if you want to sort by Album, AND by Track Number,  that you can click Track number first,  and it's sorted - then click Album Name, and the track numbers remain in the correct order for each album.
Comment: I wonder how many people realize that it works this way? Seems almost like Reverse Polish Notation.
Answer: One case is when you want to sort by multiple keys.  For example, to sort a list of first name / surname pairs, you might sort first by the first name, and then by the surname.
If your sort was not stable, then you would lose the benefit of the first sort.
Answer: The advantage of stable sorting for multiple keys is dubious, you can always use a comparison that compares all the keys at once. It's only an advantage if you're sorting one field at a time, as when clicking on a column heading - Joe Koberg gives a good example.
Any sort can be turned into a stable sort if you can afford to add a sequence number to the record, and use it as a tie-breaker when presented with equivalent keys.
The biggest advantage comes when the original order has some meaning in and of itself. I couldn't come up with a good example, but I see JeffH did so while I was thinking about it.
Answer: Let's say you are sorting on an input set which has two fields, and, you only sort on the first.  The '|' character divides the fields.
In the input set you have many entries, but, you have 3 entries that look like
.
.
.
AAA|towing
.
.
.
AAA|car rental
.
.
.
AAA|plumbing
.
.
.
Now, when you get done sorting you expect all the fields with AAA in them to be together.
A stable sort will give you:
.
.
.
AAA|towing
AAA|car rental
AAA|plumbing
.
.
.
ie, the three records which had the same sort key, AAA, are in the same order in the output that they were in the input.  Note that they are not sorted on the second field, because you didn't sort on the second field in the record.
An unstable sort will give you:
.
.
.
AAA|plumbing
AAA|car rental
AAA|towing
.
.
.
Note that the records are still sorted only on the first field, and, the order of the
second field differs from the input order.
An unstable sort has the potential to be faster.  A stable sort tends to mimic what non-computer scientist/non-math folks have in their mind when they sort something.  Ie, if you did an insertion sort with index cards you would most likely have a stable sort.
Answer: You can't always compare all the fields at once.  A couple of examples: (1) memory limits, where you are sorting a large disk file, and there isn't room for all the fields of all records in main memory; (2) Sorting a list of base class pointers, where some of the objects may be derived subclasses (you only have access to the base class fields).
Also, stable sorts have deterministic output given the same input, which can be important for debugging and testing.


Is it possible to catch a cold by inhaling an inorganic salt?

Question: My instructor once while teaching qualitative analysis told us that there's a salt in laboratory which, if inhaled, causes cold and cough. Is that true? Because today I was identifying a salt in the lab which was $\ce{AlCl3}$ and now I can feel that I've cold and cough. Is it true? Could there be any connection?
Comment: I don't advise you finding salts by exploring their effect on your body.
Comment: How is this related to qualitative analysis?
Comment: Qualitative analysis is related to finding salts.
Comment: But that was purely accidental. Our sir told us that it can happen. So today it did. I want to if there's a connection. If the teacher was right or not
Comment: Welcome to chemistry.stackexchange.com. Feel free to take a [tour] of the site. Visit the [help] to learn more about how it works.
Answer: A "cold" is viral infection of the respiratory tract. That is: it is caused by a virus (and the human body's inability to protect itself from it) and affects the nose, throat and/or lungs. I hope you are not asking whether a chemical compound (a salt) is a virus. Part of our bodies immune response is the mucus that coats our nasal passages and throat, the lungs have a similar protective layer. Inhalation of a wide variety of chemical compounds can damage the mucal layer (reduce our immune response) allowing a virus to gain a foothold. Inhalation of a variety of chemicals (most chemicals) is TOXIC and will damage or kill healthy tissue. You are sadly mistaken if you think your question has anything to do with qualitative analysis. It is a question about lab safety, or if your knowledge of human health is limited, as it seems it is, a question of medicine and health. AlCl3 shouldn't be inhaled. It reacts with water to form hydrochloric acid. You should have learned this, if you are working with it. If your teacher is so incompetent that he didn't teach you this, your parents should report him to his superiors. A fume of it can kill you (it would take a lot, not likely in qualitative analysis lab), and lesser concentrations will ...surprise, surprise, damage your lungs.
Comment: Breaking the different thoughts in the answer into separate paragraphs would help too.
Comment: You're mostly right, but there is a proper way to do a smell test to confirm certain compounds. There are also chemicals for which doing a smell test would be really stupid. The object in a proper smell test is to get a whiff of the airborne smell, not snort the solid. // One use for a smell test is that a mercaptan is added to the natural gas piped into homes. The smell is explicitly used to alert users of a gas leak.


How to nullify effect of Centrifugal force/centripetal force

Question: I have a track over which a rectangular object moves. The object holds sensitive material which should not move too much. Then there is a 90 degree turn of the track with some radius of curvature. When the object moves through this turning it experiences centripetal/ centrifugal force which moves the sensitive material over the object outwards. If i use a circular object to carry my sensitive material, and rotate it in the opposite direction will it nullify the centripetal/ centrifugal force on the turning?
Answer: It will never 100 % remove the centrifugal effect. No matter how you design it, your material must decrease its parallel speed to zero and increase a sideways speed from zero. This requires a momentum change. And a momentum change requires force. It is this centripetal force which you are trying to avoid, if I understand your question right.
Although you can't avoid it 100 %, you may be able to reduce it in magnitude. The force done is momentum change over time:
$$\sum F=\frac{\Delta p}{\Delta t}$$
Since the change in speed and also the mass are constant, the momentum change is also constant due to $p=mv$. The only thing left for you to work with is an increase of the duration $\Delta t$.

The use of a circular platform that you suggest, may have a positive effect if you are able to control that motion, i.e. with an electric engine or so. Because that platform can then start moving the object sideways at a slower acceleration, before the turn has been reached. The momentum change is then initiated a bit before it would otherwise be, give a longer duration for it to happen. Basically, this feature would extend and flatten the curved path which the material is taking.
Alternatively, you could consider the use of springs to dampen the "push" from the cart. The cart turns and pulls the material along with it - a stiff spring of some sort would decrease the initial force and would slowlier extend back to original length, thereby extending the duration.
Answer: You will only nullify the centrifugal force if the rotation which you apply enables the sensitive material (SM) to continue moving in the same straight line. This would not be useful if it is your intention to transport the SM along a curved path.
If the SM moves along a non-linear path then centrifugal force is inevitable : it cannot be eliminated, only minimised. (But see below regarding gravity.)
The force on the SM depends on its acceleration. So what you need to do is minimise its acceleration. Along a straight path you should change its speed as slowly as possible. When it travels round a bend with radius $r$ at speed $v$ its acceleration is $\frac{v^2}{r}$. To minimise acceleration around the bend make the radius large and the speed low.
The SM is already subject to an upward force, the normal reaction opposing  gravity. Additional acceleration will add to this as a vector. You need to avoid the total acceleration exceeding the limit which the SM can withstand. So you should particularly minimise any acceleration which is upward - eg at the bottom of a vertical loop.
Sudden changes of acceleration ("jerk") can also create large forces and should be minimised by making smooth gradual changes to the motion. See Bidirectional jerk motion on a stopping vehicle.

Note:
It is not actually the amount of centrifugal/centripetal force which is damaging but the manner in which it is applied to your body.
Free-falling at $30g$ in a uniform gravitational field is not damaging at all, but being accelerated at $30g$ in a rocket in space is damaging. The difference is that gravity pulls on every atom in your body equally, so no part of your body pushes against any other. You do not get squashed, you feel weightless. Whereas the rocket pushes on your back or feet and this contact force is transmitted through your body, one part pushing on another - you do get squashed.


Releasing Autoreleasepool crashes on iOS 4.0 (and on 4.1 as well..)

Question: I'm wondering what could cause this.
I have several methods in my code that i call using performSelectorInBackground.
Within each of these methods i have an Autoreleasepool that is being alloced/initialized at the beginning and released at the end of the method.
this perfectly works on iOS 3.1.3 / 3.2 / 4.2 / 4.2.1 but it fataly crashes on iOS 4.0 with a EXC_BAD_ACCESS Exception that happens after calling [myPool release].
After I noticed this strange behaviour I was thinking about rewriting portions of my code and to make my app "less parallel" in case that the client os is 4.0.
After I did that, the next point where the app crashed was within the ReachabilityCallback-Method from Apples Reachability "Framework".
well, now I'm not quite sure what to do.
The things i do within my threaded methods is pretty simple xml parsing (no cocoa calls or stuff that would affect the UI). After each method finishes it posts a notification which the coordinating-thread listens to and once all the parallelized methods have finished, the coordinating thread calls viewcontrollers etc...
I have absolutely no clue what could cause this weird behaviour. Especially because Apples Code fails as well.
any help is greatly appreciated!
thanks,
sam
Comment: Which compiler are you using? (GCC, LLVM & GCC or LLVM?)
Comment: what is your gdb description?
Comment: I'm compiling with GCC ... @raaz: how do i get ahold of the gdb description?
Answer: The best way to detect zombies is:

in the Groups and Files section, expand the Executables section and right click on your app name and choose Get Info
select the Arguments tab on the top and then add a new entry in the Variables to be set in the environment section. Name the new variable to NSZombieEnabled and set its value to YES.

After this you will have information in console on which released objects you make calls.
Answer: Seem's like i've solved the Issue.
The Problem was, that (as many of you suggested) I've overreleased an NSURL Object within a Method which calls [NSString stringWithContentsOfURL:urlRequest encoding:NSUTF8StringEncoding error:&error];
I assume that stringWithContentsOfURL autoreleases the NSURL object that i pass as a parameter.
after removing the release on urlRequest the issue dissapeared. Still i think that it's very strange that different iOS Versions behave differently on that matter.
the whole method looked like this:
-(NSString*)downloadContent:(NSURL*)urlRequest

{
NSString    *data = nil;
NSError     *error = nil;
data = [NSString stringWithContentsOfURL:urlRequest encoding:NSUTF8StringEncoding error:&error];

//[urlRequest release]; //Crashes on iOS 4.0 / 4.1 later when autoreleasepool is being released.

return data;

}
Answer: Sounds like an autoreleased object created in the scope of that autorelease pool is being released somewhere it shouldn't be.  Not sure why the behaviour differs with the version of the SDK; there must be an implementation difference somewhere that's causing the issue.  Have you built the code using "Build and Analyze"?  Does it suggest anything might be over-released?
Comment: I checked and double checked. there is absolutely no difference in the implementation. luckily, it works now.. analyzer says it's a potential leak, but oh well.. what isn't :)
Answer: I've noticed some strange behavior with performSelectorInBackground also.  I might be completely wrong on this, but in my case I've used:
[NSThread detachNewThreadSelector:@selector(blah) toTarget:self withObject:nil];

with better results.  If, when you're in that method, you need to access the main thread (to update the UI for example), you can just:
[self performSelectorOnMainThread:@selector(blah2) withObject:nil waitUntilDone:false];


How to convert the Differential pressure in Pa to flow rate?

Question: I am using SDP32 sensor and got the differential pressure value of the air. I want to convert this value to flow rate. What is the equation for that?
Comment: What type of conduit is it attached to ?
Comment: Is that through a calibrated orifice?
Comment: come back, diagram out your system, and describe what your sensor is attached to.
Comment: If you have enough pressure sensors, you can measure dynamic pressures at different points, giving you an idea of the distribution of flow velocities.  If you have static pressures as well as temperatures a good way to obtain density and other fluid properties, and an idea of your geometry, getting flow rates is not unheard of.  You need more data than a single differential pressure, which is really just a good way to measure (total pressure - static pressure)=dynamic pressure.
Answer: In general case pressure difference is described by Hagen–Poiseuille equation. In the case of pipe it can be described by more practical Darcy–Weisbach equation.
Simplest way, as i think, is to graduate your sensor by industrial flow meter.


logo and icon should or should not be in low fidelity wireframe?

Question: Is it going under the process to use icons and logo (logo of visa for payment) in low fidelity wireframes ?
Answer: The main aim of low fidelity prototyping is to not spend superfluous time on details that don't affect the Information Architecture or structure of your page.
While there is no harm in putting a logo at this stage, by putting the logo of VISA, you have restricted the payment gateway to only VISA. If that is what you were going for, I wouldn't worry about the logo much. However, by creating a generic credit card layout, there would be no loss of information either.
That being said, I believe that it is necessary to add icons when and where required. When you have 10s of 100s of wireframes, there is a chance that you can forget what a crossed box represented. Presence of icon indicates functionality, which should not be compromised with at any level of prototyping!
Answer: The point of low-fidelity is that you want to test whether your designs communicate what it needs to. Icons are a vital part of that story. However, to prevent stakeholders from falling over the details, your main objective is to keep these brand sensitive aspects as generic as possible and simply focus on what is it communicating. Adding the branding comes much later.
At this point, icons will consist of generic icon sets (think FontAwesome, Ionicon) as placeholders to convey the message it needs to send, but not have the burden of being styled with any brand specific imagery. Having icons instead of a placeholder rectangles is important; you need to test whether the icon does its job of being a scanning-anchor. The same can be said for the logo.


"Kill the biggest process" button

Question: This laptop has an SSD and therefore I decided to omit the swap. This works well in most cases, but sometimes the RAM gets a bit short and the computer gets really sluggish and tends to freeze up. Is there a way to implement a "kill the biggest process" button that goes straight to the kernel in case I notice the freeze fast enough? Or, because it's a computer, a heuristic for when it starts to freeze and shoot the biggest process itself would be fine too.
Comment: Do you mean "kill the biggest process" command?
Comment: Linux has this. It's called the OOM killer. But you have to have enable memory overcommit (and it's on by default in most distros).
Comment: @Patrick `overcommit_memory` is `0`, `overcommit_ratio` is `50`.
Answer: From your comment, it sounds like the system is just swapping.
Linux has an OOM killer, which is invoked when the system have overcommitted it's memory, and has now run out.
Linux by default performs memory overcommit, which basically means it gives programs more memory than the system actually has. It does this on the assumption that the programs won't actually use all the memory they ask for. However when the system runs out of memory, it already told the various running processes that they have the memory, so it can't just deny it any more. Instead what it does is to invoke the OOM killer. The OOM killer basically finds a process which the kernel thinks will alleviate the out-of-memory condition. Usually this is just the process using the most amount of memory, but the algorithm is actually much more complex than that.
Since you have overcommit_memory set to 0 (automatic mode), the kernel is performing memory overcommit. So from your explained behavior, it sounds like the system is just swapping heavily.
From here there are 2 options.
Reduce swap
Your system is running out of RAM, and so the kernel starts shoving things into swap. If your system runs out of swap, then it invokes the OOM killer. However since you have remaining free swap space, this doesn't happen.
Your original idea, manually kill a process.
You can manually kill a process when you think the system is swapping too much and something needs to die. This can be done through the kernel SysRq triggers.
The kernel has what it calls "magic SysRq". This is a bit of functionality that tells the kernel to perform some sort of emergency operation. This can be things like "remount all volumes read-only", "sync all filesystems", or "reboot now". One of these options is also to invoke the OOM killer.
If your kernel has magic SysRq enabled (kernel option CONFIG_MAGIC_SYSRQ), you can do this in 2 ways.

Alt + SysRq + f
Simply press these 3 keys on the keyboard.
echo f > /proc/sysrq-trigger
This will perform the exact same task as the keyboard method, but does so programatically.

You could also disable swap entirely, and this is what I do on most of my systems, and for this exact reason. Swap is beneficial in that the kernel will preemptively swap out data that isn't being used, letting more of your ram be used for caching. But it leads to this forced swapping issue you're seeing.
I personally think the best solution is some sort of kernel option to invoke OOM killer on forced swapping. Basically let preemptive swap work, but if the kernel is forced to move something into swap because you're out of RAM, then invoke OOM killer.
Unfortunately this is just my own personal wish. It does not do this.
Comment: I didn't know about OOM Killer. I was thinking of a script which continuously monitors the memory usage using `top` or `ps` command and if it exceeds certain threshold limit, killing that process using `kill` command.
Comment: I don't use any swap.
Comment: to see which process was killed by oom killer: `grep -E "oom-killer|Killed process" /var/log/syslog /var/log/syslog.1`
Comment: @Tass Oh, i completely glazed over the "I decided to omit the swap" comment, sorry :-(. Though the "manually kill a process" information still stands. However you shouldn't experience slowness when running out of memory. You should experience the kernel just killing things.
Comment: @Patrick that happens, but after ~30 minutes.

"Kill the biggest process" button


Text Bubble and Background S6 Marshmallow Update

Question: Ever since the update, my text background is white and the bubbles are yellow and blue only. I have no settings area like before where I can adjust it. I can change the background but that's it. I can't adjust or change the bubble or its color? It's really hard on my eyes. Is there a way to chsnge them still or do I have to download a theme? Seems silly to chsnge the theme for a text bubble option!
Answer: I have an S5, S4, and Note 2, and I also got fed up with the Stock Messaging app.
I highly recommend using Textra SMS. It has about 250,000 good reviews, many of them from Samsung users.
It's not one of those apps that use data and give you a separate phone number, Textra is a replacement stock SMS app with major customization.
Here's a screenshot of the feature you seek:

I have mine set to AMOLED-friendly black since I use Samsung, and I also enjoy the "Send Delay" feature for all the times I need to fix typos after hitting send.
Hope this helps!
Affiliation: App User
Answer: This is because the update now has "enhanced messaging" (you can turn on under message settings). This is just like the iMessage that the iphone has. When other android users turn this on the text colors will change and you'll be able to see if they've read your texts or not and vice versa.
Comment: Are you serious?! How did you find out about this? Post a link?


How do we deal with lightspeed self-answering?

Question: As seen in this question, the OP answered instantly (the timestamps are the same) to his question. I left a (barely mean) comment and I downvoted the answer, but what is the appropriate behavior with this kind of reputation-grinding?
Comment: I'm more concerned about the fact that it doesn't appear to be a puzzle at all. I've VTC for that reason.
Comment: Possibly related: [How long should I wait before providing the answer to my riddle?](/q/2799/81581).
Answer: Asking and answering your own question is encouraged in general on the Stack Exchange network.
Here on Stack Exchange, it's explicitly encouraged to ask and answer questions you've encountered and managed to find an answer to - that way, other people with the same question can find the answer.
It's an actual feature of the site that when you go to post a question, you can tick a checkbox to answer your own question, and you'll be able to write both the question and the answer at the same time, directly from the "Ask a Question" interface, and then post them at the exact same time. There's also a blog post about it, going into more detail.
Puzzling.SE is a bit odd, though - most questions here the OP knows the answer, and is providing a challenge to the rest of the community, so this feature is very rarely used here.
In this specific case, I don't think it's too big of a deal. The OP found a puzzle (of sorts; discussing whether it's on topic or not is an entirely different question), solved it, and decided to share it with the Puzzling.SE community. They also provided the answer they came up with at the same time, the same as they would if the puzzle was posted directly to Puzzling.SE.
Posting the question and answer at the same time in this case is not the problem. It's debatable whether or not it qualifies as a puzzle, but that's out of scope of this meta question.
Comment: Thank you, that is what I wanted to know :) It was the first time I saw a question-answer on PSE so I found it a bit odd.
Comment: @Saeïdryl Yes, I did it so that other people who had the same question could find an answer.  I didn't come up with it, so I thought it would be okay to post an answer.  I also felt it was puzzle-like (*I* spent a while trying to figure it out) but agree that it would be better suited elsewhere... except that it covers a variety of things (not just movies, not just sci-fi, ...) so ended up thinking that Puzzling.SE would be the most appropriate.  Anyway, sorry, I've deleted my question.
Comment: We also happen to be different in many ways from "the Stack Exchange network in general", and I think mentioning that in this meta without some explanation of how it also makes sense to Puzzling specifically is a bad argument. Even though I agree with the general sentiment that the self-answer was OK here.


Implementing MITM attack on MAN or WAN

Question: Is it possible to implement MITM attack on larger networks than LAN? For example is is possible to implement such an attack on the whole network of an ISP?
Answer: If you are said ISP or government, then yes it is possible. GCHQ surely has the capabilities to intercept huge chunks of Internet traffic. They are most likely able to do some amount of MITM but it's not been disclosed whether they do that or not as part of any program.
I would also assume that a competent adversary could break into an ISP and target a specific client of that ISP, though I've not heard of such attacks in years.

Implementing MITM attack on MAN or WAN


Is it healthy for dogs to wear clothes like humans can?

Question: Is it healthy for dogs to wear clothes like humans can? I am concerned of an animals welfare when they are wearing clothes made for pets. If it is/isn't healthy what are the benefits and disadvantages/problems for dogs wearing these dog clothes?
Comment: Can they physically? Yes, people dress up their pets all the time, as I am sure you have noticed. Are you asking more why it is done and if it is good for the pet?
Comment: @AshleyNunn Yep, I think that was what I am looking for...
Comment: Depends on the "clothes", their design, the breed and the environmental conditions. Care to make your concern specific enough to be answerable?
Answer: For the most part, no, it's not a good idea to put clothes on your pet for several reasons. There are a couple of good reasons and I will cover those.
Clothes aren't good for your pet for several reasons. One reason is that they will chafe your pet. Where a human can scratch an itch under their clothes or adjust them, a dog can't. Imagine if you're underwear were wedgified all day and you couldn't adjust them. Would you be okay? Yes. Would you be comfortable? No.
The other reason is more about psychology. I'm not going to categorically lump everyone who puts clothing on their dogs in this group, but I think a vast majority of people who dress their dogs up, do it because they see them as a child substitute. Granted they require similar care to a young child as far as not being able to feed themselves or go to the bathroom by themselves, but I think people are mentally substituting them for a baby they didn't or couldn't have, or for kids that have left home. Sometimes it happens when a child is in the house because the dog isn't argumentative. I phrased it that way, instead of saying the dog isn't bad, because a lot of them are. People feel like a talking teenager should know better. The dog should know better as well, but because they can't talk and they're dependent, it's easier to see them as a child and forgive bad behavior. It's also the reason people like cats and dogs like pugs and boston terriers. They have large eyes in proportion to their heads and this makes them seem child like.
So even though people objectively know that they're dogs, subconsciously they treat them like babies or dolls. This leads to dressing them up, painting their nails, carrying them around, making excuses for bad behavior, etc...
It's not a good psychological state for the person or the dog. On the persons side, they're transferring feeling onto an inappropriate object and they're harming their dog by not treating it like a dog. On the dog's part, they're not being taught what proper behaviors are when dealing with others. Because typically it's small dogs being dressed up, they're often forgiven for behaviors that you physically can't with a big dogs, such as biting or jumping on you. They are also carried like babies and never allowed a proper amount of exercise. These things all lead to a dog that is aggressive, territorial, and anti-social. It's all lumped in with the mindset that goes along with dressing up a dog like a person. I strongly disagree with this practice.
There are a few occasions I would find it acceptable to put clothing on a dog for short periods of time. These include a Halloween costume (though I've never put one on my dogs), a diaper when a female dog is in heat, a shirt of some kind if they have a wound you want to keep them from rubbing, a rain jacket if you don't want them to get soaked when you're taking them to the bathroom, snow boots if it gets packed in between their toes, guard vests on labs fetching in frozen lakes, and the only piece of clothing I have, which is a light jacket I put on my jack Russell in the mornings when it's still pretty cold. She has very thin hair and I put her outside when I go to work. I'll put the light hoody on her and it'll help her retain heat till the day warms up. When she heats up, she wiggles out of it and leaves it by the door.
So there are good reasons and to put clothing on dogs and bad reasons as well. If you have the correct mindset about it, the clothing serves a purpose, and you aren't projecting maternal/paternal feeling onto your dog, then clothing is fine. Otherwise, lets leave it off. Hope this answers your question.
Comment: I feel that "anxiety vests" belong in the category of acceptable clothing when used temporarily. (Although many dogs might benefit from a more direct approach to dealing with anxiety). Doggie backpacks for trail hiking, especially if a dog needs more exercise than the human, and especially if the dog enjoys being "helpful".
Comment: You're right. Those are acceptable things that I just didn't list. I haven't looked into the anxiety vests, because I've never had an anxious dog. I really don't like the advertisement's where they bill them as being like giving your dog a reassuring hug, because people and dogs aren't mentally build the same and while the would be reassuring to a child, it's reinforcing a fearful behavior.  If that's just poor advertising and it works on some other level, then that's fine with me.
Comment: Also, appropriate "career clothing" for a career dog, ie, rubble rescue dog, drug-sniffing dog, seeing-eye dog, etc is appropriate and helps the dog and people around it focus on its task at hand.
Comment: I think dogs at hand and whether it's moral or not, shouldn't wear clothes. I've seen dogs blood circulation cut off from the underwear they wear was preventing any motion from their back/hind legs. Yes, I've had neighbors who feel like their dogs are their children and some I've seen in my life time had over 45 puppies all wearing clothes, ASPCA had to come and remove most of them away leaving very few for my neighbor. I also think clothing for dogs stresses them out, physically and mentally.
Comment: I agree with this answer, it's great. We have a coat for our long haired dog because he gets rather frustrated when his ruff gets wet on long walks. Certainly I would never put a dog in an item of clothing that was never purposely designed for a dog to wear (and I agree with OP that dressing up animals is a bit ridiculous on all accounts) but not all dogs will find it uncomfortable or irritating if they have a chilled nature. Our old mongrel wore tinsel for fun most Christmas' but if she pulled it off, it fell off or she seemed itched by it we took it off, usually it was on enough for a photo
Answer: I don't think clothing is bad on itself, it's more the intent behind the clothing. Right now it's pretty cold in my house, and my 15 lb (6.8 kg) Yorkshire Terrier mix has a sweater on, because he has pretty short hair.
I enjoy dressing him, he's adorable, but I am clear that he's a dog, not a baby nor a child, but a dog. he needs walks, he needs to roughhouse with his larger brothers, who by the way don't have sweaters on. He's a dog!