I am reading a date column in a postgresql DB. I would like to convert it from below reading into YYYY-MM-DD (this is how it is entered into the DB originally). What is the best approach to do this?  Code:  dataReading = cursor.fetchall() print(dataReading[1])   Output:  (datetime.date(2016, 1, 5),)
This is my code:  import datetime today = datetime.date.today() print(today)   This prints: 2008-11-22 which is exactly what I want.  But, I have a list I'm appending this to and then suddenly everything goes "wonky". Here is the code:  import datetime mylist = [] today = datetime.date.today() mylist.append(today) print(mylist)   This prints the following:   [datetime.date(2008, 11, 22)]   How can I get just a simple date like 2008-11-22?
Determine the Galois group of $\mathbb{Q}(\sqrt{a+b\sqrt{d}})$ Seeking Mobile Data collection software recommendations? An alternative to translation for non-English speakers? I am getting these warnings every time I update my initramfs image(-s) with  on my Dell PowerEdge T20 server running    10.0. Is there a fix?    W: Possible missing firmware /lib/firmware/i915/bxt_dmc_ver1_07.bin for module i915 W: Possible missing firmware /lib/firmware/i915/skl_dmc_ver1_27.bin for module i915 W: Possible missing firmware /lib/firmware/i915/kbl_dmc_ver1_04.bin for module i915 W: Possible missing firmware /lib/firmware/i915/cnl_dmc_ver1_07.bin for module i915 W: Possible missing firmware /lib/firmware/i915/glk_dmc_ver1_04.bin for module i915 W: Possible missing firmware /lib/firmware/i915/kbl_guc_ver9_39.bin for module i915 W: Possible missing firmware /lib/firmware/i915/bxt_guc_ver9_29.bin for module i915 W: Possible missing firmware /lib/firmware/i915/skl_guc_ver9_33.bin for module i915 W: Possible missing firmware /lib/firmware/i915/kbl_huc_ver02_00_1810.bin for module i915 W: Possible missing firmware /lib/firmware/i915/bxt_huc_ver01_07_1398.bin for module i915 W: Possible missing firmware /lib/firmware/i915/skl_huc_ver01_07_1398.bin for module i915 Is there an easier way to install Chromium than what is described ?  Furthermore, is there an easier way to stay up to date with current Chromium releases rather than having to re-build Chromium each release? (a script which automatically grabs and installs the latest build possibly?).  Related: I have recently been reading a lot on this site (@Aniko, @Dikran Marsupial, @Erik) and elsewhere about the problem of overfitting occuring with cross validation - (Smialowski et al 2010 Bioinformatics, Hastie, Elements of statistical learning).  The suggestion is that any supervised feature selection (using correlation with class labels) performed outside of the model performance estimation using cross validation (or other model estimating method such as bootstrapping) may result in overfitting.   This seems unintuitive to me - surely if you select a feature set and then evaluate your model using only the selected features using cross validation, then you are getting an unbiased estimate of generalized model performance on those features (this assumes the sample under study are representive of the populatation)?  With this procedure one cannot of course claim an optimal feature set but can one report the performance of the selected feature set on unseen data as valid?  I accept that selecting features based on the entire data set may resuts in some data leakage between test and train sets. But if the feature set is static after initial selection, and no other tuning is being done, surely it is valid to report the cross-validated performance metrics?   In my case I have 56 features and 259 cases and so #cases > #features. The features are derived from sensor data.  Apologies if my question seems derivative but this seems an important point to clarify.  Edit: On implementing feature selection within cross validation on the data set detailed above (thanks to the answers below), I can confirm that selecting features prior to cross-validation in this data set introduced a significant bias. This bias/overfitting was greatest when doing so for a 3-class formulation, compared to as 2-class formulation.  I think the fact that I used stepwise regression for feature selection increased this overfitting; for comparison purposes, on a different but related data set I compared a sequential forward feature selection routine performed prior to cross-validation against results I had previously obtained with feature selection within CV. The results between both methods did not differ dramatically. This may mean that stepwise regression is more prone to overfitting than sequential FS or may be a quirk of this data set. Proving that an additive function $f$ is continuous if it is continuous at a single point Suppose that $f$ is continuous at $x_0$ and $f$ satisfies $f(x)+f(y)=f(x+y)$. Then how can we prove that $f$ is continuous at $x$ for all $x$? I seems to have problem doing anything with it. Thanks in advance. Basic circuit to keep LED either on or off depending on night/day How can I have a LED either on or off (not in between) depending on night or day with basic electronics? I have created the circuit below, but it only shines and in darkness it dims.    The photo-resistor is about 3kΩ when light shines and about 1MΩ when dark.  I want my LED to shine at night and be off at day.  What is the simplest way I can achieve this? I would like to know if anyone can help me with installing Ubuntu on VirtualBox Running "sudo apt-get update" returns connection errors After installing Ubuntu 18.04 from the Windows store I open Bash and want to run sudo apt-get update, but this returns the following errors:  Err:1 http://security.ubuntu.com/ubuntu bionic-security InRelease   Connection failed [IP: 91.189.91.26 80] Err:2 http://archive.ubuntu.com/ubuntu bionic InRelease   Connection failed [IP: 91.189.88.162 80] Err:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease   Connection failed [IP: 91.189.88.161 80] Err:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease   Connection failed [IP: 91.189.88.162 80] Reading package lists... Done W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic/InRelease  Connection failed [IP: 91.189.88.162 80] W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease  Connection failed [IP: 91.189.88.161 80] W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease  Connection failed [IP: 91.189.88.162 80] W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease  Connection failed [IP: 91.189.91.26 80] W: Some index files failed to download. They have been ignored, or old ones used instead.   When I open 91.189.91.26 in a browser, it shows the site without a problem.  Previously this worked without any problem, but I did a clean reinstall of Windows and now it doesn't work anymore. It seems some firewall or proxy issue, but I tried with the firewall disabled and I got the same result.  Any idea why this is happening? Maybe it is a 18.04 issue? If so, is it possible to return to 16.04 on Windows 10? Becasue I don't see a uninstall option. Among any three consecutive positive integers one is a multiple of 3 How to install packages in ubuntu without internet connection? Review Queues and Ignored Tags Steps to Recreate:   Have enough rep to use some of the review queues. Ignore a popular tag. Go to your profile-> prefs-> check 'hide ignored tags'. Open a review queue.   You will get questions from your ignored tag(s) in the review queue.  Personally, I ignored a tag on Movies.SE (and Scifi.SE) for a film that is out elsewhere in the world, but not locally.  It's a simple way to avoid being exposed to spoilers.  I then load up the First Posts review queue on Movies.SE, and I get an answer to a question about the end of the film.  Can the review queues be altered to skip posts on your ignored tags when you have the 'hide ignored tags' option enabled? I was about to reconfigure some of my code to use the newer Schema.describeSObjects(types) method that I had heard was faster than using a globalDescribe.   I made some code to quickly check this and I was dismayed to find that the newer technique is not only not faster, it's about twice as slow as using a global describe. Here's the code I used :  New DescribeSObjects() method  //each block was run separately for timing purposes String obj = 'Account'; String[] types = new String[]{obj}; System.debug('START DESCRIBE SOBJECTS');  for (Integer i = 0; i &lt; 50; i++) {   List&lt;Schema.DescribeSobjectResult&gt; results = Schema.describeSObjects(types);  } System.debug('FINISH DESCRIBE SOBJECTS');   Old getGlobalDescribe() method  String obj1 = 'Account'; System.debug('START DESCRIBE GLOBAL');  for (Integer i = 0; i &lt; 50; i++) {    Map&lt;String,Schema.SObjectType&gt; gd = Schema.getGlobalDescribe();    Schema.SObjectType sobjType = gd.get(obj1);    Schema.DescribeSObjectResult describeResult = sobjType.getDescribe();  } System.debug('FINISH DESCRIBE GLOBAL');   Over 5 runs of each, the getGlobalDescribe() method took an average of 337ms for 50 describes and the describeSObjects() method took and average of 658ms. This is basically twice as long.  Does anyone have any insight as to why this would be? Any improvements that will significantly improve the accuracy of the resulting data?  As this data stands, I'm sticking with the old method.  One final note: the old technique uses 3 times a much heap (67kb vs 27kb) How to detect true Windows version? What is Elrond's position/status, as compared to Galadriel's? In the Lord of the Rings books, Galadriel of Lorien is even more exalted than in the movies.  She is essentially a queen, and the deference shown to her far exceeds that shown to Elrond of Rivendell.  Yet in the films, we see her trying to persuade Elrond to intervene in the battle of Helm's Deep by sending Elf troops to reinforce Theoden's forces.  Eventually, Elrond relents, and orders the Elves into battle.  But the troops in question are Galadriel's, not Elrond's - they are led by Haldir, one of Galadriel's guards; the trip from Rivendell to Helm's Deep (500 miles as the crow flies) is about 2 times longer than the trip from Lorien to Helm's Deep (250 miles as the crow flies), far too long for the reinforcements to arrive in time.  But then Haldir greets Theoden of Rohan by saying he has come bearing a message from Elrond - not Galadriel.     I bring word from Lord Elrond of Rivendell. An Alliance once existed between Elves and Men. Long ago we fought and died together. We come to honor that allegiance.    This seems odd for a few reasons. The troops are Galadriel's, not Elrond's, and they come from Lorien, not Rivendell. She clearly wanted to send them to Helm's Deep - she was cajoling, prodding, and guilt-tripping him into doing just that.  She is also a queen, and could presumably order them into battle regardless of what Elrond says.    So why does she have to talk Elrond into letting her send her own troops into battle, especially when he is too far away to contribute manpower (elfpower) or materiel to the battle of Helm's Deep?  Why not say, "I'm not going to sit here doing nothing while Saruman runs roughshod over Rohan;  you can support me or not, Elrond, but if you aren't willing to help, you can at least get the hell out of the way"?  Why does her aide Haldir "bring word from Elrond" when the troops - and the impetus for sending them - came from Galadriel, and Elrond resisted sending them out for as long as he could?  And again, what is Elrond's official position/status/rank, and why would a queen need his permission to deploy her own troops? What's the projective limit of these polynomial rings ? Define an inverse system of polynomial rings over a commutative ring $k$ by the canonical projection $k[x_1,...,x_n] \to k[x_1,...,x_m]\;(m&lt; n)$.   Question: What is the projective limit $\varprojlim_n k[x_1,...,x_n]$ ? Order of "not" with infinitive This is one thing that keeps bugging me, and maybe there's a direct answer. Grammatically, which one is more correct of these two?  Does it make a difference?  I tried not to do that. I tried to not do that. How do I check if an object has a key in JavaScript? Which is the right thing to do?  if (myObj['key'] == undefined)   or  if (myObj['key'] == null)   or  if (myObj['key']) How to change the theme of Snap Apps? I am enjoying the new "snap" applications, but apps installed using this method doesn't seem to be using the system gtk theme I have set.   Some use Adwaita or worse, Raleigh.   How can I have them use the standard Ambience theme I'm using across the whole system?