Building a small network in Apple environment?

Question: I have four Macs I want networked together so files can be shared between them without email. I want it to be a wired network and I also want to be able to access the files on the network away from anywhere. A backup on a portable hardrive and an online backup would be a plus. Is OS X server what I need and maybe a dropbox? Any help would be greatly appreciated as I am not sure what to do!
Answer: There are several ways to accomplish this. Let's list your requirements:

Multiple Macs.
Shared files between them.
Wired network.
Backups either online or local.
Remote access to files.

While OS X Server is certainly useful here (especially if you wanted a VPN), it isn't necessary. Assuming all of your PCs are on the network, I would set up a NAS (network attached storage device) and locate my files there. Many NAS also have the ability to share files out remotely.
Alternatively, you could load Dropbox, Box.net, or some similar service on each device, and share specific folders to each user account. This would allow you to more easily integrate devices external to your network into your file sharing system. Each such service offers varying tiers of free space, and you pay as you add onto them. An added bonus would be the ability to roll back file changes, or recover deletions (at least DropBox has this feature.)
As with any setup, your mileage will vary.
Comment: So essentially if I had a network switch connecting all the Macs by ethernet and the NAS connected to that I would then be able to access the files from the NAS on any of the computers?
Comment: This is correct, although there are other configurations that you can do (such as using an Airport Extreme and an external drive, but that will not allow access outside of your local network).
Comment: I would also go for an NAS. I do have OS X Server and it is a nice thing, but NAS is a lot easier.
For things like Dropbox I would alternatively use Seafile because it is open source.


Probability that value from distribution A will be greater than value from distribution B

Question: I have 2 normal probability distributions, A and B.  If random values were to be chosen from each, what's the probability that the value from A will be greater than the value from B?  How can I calculate that knowing the means and std of each distribution, or conceptually from the areas under the curves:

Answer: Assuming independence (because in the case of dependence, you should provide the joint PDF), linear combinations of normal RVs are still normal. So, $A-B$ will be a normal RV. Then, we have $P(A>B)=P(A-B>0)$. In order to calculate this probability we need to know the mean and the variance of $C=A-B$. And, it is:
$$\mu_c=E[C]=E[A-B]=\mu_a-\mu_b$$
$$\sigma_C^2=\operatorname{var}(C)=\operatorname{var}(A-B)=\operatorname{var}(A)+\operatorname{var}(B)=\sigma_A^2+\sigma_B^2$$
Then, you'll have the following probability:
$$P(C>0)=P\left(\frac{C-\mu_c}{\sigma_c}>\frac{0-\mu_c}{\sigma_c}\right)=P\left(Z>\frac{0-\mu_c}{\sigma_c}\right)$$
Where you can use a Z-table to figure out the approximate probability.
Comment: Thanks.  So I take it that there's no intuitive way to visual this using the probability distributions in the figure and simple integrals?  Are there any statistical tests that have all the nitty gritty built in so I just enter the means and std of each distribution?  In Matlab, SAS, SPSS, etc?
Comment: There are no simple integrals to calculate CDF of normals, which is why we have numeric Z tables. Common statistical tests (like t-test, f-test etc.) are data-driven and for deciding if the two samples differ by mean/std or not, they don't calculate $P(A>B)$.
Answer: To add the case for dependent RVs: As pointed out in gunes' answer, you'll need the joint pdf of A and B. When plotted on a plane (A along the x-axis, B along y), A>B is the part below the diagonal through the first (and fourth) quadrant. I'm not sure if the corresponding probability can be computed analytically, but numerical integration over this area will do the job.


How to generate random data for testing database performance?

Question: I have created a test table in MySQL and would like to insert 10 million rows with randomly generated data. How to do this random generation process? Is there any predefined method in MySQL or is there any quick query we can construct to do this job?
Thank you for any help.
Answer: On MySQL forge: RandomDataGenerator:

The Random Data Generator allows the creation of tables of arbitary
  size containing an arbitary combination of columns, filled with random
  data.
Answer: You might also like the Large Data Generator (ldg) script from Tungsten's toolbox, useful for larger datasets.
Download: http://code.google.com/p/tungsten-toolbox/downloads/list
Docs:     http://code.google.com/p/tungsten-toolbox/wiki/Large_Data_generator
Answer: This one is as easy as:
call procedurename('DATABASE','TABLE',1000,'');

will fill 1000 random rows.
Here is the stored procedure to generate random test data.
Comment: I wonder why this was edited too. I had a look at the previous revision and visited that URL. I found some useful MySQL functions there.
Comment: @Batandwa there I updated the answer .. You have your procedure now.
Answer: Try generatedata.com which seems very customisable. You can also create an account on the website to store your configuration by donating or fork the project on GitHub and install it locally.
An alternative is databasetestdata.com. It doesn't seem as customisable generatedata.com, but does a pretty good job. You can also store and reuse your fields layouts (aka recipes).
I would recommend downloading the data as CSV and using MySQL's LOAD DATA INFILE to import the data into your database.


Will my fast be valid if I forgot to read niyyah?

Question: Yesterday, I had a fast but I forgot to read niyyah, After iftar I remembered that I did not rade niyyah, Will my fast is still vaild?
Answer: Assalamualaikum,
The Niyyah is a really essential for all good deeds and our Niyyah must always be good.
I didn't understand what you meant by reading Niyyah but if you had eaten Suhoor then you must have made an intention to fast.
But if you are sure that you didn't intend fast at all then your fast cannot be valid.
It was narrated by Ibn 'Umar from Hafsah (may Allaah be pleased with her) that the Prophet (peace and blessings of Allaah be upon him) said: "Whoever does not have the intention of fasting before Fajr, there is no fast for him." Narrated by Imam Ahmad, the authors of al-Sunan, Ibn Khuzaymah and Ibn Hibbaan
However, the Niyyah doesn't have to be verbal but it can be taken in the heart.
Prophet (peace and blessings of Allaah be upon him) said: "Actions are but by intentions, and everyone shall have but that which he intended…" (Narrated by al-Bukhaari, 1; Muslim, 1907)
So, you have to think whether you had taken the intend to fast or not and act accordingly.


Figure out what outlets belong to what breakers

Question: So I live in a dorm room at a college, and I am looking into getting 2 1050w ASIC miners for mining Litecoin.
My issue is, that as far as I know, you can't pull +/-3000 watts from one breaker. (2 miners = 1050w, + desktop computer 500w, + laptop 300w+ fan/chargers/etc) (I live in Canada btw, so you know what electrical standards we use)
I am trying to see if there is a way to figure out what outlets are hooked to different breakers. I know there are devices that allow you to send a signal to the breaker, but I don't have access to the breaker, so I'm hoping there's a device where I can plug it into one outlet, and check all the other outlets to see if the signal is coming through.
As far as I know, in our dorm we would have multiple breakers, so I'm trying to figure out where they are, so I can distribute the power usage between them. I'm assuming there is a separate breaker for the kitchen, bedroom #1 and bedroom #2.
Anyone know of a device that will help me figure this out? Thanks.
Comment: Check your housing contract and the colleges networking terms. Miners are specifically prohibited by most learning institutions since they consume power and bandwidth.
Comment: Do you have access to your circuit breakers and control of them?  Are you certain your circuits are not shared among rooms?
Comment: I don't have access to the breakers, the circuits could be connected between both the rooms, but I don't think they would also be connected to the kitchen as well, considering a fridge would use 100w, plus microwave using 1200w, + the load of my PC and other stuff using about 1000w, that would mean we would be pulling at least 2100w, not including my roommates power, so I think that at least the kitchen would be on a separate breaker.
Comment: Can be a quick way to not have a dorm room anymore....
Answer: The only answer here is to contact your Facilities Department and ask them.
Your whole idea of throwing big loads into a building on a "rogue" basis is only going to result in breaker trips. And since you can't reset a breaker, you'll end up talking to Facilities anyway, or they may end up having a talk with you.  I know the child's impulse is to sneak until he can't... but when you're adulting, it's better to get out ahead of it and intercept the objection before it becomes one.
Power supply
Your 1050W unit is a DC figure, it will need a power supply (PSU).  That is not 100% efficient.  Some brag 89% efficient, and 94% power factor, and if that's true that means 1255 VA of actual draw.
This is a continuous load.  That means when provisiong (planning) power to the device, you must derate it by 125%, or 1570 VA.   Normal 120V/15A circuits have 1800 VA available, and one ASIC will totally dominate it with only 230W available for maybe a small console screen.   Larger 120V/20A circuits, sometimes reveaked by the T-shaped neutral socket, have 2400 VA to give, so they also can support one ASIC, and 830 VA of other stuff will fit.  VA is a unit very similar to watts.
You will not find an 850 watt air conditioner.  This will require a third circuit.  You have not stated any plan to remove 2510 watts of heat energy from a dorm room, and that is a fatal flaw.

Colleges do not like miners.  The reason is mainly the excessive power used.  When dorms proffer "free electricity" they only mean for incidental use for normal student needs.  They do not mean for you to use it as the primary resource input into a side business that profits yourself - and everyone knows the coin-mining game is All About the cost of electricity. So yes, you are definitely violating campus rules against exploiting university assets for personal gain.
It's different if you're running an ebay business and use the power to run the heat shrink gun 30 seconds a day.  An eBay business doesn't have electricity as its primary resource input.
You're using a VPN and the traffic is low.  How does their incompetent IT department catch you?  Easier than you think.  Someone from the Facilities Dept. comes out at 5 am and aims a FLIR at the side of the building.  The dorm rooms where power is being overused light up cherry red.  They can do the same by aiming the FLIR at the service panel, the high-current breakers will light up warmer than all the rest.  It's not rocket science.
Answer: Not sure where you are getting the "+/-3000 watts from one breaker" idea, that's not accurate. Assuming 120V, you are limited to 1440VA (80% of 15A x 120V) continuous on a standard residential circuit. It's possible that they used heavier wire (12ga) and a 20A breaker for 15A outlets (legal in the US, not sure about Canada), but that's still limited to 18A, so 2160VA. then assuming the Power Supplies in the severs are at .8 power factor, that's either 115W or 1728W respectively. Bottom line you probably cannot use one circuit to run both of your servers (assuming you are not prohibited anyway) or even one of them if there is almost anything else on that circuit.
Comment: 16A or 1920VA on a 20A circuit.
Comment: As correct as the information may be here, this doesn't actually answer the question, which is about how to tell which receptacles are on different breakers.


Do soap molecules form liposomes?

Question: I know soap molecules form micelles. Do they also form liposomes in water? I need the reasons too.
Answer: Amphiphiles spontaneously form a variety of self-assemblies in water, such as
micelles, vesicles, and bilayers. The simplest form of self-assembly for single chain amphiphiles are micelles.
The concept of packing parameter proposed by J. Israelachvili allows a simple
and intuitive insight into the self-assembled aggregates of amphiphiles in water
The packing parameter $P$ is defined as:
$$P = \frac v{ l \times a_0}$$
where $v$ and $l$ are the volume and length of the surfactant hydrophobic tail, respectively, and $a_0$ is the optimal surface area per amphiphile.
Let me briefly explain the concept of optimal surface area per amphiphile ($a_0$). It is based on the principle of opposing forces; the hydrophobic interactions act to pack the soap molecules closer together to avoid exposing their hydrophobic tails to water, while the repulsive energy between the charged headgroups of the soap molecules increases as molecules are pushed closer together. The surface energy of the self-assembly is minimized when the amphiphilic molecules occupy the optimal area.
Single-tailed amphiphiles (like your soap molecules) have a large head-group area and have a packing parameter $P < \frac13$. Thus, they form spherical micelles. Ionic surfactants such as sodium dodecyl sulphate (SDS/NaDS) generally forms spherical micelles in solution at low salt concentrations. Single-tailed amphiphiles with a small head-group area ($\frac13 < P < \frac12$) will form elongated or cylindrical micelles. Non-ionic surfactants and ionic surfactants such as
SDS and CTAB in high salt are known to form elongated micelles. Double-tailed
amphiphiles with a large head-group area (phosphatidylcholine, phosphatidylserine, phosphatidylinositol etc) have a packing parameter approaching unity and tend to self-assemble into planar bilayers and vesicles/liposomes.
The figure here will explain this schematically:
Answer: Liposomes are a lipid bilayer separating an aqueous internal compartment from the aqueous phase. Micelles are closed lipid monolayers with a fatty acid core and polar surface, or a polar core with fatty acids on the surface (inverted micelle, Aerosol-OT).  A soap would then form a micelle but not a lipsoome for its ionic water-soluble head.
A non-ionic surfactant, e.g., diblock short PEO-PPO, could stretch the definitions.
Comment: So basically that ionic ends stops the formation of liposome?
Comment: So it seems.  Ask your prof.  Some definitions are matters of fashion or convenience.  Carbonium ions (-onium - highest valency) became carbenium ions after Magic Acid.  The nomenclature is still all over the map.

Do soap molecules form liposomes?


Gravitational force between Earth and Sun is decreasing

Question: According to one of the most famous equations in physics, i.e. $E=mc^2$, the mass of the Sun is decreasing as it emits energy. So there must be some kind of disturbance in planetary orbits, and if there is, then how will it be according to Newton's perspective and by Einstein's perspective?
Comment: Something I try to drum into my students is the importance of relative scales in physics. Have you worked out how much mass is lost in a year? Hove you looked at what fraction of the current solar mass that represents? Have you then figured what the yearly change in the radius of the Earth's orbit would be on that account? Those are the kinds of question that can lead you to understand this phenomena for yourself.
Comment: Thanks for your great suggestion but I'm just a high school student I can't solve Einstein's field equation but yeah I can solve it using Newton's gravitational law
Comment: This is a completely classical Newtonian problem. The sun is losing about 1.5 million metric tons of mass per second due to radiation. Put that in relation to the total mass.
Comment: The big effects are all Newtonian, and so you should be able to calculate them for yourself. It is a good exercise. As for Einstein, the Earth-Sun system is emitting gravitational radiation and the Earth is spiralling in towards the Sun and will eventually crash into it. According to https://en.m.wikipedia.org/wiki/Gravitational_wave we get $10^{-15}$m closer to the Sun every day (about the diameter of a proton) and will crash into it in around $10^{23}$ years. A lot else will have happened long before that!
Comment: Possible duplicates: http://physics.stackexchange.com/q/208/2451 ,  http://physics.stackexchange.com/q/114735/2451 and links therein.
Answer: Yes, the sun's mass isn't constant causing disturbances of orbits, but should you care.
Mass of sun now: $\approx 2 * 10^{30}$ kg so $E \approx 1.8 *10^{47}$ J. Radiation per year is about $10^{34}$ J.
You've got a lot bigger problems that affect your calculation of orbits. Especially like where Jupiter is relative to where you thought it was. Namely the many body problem.


Rooting HTC One M8 fails using KingRoot

Question: I am trying to Root my HTC M8. I have tried using KingRoot to get it rooted, but I lost root and couldn't get it to get rooted again. Do you have a better way of rooting the device?
Answer: Yeah! Your phone was rooted but there was no change in recovery. So, It would be told that stock recovery has some scripts that sets all back. I have been through it already.
So, I have solution which helps in permanent rooting.
It can be applied nearly all devices over the globe -->

Download a custom recovery and flash it.
    You can find its tutorial and requirement based on your model on some searches.
Now, find a flashable zip file of SuperSu and flash this one using recovery.
 This zip file can be found by just searching these highlighted keywords.

This process is permanent for rooting as there is no one to check system changes for SuperSu binary. And as recovery has already root access. So, it can share it with you. I hope it may be helpful for many people.

Rooting HTC One M8 fails using KingRoot


Distinguish between a log file and a file logged in the log file

Question: This form has a file upload element which is used to upload a log file, and a drop down to select files that are 'logged' in the log file. The users of this will be familiar with what a log file is and the structure of the specific log files used in this tool. My questions is: Do the labels accurately describe what the elements are for? If they don't, how could they be better described?
Comment: I thought I knew the difference from the question, but then I saw what you were trying to do and now I honestly don't know what your selector is selecting. Let's say I upload a file, octopus.log. Will that file show up in the list? I'm thinking it won't. So,  what will show up? And what does selecting it do?
Answer: The controls are fine. Clarity in the wording would be an improvement.

First, upload your log
Then, select the [relevant] file within your log

Only allow step two after step one has been completed.


Is there a way to "calculate" speed/duration for animation?

Question: So this video of the burning earth is one of my first (Blender) videos. I had made the quite arbitrary choice to let the earth turn in 10 seconds. It seems a little too fast ? Is there a way to "calculate" the best speed/duration for such a video ? And are there any tools in Blender to "play" with the speed of your video ? I guess I should study relevant concepts for this kind of work because now it is a bit of trial and error.
Answer:
It seems a little too fast?

There is no "right speed" when it comes to animation. It all depends on what  you are intending to do.

Is there a way to "calculate" the best speed/duration for such a video ?

Best (or any other superlative) is beyond the scope of this site, as there is no categorical way to answer...
But calculating the duration of an animation is not only possible, but absolutely necessary for anyone trying to express ideas through animation.
To only way to get a sense of how your animation is working out, is to pre-visualize it in real time, meaning: evaluating while playing back at a sustained pace at the target framerate.
For simple scenes you can just playback the animation on the 3D vieport at the desired target rate.
As the scene gets more complex your system might not be able to compute the transformations in real time.
As you play your scene you'll see a number on the top left of the screen that reflects the actual playback speed. If those numbers are red it means that the playback speed is not the correct one and what you are seeing is not an accurate representation of your scene.

At that point you can use a multitude of strategies to get a sense the actual pace of the aninmation:

Visualize things in wireframe mode or bounding box.

Do a quick render in OpenGL

Render a low resolution file using a single simple material for the whole scene. Simplify it by reducing the numbers of subdivisions, baking all bakeable actions/surfaces/simulations. Hide objects that do not move or are irrelevant to the elements you want to evaluate. In other words, use every trick you can think of to simplify your scene and accurately evaluate it.

In short, make sure you have a good idea of what the pace of the animation is before you spend a lot of time rendering the real animation in full detail, only to find out errors that could have been prevented by pre-visualizing.
How do you modify the timing of animated objects?
The pace of animated objects is an easy formula: how much are the elements transforming over how many frames (time).
To slow something down you need to have less transformation occur on the same number of frames (time):

Or have the transformation occur over a longer period of time:

In the simplest form of animation you have a start key frame and and end keyframe. Spacing the keyframes apart in time will make the transformation slower, getting those keyframes closer together will accelerate the transformation.

See this post for more details
For complex animations where all the elements are working fine with each other, and you don't want to affect the placement of keyframes in any way,  you can use the Time-Remapping tool on the "dimensions" section of the properties panel:

More info on this post.

And are there any tools in Blender to "play" with the speed of your video ?

There are, and they should really be avoided and thought of as the absolute last resort.
Re-timing a rendered video is only going to create a new set problems. Not only will you be dealing with decompression-recompression issues, and multigeration quality loss, but even if your workflow involves real lossless formats you will be dealing with some form of spatial and temporal interpolation that blender handles very poorly.
When you are re-timing video, you are either creating new information for new frames by interpolating existing ones, or discarding/combinig frames to compress the time. Depending on how severe the changes are you'll be introducing stuttering/flicker to scene or will have issues with inaccurate motion blur.
To re-time video properly you need some form of otpical flow. Blender does not have any such tools.
There are some amazing tools out there that will allow you to re-time video like twixtor (Not cheap) or slowmovideo (open source) both require in depth knowledge to make them work correctly... Adobe Premiere, Davinci Resolve or Fusion have basic tools for optical flow

It is a bit of trial and error.

Just like life...
So to summarize:
Try to get the rhythm of your animation before you render, not as an afterthought.
Comment: Thanks again !! I get the message, don't mess around with the speed of the video after rendering. You say Adobe Premiere has basic tools for optical flow . What do you mean with that ?
Answer: Play Rendered Animation Speed
The default Blender video sequence player has keyboard speed controls. The menu choice in 2.77 is [Render/Play Rendered Animation].  Numpad 0-9 as an excerpt.
https://www.blender.org/manual/render/output/display.html#animation-playback
This allows you to keep your camera panel final render settings untouched.  You will see the speed effect with [no] explicit screen text or graphics to confirm your choice. In the video player press [shift] to see filenames and fps frames per second. This worked for .png image sequences.
The timeline window alternate has an alternate frame range. This setting affects 3D View [play animation] and [Render/Play Rendered Animation] as well.
If you choose not to use the Blender internal playback keyboard controls, there is another alternative.  Lowly recommended.  A quickly created new scene with [Copy Settings] will allow you to have a second choice for playback of the rendered images sequence.  Thus the Blender user can use the Camera Render panel to select a new speed and frame range for Play Rendered Animation. New Scene just to playback rendered sequence with speed or frame range changes.  Thus the original scene remains intact.
A quickly created new scene with the a new VSE editor can examine any frame range of any sequence at any speed. Thus the original scene remains intact.

If you create an image sequence with Blender such an .pngs or .jpegs they can be be played back at variable FPS frames per second by changing frames rate in the render settings panel with the camera icon. Playing Back an image sequence is not a great amount of CPU Consumption.  So final view may have one rate. Inspection may have another rate. Or the range of frames for inspection may be changed.  This affects the playback rate from the menu for image sequence [play rendered animation].
Of course the Camera Render panel will show your current choices explicitly.  You can choose to use the same scene to change settings.  The Blender user must remember to set the appropriate rate for a movie final render. The techniques above eliminate the need to remember settings with the burden of new scenes.
Sometimes I watch a video slower to look for defects.  Faster when I feel its too slow.
The playback of render command is printed to the console where it can be seen and copied.  Thus you can issue the the command to your Operating System Console. Name separators must be inspected. \\ or \ as an example. As an example you may want to examine a certain range of frames.  The Timeline window also as an alternate range of frames.

<code>  'C:\\Program Files\\Blender Foundation\\Blender\\Blender2.77\\blender.exe -a -f 24 1.0 -s 1 -e 8 -j 1 J:\\A\\3D\\Blender\\C\\D\\E\\F\\G\\image_516_0001.png'
</code>
See this link for more information
https://www.blender.org/manual/advanced/command_line/arguments.html?highlight=playback
The Video sequence editor is capable of slowing down image playback in the same way.
If you happen to like a different speed you can then to decide what combination of scaled keyframes or different FPS will help you.  If your actions are a NLA strip they can be scaled.
Yoo Toob has a speed control on screen.
Comment: I did create an images sequence of PNG's. Where can I find the camera settings you for changing the frames per second ? Same question for VSE
Comment: Please see edit.
Answer: Add your Scene to the VSE and add a Speed Control Effect Strip on top while it's selected. You can then just grab your Scene Handles to adjust its length and the Speed Control will do the magic.
And since 2.76 Blender even calculates correctly interpolated subframes of your animation to be played back propely:

Speed Effect can re-time scenes with subframe rendering.

Make sure, your Sync Mode is set to AV-Sync.
Comment: if I play the video in VSE (AV-Sync = on) then the video is stuttering. Is this normal ?
Comment: uhh... what is a subframe ?
Comment: When you slow down video you need to create frames there where there are none. The stuttering you see happens when the software you are using is repeating frames instead of synthesizing new ones.
Comment: Frames are usually constant points in time dependant on your fps setting. But when you slow down or speed up a Strip you might need to have the information of some interpolated point in time in between two original frames. These are called subframes. They help in certain circumstances like fast simulations or speed effects...
Comment: no, the stuttering is there before I change the speed of the video. And the frame counter in the top left of the screen is also in red. I think the CPU of my computer is pretty fast, so what can be the cause ?
Answer: For calculating the time, say you need 60 seconds of an animation then it is 25 frames multiplied by 60 seconds giving you  1500 frames so for any real time calculations the number of frame rate multiplied by the desired time gives the exact number of frames suitable for the animation.
About the speed of animation, I have always scaled the keyframes where necessary in the dopesheet to make some parts in the animation fast or slow but that could mean adjusting other keyframes too, increasing the number of frames or even more render time than planned so it is better to always play the finished keyframed part to check out its play speed before taking more steps into animation creation.


Graphics driver update goes wrong

Question: Lately I tried to (manually) update my graphic drivers on my ubuntu 14.04 . So I downloaded deb package from Amd website and install it. Unfortunetly package was allegedly corrupted so I was force to run apt-get -f and remove it . After reboot I get popout informing me that system is running in "low graphic mode" . But when i choose option to agree to one session in low graphic mode , everything is getting stuck in some kind of loop. So basically i only Have access to console login. I've tried to using xinit command but it throws error too. What should I do ?
Answer: How about trying this? https://help.ubuntu.com/community/BinaryDriverHowto/AMD#Manually_installing_Catalyst_13.4
Do it step by step so you know you are doing it correctly.
I have never had Linux + AMD, so this was all I could come up with. I know Nvidia blacklists the open source drivers, maybe AMD does the same?
Answer: It may be a good idea to do a clean reinstall of your OS. AMD video drivers are finnicky and require a strict procedure to install and update. If you decide to reinstall your OS entirely, you can install/update the video drivers for your AMD GPU following this process:

Make sure you are using the open source divers (you can check on the aditional drivers tab, under your system configurations)
Uninstall the fglrx drivers (the proprietary AMD drivers). To do this, run this command on the terminal:
sudo apt-get purge "fglrx.*"
Delete your xorg.conf:
sudo rm /etc/X11/xorg.conf
Redownload and install xorg completely:
sudo apt-get install --reinstall xserver-xorg-core libgl1-mesa-glx:i386 libgl1-mesa-dri:i386 libgl1-mesa-glx:amd64 libgl1-mesa-dri:amd64
Configure xorg (if this command gives you an error, don't worry about it. This one is more just to be safe than for anything else):
sudo dpkg-reconfigure xserver-xorg
Reboot your computer.

I do this everytime I need to install a new AMD driver version. It helps to avoid errors. When you boot again, you should be using the open source drivers by default. After this, you can proceed to download and install the AMD drivers:

Go to AMD's website (www.amd.com) and on the tab "Drivers and Support" click on the option "Drivers + Download Center".
Once the page loads, look for the "Latest AMD Drivers and Software" section and choose the apropriate sub-section for your GPU. For example, I have an R9 270X, so I would choose "Radeon™ R9 200, R7 200, HD 8500 - HD 8900, and HD 7700 – HD 7900 Series". On the apropriate sub-section, click on the link that says "RHEL / Ubuntu / Linux".
Another page will load and here again you will have to look for the apropriate section for you. On my example, I'm using Ubuntu 14.04 64bit and an R9 270X, so I would choose the "Ubuntu 14.04.2 64bit" link, under "Radeon™ R9 200, R7 200, HD 7000, HD 6000, and HD 5000 Series".
On the next page, download all the packages compatible with your system. On my case, I would download all the packages marked with "14.04". On the Crimson 15.12, there are 4 .deb packages to download (Video Driver for Graphics Accelerators; Minimal Video Driver for Graphics Accelerators (Non-X Support); Video Driver for Graphics Accelerators Devel Files (OGL, OCL); Radeon Setting)
After you download all the packages you need, put them in a folder exclusive for them. Open this folder in the terminal and issue the comand:
sudo dpkg -i *.deb

This command will install all the .deb files located in that folder atuomatically for you. If the install fails, read the output on the terminal. It probably needs some dependent packages to be installed. To install these packages, simply read from the terminal which ones they are and use apt-get to install them. For example, in my system I had to do:
sudo apt-get install lib32gccl libc6-i386 dkms

After you installed any dependecies, run
sudo dpkg -i *.deb

again and the instalation should complete.

After the instalation completes, issue on the terminal:
sudo aticonfig --initial

and reboot your computer. When it comes back, you should be using the proprietary AMD driver :)

Graphics driver update goes wrong


Mobo dead, how to access striped volume externally from laptop?

Question: I have a dead PC with 2 data drives that are windows striped (not hardware raid-0). If I buy a usb raid enclosure, do you think windows will recognize them as a dynamic disc? If not, is there a way to access it externally without a desktop?
Thanks.
Answer: If it was done in Windows (e.g. through Disk Management), then yes, another Windows OS will recognize it. Don't expect to be able to boot from them on your laptop though.
Doing it over USB may introduce some wrinkles, but should work fine in theory if Windows can see the individual drives.


What are some criteria to get an Australian PhD scholarship?

Question: I want to apply for a PhD in Australia and I wrote a professor (who has an open position) with my CV. He was very positive in his mail and encouraged me to apply for that position. Now I want to know who is the decision-maker in taking a student and offering funds? I mean is it like the professor asks people to apply but the ultimate decision-maker is the university itself? Or the professor can take anyone if he wants to. What is most likely to be in Australia?
Also, is it true the scholarship committee focuses solely on GPA, rather than research work? I mean is it possible if the GPA is not high but research experience and works are excellent?
Comment: Why not ask the professor? "Could you confirm the source of this scholarship, and what the selection process will be?" is an entirely reasonable question. Whenever you apply for something, you ought to know who you're trying to convince and what they're looking for. There is no way random strangers on the internet can answer this for you - only the professor can give you a definitive answer.
Comment: @Prof.SantaClaus That's an answer that belongs in the answer box.
Comment: There are two possible scenarios: (i) the professor has scholarships from a funding source, which could be from the industry or the Australian Research Council (ARC), or (ii) the scholarships are provided by the university.  For (i), it is up to the professor to decide.  For (ii), multiple committees are involved in the decision process.  What the committee focuses on varies.  If you have an excellent research record, but a relatively poor GPA, you may still get a scholarship.  However, there are usually candidates with a high GPA and good research record.
Answer: For Australia, both the supervisor and the university might reject a PhD student.  Universities may often reject PhD students for inadequate language ability even if the supervisor wants the student.  These decisions are based on a threshold, not based on who else applies.
Some supervisors have funding they can use to pay PhD students at their discretion, but most PhD students are funded through a university program.  The fact that a position has been advertised does not mean the supervisor necessarily has funding for that position.  For funding by a university, research experience is essential.  Marks (not called GPA in Australia) are also considered.  There is a fixed amount of funding available, so decisions depend on who else applies.


What is multilingual vs monolingual corpus?

Question: If I have a corpus which has Hindi script and Hindi transliteration with English script. Is it multilingual or monolingual corpus?
Answer: If you have a fool-proof way of converting the Hindi transliteration to Hindi script (or vice versa), then you should do it, and you will have a monolingual corpus. If not, it is multilingual, from an algorithmic standpoint.
Caveat: Even if we can convert all text into the same script reliably, we sometimes need to be careful about treating everything in the same language. For example, the Hindi spelling, grammar, and usage may differ between the text in Hindi script and the transliterated text (usually user-generated content like comments on websites). Depending on the use case, we may want to treat transliterated text as a separate language.


When an Adobe AIR app requests a resource from the server what shows as user agent?

Question: When a browser like Chrome makes a request for a web page or image like a gravatar icon the server receives the userAgent information like so:
<code>"Chrome/2.0 AppleWebKit/400.1.1 (KHTML, like Gecko)"
</code>
But if an Adobe AIR app makes a request for an image in the Image component what does the server receive? Is the same as a URLRequest?
<code>"Chrome/2.0 AppleWebKit/400.1.1 (KHTML, like Gecko) AdobeAIR/3.0"
</code>
Background:
My AIR app shows Gravatar icon for the user and recently it stopped working. I'm wondering if it's gravatar is denying calls from user agents it doesn't recognize.
I've tried changing the userAgent to test the theory and it's throwing an error:
<code>// 1195: Attempted access of inaccessible method userAgent through a reference with static type Class.
URLRequestDefaults.userAgent("chrome");
</code>
Update:
It looks like I need to set the user agent as a property and not a method. Was referring to this forum post. So I can change that might fix the gravatar issue but not answer how Adobe AIR apps appear to the server.
Answer: i hope this result's comes useful

Mozilla/5.0 (Windows; U; en-US) AppleWebKit/533.19.4 (KHTML, like
  Gecko) AdobeAIR/3.1

also i cant realize that what's difference between requesting for an Image and URLRequest, they are same.


How do I find out the numbering of merge commit parents?

Question: I need to do a git revert -m , but I have not been able to find any documentation on how the commit parents are numbered. Everything I've seen (including the help pages for rev-parse) just tells me that the parents are numbered but do not say how they are numbered. Could someone point out to me where this is defined and how to determine this?
Answer: git show --format="%P" <SHA>

will give you the parent SHAs of the given commit in numerical order. Most often the one you'll want to specify for git revert will be 1.
In the case of most merges, the SHA of the branch that was checked out will be the first parent, and the SHA of the branch that was merged in will be the second. (Basically, the checked out branch is always the first parent; the other parents are the branches that were specified to the merge command in the order of their specification.)
If you want to find the SHA for a particular parent, use the caret operator:

First parent: git rev-parse <SHA>^1
Second parent: git rev-parse <SHA>^2

et cetera.
Comment: Good answer, but the danger lies in "most", not all. I have a git repo that was converted from svn and several `git-filter-branch` operations have been executed on it, and now it appears that in some cases the order is the other way around. See http://stackoverflow.com/questions/27704438/find-the-right-parent-of-a-merge-commit-in-a-non-interactive-way
Answer: Doing git log or git show on the merge commit will show you the list of parents for the merge in the "Merge: " header.  This lists the parents of the merge in sequential order from left to right.  The first one is the first parent, the second one is the second parent, etc.
For example on the git repository:
$ git show 0af53e188a3a8915f65c3b3edaeed3e07d8d3802
commit 0af53e188a3a8915f65c3b3edaeed3e07d8d3802
Merge: b81b758 8894d53
Author: Junio C Hamano <email@example.com>
Date:   Thu Aug 11 11:04:28 2011 -0700

    Merge branch 'cb/partial-commit-relative-pathspec'

    * cb/partial-commit-relative-pathspec:
      commit: allow partial commits with relative paths

b81b758 is the first parent, and 8894d53 is the second parent for the merge commit 0af53e1.
The parent commits are numbered according to their order of appearance on the command line when the commit is done:
[on branch master]
$ git merge foo bar baz

That will merge the branches foo, bar and baz into master and create a new merge commit if fast-forward was not possible.
In the resulting merge commit "master" will be the first parent, "foo" 2nd, "bar" 3rd, and "baz" 4th.
Answer: The commit 'number' is in fact its SHA1 hash value. This gives it great integrity for verification purposes.
It also has the nice side effect that you don't/can't expect it to be in any way sequential, which is also a natural property of branch & merge multi-user distributed VCS systems. There are lots of tree walk commands and methods of referencing commits, such as HEAD^ or HEAD^^.
git help revisons gives a full description of all the different syntaxes.
Comment: The question is about parent numbering, not commit IDs.  i.e. "First parent" "Second parent" (`HEAD^1` vs `HEAD^2`)
Comment: @ABMagil The original question didn't explictly state it was about counting within the HEAD^^~~ style syntax, it just talked about commit numbering, which canonically is the sha1. I did finish by saying that the HEAD ^ style was available - I just failed to highlight `git help revisons` as a source.


Line between two 'empty's

Question: Simple question: I need a line between two previously made objects 'empty' so that it remains attached to these vertices: the line itself can't be moved, but moving the vertices modifies the line. Thanks!!
Answer: You can use vertex hooks, example: draw a line mesh (2 vertices).
Then in edit mode, select one vertex, press CTRL+H and select "hook to new object". Here an example for a cube mesh, easier to visualize: it works anyway.

A new "empty" will be created where the vertex is, and the vertex is "hooked" to it (meanwhile a "hook" modifier has been created, for your line mesh, with proper relations to empty object).

Do the same with the other vertex. Now you have the line mesh and two empties. Wherever you move the empties, their respective hooked vertex will follow.

You can also hook to existing objects (empties or others) or bones, choosing other options after CTRL+H. You may need to select them first.
In this case you'll probably have to move the control points to the respective empties origin while in edit mode to set their position:
Comment: @jekyll-friend: if you select the empty, then the mesh, go in edit mode and select the vertex, press CTRL+H and select "hook to selected object", it will be hooked immediately, since the empty is the only other selected object. If the empty is not in the same vertex position, though, visually it seems that nothing happens, but it's hooked. Try to move the empty, the vertex will follow. To make the vertex reach a distant empty, you can use the mesh snap tools,as in the Carlo's gif.  The circle you see there is a visual snap confirm of those tools.
Comment: Thanks!! But I have problems doing that with existing empty objects. In Object Mode, I select first the empty, then the line, then tab to Edit Mode... but CTRL+H gives three options (hook to new object, hook to selected object and hook to selected object bone), but no one works. How should I do it?
Comment: you can check the hook in your objects modifers to fix it (the target object has to be the empty) or do the entire hook manually there.
Comment: @m.ardito How can you snap to the empty? I see in your gif a little orange circle appearing, but I can't get it
Answer: You may do it using Stretch To bone constraint.

Add a bone (Shift+A-->Armature-->Single Bone) between Empties.

With a bone selected in Pose Mode go to Bone Constraints header-->Add Bone Constraint-->Stretch To

Now being in Object Mode create a simple line consisted of two vertices (add a plane and delete two vertices). Place it exactly between Empties. Name it viz.

Select the bone again in Pose Mode, go to Bone header and type viz below Custom Shape in the Display panel. It'll change the bone appearance to the line you've created. Next go to Stretch To constraint settings and adjust the Rest Lenght value to make the line fit between Empties.

Lastly you may parent (Ctrl+P) the bone and second Empty to the first Empty to make them move together.

Line between two 'empty's


Handling Dates in Einstein Analytics UTC vs Local DateTime

Question: Our users are using the New York timezone in Salesforce (UTC - 4 or -5 depending on DST).  It appears that the dates are stored in SF as UTC.  Salesforce reports that need date ranges work fine because the UI takes the users Timezone into consideration.  It appears that Wave (Einstein Analytics) does not do this natively/automagically.  Is there a setting for Wave/Einstien to force the DataFlow to generate DataSets with the local date/time?  All the info I found online about this indicates that a new DateTime field needs to be created using the todate() function, something like this:   "saqlExpression": "toDate(CreatedDate_sec_epoch - 4*3600)"
Comment: What you found online in the docs is pretty much correct. Unfortunately, DST isn't consistent each year.
Answer: True, Many of the MNC companies face this Challenge. You found the solution yourself. In Einstein Analytics you can add a computed Date field which can calculate the user time zone. for example you can create a field something like below and use it everywhere
<code>"Extract_Opportunity": {
  "action": "computeExpression",
  "parameters": {
    "source": "Digest_Opportunity",
    "mergeWithSource": true,
    "computedFields": [
     {
      "name": "CreatedDateNew",
      "type": "Date",
      "format": "MM/dd/yyyy",
      "saqlExpression": "toDate(CreatedDate_sec_epoch - 8*3600)"
     }
    ]
  }
},
</code>


How to add Time to Date in Excel

Question: I have a cell that contains "01.08.2014", which is a date.
I want to use a formula to turn it into "01.08.2014 00:00:00" which is supposed to be date and time.
Answer: Assuming your date "01.08.2014" is in cell A1, this should work.
=DATE(RIGHT(A1,4),MID(A1,4,2),LEFT(A1,2))

The DATE() function works by pulling out the Year, Month and Date components of your string and reassembling them into a proper Excel date.
Comment: Somehow LEFT(A1;2), which should give "01", returns "41" instead, so it appears my data is formatted backwards and displayed differently..
Comment: @Hans You have a `;` instead of `,`?
Comment: Yes, I got an error using ,

Also, I just found out, somehow the content of the cell which displays 01.08.214 is actually 41852. What type of format is that? Seconds?
To make that more clear: =A1 &"test" yields 41852test
Comment: 41852 is an unformatted date in Excel. As you've discovered, you can use the built-in cell formatting in this case - the formula I explain above is for dates embedded as text. And to explain the comma/semi-colon thing, in some European versions of Excel, `;` is used instead of `,`.
Answer: I fixed it as follows: Apparently, the date was already fully included in the information in the cell, so I only had to reformat:
Select all cells, press CTRL+1 and then define your own format, e.g. I did dd.mm.yyyy hh:mm:ss
Answer: Date/Time values are stored as a single number.  The integer portion is the date (number of days since a reference date), and the decimal portion is the time (fraction of a day).  That is the actual content of the cell if Excel stores it as date/time data.  What you see displayed is just formatting to express it in human-readable form.  Using string functions to parse the date components won't work because that is not what is actually in the cell.
You can format the contents any way you want.  Custom formats give you a lot of flexibility.  Or you can use functions to extract components of the date and time and concatenate them for a custom format.  This link provides some explanation: http://www.excel-examples.com/microsoft-excel-date-time-functions.htm
EDIT: @Hans, When I wrote this, I missed your post that you had already solved your problem.  I'll leave the answer in case it is useful to anyone else.

How to add Time to Date in Excel


DS1337 with shared I2C pull-up

Question: I have a project using an ATMEGA328P and a DS1337 RTC chip. The DS1337 is an 8 pin IC with VCC at pin 8 and GND at pin 4. According to the datasheet both pin 5 (SDA) and pin 6 (SCL) need an external pull-up. From what I read elsewhere, a pull-up of 4.7K to 10K for each I2C pin should be good enough. Considering the position of both I2C pins to each other and the VCC pin, I was thinking of simplifying things by using a shared 10K pull-up. This post suggests that it should be possible, but I am still not sure. Does anyone have experience with this, that is using a shared pull-up to an I2C connection? What could be some problems, if any, by doing this?
Comment: If you connect SDA and SCL to the same resistor, you're shorting them together. Does not sound like a good idea.
Answer: You need at least one pull-up on the SDA pin and at least one pull-up on the SCL pin. You cannot use the same pull-up for both pins as you will be shorting the two pins together.
The pull-ups are required on the I2C signals, not the pins of a chip. If you have multiple chips on the I2C bus you only need one pull-up on each signal. It really doesn't matter (given that I2C buses are intended to be short) where on the signal the pull-up is in relation to any one chip.
I would personally say that 4.7kΩ to 10kΩ is too high. I don't use more than 3.3kΩ pull-ups for I2C, and more likely 1kΩ if I am using higher speed (e.g., 1MHz) I2C.
Comment: Thanks very much for your answer. I also had a feeling that connecting both pins together via the resistor was not a good idea, but the post I had mentioned made it sound plausible. Also the datasheet didn't give any indication of what kind of resistors to use or how to calculate their value and what info I found was between 4.7K and 10K. I tried with 10K each and it worked. However, there will also be a barometric sensor module (BMP180) attached which has its own internal resistors. Would this then mean I wouldn't need resistors for the DS1337 in the first place?
Comment: @jhorv The resistors only need to exist. It doesn't matter if they are in another module or wired direct to the bus. You can even have multiple resistors, in which case the resistance is just the parallel total of those resistances.
Comment: I made a mistake with the resistors. I forgot to pull the interrupt pin high, thus it was always low and that made it look like the DS1337 was waking the MCU. The DS1337 is not working with 10K resistors but neither with 1K resistors. I keep getting an I2C error 4. I will start a new question after doing some more tests and background research. Thanks again for your help.

DS1337 with shared I2C pull-up


Where should I put the Mobile detection in .htaccess or php?

Question: I have a mobile version of my site working now and I want to know where should I do the redirection. I only can think to do redirection using:

.htaccess
PHP

I would like to know which one is better/more efficient? Is there a better way to do that other than in the .htaccess or PHP?
Thanks
Comment: will it be better in apache configuration?
Answer: I vote for Apache.
If you do it at the Apache level (in the .htaccess file or, even better, in the Apache config), then if you have HTML files, the only way to detect this that I can think of is JavaScript; this can be easily removed (like disabling JavaScript).
This also applies to other types of files, like PDFs, Word documents, MP3 files, etc. It can easily redirect to a page that contains a "not available for mobile" message.
The other thing I can think of is a css file if they are different (standard version vs mobile version).
Comment: Regarding the CSS point: you can use multiple CSS stylesheets with different `media` attribute tags. For example, you could have a `` and a ``. For more, see [this link](http://www.w3.org/TR/CSS2/media.html#media-sheets).
Answer: Definitely PHP. You should allow clients to switch from mobile version to full version and back, so there will be some cookies involved.
It is good practice to run full version on www.example.com and mobile version on different subdomain, m.example.com
Answer: By doing it in PHP, you can make some automatic adjustments to refine the same content for mobile viewers, without necessarily having to have completely different copies of your content. This article on mobile-friendly PHP design gives some details. You probably do not want to follow all the tips it gives, since it's from the days when mobile data speeds meant minimal images were best, BUT it can give you ideas on methods you can use to make adjustments.
Basically, it amounts to creating a function to adjust the HTML output in whatever ways make the most sense for your site. Then you put that function into a single file that is included on every page via .htaccesss (so I guess you're kind of doing both PHP and .htaccess). And part of that inclusion is to use ob_start(); to run the function on the page's output on load.


Android Adding a smooth screen rotation effect

Question: I would like to simulate the iOS screen rotation on my app.
My idea of doing this is using a sreen transition which scales and rotates the screen to fit the new orientation, but I don't know where to use overridePendingTransition in order for the transition to affect the new created activity with the new orientation.
Any ideas where to use overridePendingTransition?
Answer: You have to fake it by taking a screenshot and animating that. The entire Activity is destroyed and recreated and it abruptly blanks out and reappears when you rotate the screen. Otherwise you have to handle the configuration change manually and handle the entire layout change yourself.
iOS smoothly resizes all the UI elements to fit the new dimensions when you rotate it.


Can I update multiple text layers simultaneously in Photoshop CS6?

Question: First of all, I'm using Photoshop CS6. I'm also using a Mac, and don't have access to Windows. (if that makes any difference)
What I want to be able to do is have multiple text boxes containing the same text. The tough part is I want to be able to edit the text in one box, and the other(s) automatically change.
To clarify, I'm not looking to change the style, font or shape of the boxes. I want the actual text itself to be cloned across multiple boxes.
The scenario is that I am creating custom CD cases, and I want to be able to change text written on both spines at the same time, whilst only having to edit one entry.
I'm sure I found a guide to doing this a while ago, but a hour of 'Googling' has resulted in nothing useful. The guide I remember had the text change for the 'slave' boxes automatically, rather than having to select the layers and use the 'Find/Replace' option. I'm unsure if there was some kind of layer linking involved.
Any help would be greatly appreciated, as being able to do this would be a massive time saver.
Answer: Right click on the text layer -> Convert to Smart Object.
Duplicate that layer and place the other layers wherever else you want to display the same text.
To change text, double click the thumbnail (that will open a new window/tab where the text is in its own file) and change text, File -> Save when done. If you add more text than originally there you will have to expand the canvas size so the text is not clipped.


Term meaning "to listen to somebody secretly"?

Question: I know spying on somebody means to watch somebody secretly, but is there a term that means to listen to somebody secretly? For example, you are in a room talking with someone and there is someone else outside the door listening to your conversation without you knowing.
Comment: [Eavesdrop](https://www.google.com/search?q=define+eavesdropping).
Comment: sidenote: spying on someone doesn't necessarily mean just watching them. It just means to collect information on someone without them knowing. For example, eavesdropping is a form of spying. Same with reading mail or other forms of communication. Best I can think of for an example to watch someone secretly would be to use the context with "spy". For example, "spying on someone with binoculars" or "he was spying on them through the window" both imply that there is some visual information being collected.
Answer: Consider  eavesdrop ("To hear a conversation one is not intended to hear; to listen in") and  overhear ("To hear something that wasn't meant for one's ears").
A usage note at the first link points out:

To eavesdrop usually implies the listener is purposefully trying to hear the conversation of others. To overhear is more often accidental.
Comment: It helps to realize what _ eavesdrop_ literally means: the _eave_ is the overhang of a roof.  Unless it is raining, why would you stand so close to a building except to listen to the conversation inside.
Answer: In addition to the very fitting answers provided by jwpat7, there is also the phrasal verb listen in.
NOAD says:

listen in (phrasal verb) listen to a private conversation, often secretly

I usually hear it used with the word on:

Maybe I should have minded my own business, but I couldn't help but listen in on Rob and Amanda's conversation.

Also, if the eavesdropper is using electronic equipment to monitor the conversation, an oft-used word is bug, which can be used as a verb (to conceal the device) or a noun (for the device itself):

The spy was not aware that someone had bugged the room.
The spy planted a bug in the room.


deploying Django - Dreamhost

Question: I am neewbie with django and I am stuck trying to deploy my project on the server ( a shared Dreamhost server). I have followed the tutorials I found but it doesnt work. My project structure is:
/usr/mydomain.com
    - public
        * media
        * static
    - project
        * __init__.py
        * manage.py
        * settings.py
        * urls.py
        * views.py
    - tmp
    - django-setup.py
    - manage.py
    - passenger_wsgi.py
    - passenger_wsgi.pyc

It only works on my domain.com/admin, but I have a simple 'hello world' view to try but it isnt showing. I get only an HTTP 404 when I access my domain...
EDIT
I have installed Python 2.7 and Django 1.5 . Now I get a 500 Internal Server Error.
Answer: This is how I do it, with Django 1.5, on DreamHost:

A virtualenv dedicated to my project is in ~/virtualenv/myproject
My Django project is in ~/projects/myproject, with setup:

The database file is in the project root, named sqlite3.db
STATIC_ROOT is set to os.path.join(os.path.abspath(os.path.dirname(__file__)), '..', 'static'), that is, the static directory in the project root.
When the static files are updated in the project, I have to run python manage.py collectstatic
I have per-environment settings in ~/projects/myproject/myproject, named prod_settings.py, beta_settings.py, and so on.

My site is in ~/sites/www.myproject.com, the layout inside:

myproject -- symlink to the Django project
sqlite3.db -- symlink to the database file in the Django project
public/static -- symlink to the STATIC_ROOT defined in the Django project
tmp/restart.txt -- touch this file to have Passenger reload the site settings
passenger_wsgi.py -- the Passenger configuration

Create passenger_wsgi.py like this:
projectname = 'myproject'
virtualenv_root = '/home/jack/virtualenv/' + projectname

import sys
import os

INTERP = os.path.join(virtualenv_root, 'bin', 'python')
if sys.executable != INTERP:
    os.execl(INTERP, INTERP, *sys.argv)

sys.path.append(os.path.join(os.getcwd(), projectname))
os.environ['DJANGO_SETTINGS_MODULE'] = projectname + '.prod_settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

Create prod_settings.py like this:
from myproject.settings import *

DEBUG = False
TEMPLATE_DEBUG = DEBUG

ADMINS = (('My Project', 'firstname.lastname@example.com'), )
MANAGERS = ADMINS
DATABASES = {}  # Appropriately for your production environment
SECRET_KEY = "..."  # Your secret key
ALLOWED_HOSTS = ["myproject.com", "www.myproject.com"]

For Django 1.4 or earlier, you need to make some minor modifications, but the same idea works. I've been using variations of this setup since Django 1.2.
I setup virtualenv like this:
# install pip and virtualenv in my home directory
easy_install --user pip
pip install --user virtualenv

# create a virtualenv dedicated to my django project
mkdir ~/virtualenv
virtualenv --distribute ~/virtualenv/myproject

# activate the virtualenv, install django and all project dependencies
. ~/virtualenv/myproject/bin/activate
cd ~/projects/myproject
pip install -r requirements.txt

Notice that after activating the virtualenv, you don't need the --user flag anymore when you install packages with pip. When a virtualenv is active, all packages are installed in that virtualenv.
About requirements.txt:

Create it in your development like this: pip freeze > requirements.txt
Edit it, leave only the packages that your project really really needs. It's better to remove too much and add back later as needed.

Note that virtualenv is not necessary, but recommended. You can do without by setting INTERP in your passenger_wsgi.py to /usr/bin/python. virtualenv is useful to have multiple Django sites with different dependencies on the same account. It is also useful when you want to upgrade Django for your site, so that you can test the upgrade on beta.myproject.com without disrupting traffic on your main site.
Finally, if you are using shared hosting, DreamHost support encourages using different user accounts for each website, but I don't know what difference that makes. Be careful with heavy operations, for example large data imports, because if the process uses much memory, it can get killed by DreamHost. The memory ceiling is unspecified, but it's quite low. So if your site needs to do some heavy operations, you need to make such operations fault tolerant, in order to resume after killed.
Comment: Thank you for your answer ! I 'll try with those steps ! Now what I'm getting is a 500 error.
I have installed Python 2.7 and Django 1.5 in my server
Comment: still cant make it work... could you please tell me how did you setup virtualenv ? thank you!
Comment: @lorenag83 I added the setup steps for virtualenv.

deploying Django - Dreamhost


Tips on making a YouTube channel

Question: I had the idea of starting a YouTube channel (called 'Hardcore Durability Test') focused on creating entertaining durability tests on all sorts of items. The show would be presented by two children (one 13 and the other 11) who are actually much more sensible than their ages suggest. Does anyone have any general tips on making this? Thanks!
Comment: You need to be way more specific. What sort of advice are you after?
Comment: Mainly about how to gain popularity and optimise video content to achieve this.
Answer: This is an extremely broad question, but I'll do my best to provide a quick surface overview.  Producing good quality video is HARD.  To put it in perspective, I'm working on an indie level web series right now and I'd guess it takes probably around 10 man hours of work per minute of video.  Making a successful video involves lots of planning and high quality execution, all of which takes time and a variety of different skills.
You start out with writing.  The concept of the show needs to be flushed out.  Improv is an option, but the basic premise still needs to be there and the topics, items to test, etc all need to be determined in a way that gives the foundation for producing content that holds together and is interesting to viewers.
Then you need to begin producing the video.  This involves gathering and organizing the resources you will need to make the video.  You will need products to test, your cast is already selected, but you'll need crew (possibly yourself for now) and equipment that can be used for actual production.
Once everything you need for production is gathered, you have to actually execute the production.  This involves making sure you have good sets, lighting, sound, video, etc.  You need to make sure that the video both looks and sounds good and that there is good content in the raw footage you shoot.
Next, you move in to post production once all the footage is shot.  This is when you work on editing the footage in to the final consumable form.  You have to work out pacing of the content and add any post production elements like titles and graphics and any additional sounds in order to make sure that the final product is interesting to watch.
Finally, you move in to release and marketing.  In this case, you've already decided that you want to release on Youtube, but just putting a video up on Youtube isn't going to get people to watch it quickly.  You need to let people know about the video and raise awareness about it.  This can be as simple as making social media posts about the videos to your various networks or as complicated as actual paid advertising to reach out beyond your direct network.  You might also consider trying to get news coverage of the show for some free marketing if you can get any news sources to pick up the story.
As an added bonus, there is also the luck factor.  Even if you do everything completely wrong, there is a large luck factor in any release, especially on places like Youtube.  Certainly well maintained and high production value channels tend to have the most staying power, but just about any video has the possibility of going viral regardless of almost any other factors if the stars align just right.  Even if you do everything right, there is still no guarantee of success.  It's notoriously hard to tell what people will or won't find interesting and even major large budget projects fall victim to this.  It comes down to how things strike people's fancy and people are fickle.
Answer: YouTube is the answer to YouTube. There are plenty of Videos on how-to everything.
You can see other people's Format (and comments) so you don't copy the bad ideas or compete with a far better Channel.
From learning what is current and what other people have done, to finding out which Camera is recommended (and what Settings / Bitrate / Format). It's all there.
10's of thousands of hours of lessons.

Tips on making a YouTube channel


push an apk file into assets folder programmatically in android

Question: Can i push an apk file into my assests folder programmatically?I wanted to use this apk file
in my application.
Please forward your valuable suggestions to me.
Thanks in advance...
Priya
Comment: http://stackoverflow.com/questions/12674535/programatically-save-apk-file-from-asset-folder-to-system-app-in-android
Answer: AFAIK, you can't store it in the assets directory. However you can store is some where on the sdcard or cache directory. Check this for different data storage methods available.


If you apply the Distributive Property to a Rational and an Irrational number, which will your solution be?

Question: Say that "A" and "B" are Rational, and C is irrational, would the solution to "A(B+C)" be Rational or Irrational? An example for clarification would be wonderful.
Comment: As long as $A$ is not zero, then $A(B+C)$ is irrational.
Answer: Remember how to add, subtract, multiply, and divide fractions:
$$
\frac p q \pm \frac r s = \frac{ps \pm qr}{qs}, \qquad
\frac p q \cdot \frac r s = \frac{pr}{qs}, \qquad \frac{p/q}{r/s} = \frac{ps}{qr}.
$$
You have $B+C$ and $B$ is rational and $C$ is irrational.  Say $B = \dfrac p q$ and $p,q$ are integers.  If $B+C$ is rational, then $B+C = \dfrac r s$ for some integers $r,s$, and then
$$
\frac pq  + C = \frac r s, \text{ and therefore } C = \frac r s - \frac p q =\cdots \quad\text{(So $C$ would be rational.)}
$$
Hence $B+C$ must be irrational.
Next we ask whether $A(B+C)$ might be rational. Since $A$ is rational, there are integers $k,\ell$ such that $A=k/\ell$.  If $A(B+C)$ is rational then there are integers $m,n$ such that
$$
\frac k \ell (B+C) = A(B+C) = \frac m n, \text{ and so } B+C = \frac{m/n}{k/\ell} = \frac{m\ell}{kn}, \text{ so } B+C \text{ would be rational}.
$$
Answer: HINT:
Sum of a rational and an irrational number is always irrational
$$\text{AND}$$ Product of a rational and an irrational number is a non-zero rational.
Comment: The product of a rational and an irrational is not always irrational. $0\cdot \sqrt{2}$ is not irrational.
Comment: Non-zero rational for the second part. :)
Comment: @ThomasAndrews Sorry but I couldn't get you :)


Porting nginx as a mountain lion bundled app

Question: I was wondering how difficult it would be to create an app bundle from the sources of nginx. Since mountain lion, the apache webshare option has been removed and i can imagine that some people would like a gui frontend that will start/stop nginx, and perhaps even with configuration directives like radio buttons etc.
Now this could be a panel or a stand alone app. I have been searching on a "best practice" manner to do this kind of thing but came up with all kinds of hacks.
I feel it would be cool to build the whole thing inside xcode with all libs bundled. So question, how to take on a pet project like this? Any suggestions?
;-)
Answer: Did you tried MNPP?
Here is source code for it https://github.com/jyr/MNPP


Create document library same as existing document library

Question: I want to create a document library same as existing document library. There is some setting 'save as template' but it's also copy all items or folder. I want only create document library with same structure
Answer: You are right there...Just uncheck/deselect Include Contents Checkbox while doing save as template.

 It seems that you have checked that option.
Comment: It will create same structure means same column & content type if we uncheck include contents


How to disable progress feature in windows 7 or 8?

Question: When you download something say a file in Mozilla Firefox browser a green bar starts occupying the browser's icon on task-bar that shows the overall progress of download(s) going on .But, I want to disable this feature. How can I disable the feature ? Also give a way to enable it too.
Answer: Don't allow me be the bearer of bad news.
It seems the progress bar overlay is implemented by Firefox, so I doubt if you can disable on Windows. There seems to be no way to disable it on Firefox currently.
However, according to an answer given to this same issue, a possible solution may be to edit certain files in the Firefox Download API that makes it think the download is complete.

You may want to read this article: https://support.mozilla.org/en-US/questions/969790#answer-477588


What properties of grass would a plant need to fill the niche of grasses?

Question: What features of grasses would need to exist in a plant for the plant to fill the same niche as grasses in a grassland?
Comment: @AlexP This question is asking what a plant needs to form a 'grassland', not what would happen without grasses
Comment: The OP is asking, in a scenario where grass itself does not exist, what must the properties of the replacement plant be, to fulfill the same ecological roles. For example, in the right climate, Kudzu is a very good "grass replacement" plant.
Comment: Grasses are a latecomer in the vegetable kingdom. The first grasses appeared towards the end of the [Cretaceous](https://en.wikipedia.org/wiki/Cretaceous), and grasslands did not become widespread until the Late [Miocene](https://en.wikipedia.org/wiki/Late_Miocene) epoch, well into the [Neogene](https://en.wikipedia.org/wiki/Neogene) era. Before that, there were only forests and shrublands. As so, the answer is trivially simple: if there were no grasses, grasslands would revert to being forests or shrublands, as they had been for hundreds of millions of years before the rise of grasses.
Comment: Last time I checked grass was a plant. I don't understand your question.
Comment: Lack of branches maybe... I guess hee hee
Comment: A **grass**land is formed by grasses: nothing but grasses can form a grassland. Areas dominated by plants other than grasses have different names -- forest, shrubland, heathland, moorland and so on. Or else, the question must explain what is to be understood by grassland, if not an area of land dominated by grasses. And, on one hand, heaths look pretty grassland-ish to me; on the other hand, the Poaceae are not the only family in the order Poales; rushes (Juncaceae) and sedges (Cyperaceae) come to mind.
Comment: may be helpful. http://www.plantphysiol.org/content/125/3/1198 and https://www.annualreviews.org/doi/abs/10.1146/annurev-earth-040809-152402?journalCode=earth
Answer:
Rapid growth and spreading.

Willing to grow in marginal and poor soils.

Ability to survive grazing, including really severe grazing.

Ability to survive being stepped on by absolutely everything in sight.

Strong root system for stabilizing soil.

Ability to either survive fire, or rapidly reseed and regrow after a fire.

If in a region that experiences frost and snow, it should be able to at least regrow rapidly after a frost, better survive and thrive even after being frozen solid.

Capable of letting the upper surface "die", to provide reduced water needs and shade/thermal protection in event of drought/water shortage.

Ideally, should be significantly nutritious to eat, as this invites grazers to trim old growth and fertilize and spread seeds.

Should not grow tall enough for a 'grass' fire to become a 'forest' fire.
Comment: My understanding is that grasses came to dominate because ungulates evolved a new enzyme allowing them to eat woody stems, and grasses grow back from the base, not the bud. Animals ate the brush, and the brush couldn't recover. Grasses could.
Comment: @DWKraus Yep. That's the third point in here. Ability to survive being eaten (because he important bits are down where they are safe). With a root system that does most of the growing effort, does not die of grazing or trampling, and usually survives frost and fire, you have a plant that completely dominates its niche. Hence, the formation of grasslands.


Editing Boot Menu options Mac (Bootcamp)

Question: I had a problem where I was wanting to make my windows partition bigger using Winclone. I also used a file-based backup in Windows. I made the wrong, move and after restoring the Winclone image, I then restored the file based backup on the wrong partition. Luckily I had a backup of my Mac from a few hours before, so it was nearly a train smash. I've restored my Winclone image to a new (bigger) partition.Just wondering how to get rid of the 'recovery-10.xx.x' drive from the boot menu after pressing option key? Bootcamp and MacOS still show up fine by the way.
Answer: If I recall correctly (no guarantee of that ;-) the Recovery partition usually shows up in the "Option boot menu."
If I am inexplicably wrong likely the only way to get rid of it would be to boot from an OS install thumb drive that you created previously (you did create one previously, didn't you?) and reinstall from scratch. during the OS install open Disk Utility, delete both partitions and then create one new one to install Mac OS onto and install. The install process will re-create the emergency boot partition behind the scenes. Once that is done you can restore your files and apps from your back up that you cleverly thought to make before wiping your hard drive.
There I think I have covered most of the bases here... I hope.
Comment: It's normal for the recovery partition to appear *unless* the macOS startup volume is being managed by Core Storage. Actually, I'd argue that it really should appear even then, but for technical reasons it can't. Anyway, it's normal and does not indicate any problem at all.
Comment: Awesome, thanks for the help! Yeah it didn't show up with my initial bootcamp partition.


How can I get my toddler to drink more water?

Question: My toddler doesn't like to drink water.
She doesn't seem to notice that she is thirsty, even if her pee is a dark yellow.
How do I help her to recognize that her body is thirsty and that drinking enough water is wonderful?
Comment: Have you tried a variety of different cups?  Like, different colours and straws and etc?
Comment: Indeed, she likes to have her own water bottle and prefers drinking from a bottle to drinking from a cup.
Answer: I hate to drink water too. I am not a toddler, but I know how she feels. I hate the way it sits in my stomach. Here are my suggestions (including a few from my mother that worked on toddler-me):

adjust the temp. She may not like cold water because it hurts her teeth, or some other reason. Try room temp instead. I actually can stand to drink an 8 oz glass of water that has been left out overnight (my husband refers to this as "stale water" but I think it tastes more pure after a day of resting) Or, perhaps it's not cold enough. Very cold water will hide any mineral or other 'flavors' the water may have.
try ice chips if she doesn't mind the cold. My kids love "ice-slushies."
don't force a whole glass or even a half. A sip here and there, repeated enough times, should suffice to keep her hydrated.
forget water altogether. There are plenty of other sources of hydration. Fruits and veggies with a high water content, soups, decaffeinated teas, and milk are all good, healthy sources of fluid.

Starting around this age, they figure out they have control over what actually makes it into their mouth. They won't starve themselves or die of self inflicted thirst though, so just do the best you can. Start perfecting those compromising skills; you're going to need them ;)
In case you are wondering, according to babycenter you only need to get 1.3 liters (or about 4 cups) on average into her per day, and this includes intake from foods.
Comment: One small addition: maybe flavor the water?  Just a small twist of lemon or orange can change the flavor enough to make it more palatable.
Comment: Good answer - one note, 1.3 liters is over 5 cups [1 liter ~= 1 quart = 4 cups].
Comment: The "stale" water might have absorbed more oxygen from the air. Try pouring it between two glasses a few times and see if that works better.
Comment: *and this includes intake from foods* This is a widely misunderstood point. Lots of people see the "2 liters per day for an adult" and assume that they are supposed to drink 2 litres of tap water per day. It doesn't mean that. Dry foods like biscuits apart, most of what you eat is water and counts towards the total water consumed.
Answer: IMHO the human body is quite good at regulating such important things as water and salt balance. Kids will drink if they need to. For the same reason I am not worried when my toddler shakes some salt in his hand and licks that off. It'll even out.
Comment: Children won't necessarily drink if they need to. While it may be an instinctual thing to drink water, they may have a predisposed hesitation to drinking water for any number of reasons. I remember I used to not eat food, despite being absolutely starving, simply because there were people that weren't from my immediate family sitting at the table. It was an irrational fear and I got over it but it just goes to show that issues like this aren't always a physiological issue.
Answer: In general toddlers do drink and eat enough for them to survive as long as something is available, so unless there is some very unrealistic and rare disease, there is no need to worry about that. However survive and optimal are different things.
Kids usually love everything sweet, so instead of pure water, you might want to add something to it that changes the taste enough for her to no longer consider it water.


How to make moving parts not stick together?

Question: I am new to the 3D printing world and I would appreciate if someone can give me advice on how to 3D print moving parts without them sticking together. I recently 3D printed the predator pliers from Thingiverse and it came out very nice except for the fact that the parts where stuck together and I could not move any of the pieces. I had to use an Exacto knife to loosen the parts and in doing so my predator pliers broke and I was very sad.
The printer and the settings that I use are:

PowerSpec WanHao Duplicator I3 PLUS 3D Printer
Ultimaker Cura 3.4.1
Black PLA Plastic 1.75 mm
0.4 mm nozzle
60 °C Bed Temp
200 °C Extruder Temp
20 fill  (usually-sometimes more)
Layer height 0.15
UPDATE:
I printed a PIP from thingiverse and it worked out    perfectly. All the parts move.
Comment: Hi Alias311, welcome to 3D Printing.SE! What you are referring to, is known as Print-In-Place (PIP).
Comment: Hello! Ahhh I did not know this. You know I've tried to print things that move but almost always don't come out that good. For a while, I thought it was because I am using PLA. @0scar
Comment: you might also want to link which model you refer to.
Comment: @Trish hey sorry, this is the link to the model i was making. https://www.thingiverse.com/thing:2917515
Comment: Glad it works! It could well be that the PIP model you printed has larger tolerances. Please vote to accept an answer (using the green tick button next to the question) so this question is not bumped up once in a while and can be removed from the unanswered question list. You may even add your own solution and accept that after 48 hours! Thanks!
Answer: If parts stick together after printing, the positioning or extrusion is not working optimally.
This can be related to various issues:

Positioning of the head is not correct; this could be related to incorrect belt tension, incorrect steps per mm, streched belts.
The extrusion process is not working optimal; this could be related to over-extruding (incorrect steps per mm for the extruder, incorrect multiplier in the slicer, filament too hot) or the first layer height is incorrect (too low, so the lines spread out and tough each other). Extruder calibration is explained in more detail in this answer.

A very good start to verify what exactly your tolerance problem is is to print this tolerance test. Basically, these are diabolic shaped objects in a slightly larger outer shape object. Please slice this STL file with your favorite slicer to obtain the G-code for your printer. When the print is ready, you use a screwdriver to turn the diabolic shaped objects from large to small tolerance, the last one that does not turn is the maximum tolerance of your printer. So when printing in place hinges, you should use tolerance values higher than the one that did not turn.
Comment: How can this be resolved? Will I need to change the extruder? Because I have tried to level the bed as well as I can. I have ordered new nozzles as well as I feared that this one maybe clogged.
Comment: @Alias311 A clogged nozzle will lead to under-extrusion, so that is probably not yout problem. Please add a picture of the print to the question.


Travel within Cape Verde

Question: I plan to visit Cape Verde in December. In particular, I'd like to visit the island of Maio. I'd like to know how to get there from the island of Sal. I fly from the UK to Sal, but I haven't seen if there is a direct flight or ferry to Maio. I have looked on the www.ticv.cv website and also on the www.cvinterilhas.cv but I can't see any flights between Sal and Maio and the ferry timetable only shows the next month's ferries. I need to know because I want to find and book my accommodation.
Answer: You have chosen two of the islands I know best. Sal is more touristy, with more  activities, bars and restaurants. Maio is lovely quiet, peaceful island. Both have lovely beaches, but those on Maio are almost deserted.
There is no direct flight between Sal and Maio, you would have to fly to Praia and then from Praia to Maio.
Very recently, they have introduced a ferry between Sal and Maio, but it doesn't appear to operate every day. As you say, the ferry operators do not publish timetables in advance unfortunately. It's quite a long journey.
At the moment, because of Covid-19, there is some disruption to services, which have been halted completely, but are due to recommence on 15 July 2020. However, there may be a restricted timetable initially. It is only the flight schedules that are published in advance. I would recommend the flight rather than the ferry. There is more information on travel within Cape Verde here
Cape Verde Travel Information
If you want more information about Sal or Maio, or any of the other islands, you can find that on the same site.
I hope this helps, I know you will love CV if you go & especially Maio
Philip
Comment: Thanks so much for a very helpful answer. Makes a big difference in my travel plans while in CV.
Answer: currently no 'direct' connections to Maio from Sal or Boavista. CV Inter-Ilhas have created a new ferry route from Santiago to Sal via Maio, but due to COVID-19 I don't know when the route will commence. TICV only fly from Santiago to Maio. The only way to fly is from Sal to Santiago and then a flight, or ferry, to Maio. Therefore, access to Maio is via Santiago only at present. The best website that I've found for Maio is www.MaioCapeVerde.com
Good luck.

Travel within Cape Verde


How can I determine if the current version of Windows is either 32-bit or 64-bit from the command line?

Question: What's the command line to find out if the OS is running a 32-bit version or 64-bit of Windows?
Comment: In what language?!
Comment: @AlixAxel, well they said *command-line*, so presumably, if anything, Batch.
Answer: You can get this via WMI:
wmic OS get OSArchitecture

Example on my system:
C:\>wmic OS get OSArchitecture
OSArchitecture
32-bit

Comment: I like this answer (gotta go learn me some WMI console :) ), but I gotta give it to "systeminfo" for keystrokes. ;)
Comment: XP?
Answer: Command line:
systeminfo | findstr /I type:

example output:
System type:               X86-based PC
X86 indicates a 32-bit system in this example.
(/I parameter indicates case-insensitive search)
Comment: But is "X86-based PC" the same as OSArchitecture 32-bit? You can run 32-bit Win XP on an x64 processor.
Comment: I gave you a point for keystrokes, and then you made it longer. hehe :)
Comment: It's not my answer :P
Comment: be careful if your OS language is german(or maybe any other than englisch)! I have to change to `systeminfo | findstr /I typ:` as the whole entry is `Systemtyp: x64-based PC`
Comment: `systeminfo | findstr /C:"System Type"` also retrieves the same information, but I guess longer text so less preferred.
Answer: I can not attach answer to another post so here.
Piping the result of systeminfo - is taking a quite good amount in time and writes to the console so is not the best solution for command files (batch scripts - anyhow You like to call them B-) ).
Even with the findstr - it does not find this on other language version of windows.
On a central european language win7 os it also returns ..."X86-based"... on the result but something other on then the "type" were looking for. I am not sure that it can vary on other language variants of the os.
Probably the "wmic" method is the most reliable - it asks the os directly.
Other possible quick solution can be to examine a variable (at least working on win7 at me).
echo %PROCESSOR_ARCHITECTURE%

Ok - it is quite long to remember but possible a set | findstr ARCH can be remembered.
Sure - some can modify a system variable so not that reliable than wmic. But can be used quickly.
I hope I could help someone out.
Comment: I wasn't sure the echo command would work on my XP box because I've never seen this environment variable before (perhaps because I've never looked for it), but it does. +1 for a simple solution.
Comment: +1 because it specifies ARM/AMD architecture as well.
Answer: There are numerous ways to check the processor architecture under Windows:

The fastest, easiest, and most compatible way to check the processor architecture in at least Windows 2000 and up is to examine the PROCESSOR_ARCHITECTURE environment variable:
echo %PROCESSOR_ARCHITECTURE%

However, this can give different results, depending on the way in which the command-prompt is opened. To avoid getting "unexpected results" due to WoW64, you can read it directly from the registry (Microsoft made no less than two typos in the key):
reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PROCESSOR_ARCHITECTURE

Microsoft also suggests reading the hardware information store from the registry:
reg query "HKLM\Hardware\Description\System\CentralProcessor\0" /v Identifier

You can also check for the existence of the x86 version of the Program Files directory (or the environment variable that points to it) since it would only exist on a 64-bit system. Unlike the PROCESSOR_ARCHITECTURE variable, this is not dependant on the way that the command prompt is run since the directory exists (or not) regardless of how the prompt is opened:

::via env-var
if not defined ProgramFiles(x86) echo 32-bit

::via file-system
if not exist "%systemdrive%\Program Files (x86)" echo 32-bit

These methods can be combined in a single batch-file (e.g., cpuinfo.bat) and provides a nice, lightning fast way to check the system from a standard Windows NT command-prompt without needing to resort to running other programs or frameworks.
The batch-file below was tested on 32-bit and Intel 64-bit systems (please test on AMD64), giving correct results in <1 second:

@echo off

echo PROCESSOR_ARCHITECTURE var:
echo %PROCESSOR_ARCHITECTURE% | find /i "x86" > nul
if %errorlevel%==0 (
    echo   32-bit
) else (
    echo   64-bit
)
echo.

echo PROCESSOR_ARCHITECTURE reg:
reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PROCESSOR_ARCHITECTURE | find /i "x86" > nul
if %errorlevel%==0 (
    echo   32-bit
) else (
    echo   64-bit
)
echo.

echo CentralProcessor reg:
reg query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > nul
if %errorlevel%==0 (
    echo   32-bit
) else (
    echo   64-bit
)
echo.

echo ProgramFiles(x86) var:
if not defined ProgramFiles(x86) (
    echo   32-bit
) else (
    echo   64-bit
)
echo.

echo ProgramFiles(x86) dir:
if not exist "%systemdrive%\Program Files (x86)" (
    echo   32-bit
) else (
    echo   64-bit
)
echo.

Answer: I could not find the OSArchitecture property (as per phoebus' answer) so I would suggest using the SystemType property in ComputerSystem instead.
Running the command wmic computersystem get systemtype from a command prompt gives
C:\Windows\system32>wmic computersystem get systemtype

SystemType x64-based PC

Answer: Regular command line: wmic OS get OSArchitecture  (IIRC)
PowerShell: (gwmi win32_computersystem).SystemType
Comment: I get `Invalid Query` in XP.
Answer: if you are referring to windows OS, you can use vbscript with WMI
strComputer = "."
Set objWMIService = GetObject("winmgmts{impersonationLevel=impersonate,authenticationLevel=Pkt}!\\" & strComputer & "\root\cimv2")
Set colSettings = objWMIService.ExecQuery("SELECT * FROM Win32_Processor")

For Each objProcessor In colSettings
Wscript.Echo "System Type: " & objProcessor.Architecture
Wscript.Echo "Processor: " & objProcessor.Description
Wscript.Echo "Address Width: "& objProcessor.AddressWidth
Next

Answer: You can find that Information using "System Information"

Start-> Run -> winmsd.exe

Under "System Summary"/ System Type you can find the OS version

X64 -> 64 Bit
  X86 -> 32 Bit

JohnT's answer in GUI ;)
Answer: Go to Start » Run and then type cmd. Now you will be in command prompt. There you can type  systeminfo and then press enter. It takes a few seconds to get all your system information. You can find the processor data too.
 Processor(s):              1 Processor(s) Installed.
                           [01]: x86 Family 15 Model 4 Stepping 10 GenuineIntel

x86 Family means, your processor is 32-bit.
x64 Family means, your processor is 64-bit.

C:\Documents and Settings\mr85464>systeminfo

OS Name:                   Microsoft Windows XP Professional
OS Version:                5.1.2600 Service Pack 3 Build 2600
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Member Workstation
OS Build Type:             Multiprocessor Free
Product ID:                76487-640-3658033-23932
Original Install Date:     3/16/2012, 2:03:44 PM
System Up Time:            5 Days, 21 Hours, 35 Minutes, 51 Seconds
System Manufacturer:       Dell Inc.
System Model:              OptiPlex 210L
System type:               X86-based PC
Processor(s):              1 Processor(s) Installed.
                           [01]: x86 Family 15 Model 4 Stepping 10 GenuineIntel
~2992 Mhz

Comment: Takes a few seconds indeed! And running it again won't help because it doesn't cache the information. Also, the Windows updates cause the part about the architecture to quickly scroll off-screen, so unless you have a large enough buffer, you need to pipe it into `more`.
Answer: Simple code I used:
:arch
set p | findstr /i AMD64 > nul
if not errorlevel 1 goto no64
goto eof
:no64
code to execute
:eof


Pouring concrete for fence posts in heavy rain

Question: My contractor just poured the concrete and set the posts for a new fence we are getting and much of the work was done in the pouring rain. Will this hurt the concrete and effect how it holds up down the line?
Comment: Good comment. Should've been an answer.
Comment: I have poured in the rain very few times as it has to be covered. a fence post will probably be fine if it was a good mix.  Concrete will cure under water. the top at ground level may look a bit like exposed aggregate if it wasn't covered but it is better than being two hot (causing cracks) or two cold and not setting up .
Comment: @EdBeal If you have an answer, please post it below. Comments do not have the features to properly vet content and, as far as system is concerned, this question remains 'unanswered' . Thanks.
Answer: All concrete sets up under water.  http://www.cement.org/cement-concrete-basics/faqs
The only thing that will be impacted is the finish.  If the top was not covered then the concrete will take on a bumpy appearance as the finer material may wash away and expose the aggregate.
Comment: I don't know if it's fair to say "the only thing that will be impacted is the finish".  The more water added to the mix, the lower the strength.  Whether enough extra water was added to have an important effect in this case is questionable, but definitely there's an impact on the strength.
Comment: @JoelKeene, Adding water to the mix is very different from rainwater sitting on top of the concrete.
Answer: ACI 301prohibits the placement of concrete in rain without "adequate protection".
Comment: This is more of a great comment than a mediocre answer.
Comment: -I agree. Now post your comment above as the answer. Good answer.
Comment: @ojait It's the only objective answer possible at present without more information. ACI 301 is incorporated by reference into typical building codes, e.g. IBC. Fences are occupancy type U under IBC. Hence if there are building codes in force the installation is unlikely to be in compliance. The only other objective answers are wait X years and see if it holds up, or, hire an engineer to take concrete samples, analyze the loads and write a report. Or to go meta, maybe the question is a help me fight my contractor issue.