Is Xubuntu really faster than Ubuntu?

Question: I installed Xubuntu desktop on top of Ubuntu 12.04. The usage of RAM and CPU is in general lower than in Ubuntu. But when it comes to some serious computations, I did not see much of a difference between the two.
For example, I ran a MATLAB program that took 99 seconds to run on Ubuntu and 98 seconds on Xubuntu. Then I ran Geekbench benchmarking and the overall scores Ubuntu and Xubuntu are 2996 and 2997, respectively.
My laptop is a 4 year old Dell 1535. Would things run faster on a clean install of Xubuntu?
Comment: You should try Lubuntu. It is even faster than Xubuntu. It runs on my two-generation-older (Centrino) laptop as fast as Unity does on my Core2Duo desktop.
Comment: it is faster if initially ubuntu with unity made it slower. if you are used to ubuntu-unity (or kubuntu-KDE) on a powerful new computer running perfectly, you will not see the same decisive difference that is really obvious on an older 1GB-RAM machine when trying xubuntu (and even more so, lubuntu). With 2GB of RAM or more i guess the advantage of using lighter desktop environments is gone. more here:http://askubuntu.com/a/181304/47206
Comment: I didn't notice some drastic changes in speed when changing to Xubuntu. One thing I noticed, is that the computer does not overheat like in Ubuntu. I also use Matlab, and in Ubuntu, on hard computations, CPU temperatures were around 90 degrees celsius. On Xubuntu, it barely passes the 65 degrees limit. I was surprised to see this, and it is a pleasure to work on a silent laptop. :)
Comment: Its Linux full stop. So it depends really what it is you mean to say.
Answer: The Kernel is the same, the underlying system is the same, the tools are the same, the desktop is different. It's the same Operating System, it's just using a different Desktop Environment.
Comment: This is perfectly accurate and technically correct, and provides no information that would help in any decision making. Reminds me of that old [Microsoft joke](http://www.techsupportforum.com/forums/f289/microsoft-joke-404432.html).
Answer: This is an issue that I looked into pretty seriously because I had an older laptop that was not running very smoothly at all. It took forever for programs to open and execute various tasks, and got slower and slower during the time I would use it, forcing me to reboot periodically just to refresh the system. I experimented between Xubuntu and Ubuntu, and kept track of times to measure the actual difference.
The technical answer is, yes, Xubuntu is faster than regular Ubuntu.
But, the more accurate answer is, no, probably not in any way that will make a difference to you.
If you just opened up Xubuntu and Ubuntu on two identical computers and had them sit there doing nothing, you would see that Xubuntu's Xfce interface was taking up less RAM than Ubuntu's Gnome or Unity interface.
But, so what? You don't just run computers to have them sit there. And here's where the rubber hits the road.
Xubuntu isn't just Xfce, it's also a whole suite of bundled applications to handle most tasks you want to do. For example, if you wanted to do word processing, Xubuntu comes with Abiword preinstalled. On regular Ubuntu, you're offered LibreOffice Writer by default.
Abiword may take less resources, but you pay for that with less features. And while I probably don't use 90% of the features available in Writer, the difference was noticeable enough that I found I would rather use Writer.
Which brings us to the real issue when determining whether Xfce is faster or not. Even though underneath Writer, Xubuntu's Xfce interface is using less resources than Ubuntu's Gnome or Unity, the question you're coming down to is this: Is Xfce using less resource to a degree that would make a difference in how fast LibreOffice Writer runs?
The answer is, no, not really. LibreOffice uses so much resource on its own that it quickly eats up any savings in using Xcfe. For all intents and purposes, when running something like LibreOffice on Xubuntu, the savings that Xcfe offers you is so negligible as to not matter.
So, if you're content to stay within the suite of applications offered by Xubuntu, then you might see some difference.
If, however, your hope is to run more or less the same programs as you would with Gnome or Unity but are hoping to get an appreciable performance boost, then there is no meaningful difference. By "meaningful difference", I mean a difference in how fast programs open or execute tasks to a degree that a human can tell the difference. I don't know about you, but saving .03 seconds if it takes a minute and a half to open a program doesn't mean anything to me.
In the end, I found that buying more RAM for my laptop - going from 512MB to 1GB - was the real solution I was looking for. The dream is that by getting an optimized desktop manager you can breathe new life into an old machine, and I'm sure some people have a situation where they pulled that off. But my experience was that trying to tweak the interface and applications ultimately had too many feature drawbacks for too little return.
So the question about which is faster, Xubuntu or Ubuntu, comes down to this: what applications do you want to use? If you are willing to go with the whole Xubuntu suite and all the bundled applications that are meant to be more minimal in resource use, then you might notice a performance improvement. But as soon as you start using bigger applications, the interface savings will become moot.
Answer: If you are doing the same 1 billion multiply operations, without accessing windows or any other operating system function, and nothing else is going on in the background, it shouldn't really matter what operating system or desktop environment you are using Ubuntu, Red Hat, Windows. The hardware is the constraint. If whatever operating system is bringing the program into memory and then letting the processor or processors do their best your hardware will mostly determine the speed (assuming all of the operating systems handle the multiple processors, hyperthreading, and so on).
When compiled with a better compiler, or compiled with more optimization, you may not be performing quite the same number of operations, however. Ubuntu, Xubuntu, Red Hat, probably are using about the same compiler. It may make a difference how MATLAB is compiled between Ubuntu/Debian and Windows, however.
When you get into doing reads and writes to disk, you shouldn't necessarily expect a benchmark to work the same on Windows, BSD, or Linux, but should probably expect the Linux numbers to be about the same, including Ubuntu and Xubuntu (but the kernels will be configured differently and that may make a difference).
If you are putting someone at the desktop and have taught them how to perform some task, Ubuntu and Xubuntu will use different resources when they perform them later, Xubuntu probably fewer resources. The individual may take more or less time to perform the task with either Ubuntu or Xubuntu. In this case it makes all the difference what you decide to measure.
Answer: In my experience: Xubuntu is a lot faster. In my netbook: Samsung NC110 A02 couldn't stand unity (everything was slow, much clipping etc.). On the other hand: my Asus F3ka have been better with Ubuntu (12.04) but also, slow as hell. It took hours to do simple things, also I don't like how they have hidden most of settings (since 11.10 it isn't a customizable O/S). I tried Xubuntu. And since then I have it in all of my computers. Fast, stable, customizable and light OS. It eats only about 190 MB of RAM. I repaired a lot of old computers with it. I could not even image what Ubuntu 12.04 will looke like if on them.
Comment: It is faster if you alternate between application a lot. But if all you are doing is running Matlab scripts or other batch tasks then you won't notice a difference. That's why @ahamkah reported equal times for running matlab.
Comment: Going forward: it wouldn't make any difference if pc with ubuntu and xubuntu are both powered off.
Comment: When you run a batch process and no other process is running, only the kernel and a few other things matter. CPU time and memory is dedicated to that process and so the desktop is largely irrelevant.
Comment: If you don't run it then yes.
Answer: Yes, the desktop environment of Xubuntu is faster than the Unity shell on top of GNOME that Ubuntu uses.
Comment: @StephenMyall This does provide details. It says the DE (and not associated apps, for instance, which also differ) is faster. This isn't the best possible answer and it certainly could be improved. But it does provide enough information that someone can search the web to find specific information about how the different desktop environments perform. Furthermore, [as an answer, it can be improved; as a comment, it couldn't be](http://meta.askubuntu.com/q/2281/22949). In my opinion, only when something *does answer* the question is *fundamentally* an opinion should it be converted to a comment.
Comment: The Unity shell is interwoven with Gnome applications. But it is on top of GTK, not Gnome.
Answer: I came here looking for a technical answer. I didn't find that.
I'm looking into this for an Ubuntu server install on a pretty low resources box.
So here is a better technical answer with resources comparison:
http://mylinuxexplore.blogspot.com/2012/10/ubuntu-1210-vs-kubuntu-1210-vs-xubuntu.html
Hope this helps someone.
Answer: Probably yes. Regular Ubuntu brings Unity and a lot of more programs that are kept executing in memory, while Xubuntu brings less of those.
If you want a really fast and less memory consuming, you can try download Ubuntu server and install only what you need, or even use a WM likde Openbox instead of a DE.
Answer: Matlab would be slow on any system, that's what it is. Matlab is written in C++ and you are not compiling it from source for your system to build binaries. It's all compiled code and it is one of the slowest scientific computation environments.
It doesn't really matter whether you run it on an RHEL, Ubuntu or Xfce version of Ubuntu. Don't look for these kind of benchmarks. Look for things like sensor outputs throughout the day for normal and extreme usage in your system. SMART data is available for sensors. Just see how the resources are being used through out the day.
Don't do benchmarks with Matlab. At least write a real scientific code in C++ and Fortran and run it in both environments and see if there is any difference (would be pointless still, if you are gonna do something stupid do it right).
If you are the looks person use Ubuntu. If you are the stability person go for Xubuntu. It hardly crashes unless you do something stupid.
Comment: Matlab is Java actually.

Is Xubuntu really faster than Ubuntu?


Single word for making a situation doubly worse

Question: I'm thinking of a situation, wherein instead of helping someone's cause the helper rather doubly complicates the problem by giving an uneasy solution to it. For example, I'm assuming a person who doesn't know the meaning of the word sorry, he's tried to be helped with the synonym apologetic, of which he has no clue either, now his problem is twofold and his cause hasn't been helped but rather complicated.
Answer: Try compound. According to NOAD, it means:

make (something bad) worse; intensify the negative aspects of : I compounded the problem by trying to make wrong things right.

That fits your context:

What does the word sorry mean?
  It means "apologetic".
  Egads! I don't know what apologetic means; you've only compounded my problem.
Comment: I like that term. It never crossed my mind that what I was looking for could be as simple as that.
Answer: To exacerbate:

Make (a problem, bad situation, or negative feeling) worse.

The police intervention to calm the crowd unluckily exacerbated the situation and new episodes of violence took place.
Comment: @Andy Semyonov *Obfuscate* might be the term you were looking for, but this is the answer to the question as worded.
Answer:
ag·gra·vate
verb

make (a problem, injury, or offense) worse or more serious. "military action would only aggravate the situation"
informal annoy or exasperate (someone), especially persistently. "the gesture aggravated me even more"

From OED http://www.oxforddictionaries.com/us/definition/american_english/aggravate
He was not a native English speaker, so when he found apologetic as the definition for sorry in the dictionary this only aggravated his situation, which in turn aggravated him.
Comment: Obfuscate was the term I was looking for. Thanks for your answer by the way.


Is it ungrammatical to substitute 'incorrect' with 'wrong' in the following sentence?

Question: I dislike people that use 'literally' wrong.
Comment: I forgot about our quality standards, so I answered. But usually you are expected to show some effort on your part. For example, do **you** think it is wrong or right and why? This is for future reference.
Comment: It is obvious that you need an adverb
Comment: Depends on what dialect the person speaks. *Incorrect* can be a 'flat adverb' (which means an adverb that doesn't end in *-ly*) in some dialects  or just to some speakers. Standard English probably wants it to be *incorrectly*.
Answer: You are using "wrong" and "incorrect" as modifiers for "use" and so they need to be adverbs.

I dislike people that use something wrongly.
  I dislike people that use something incorrectly.

would be standard ways of using the adverbs.
Comment: You are correct. However, "wrong" is often used in speech instead of "wrongly" (which seems a little stilted to my ears), but "incorrect" is (practically?) never used instead of "incorrectly". Hence "incorrect" is wrong-er [sorry!] than "wrong".
Comment: If you use "wrong", though correct, it may introduce an ambiguity. For example, "use a spoon wrong" is unambiguous, but in "use something wrong" is the something inappropriate, or is the use incorrect?  I was erring on the side of generality to avoid individual cases.
Answer:
I dislike people that use 'literally' wrong.

This is ok! The word wrong acts an an adverb, so the sentence is grammatical.

I dislike people that use 'literally' incorrect.

This is not ok! It is grammatically incorrect because incorrect behaves as an adjective. We need an adverb here. It should be written as

I dislike people that use 'literally' incorrectly.


Angular 2 iframe on website

Question: Is it possible to launch angular2 cli 4.0 into an iframe on a website, in order to have a preview of angular2 components? I would be grateful for an answer to this question.
Answer: You could run an angular app and load it into iframe. In your app, you should create a route where only one component will be visible. Then you can load it into iframe in the other website.
Example: your component would be available at http://localhost:4200/components/card
and then on your website, you can load it like this:

Comment: Is it possible to Load an angular app in a div?
Answer: Lets say you angular app is hosted at http://localhost:4200 which is the default url when you run the app with ng serve
Just add  in you web app and angular app will be loaded inside you website.

Angular 2 iframe on website


Surface Mount package standards guide?

Question: Is there a universal guide-line for the mechanical dimensions and tolerances of Surface Mount packages across the industry?  I'm very new to SMT machine programming (<1 year), so I've been trying to look for a copy of JEDEC's JEP95 that wouldn't cost me over $1,000 but to no avail.  I have seen a few things related to IPC around the web, but I don't know what is most reliable and up-to-date, and would like guidance from someone more experienced than I.
Answer: There are many resources available on-line.
I use a service called "PCB Libraries" link.  The link takes you their free version of Expert, which allows you to create symbols and padstacks.
The download page also gives you the option to download the IPC standards for free.  This is only one of the many resources available for free from the download page.
Putting the string "PCB Libraries" into Google brings up many similar resources.
Answer: Usually, PCB designers will maintain a library of components which include their PCB layouts. This is done by analyzing the component datasheets.
For more generic usage see: IPC-7351B: Generic Requirements for Surface Mount Design and Land Pattern Standard
You can view the Table of Contents here: http://www.ipc.org/TOC/IPC-7351B.pdf

Surface Mount package standards guide?


Update and add-on problem

Question: I have Blender 2.73 and want to update to 2.75 but when I do it does not unzip correctly or completely, and it does not show up in my control panel where the installed programs show up. Also I want to install the Blend4web add-on but the install from file does not work. I really don't know about scripting and all that so I would need a detailed walkthrough if I was going to install it that way. Can anyone help me with these issues?
Comment: This video explains installing the Blend4Web add-on
https://www.youtube.com/watch?v=kH7rirEYVYI
Answer: When you do the update the installer file it should be an .msi file. if the one you have is zipped, unzip the file in a temporary file location, and the double click the [filename].msi file.  You should ensure that you install it in the same directory as previous installations, if you did not use the default for your previous or first install.
The addon, after it is unzipped should be a *.py file; you can find help on this installation at this location: Installing an addon
Comment: Thank you so much for your response. I will try the .msi file. Will post if that works for me.
Comment: The install for the 2.75 worked using the .msi, thank you However, the install for the addon did not, no matter what I tried. This is a new install of Blend4web and not an update like you thought. The only option it gives me for a download is a zip file. I did unzip to it's own folder but I did not see an .msi install file but I did find a bunch of .py files in one of the many folder for this addon. Do I have to find each and every .py file in this addon and use the "import from file" option in the user preferences section to make this work? That seems to be the long way to go.
Comment: I would look up how to install add-ons in blender stack exchange; then if you still have a question, ask that one specifically. Hope that helps.  I'd have to look it up again; but, I think it can be as simple as extracting the .zip file contents to the right Blender folder (addons).  At least the last time I did it I didn't think there was much to it.

Update and add-on problem


How do I export stl without the origin point being connected as vertex to the mesh?

Question: I have a problem in the stl's exported from my Blender file: the origin point is connected as vertex to the mesh. How do I export without this connection?
Answer: Try going to the "Object" tab, and select the "Origin to geometry". This will put the origin in the center of the object, which should make the object easier to export.
Comment: The result of this action is similar: there is a vertex now in the center of the object that is connected.
Comment: The origin will always be connected to the object, but you can move it by setting the cursor location, and selecting "Origin to 3D cursor" The origin is the main pivot point for rotating the object.
Comment: Thank you very much. With this input I've succeeded in exporting an stl with 'invisible' origin: I have put the origin on an edge of the mesh by use of the 3D cursor and I have put the pivot point on 3D curosr.


Travelling to Kiruna, Sweden from Dubai, clothing during extreme cold climate

Question: We stay in Dubai. Four of us are planning to travel to north Sweden this February end to see the northern lights. We would be facing a temperature of -25 to -30 degree Celsius. We are worried on where to buy the winter clothes. We have bought jackets and ski pants from the Columbia store, but not sure that would be enough. A few of my friends warned us not to buy the winter clothes from Dubai as it wouldn't be enough to stand the extreme weather. They say it's best to buy it from Stockholm. We are confused now. Could you please comment?
Is it fine to drive around in the snow if we have a GPS? Any other heads up?
Comment: Those sorts of temperatures simply do not exist in Dubai or anywhere in UAE, so it would be quite unexpected to find suitable clothing for sale as there would be very few buyers. I would expect to find clothing good to -10 so that people can go to the indoor ski place, but nothing for an arctic journey! I could be wrong though.
Comment: GPS isn't the big concern for driving in the snow. You need the right tyres, you need to change your driving style dramatically, and you need to carry with you clothing/drinks etc so that you can survive if you get stuck.
Comment: I'd suggest asking the question about driving and GPS as a separate question so we can keep this one focused on clothing and that one focused on driving
Comment: If you bought Columbia brand jackets, they are going to be the same (and good quality) wherever you bought them.  Columbia don't make special crappy jackets to sell in Dubai. Also if you tell them the temperatures you are expecting the Columbia store staff should be able to recommend clothing.
Answer: You should buy your clothes in Kiruna.  There are plenty of excellent outdoor stores in the city centre.  Although it is regularly -25°C to -30°C in the valleys outside the city (where tours such as sled dogging tours take place), it's not cold in the city centre, where temperatures rarely drop down below -20°C (you might be surprised that a dry, calm, and sunny -15°C doesn't feel extremely cold).  Although your jackets and skipants are likely insufficient for long outdoor outings, they should be sufficient to walk from your hotel to the outdoor stores.  Don't forget properly insulated boots.  As a bonus, in case it's a warm week and only -5°C or so (it happens), you might find your existing clothes are sufficient.
When I left Kiruna in 2014, in the city centre, there were Intersport, Vildmarkshornan, Höjdmeter, and one whose name I forgot, with additionally Team Sportia/Jaktia in the industrial area (some 3–4 km from the city centre).  The latter have apparently disappeared but each of the former three should have thick down jackets.  Intersport is a regular sport+outdoor store, Vildmarkshörnan (meaning "wilderness corner") has a focus on wilderness experiences including hunting and fishing, and Höjdmeter specialises in skiing.  Each should be happy to make you a set of winter clothes richer (and quite a lot of Swedish crowns lighter).
Enjoy Kiruna.  It was my home for nearly 6 years.  Don't forget to take a day trip (at least) to Abisko and Narvik by train, as the train ride is very scenic and the transition to the Atlantic coast is absolutely amazing.  Abisko has much clearer skies than Kiruna.  There may be some trails near the town that are good for aurora watching; the "Aurora Balcony" near Camp Ripan was one of those in 2014, but with the city centre moving east and a new road being built nearby, I don't know if this is still the case in 2024.  Going 20 km out of town is even better as you get out of pollution from the mine, but that requires a car and the courage to drive it on icy roads.  Jukkasjärvi (where the Ice Hotel is located) is good as well, although you see a somewhat smaller proportion of the sky as you're in the valley.

Edit:  On the driving:  if you rent a car locally, it will most likely be a reliable, modern car with studded tyres.  In the depth of winter, streets are covered in hard packed snow, but typically not icy like in autumn or spring.  Although you do need to be careful in curves, I personally find the driving on packed snow not too bad.  October or April can be much worse, as can driving in coastal Norway where freeze-melt-cycles are much more likely.  You don't want to rent or borrow a crappy old car; I had an old borrowed car break down once on a rarely trafficked road 40 km from civilisation, it was -35°C outside, and we were not happy.  Also, be careful of driving long distances in the dark, and drive on the assumption that reindeer (bad) or moose (very bad) might suddenly decide to walk in front of your car at any time.  The 90 km/h speed limit exists for a reason, do not be tempted to drive 140 km/h on wide and empty roads.  People do and sometimes it ends quite badly.  This applies in any season, day and night.
Comment: I love "it is not cold ... temperatures rarely drop below -20 °C" :-)
Comment: @Willeke True.  -20°C would be considered cold by many.  On the other hand, many first-time visitors to Kiruna are surprised when it's a dry, calm and sunny -15°C that it doesn't feel as cold as they feared, and consider a humid and windy -2°C on a cold western European winter morning to be worse.
Comment: @HenningMakholm: In Sweden, they often say "there's no cold weather -- there's inadequate clothing".
Comment: @gerrit the OP is used to Dubai temperatures, where it is cold when it is +10. You need to consider the difference more than the actual temperature.
Comment: @HenningMakholm The Kiruna tourist office says the same ☺
Comment: The trouble with not buying Winter clothes until you're in Kiruna is, what do you wear on arrival, and on that first day when you're walking around between clothes shops? Kiruna's town centre is fairly compact, but I don't remember any covered shopping centres, and I seem to remember fairly restrictive shop opening hours (I remember lots of shops being closed on the weekend)? Much of the accommodation is a 15-20 minute walk from the town centre, too...
Comment: Thinking back, there was something we were missing on our first day... I don't remember what, but it was pretty important for keeping warm. I have a memory of being very cold and grumpy at something like 4pm on a Saturday in that pedestrianised square near H&M, surrounded by clothes shops that were closed, wishing I'd spent more time buying everything before we came. I think the shops were closed all day on the Sunday?
Answer: I went to Kiruna and around the Swedish arctic in Winter a few years ago on route to the Icehotel. Here's what I wore, it was enough that I felt perfectly comfortable walking around including at night:

Important: avoid cotton being in contact with your skin! There's a cliche among outdoors types that "cotton kills" in cold weather. Even in arctic weather, you'll sweat small amounts when exerting yourself or when temporarily in a warm place, and cotton will turn this small amount of moisture into an icy layer that prevents its normal insulation from working. Insulating fabrics, however, "wick" moisture away from your skin, keeping your skin dryer and warmer.
Wear proper thermal underclothes. If you do just one thing, do this. Long sleeved thermal top, tucked into tight thermal long johns (undertrousers) or thermal tights, tucked into thermal socks. They're cheap, comfortable, and make a massive difference. This is also the key secret why Swedes can continue dressing stylishly even at absurdly low temperatures.
Good quality gloves are essential. Ski gloves are usually pretty ideal. If you pay extra for quality on anything, get good gloves. Find ones that are waterproof on the outside, insulating on the inside, and comfortable and well-fitted. You'll get more out of the trip if your fingers a) don't feel like they're about to drop off, and b) don't feel like useless, unusable stuffed sausages strapped to your hands - find the best balance.
I'd strongly recommend good quality snow boots and a good, warm ski jacket. Try the snow boots on before buying - I bought mine online and while the size was fine, they were so inflexible I could barely walk, I was clunking around like a Scooby Doo villain in a suit of armour. It's possible to find proper snow boots that are comfortable and feel like normal boots. Also, try to keep the laces of your boots dry - it's very difficult to remove your boots when the laces have frozen solid!
I'd strongly suggest bringing a woolly hat (make sure it's not cotton!), even if your ski jacket already has a hood. Lots of heat leaves via your head.
I'd recommend having a scarf. I only wore mine occasionally and kept it loosely draped or in a pocket much of the time, but I was grateful to be able to cover my face when the icy winds picked up.
Waterproof trousers or ski trousers are worth considering. Activity centres will often lend them if you need them (e.g. for sledging), but it might be worth bringing your own if you're doing long hikes or similar. They're probably not necessary for normal walking around town etc (except in bad weather maybe).

Regarding the change in temperatures, it will be a shock, but it'll be doable if you're prepared. It's less extreme, but I recently went from 35 C+ West Africa to UK winter, and it was enough to just have a set of warm clothes in hand luggage for getting off the plane and through the airport. Some people "prepare" by keeping their air conditioning at it's coldest setting for a few days before... I'm not convinced that helps, but maybe it reduces the shock.
If you can, it'll be more comfortable if you can break the journey with a day or two in temperate, non-Arctic Stockholm, so it's less of a sudden shock. This also gives you time to buy anything you can't buy in Dubai (also, Stockholm's really nice).

Regarding where to buy stuff, be aware that things are very expensive in Kiruna. Kiruna makes Stockholm look cheap (and Stockholm makes London look cheap). Kiruna's town centre does however have a good number of well-stocked clothes and outdoors stores, more than you'd expect for a city of its population (it's the economic centre of its region) - but they don't have great opening hours, particularly at weekends.
I don't know much about shopping in Dubai, but it's such a transport hub and international shopping destination, I'd be amazed if you couldn't stock up at shops selling international brands like North Face etc, aimed at high-flyers on weekend shopping trips. It may be more expensive than shopping in a "normal" city, but probably compares well to Kiruna.
Answer: Dress in layers,

Good boots, if you have hiking boots they might do for starters, in it thick socks.
For your legs: long underpants, nice layer for indoors and over that waterproof pants.
For your top half, T-shirt, long sleeved thick shirt, woollen jumper, fleece jacket and over that your out of doors jacket. It's a good idea to avoid cotton clothing, they're not particularly warm and they retain humidity, that conducts heat away from your body and feels heavier.
Wooly hat, scarf and good mittens (or skiing gloves but mittens are warmer for the same material.)

When you leave home have your warmest clothes with you and layer those when you get to Sweden, not warm enough for extended periods but enough to get to your hotel and from there to the shops.
Answer: If you are used to warm temperature, cold temperatures will feel even colder. Usually it takes month till the human body can handle unused climate properly.
I cannot really say what to buy, but definitively where: in Kiruna.
Also I would suggest that you add at least one day in Kiruna, just to get used to the clothes and the temperature. If you spend some hours walking in the city you will detect if the clothes are okay or not. Beeing on the road freezing is not only unpleasent but can get dangerous too.
Comment: I wouldn't recommend walking around Kiruna in winter doing clothes shopping while lacking suitable winter clothes... you'd freeze! Especially since most shops in Kiruna close early on Saturday and don't open at all on Sunday. If you arrive on Saturday afternoon, that's over 40 hours without proper warm clothing!
Answer: As explained in the other answers, you should wear multiple layers of clothing as this traps air, providing insulation, and also allows you take take off some layers if it is too warm and you start to sweat. You want to prevent sweating as this cools you down rapidly later when you are no longer warm (e.g. when you stop exerting yourself).
From my own experience, you should pay particular attention to your shoes, trousers, and your hat, as it's often quite difficult to get hold of good quality stuff, even in the Arctic areas. You should consider buying some of your gear online before you leave. E.g. I could only buy these double wool long underpants in a shop in Svalbard, they didn't have them in any of the shops I visited in mainland Norway.
Ski pants don't work all that well as they are not so wind proof in the upper parts. They are, after all, designed for people doing hard exercise. It's better to try to get hold of goose down filled pants. This is hard to get hold of in shops, but it's easy to buy online.
For your head wear, you must also consider wearing multiple layers. So make sure you have a balaclava and on top of that you should wear an arctic hat like this one:
As the third layer you should use the water and wind proof head cover from your jacket. Like the other items I mentioned, a good arctic hat is also difficult to obtain in shops, I bought mine from Svalbard, so you could consider buying this online.
The multiple layer principle should also be used for your feet. The first layer can be light socks, the second layer a thick woolen sock. Good quality snow boots will consist of a removable inner boot that fits into a larger outer boot.
Comment: I like the tip for removing clothes to cool off, but beware of taking off clothes when you take a rest. If you are too warm, take a rest *or* remove items of clothing; but don't do both at the same time.
Answer: Keeping up your body temperature is a very big hurdle and i feel this because travelling in -25 to -30 degree Celsius is not so easy. As you are from the place Dubai where you know how the temperature treats you and in that cases if you are suddenly getting into the - degree Celsius i am not sure how your body will react which you should protect every time.
Mainly the things that you carry with you should be able to keep you up and maintain your body temperature all the way to make sure that you and your body respond stable in situations.
Sometimes the extreme freezing cool weather can make your "Your blood vessels constrict" which means the flow of blood inside the body tightens where your blood which keeps the warmth in your body decreases slowly. And many times it is also read that dressing too warmly can also make your body too cool which is another worse time if we do while travelling. Make sure that you do keep something with you that can fight with your white turning hands and the rashes that you face on your body due to the too cool weather over there. If you have some breathing issues then it is worse so make sure that you carry everything that you need in your trip to make sure that you won't face any issue in the middle.
Coming to the clothes that you have mentioned i feel you can buy the clothes at your place also as you said that you are from Dubai there are many on the list which will definitely help you find the best of the choices which suit the weather conditions where you are travelling.

I feel you should take boots, socks and the jackets that help you keep up your body heat to a level as mentioned too much of dressing may create the sweat again and make your body wet. You can even choose the collection in Dubai from online stores like souq in discounts available at Rezeem.
Comment: Welcome to SE! Thank you for your first answer. It has some interresting arguments, like the not dressing to warm part to reduce sweat.
For your next answer, it would be great if you tried to answer all the questions from OP, including the driving around in snow part.
Welcome to our great community =)


Where can I find/learn industry standard SQL Conventions?

Question: I work at a company that has some very non-standardized SQL conventions (They were written by Delphi Developers years ago). Where is the best place that I can find SQL industry standard convention definitions that are most commonly used?
Answer:
there aren't any
it there were, they'd be obsolete
if they're not obsolete, you won't like them
if you like them, they're insufficient
if they're sufficient, no one else will like them

seriously, strive for readability, i.e. use meaningful field and table names; nothing else is really necessary
(ok some common prefixes like usp and udf and udt may be useful, but not required)
Comment: See, starts right off with a zinger. Needs an "argumentative" tag (kidding).
Comment: Funny, but true. I can honestly say there are no "enterprisey" ways to name tables, columns, stored procedures or functions. As far as syntax, the same applies. I'm guilty of old style joins (i.e. a.id = b.id or b.id is null), but that really comes down to readability.
Answer: In his book "SQL Programming Style," Joe Celko suggests a number of conventions, for example that a collection (e.g. a table) should be named in the plural, while a scalar data element (e.g. a column) should be named in the singular.
He cites ISO-11179-4 as a standard for metadata naming, which supports this guideline.
Comment: This has always seemed to make the most sense even when i designed my very first database. I also adopted Suffixing any foreign key field with ID.
Answer: This is the best one I've ever seen... Naming Conventions
However, standards should really be all about clarity, simplicity, and ease of adoption among your team.
There shouldn't be a bunch of incredibly strict naming guidelines, it should focus on style.
The point is not to torment developers, it is to create a congruent style throughout the system so that it is easy to move from one section to another.
Answer: There are no exact industry-wide SQL standards.  The best option is to google for SQL standards because several knowlegable people have posted some rather good, extensive, and complete documents on the subject.  Read through them and absorb the items that apply to your environment.
Answer: Here you can find a lot of Rules to better SQL /SQL Server.
Yes, it's the company that I am working for, but they are good!
And these rules come from experience with client projects.
Have a look and take what you like!


Why, on each side of Shuttle, are there 2 Helium tanks for RCS and only 1 Helium Tank for OMS

Question: I'm trying to write a book on my experiences on working on the Shuttle BFS SW. I've looked all over the web and every diagram on an OMS/RCS pod shows the 2 fuel tanks for each, OMS and RCS. What seems odd is that there are 2 Helium pressurisation tanks for RCS, one of each of its two hypergolic fuel tanks, but there is only 1 Helium pressurisation tanks for its 2 hypergolic fuel tanks. What do I not understand about these two systems that would have the OMS system requiring only one pressurisation tank?
Answer: Sometimes, as an instructor, it seemed like that we had found the Orbiter on the runway left by an ancient civilization, with no answers as to why things were done the way they were.
This is one of those things I've wondered about as well - I don't have a referenced answer, so consider it informed speculation.
In the OMS with the single helium tank per pod, there was a danger that over long periods of time, propellant vapors could diffuse upstream through the quad check valves into the helium lines. If the fuel and oxidizer vapors get together in the helium lines, it's a KABOOM case. So OMS had to provide additional valves - the Vapor Isolation Valves - to prevent this.  This schematic from the 1995 OMS training manual shows the vapor iso valves.

In the RCS, providing a separate helium tank for each of the fuel and oxidizer systems designs out this failure case, because the helium lines for the two systems do not interconnect. It seems like the better design from a safety standpoint.
The OMS training manual says that having one helium tank for the whole system provides better control of mixture ratio since both propellant tanks are pressurized from the same source. Perhaps that's a bigger deal for the OMS since it's a much more powerful engine than the RCS jets. I also wondered if packaging in the pods was an issue since the OMS helium tank was quite a bit bigger.

I think these were some of the main tradeoffs they considered when they came up with the design, and I'd love to see it actually written down somewhere.  Some maybe more minor factors that might have been considered:

Everything else being equal, two tanks that together hold X amount, weigh more than 1 tank that holds the same amount, plus plumbing, valves, etc.
The RCS systems were active almost all the time in space for attitude control, so the vapor iso valve scheme wouldn't be practical for them. OMS got turned on relatively rarely compared to the RCS.

Sources (annotations mine):

Shuttle OMS training manual
SODB Volume 4 "Crash book"
Comment: I bought an eBook  version from Kobo books for my tablet.
Comment: That was a very thorough and informative response. It is too bad that we do not have a copy of the tradeoff study. It seems the issue was weight of 2 versus one 1 tank, but the other side was the addition of those vapor isolation valves, needed for safety with those two hypergolics. You had a good point about the RCS being in use considerably more tan the OMS. You didn't mention that the Fwd RCS has two Helium tanks, as well as each Rear pod. Can you give me a link to the Shuttle OMS training manual. I couldn't find it with a Google Search.
Comment: @DaveS The OMS and RCS training manuals aren't online as far as I know. Most of the same material is covered in the Shuttle Crew Operations Manual https://www.nasa.gov/centers/johnson/pdf/390651main_shuttle_crew_operations_manual.pdf chapters 2.18 and 2,22 The "crash book" used to be online at the KSC PAO website, but it's gone now.
Comment: Thanks for the info. I did find and pickup a copy of NASA Astronaut Training Manual (RCS 2102A). Very interesting. OMS to RCS interconnect for RCS burn from OMS tank.
Comment: @DaveS if it is a pdf, consider posting it somewhere. I only have an old paper copy. I look forward to reading your book!


How to disable to the review page for event registration in CiviEvent?

Question: A lot of times people who register mistake the review page for the confirmation page and assume they have successfully registered for the event. This creates a headache for paid events. Is there a way to disable review page and register the participant directly without showing the review page.
Answer: Skip confirmation extension provides a settings on every event page settings to turn on/off confirmation/review page.


What is a 4002's "RAM Status Character"?

Question: I was looking at this emulator of a Intel 4004, and I noticed something with the RAM. It had something called "Status Chars". There were 4 of them per memory line and all were 4-bit numbers which could be set from 0-F. They didn't seem like they had any use to me, so I searched on Google to find answers, but I found nothing. They appeared on every single RAM chip on the emulator, and they didn't appear at all in the ROM. What are these "Status characters", and what is their purpose in the 4004 and other microprocessors?
Answer: Per Wikipedia

4002: 40-byte RAM (80 4-bit data words), and one built-in 4-bit output
port; the RAM portion of the chip is organized into four "registers"
of 20 4-bit words:
16 data words (used for mantissa digits in the original calculator
design), accessed in a relatively standard manner, and
4 status words (used for exponent digits and signs in the original
calculator design), accessed using I/O type commands in place of the
ROM's input channel.
Comment: So those 4-bit status words are used for floating-point operations and positive/negative signs?
Comment: I assume they can be used to store whatever you wish in your program. The only mention is one particular program, the Busicom calculator. There is no hardware floating point.
Comment: Ok, I'll look at Busicom to see if I missed anything.
Answer:
[...] RAM. It had something called "Status Chars". There were 4 of them per memory line and all were 4-bit numbers which could be set from 0-F. [...] They appeared on every single RAM chip on the emulator, and they didn't appear at all in the ROM.

The 4004 can address 16 ROMs and 4 RAM chips. When addressing a ROM port 4 bits are used to indicate the ROM. With RAMs two are used to address the chip, while the two remaining select the register (*1)

What are these "Status characters",

They are simple RAM cells, like all the others. Except, they got kind of an immediate addressing mode.

To access any of the 'main' words the address (chip/bank in R and address in R+1) had to be set with the SRC instruction and fetched/written with RDM/WRM. For accessing another word the address had to be set again and issued with a SRC instruction.

<code>     LDM   0        / 0 -> ACCU
     DCL            / Select Data Bank 0
     FIM   2   4    / Load register pair 2/3 with address for Chip 0 Register 0 Word 4
     SRC            / Set address
     RDM            / Read word 4 into ACCU
     ...
     WRM            / Write the same word
     ...
     INC   3        / Increment Word address
     SRC
     RDM            / Read word 5
</code>

To access the 'status character' only the chip/bank part had to be set via SRC, while the individual words were addressed by specific instructions, resulting in faster access

<code>     LDM   0        / 0 -> ACCU
     DCL            / Select Data Bank 0
     FIM   2   0    / Load register pair 2/3 with address for Chip 0 Register 0 Word x
     SRC            / Set address
     RD0            / Read status character 0
     ...
     RD1            / Read status character 1
     ...
     WR0            / Write status character 0
</code>

and what is their purpose in the 4004

Primary to work as fast, direct accessible scratch pad and/or markers for the value stored in a (RAM) register. The 4 status characters of a (RAM) register addressed can be accessed direct without setting up and issuing an SCL instruction.
Like with any RAM it's up to the programmer what to use it for. The Busicom 141PF, the first device using a 4004, had two RAM chips for a total of 8 registers of 20 words each. While register 0 was used as keyboard buffer, the other seven stored numbers.

Special Character 0 held the sign in bit 0, while
SC1 held the position of the decimal point, essentially the decimal exponent (*2).
SC2 and SC3 of some registers held various flags,

So long story short, the RAM was used as 7 registers, one keyboard buffer and 32 words of other RAM.

and other microprocessors?

They are specific to the 4004

At that point one may ask why this strange organisation. After all, there were enough opcodes to address a second set of 16 word registers instead of fiddling with normal RAM and 'special' RAM.

For one such a chip would have been way to complex (and expensive) at the time. The 4002 RAM had already a transistor count similar to the 4004 CPU. Doubling that was simply unrealistic.

For the intended use as calculator the main need for RAM comes from number storage, not so much from runtime variables and alike. The Busicom 141PF uses only 8 words to store other information then numbers, most of them holding just one or two valid bits.

Of course Intel could have gone for a straight 4x16x4 RAM instead, but then calculators would have had to limit precision to less than 16 digits (*3) or use a second RAM chip.

By implementing full 16 digit storage per register and 4 word scratch in one device a simple calculator could be made with a single RAM chip. Further lowering entry cost.

*1 - The description from the Wiki about them being addressed instead of ports is misleading, as for one a different instruction is used, but even if assuming, it's not instead of ports but instead of ROM addresses.
*2 - Except only positive - the machine was intended as business device, a task in no need for real small numbers.
*3 - Busicom 141PF used only 14, but that's due the printer only offering 15 positions.
Comment: You mention an SRC instruction but I don't see one in the example code you presented. I see SCL which seems like it might be doing the operation described.  Do I misunderstand? (As you can tell, I know nothing about 4004)
Comment: @another-dave Oh. Well, thanks fo taking on the role of an assembler and flagging my typos :)) one thing to learn here is that 4004 mnemonics are seriously strange. I guess I mixed up DCL and SRC when writing.
Comment: @Raffzahn Ah! "We meet again!" I'm GLAD I read this, Raff - hope you don't mind that nickname! You illustrate I made the RIGHT move when considering using those early chips a bit later: What A Pain In The Butt they are to deal with! BUT, as you also point out, were valuable "at the time." Spot on there. I did a lot of hardware design work in the late '70s and very early '80s, including designing a quad CPU "upgrade" for Motorola 65xx and 68xx CPU systems, and more ... but always preferred Motorola over Intel and you helped reinforce that I was right; hard to use and oft "illogical."  ;-)
Comment: @RichardT The 4004 is really a very special case of CPU. More of a border case between no CPU and a 'real' one :)) It's geared toward a special case and the system offers very interesting ideas to squeeze more out of the given resources (instructions bit lengths, etc.), adapting its hardware to the max. Like a DSP may seem weird when viewed as a GP-CPU. Intel isn't bad per se, just a different way of thinking than the Motorola/MOS line. Same way a /370 requires a different approach. I enjoy learning the way each of them ticks and then play it like it's supposed to sound.


Best Practices for 3 Tier Development

Question: Does anyone know of any documentation by MS or someone else that lays out the best practices for developing a 3 tier architecture in ASP.NET.  I am in the process of trying to convince my boss that the current architecture needs rethought and reworked to provide a flexible and reusable system.  I have found a lot of generic documentation that tells you at a high level the best practices as far as how to do this but little showing how you actually implement them.  I need to show him documentation as far as the advantages to using business objects versus data sets and things to that level of detail.  Any help would be appreciated.
Comment: I have looked at the guides but what I am looking for is some examples of them being applied.  Ideally I would like an open source project that I can look at that used the guides as a base.
Answer: Microsoft's Patterns & Practices group has published various whitepapers and documents in the form of "architectural guidance" that can be helpful. They recently published a number of "pocket guides" as well. Even if you don't follow them to the letter, they're likely to be a great starting point for discussing your particular needs.
That they come from Microsoft may also help add credibility in the discussion with your boss. There's one on Web Application Architecture, in particular, that sounds like it may be relevant.
Answer: I would highly recommend looking into ASP.NET MVC.  It's a far better option for n-tier appliactions as it allows for a greater degree of Seperation Of Concerns.  This leads to a more testable and maintanable application that can be achieved with ASP.NET

Best Practices for 3 Tier Development


Any way to soften gummy candy?

Question: Sometimes when I buy (cheap) gummy candy, it's a little too hard to enjoy. Is there a way to soften them? Preferably something that lasts, as opposed to perhaps heating them and eating them while they're warm.
Comment: Not quite what you asked, but if you don't mind changing them to a slightly more adult treat, you can put them in a bowl and add just enough vodka to cover them. Let them sit in the fridge for about 48 hours. The vodka will be absorbed, they will swell and be significantly softer. They'll also have a slight alcoholic kick that goes away over the next day or two as they cure.
Comment: Microwave them for a couple of seconds. Works wonders
Answer: Gummy candy is essentially just water, sugar, gelatin, and a few other additives like food colouring.
Gelatin's gel strength1 is partially dependent on its concentration.  The more concentrated, the harder it gets.  Gummy candies left sitting around will lose water due to evaporation, which makes the gelatin more concentrated and thus harder, and if you watch carefully you'll notice that the moisture loss also makes the gummies shrink.
To soften them, you need to rehydrate them.  Toss them in a bowl of hot or warm water (don't use cold water - gelatin is only soluble in warmer water) until they reach the desired consistency - usually around 20 minutes or so.  The longer you leave them in the water, the more water they'll absorb, the more they'll grow and the softer they'll get.
Comment: @Brian: I think you made it too warm. :P I guess this partly depends on the actual gummies, but try starting with a temperature just above tepid and try just a few gummies as a test.  It is possible, though unlikely, that your gummies weren't made with very much gelatin to begin with, so it might not take much to dissolve them outright.
Comment: I've done what Aaronut suggests in the past, the only thing I'll add is that if you aren't going to eat them then, toss them on a drying rack for a little while so the outer surface dries before packing them back into a bag. Otherwise they'll stick to each other and turn into a congealed concrete like mass. This is especially true with gummy worms. They were almost impossible to get apart.
Comment: depending on who is consuming you can use rum instead of water, that is the only experience i have with hydrating gummies. They do stick terribly if you don't let them dry before re-packing.
Comment: How warm should the water be? I tried it but my gummy bears melted and ended up half the size and they were only slightly softer.
Comment: While gelatin melts in warm water, it actually hydrates just fine in cold. You actually bloom gelatin in cold water to hydrate it fully so it can melt more evenly in hot water. So I'd thing cool water would work too, just more slowly.
Answer: Put the gummies in a microwave for 5 to 10 seconds, but since microwave ovens vary by manufacturer keep an eye on them.
Comment: Works like a charm!
Answer: Put a piece of bread in the bag with the gummies, clip the bag, and put it somewhere warm. It will take a day, but will come back just like new.
Answer: Put em in your pocket! They get warm and squishy after five minutes or so.
Comment: This would be a temporary warming solution, which the question specifically avoids.
Answer: I think it takes approximately three hours for chewy candy to become a soluble in water
Answer: Submerge them in vegetable glycerin and Seth them in top of your gaming PC while playing a demanding game for an hour. They become so soft that they nearly melt in your mouth. The vg also makes them slightly sweeter.
Comment: What is vegetable glycerin and where can you buy it?
Answer: I put mine on the dash of my car on a warm sunny day. You have to keep an eye on them but they regain softness. I have even used the heat from my blow dryer!
Answer: Try stick a piece of bread in the bag, I use this to soften my cookies

Any way to soften gummy candy?


Multinomial logistic regression with unequal categories

Question: I'm trying to solve a statistical problem in my research. The research was conducted to test the relationship between the experience (happy, unhappy) of a traveler and his awareness of digital communication channels in the airport. My dependent variable consists of 3 responses from 200 people; happy, unhappy and neutral. The predictor is the number of digital channels that they are aware of (total of 9). There are several other variables that have also been taken into account, such as age, sex, Residence (dummy variable), whether traveling first time (dummy variable), travel purpose (dummy variable), place where data was collected such as ticketing, baggage claim, parking lot etc. (categorical variable) and whether traveling with a companion (dummy variable). My hypothesis is that awareness of digital communication channels improves the quality of experience (happy unhappy or neutral).
I want to perform a regression analysis to see test my hypothesis and also to see which of the predictors are the strongest. I tried Multinomial logistic regression I get a statistically significant model, however, none of the parameter estimates are significant. I feel that the problem might be because my three groups (happy, unhappy and neutral) are unequal in size (happy = 125, unhappy=33 and neutral = 42). How do I carry on a meaningful regression analysis?
Comment: Wouldn't ordinal regression be more appropriate in your setting? There seems to be a natural ordering of your categories: unhappy --> neutral --> happy.  You could start by looking at your (ordered) outcome variable to see how it relates, in turns, to each individual predictor. Then consider the ordered logistic regression model which includes all predictors at once.
Comment: Thank you! Even in this case, wouldnt the unequal categories pose a problem?
Comment: That is why I suggested you look at one predictor at a time first - you can build an intuition for what may be happening. Is a predictor significant by itself but not in the presence of other predictors?
Comment: number of digital channels: You treat it as categorical or continue covariate?
Comment: @a_statistician I treat it as a covariate
Comment: continue or categorical (dummy variables)?
Comment: @ a_statistician Continue
Comment: "I get a statistically significant model" Based on what kind of test?
Comment: @a_statistician, the goodness of fit (Pearson and Deviance) are both above 0.05 and Likelihood ratio tests is significant at <0.05.
Answer: I don't think unequal class is the problem. Multinomial logistics seeks coefficients that maximizes the probability of a class in relative to the baseline class, i.e.
$$\hat{\beta} = \max_\beta \ln \sum_{i=1}^{K-1} \dfrac{P(C=i)}{P(C=K)}$$
And $\dfrac{P(C=i)}{C=K}$ is the size of class $i$ relative to class $K$, so the difference in class sizes convey information that is (and ought to be) taken into account.
Imagine if one of your class has only 1 data point (say only one customer responded "unhappy"). You would expect your algorithm to be really careful to classify a new observation as "unhappy" -- and any features that qualify an observation as "unhappy" ought to be highly salient. If two customers are identical in every observed dimension, and one is "happy" and the other is the only case of "unhappy", then the feature dimensions would have no explanatory power for classifying "happy" vs "unhappy". The algorithm will simply classify observations with these features to "happy" if that's the majority case.
In short, you want your model to be trained on whatever class sizes that come from the field. You may want to look into your X variables, and consider increasing your sample size overall. I do not think it is a good idea to hand pick samples from each class to artificially create equal classes.


Report to get all roles in salesforce (with assigned users and without users)

Question: I need a report that shows all roles. Currently I have created a report on user which shows those roles which have users assigned, but I need to show all roles with or without users assigned.
Comment: Thanks for the below Solutions.But still if i need to show report with roles (assigned to active users and without users) then what is the solution to achieve this functionality.
Answer: You can't run a report against the UserRole object but you can try this instead:

Go into the Developer Console and select the SOQL query tab or you can login to workbench.developerforce.com.
Go to the Queries Menu/SOQL Query
Paste this query in the query box and click the Execute (or Query) button.

This query selects all roles that are not found in the User table.
SELECT Id, Name
FROM UserRole
WHERE Id NOT IN (SELECT UserRoleId FROM User WHERE UserRoleId !='000000000000000')

This is what you get:

You can then run the same query a bit modified to get all Roles that are assigned
SELECT Id, Name
FROM UserRole
WHERE Id IN (SELECT UserRoleId FROM User WHERE UserRoleId !='000000000000000')

The results can be placed in excel and then imported to a custom object where you can create a report on it if you wanted.
Comment: Appriciate the early Response.
Comment: Thanks very much.Here (id=0000000000000000)?.does it mean blank value
Comment: Yes.

If you liked the answer, why not express it by voting for it. I hope that it helped.
Comment: yes.Sure here is the vote.
Answer: I don't think you can do this with a report, but you could use something like the following in an execute anonymous window, which would give you an output with the names of the roles not being used.
You may want to add in criteria to only look at active users, or maybe remove community/partner users.
Map<Id, UserRole> roles = new Map<Id, UserRole>([SELECT Id, Name, DeveloperName FROM UserRole]);

List<User> users = [SELECT Id, UserRoleId FROM User];

List<String> rolesWithoutUsers = new List<String>();

for(User theUser : users)
{
    roles.remove(theUser.UserRoleId);
}

for(UserRole theRole : roles.values())
{
    rolesWithoutUsers.add(theRole.Name);
}

system.debug(rolesWithoutUsers);

Answer: If you want to use the rest api the endpoint you can use user24509 response with /services/data/v37.0/queryAll?q=SELECT Id, Name FROM UserRole WHERE Id IN (SELECT UserRoleId FROM User WHERE UserRoleId !='000000000000000')


How to prevent colleagues infiltrating my patent?

Question: I disclosed a patentable concept to my employer and some other colleagues who were tasked to evaluate technical feasibility, they try to instead propose "improvements". This is despite sending them a broad description of the concept and not all the alternative embodiments so likely their "improvements" may be included in the final draft anyway. It is very likely that they don't know about patenting and that I am trying to patent something as broadly as possible rather than getting into several permutations or specifying minor improvements which probably would not stand alone as substantial patentable improvements. Do you think they are trying to get a place in the inventors list and how can I prevent this? If unavoidable, is there an established process of having different ownership percentages in the patent?
Comment: Will it be assigned to your employer or is it unrelated to work?
Answer: There are several issues here. If your invention is part of your job or you are otherwise required to assign it to your employer then it will be owned by your employer and the listed inventors will just be a matter of pride not ownership or monetary value. This is a very likely case.
If it is your IP and not that of your employer, I hope you have disclosed it under an understanding of confidentially. If not you are now barred from filing in the most of the world and have a sort-of one year grace period to file in the US. If your claims extend to anything suggested by your colleagues you may be obligated to state that in a disclosure to the USPTO.
In the US all of the listed inventors on an unassigned patent have identical and undivided rights. They can all license third parties with no need to account to each other. If they chose to have joint ownership under a less horrible set up they can all assign their rights to some entity and share rights in that entity in any mutually agreeable way assuming they have no preexisting obligations.
Inventors are those that have made a conceptual contribution to something that is claimed. If it does not belong to your employer and you are controlling the prosecution you can cause there only to be drafted claims to things where you are the sole contributor and you will be the only inventor. If others who you disclosed your invention to decide to file separately on the improvements they have made you will be in a very complicated situation.
Answer: First, Congrats!
Second, I suggest, you present the general concept and all the possible applications you can think of next time. If you share all what you have, it won't hurt you that others improve your idea. It might be the case that you may file 2-3 patents instead of only one.
Also, don't forget in most cases royalties are dependent on the success of the invented product. It is financially better to be a co-inventor of a widely used product than the only inventor of a never sold product.
Answer: First thing to remember is that if you work for a company they own the results of your labor and that usually includes IP. So, it is very likely the company will own any resulting patent. Thus, there is no issue with ownership percentages.
As for additional improvements, identifying alternative embodiments is a good thing and can result in a better patent. The patent attorney will determine if any of those improvements result in a claim and thus the person suggesting the improvement being listed as an inventor. Having co-inventors does not diminish your status as an inventor.
In my opinion, your professional life will be more rewarding if you collaborate with your colleagues and look upon their contributions as helpful. They might get added as an inventor on your patent. Down the road, you might contribute to one of their inventions and become a co-inventor too.
Comment: If you get royalties from your employer, you have a very rare privilege. In any case the question is what is in the claims and who contributed to those claims.
Comment: Thanks all, yes the employer will own it, me listed as inventor and they will be paying royalties. The thing is the royalties will be diluted and it's less prestigious to have co-inventors. It is a matter of getting "inventor" status with little effort which wouldn't be enough to even get a patent, cannibalising on someone else's efforts.
Comment: Then it is all a matter of company policy as to who gets what compensation - nothing for anyone here to help with.


Black Screen after installing SageMath

Question: This problem happened in my friend's computer, and I'm trying to help him out. He was using Jupyter for coding python, and installed SageMath using sudo apt-get install sagemath. He said that after that, the Jupyter kernel stopped working, so he decided to reboot his computer. The problem is, once he did this, he got a black screen, as shown below:

He said he can actually navigate the Ubuntu system, but there is no GUI. Here is another photo:
Comment: What happens if you type startx  to start the X server and desktop?
Answer: The disk is full.  10% of a disk drive's space is reserved for root, which means that when a typical user program (like GNOME desktop) starts up and tries to create a log file, it can't.  Use the du -hxd1 -t 10M command repeatedly to track down what is eating up this space, and delete it.

Black Screen after installing SageMath


Relationship between epistemology and ontology

Question: In what domain do questions about the nature of knowledge fall epistemology or ontology?
How do you distinguish the two fields?
Comment: What have you found out so far? :)
Comment: There are 2 sentences in the body of this question, the latter of which is in tune with the title question, the former is something else entirely. Which question do you mean to ask? Are you trying to ask about the differences between the two fields, or whether "knowledge" falls under either? Also, why couldn't you simply look this up yourself? In general, asking easy-to-answer questions is not a problem, but really? These are just the definitions of the most basic categories of philosophy, it's like asking on Math.SE "What is addition and subtraction?"
Answer: I don't actually understood what you're trying ask here, but I can  point out that 'questions about the nature of knowledge' ARE epistemological questions per se. 'Do you need any ontology to answer epistemological questions?' - I think that's where you are trying to get to. Well, ontology is all about what things are and it seems that in many cases epistemologists do need to do some ontology [and vice-versa]; metaphysicians do loads of epistemology as well. Just a few examples, 'Knowledge and its Limits' and 'Modal Logics as Metaphysics' from Timothy Williamson, 'Formal Epistemology' Von Hendricks, etc.
Answer: A quick google search would have done it, so next time, please don't be lazy.

Ontology is the philosophical study of the nature of being, becoming, existence, or reality, as well as the basic categories of being and their relations.
Epistemology is the branch of philosophy concerned with the nature and scope of knowledge and is also referred to as "theory of knowledge". It questions what knowledge is and how it can be acquired, and the extent to which knowledge pertinent to any given subject or entity can be acquired.


How do I sort out duplicates using a formula in excel? Listing the unique values in adjacent cells. Without using VBA?

Question: Pretty often I want to pick unique values from a table and list them in another, mostly to make statistics or summaries. A child can do this manually, shouldn't be too hard a task for my computer to do the same thing? Of course I may use VB, control buttons ect, but this is not very user friendly when shared with other users, and security settings confuse even more.
Answer: Data Tab - Sort & Filter Group - Advanced - copy to another location - unique records only - OK
Answer: This formula checks for duplicate entries using COUNTIF and MAX and a range which moves subsequently downwards. The last entry will be kept.
=IF(MAX(COUNTIF(A1:A65536,A1:A65536))>1,"",A1)

Assuming your data is in column A: Copy the formula to B1 and use autofill down
Answer: See also, this question here - including my alternative approach using pivot tables:
How do I get the distinct values in a column in Excel?
If you've customised your shortcuts/ribbon/QAT in Excel to add an 'Insert PivotTable' shortcut, this can be a very speedy way to get unique records.


GCP MySQL query logging

Question: I have a managed MySQL instance on GCP. Where would I find a query log? Is this something I need to enable first somewhere? I have read their documentation ( https://cloud.google.com/sql/docs/mysql/how-to ) and didn't find it helpful on this topic.
Comment: I've not used MySQL on GCP, but if you can run the mysql client (which you have to be able to do - no?) run `SHOW VARIABLES LIKE %log%` or similar and that should point you to any logs you have that are operational. p.s. welcome to the forum!:-)
Answer: It's all documented here and here.
Relevant part:

To make your general or slow query logs available, enable the
  corresponding flag and set the log_output flag to FILE. This makes the
  log output available using the Logs Viewer in the Google Cloud
  Platform Console. Note that Stackdriver logging charges apply.
If log_output is set to NONE, you will not be able to access the logs.
  If you set log_output to TABLE, the log output is placed in a table in
  your database. If this table becomes large, it can affect instance
  restart time or cause the instance to lose its SLA coverage; for this
  reason, the TABLE option is not recommended. If needed, you can
  truncate your log tables by using the API. For more information, see
  the instances.truncateLog reference page.
Comment: Is `general_log` set?
Comment: Thank you - ours is set to FILE, working on getting permissions to view logs in Stackdriver now!
Comment: After setting this up, I am only able to view error and activity logs - not query logs. Any more tips?
Comment: Is `slow_query_log` set to `on` ?
Comment: Yes, but I am interested in ALL queries, not just the slow ones... the slow queries portion is working OK.
Comment: It is now - and everything is great. Thank you very much Phil!
Comment: When I view the logs all the queries are broken up.  SELECT will be in one line and then further down the log will have FROM on its own line.  The log software doesn't break up the query properly.  This isn't usable.

GCP MySQL query logging


Froze or freeze bottle Exploding

Question: I kept a bottle in my freezer with full water overnight. When my mom took it out and put it in normal condition, it blasted after a few minutes. More surprisingly the bottle was made of aluminum. Pls, explain this.
Comment: Congratulations! https://physics.stackexchange.com/q/357805/
Comment: I believe I read somewhere else on here of something where if something is chilled just under the right conditions (I think purity of the water mattered) ice crystals won't form. But if you disturb it they will form and it will spontaneously freeze. That might be related here.
Comment: Could you please add some more details. What does blasting mean? Do you mean it exploded? Where did the aluminum bottle crack?
Comment: Yes, sustained temperatures of -35C or +35C will cause Pepsi cans to explode. I've seen it happen multiple times. The spontaneous freezing sounds like the best comment!
Comment: blasting means the bottle's bottom broke. it just came out now you can see through the bottle
Answer: if left unperturbed and in a very clean container, a body of water will easily persist in the liquid state at temperatures below the freezing point. Then, when picked up and moved, the supercooled liquid will be sufficiently perturbed that nucleation sites will be created within the liquid and it will then spontaneously freeze all at once. It will then burst the container it is in.
Answer: Frozen soda bottles explode better, this is because water expands when it freezes (the unusual property of water) which pushes the $CO_2$ from the bottle outward.  The union of pressurised $CO_2$gas trying to escape and ice filling a space too small for it is too much for the bottle, and this can make the bottle explode.
This works even without $CO_2$ gas, you fill up lets say a 500ml bottle. When it freezes the ice occupies more than 500ml hence pushing on the container, if this pushing amount is higher than the maximum tensile strain the bottle will break.

Froze or freeze bottle Exploding


Resurrection via Psions using their Psicrystal

Question: I vaguely remember psicrystals holding the soul of the Psion upon death and escaping to a safe location to regrow a new body for its owner where the crystal itself is part of the new body. Was this done with feat or Class specific Psion?
Answer: The Psicrystal Imprinter PrC has this ability
The Psicrystal Imprinter gains the class feature Essence Crystal at level 9 (of the PrC, minimum character level 14) that does what you're looking for.
--
This seems to be, at least partially, based on the 3.5e Psicrystal Savant which gains Psicrystal Phylactery at level 7 (minimum character level 10... unless you cheese to Manifest 2nd level Powers early).
Comment: Yes this is exactly what I remember reading way back then. Sadly there is no Pathfinder equivalent.


What are the drawbacks of using a web based wallet and how to overcome that?

Question: Can anyone tell me why many prefer to use application when compared to web based wallets.
What are the drawbacks of using a web based wallet and how to overcome that?
Answer: The chance of a "known" website to have various attacks and compromising schemes done to it are attempted all the time.  So if you wallet on online and that site is compromised, your coins are gone... However if the wallet was on your computer, then the chance that some hacker is attempting to hack into your network is so small.  Using your own computer, you just want to regularly create backups or your wallet.dat file from your wallet and encrypt it with a strong password and put it somewhere like a thumb drive that you put in a fireproof safe, or maybe online in google drive, skydrive, dropbox.  The chance that an encrypted file is discovered by someone is so unlikely relative in comparison to the many hackers knowing about the mass storage of a given online wallet.
You could always diversify.... depending on your strategy for assets and asset management, you could always do like 10-25% of your coins in online wallet, I personally would not do any more value than that.
Comment: Please add comment if downvoting, it is the honest thing to do.
Answer: So when you used a web-based wallet the bitcoin usually is 'Not' yours. Why?
Because you don't have hold of the private key. If the company decided to shut down randomly or discontinued, all the coins you stored are gone (unless the online wallet allows the client to have the private key which ofc unlikely from what I have seen).
This is different when using hardware/software wallet. When you using a hardware/software wallet, you have hold of the private key(s) which means you owned the bitcoin. Not every single wallet is trusted (most are, just don't download random software from anywhere). You can also make a backup of the private key in-case your computer got damaged, that way u can recover it later.
Extra/Side-Note: Try to use USB/external hard drive for backups, an online cloud can be also a bit risky depending on what provider you use (aka if they have access to your file or not).


Generating SVG from LaTeX (tikz)?

Question: How can I generate an SVG image from a LaTeX file - more precisely, a tikz diagram? I'm working in Windows.
Comment: You may have more luck asking this question on [TeX.sx](http://tex.stackexchange.com).
Comment: Here is an answer that worked for me: http://tex.stackexchange.com/questions/51757/how-can-i-use-tikz-to-make-standalone-graphics
Answer: The simplest way to do so would be to first generate a PDF or DVI  with just the said diagram/equation and then convert it to a vector format.
If small page-size PDFs work fine for you, then you can use
 * Use ghostscript:
    gswin32c.exe -sDEVICE=pdfwrite -dMaxSubsetPct=100 -dPDFSETTINGS=/ebook -sOutputFile="outfile.pdf" -dNOPAUSE -dBATCH "infile.pdf"
where -dPDFSETTINGS is used to define how images are resampled. Using -dPDFSETTINGS=/screen will yield dpi=72. I just tried this with a sample pdf and it seems to work fine.

PDF tools : http://www.pdfill.com/pdf_tools_free.html
pdfcrop (I suppose there it will be available with an implementation of MinGW)

Otherwise, use any of the methods described at:
https://stackoverflow.com/questions/10288065/convert-pdf-to-clean-svg
Also, this answer for multiple pages:
https://stackoverflow.com/a/4502030
This resource is useful as well:
svgkit.sourceforge.net/SVGLaTeX.html
Of course, some of the mentioned commands would work fine with using MinGW implementations or will have native Windows implementations, which you'll have to download. And of course, then add the executable file's directory to the PATH variable environment (available in the advanced settings in the computer properties).
For inkscape, see this link: http://kaioa.com/node/42#inkcl_bat_usage
Here,you just place a batch file (InkCL.bat)in the inkscape directory. and use it instead of typing inkscape in the command-line.
        inkcl
To sum it up, it is generally requires just 3 commands

Create a TeX file with an empty page style
Say, input.tex:
\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}

\thispagestyle{empty}
\begin{document}
\[
2 \pi f t
\]
\end{document}

Now, Use any of the following methods:

After Creating PDF:
 pdflatex input.tex

This creates the file input.pdf
Now, Use any of the following methods:

from Inkscape:
 inkscape -l output.svg input.pdf

(Same as above):
inkscape \
  --without-gui \
  --file=input.pdf \
  --export-plain-svg=output.svg

For multiple pages (and single as well), use pdf2svg[cityinthesky.co.uk/opensource/pdf2svg/]. It uses poppler and Cairo to convert a pdf into SVG. This is particularly useful for bulk conversion:
pdf2svg <input.pdf> <output.svg> [<pdf page no. or "all" >]

Note: if you specify all the pages you must give a filename with %d in it (which will automatically be replaced by the appropriate page number). E.g.
pdf2svg input.pdf output_page%d.svg all

Fom DVI,
latex input.tex

This creates the file output.dvi

Then,
dvisvgm --no-fonts input.dvi output.svg

This works perfectly for instances with LaTeX formulas (with option --no-fonts)
Also soandos' answer (Including for comprehensiveness):
dvips -q -f -e 0 -E -D 10000 -x 10000 -o eqn.ps eqn.dvi

From the dvips man page (ma.utexas.edu/cgi-bin/man-cgi?dvips%201):

[-q] Run in quiet mode.
[-f] (filter) Read the .dvi file from standard input and write the PostScript to standard output.
[-D] sets the resolution between 10 and 10000 (also affects positioning of letters)
[-E] makes dvips attempt to generate an EPSF file with a tight bounding box.
[-e num] Each character is placed at most this many pixels from its `true' resolution-independent position
[-R] Run in secure mode.
[-x] num Set the magnification ratio to num/1000 no matter what the dvi file says (between 10 and 100000)
[-y] num Set the magnification ratio to num/1000 times the magnification specified in the .dvi file (between 10 and 100000)
[-o] specifies the output file as eqn.ps

Then,
pstoedit -f plot-svg -dt -ssp eqn.ps eqn.svg

This creates the file eqn.svg

[-f] specifies the format as plot-svg (direct svg does not work)
[-dt] Draw text - Text is drawn as polygons.
[-adt] Automatic Draw text - This option turns on the -dt option selectively for fonts that seem to be no normal text fonts, e.g. Symbol.
[-ssp] simulate sub path for backends don't support PostScript pathes containing sub pathes, i.e. pathes with intermediate movetos.
[-usebbfrominput] If specified, pstoedit uses the BoundingBox as is (hopefully) found in the input file instead of one that is calculated by its own. (Doesn't seem to make a difference for plot-svg)
[ -noclip ] don't use clipping (relevant only if backend supports clipping at all)

In order to get good quality text to polygon conversion, we had to run dvips with a high magnification, so one will have to scale down the resulting SVG.
Answer: You might want to check out a tool I just wrote: tikz2svg.
Given in.tikz (or stdin):
> cat in.tikz
\begin{tikzpicture}
  \fill[red!90!black]   ( 90:.6) circle (1);
  \fill[green!80!black] (210:.6) circle (1);
  \fill[blue!90!black] (330:.6) circle (1);
\end{tikzpicture}

It outputs:
> cat tikz2svg < in.tikz
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="93.472pt" height="86.205pt" viewBox="0 0 93.472 86.205" version="1.1">
<g id="surface1">
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(89.99939%,0%,0%);fill-opacity:1;" d="M 76.742188 30.347656 C 76.742188 14.691406 64.050781 2 48.394531 2 C 32.742188 2 20.050781 14.691406 20.050781 30.347656 C 20.050781 46.003906 32.742188 58.695312 48.394531 58.695312 C 64.050781 58.695312 76.742188 46.003906 76.742188 30.347656 Z "/>
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(0%,79.998779%,0%);fill-opacity:1;" d="M 62.011719 55.859375 C 62.011719 40.203125 49.324219 27.511719 33.667969 27.511719 C 18.011719 27.511719 5.320312 40.203125 5.320312 55.859375 C 5.320312 71.515625 18.011719 84.207031 33.667969 84.207031 C 49.324219 84.207031 62.011719 71.515625 62.011719 55.859375 Z "/>
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(0%,0%,89.99939%);fill-opacity:1;" d="M 91.472656 55.859375 C 91.472656 40.203125 78.78125 27.511719 63.125 27.511719 C 47.46875 27.511719 34.777344 40.203125 34.777344 55.859375 C 34.777344 71.515625 47.46875 84.207031 63.125 84.207031 C 78.78125 84.207031 91.472656 71.515625 91.472656 55.859375 Z "/>
</g>
</svg>

See http://juan.benet.ai/note/2014-03-09/tikz2svg/
Answer: Try this python CGI script.
Comment: doesn't work for me
Comment: Why not? (filler)
Answer: One method is (assuming you have a working LaTeX installation) to compile the LaTeX diagram to produce a pdf output file (usually using pdflatex).
This can then be opened using the vector graphics editor Inkscape. Inkscape can import a range of files, including pdf (using the poppler libraries) and can save them as SVG files. (Inkscape also provides command-line conversion capabilities but I don't know whether this is available on a Microsoft Windows system).
Answer: I recommend the process mentioned by @Rohan.
Create a dosbatchfile first,
"miktex_path.bat" as:
@echo off
path=C:\Program Files\MiKTeX 2.9\miktex\bin\x64;%path%;
cmd
@echo on

Then edit a .tex file with some equation with your favourite editor like Texmaker or Notepad2. Save it like Sample.tex.
Double-click the batch and on the console
do as follows:
latex Sample.tex
dvisvgm --no-fonts Sample.dvi Sample.svg

The job is done.
Here is a collection of some equation contained in one page:
\documentclass[16pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}

\usepackage[spanish]{babel}

\usepackage{color}
\usepackage[T1]{fontenc}

\begin{document}

\[\psi (t)=\hat{\psi}e^{i(\omega t\, \pm\, \theta)}\sum_i \hat{\psi_i} cos(\alpha_i \pm             \omega t)\]

\[\sum_i \hat{\psi_i} cos(\alpha_i \pm \omega t)\]
\[\sqrt[{\Delta+n}] {\hat {\mu}}\]
\[\Omega t\]
\[\omega Q_{1}\]
\[\frac{\delta (x^2)}{\delta x}\]
\[\frac{\delta}{\delta x} (x^2)\]
\[\int \hat{i}(x^2+3xi)dx\]

\begin{huge}
\[\psi (t)=\hat{\psi}e^{i(\omega t\, \pm\, \theta)}\sum_i \hat{\psi_i} cos(\alpha_i \pm     \omega t)\]

\[\sum_i \hat{\psi_i} cos(\alpha_i \pm \omega t)\]
\[\sqrt[{\Delta+n}] {\hat {\mu}}\]
\[\Omega t\]
\[\omega Q_{1}\]
\[\frac{\delta (x^2)}{\delta x}\]
\[\frac{\delta}{\delta x} (x^2)\]
\[\int \hat{i}(x^2+3xi)dx\]
\end{huge}

\end{document}

Comment: This worked for me!
Answer: I'm using Linux but I think this will work on any platform with TeX and TikZ/PGF. I've only used it to create SVG of a TikZ picture in an otherwise empty document but it looks like you could use this to make html with SVG graphics of a large document. This solution comes from page 110 of the pgfmanual.

In the TeX or LaTeX document preamble before you load the TikZ package, e.g. with
\usepackage{tikz} in LaTeX type:
\def\pgfsysdriver{pgfsys-tex4ht.def}
Then process the TeX or LaTeX with httex or htlatex as appropriate. You may need to add tex4ht to your tex installation; it's at http://www.tug.org/applications/tex4ht/. For example to process my file called logoname.tex I do
htlatex logoname.tex
The following output files are created in the current directory
logoname.html
logoname.css
logoname-1.svg

If you have more TikZ pictures I assume they would become logoname-2.svg and so on.
I'm able to look at the SVG output in firefox and inkscape so it seems to produce good results

Generating SVG from LaTeX (tikz)?


Can I take money from my employee stock and put it towards another stock?

Question: Can I take money from my employee stock and put it towards another stock?
Answer: The question is for your HR department, or administrator of the plan. How long must you hold the employee shares before you are permitted to sell? Loyalty to your company is one thing, but after a time, you will be too heavily invested in one company, and you need to diversify out. One can cite any number they wish, 5%, 10%. All I know is that when Enron blew up, it only added insult to injury that not only did these people lose their job, they lost a huge chunk of their savings as well.
Answer: Only if you sell the stock in question, and use the proceeds to buy other stock.
(You should probably never feel bad about selling your company stock, even if it goes up a lot later, because from a risk-exposure basis you are already exposed to your company's performance through your career. Unless you have a lot of other savings, you should diversify.)


Proof that uniform circuit families can efficiently simulate a Turing Machine

Question: Can someone explain (or provide a reference for) how to show that uniform circuit families can efficiently simulate Turing machines? I have only seen them discussed in terms of specific complexity classes (e.g., $\mathbf{P}$ or $\mathbf{NC}$). I would like to see how uniform circuit families is a strong enough model for universal, efficient computation.
Comment: What does it mean for uniform circuit families to be strong enough for universal, efficient computation? I truly have no idea.
Comment: Yea, I guess this is what I'm getting at. If it's a nonsense question, then great...I just want to understand why it's nonsense. We can define a poly-time uniform family of circuits (i.e there is a poly-time TM that on input $1^n$ outputs the description of the circuit). Turns out this captures the power of complexity class P. Can we give an analogous description which gives a definition of the complexity class R?
Comment: Yes. There is a Turing machine that on input $n$ outputs the description of a circuit.
Comment: Do you have a reference with more detail on this? You gave a definition but how do you prove that a language is in R iff such a uniform family exists? (I'm concerned that such a TM has too much power.) Also, for a language $L \in \mathrm{TIME}(n)$, can we show that the resulting uniform family has size $poly(\mathrm{TIME}(n))$? Thanks for your time!
Answer: Here is the basic idea. We'll take P as an example.
Given a Turing machine running in polynomial time, we construct, for each input length, a layered circuit in which each circuit represents the current configuration of the Turing machine:

For each cell, the contents of the cell.
For each cell, whether the head is there.
The current state of the machine.

The number of layers is the same as the polynomial upper bound on the running time, and the width of each layer (number of cells) is the maximum space used by the machine.
The initial layer is initialized directly from the input. Each other layer is constructed from the preceding layer (using the convention that once the machine halts, its configuration remains static). Finally, the output is extracted from the last layer. The construction is uniform, as the description hopefully makes clear.

This shows that you can convert Turing machines running in time $T(n)$ and space $S(n)$ to uniform circuits of size $O(T(n)S(n))$. This can likely be improved.
Comment: I guess I'm hung up on the definition of such uniform families. You can define poly-time uniform circuit families with a single, poly-time Turing machine that outputs a circuit per input size. What is the equivalent definition for universal uniform circuit families?
Comment: There are several definitions of uniformity. You can check out [this paper](https://people.cs.umass.edu/~immerman/pub/bis.pdf), for example.
Answer: Let us prove the following theorem:

A language $L$ is decidable if there is a Turing machine $T$ that on input $n$ outputs a circuit for $L \cap \{0,1\}^n$.

$\Longrightarrow$ Suppose that $L$ is decidable. Given $n$, we can compute $L \cap \{0,1\}^n$. We can then construct a circuit for the corresponding Boolean function.
$\Longleftarrow$ Suppose that there is a Turing machine $T$ than on input $n$ outputs a circuit for $L \cap \{0,1\}^n$. To decide $L$, given an input $x$, run $T(|x|)$ to get a circuit for $L \cap \{0,1\}^{|x|}$, and run it on $x$ to determine whether $x \in L$.


Hoare's Axiom Scheme Precondition

Question: I have a question about determining preconditions for Hoare's Axiom Scheme. For example, if we have P { x=2 } x==1 and we are trying to determine the precondition, P, could we just set P as false giving us False { x=2 } x==1. I've read some of the other posts on this forum about Hoare's Axiom Scheme but am having a hard time wrapping my head around the topic.
Comment: It is not clear what you don't understand or disagree with. $\{\text{false}\}\, x:= 2\, \{x=1\}$ and $\{\text{true}\}\, x:= 2 \,\{x=2\}$ are two correct annotations. What is your question ?
Answer: Yes.  You can set P to be false.  However, the resulting statement won't be very useful.
Let's back up, and consider how to interpret a statement like P {x=2} x==2.  This is saying that for every state of the program that satisfies P, if you execute x=2 in that state, then the state of the program afterwards will satisfy x==2.  How useful is this?  Well, the more states that satisfy, the more powerful and useful a statement this is -- the more you have learned.
So, a statement like true {x=2} x==2 is correct, and also very useful: it works no matter what the prior program state.  It says that, no matter the previous program state, if you execute x=2, then the expression x==2 will hold afterwards.
In contrast, a statement like false {x=2} x==2 is correct, but not useful.  It is correct, because it claims that for every program state that satisfies false, then executing x=2 will leave you in a program state where x==2.  This is vacuously true, since there are no program states that satisfy false.  However, it is not very useful.  There are no program states that satisfy false, so there are no program states where this tells you something useful about what will happen if you execute x=2.
Now let's move on to the example you gave, of P {x=2} x==1.
How about true {x=2} x==1?  This is incorrect.  It's not true.  If you start in a program state where, for instance, x==7, then this will satisfy true, but after executing x=2, the condition x==1 will not be satisfied.  So, that's just a faulty claim.
How about false {x=2} x==1?  This is a correct claim.  For the same reasons as explained above, it is vacuously true. However, for the same reasons as explained above, it is not useful: there are no situations where this is a useful claim to know, since there are no program states that satisfy false.

Generally we look for the weakest precondition.  Here a precondition that is "strong" is one that is restrictive; thus "False" is strong and "True" is weak.  Notice that weak preconditions are one that apply to more prior states, and thus are more useful (can be applied to a larger set of prior states), so the weaker the precondition P, the more useful the statement will be.  In other words, the weakest precondition is in some sense the most useful precondition.  "False" is a very strong precondition; while it might be a valid precondition, it is not useful.
Comment: What do you mean "not useful" ? It does prove that the algorithm is not correct.
Comment: @YvesDaoust, Thanks for the feedback!  I've revised my answer to try to elaborate on my reasoning.

Hoare's Axiom Scheme Precondition


How to configure Elastic Beanstalk for using Rails with Postgres?

Question: Elastic Beanstalk has built in support for RDS. But, I want to use Postgresql with Elastic Beanstalk. Which will be the best approach for doing this?
Comment: Elastic Beanstalk documentation does say that you can use any DB that you want but doesn't provide any documentation on how to configure it.
Comment: Have you checked the Elastic Beanstalk documentation or talked to the folks at Amazon? [From what I can glean from a 30 second google search](http://aws.amazon.com/elasticbeanstalk/faqs/#db-solutions) you can use whatever DB you want, so this is really a programming question at best, and a Tech Support question at worst - I'm not sure how Server Fault can help you here...
Comment: configure the database, or configure EBS?  The former we can help you with (though the Postgres docs are probably better than we are) - the latter I'm not sure is really "system administration" -- I can reopen this but you may not get great answers...
Comment: I was looking for some pointers on how to add an EC2 instance to Beanstalk which will run POstgres. I understand that this may not be appropriate for this forum. Thanks anyways for your comments.
Comment: Check @n__o's answer, point #3 ... it's the way to do it.
Answer: The easiest and cleanest way I found, assuming you're using Elastic Beanstalk CLI eb:

Create an instance (follow the steps):
eb init

This will create an instance with MySQL.
Once it's created, stop it.
eb stop

This will stop your instance and delete the MySQL database that was created by the initial setup.
Edit your instance configuration file in .elasticbeanstalk directory at the root of your project, replace DBEngine entry in the [aws:rds:dbinstance] section by postgres.
vi .elasticbeanstalk/optionsettings.<my-app>-env

[aws:rds:dbinstance]
DBDeletionPolicy=Delete
DBEngine=postgres
DBInstanceClass=db.t1.micro
DBSnapshotIdentifier=
DBUser=<dbrootuser>

Restart the instance:
eb start

Starting application ".<my-app>".
Waiting for environment "<my-app>-env" to launch.
2014-07-17 17:53:15 INFO    createEnvironment is starting.
2014-07-17 17:53:21 INFO    Using elasticbeanstalk-us-east-1-xxxxxxx as Amazon S3 storage bucket for environment data.
2014-07-17 17:53:52 INFO    Created EIP: nn.nnn.nnn.nnn
2014-07-17 17:53:58 INFO    Created security group named: awseb-e-xxx
2014-07-17 17:54:10 INFO    Creating RDS database named: <db name>. This may take a few minutes.
2014-07-17 18:06:09 INFO    Created RDS database named: <db name>
2014-07-17 18:07:07 INFO    Waiting for EC2 instances to launch. This may take a few minutes.

Check the status. Once it gets green, you'll now have a postgres database.
eb status --verbose

URL         : <my-app>-env-xxxxx.elasticbeanstalk.com
Status      : Ready
Health      : Green

RDS Database: YYYYDatabase | <db name>.zzzzzz.us-east-1.rds.amazonaws.com:5432
Database Engine:    postgres 9.3.3
Allocated Storage:  10
Instance Class:     db.t1.micro
Multi AZ:           False
Master Username:    <dbrootuser>
Creation Time:      2014-07-17 18:02:28
DB Instance Status: available

Answer: You can set your custom postgres database running anywhere and make your rails application to use it from your database.yml file settings.
For e.g.
You can get a hosted postgres instance on Heroku Postgres - it gives very nicely formatted configuration details for ActiveRecord. You just have to get them in your database.yml file.