Currently I am able to connect to a SQL server, fetch data through the tables and export the results in a .xlsx file, but I am able to export only one set of results instead of the two set of results that SQL displays in Microsoft SQL Server.   This is the set of results that I receive from SQL.    This is my Python code that I use to connect to the database, extract results and save them in an Excel file.  from openpyxl import Workbook from datetime import timedelta, date import pypyodbc  def extract_from_databases():      # declare cursors for the rows of the .xlsx file     # in openpyxl, you start counting from row 1 and row 1 contains the headers     row_main_file = 2      #set the start date of yesterday     start_date = date.today() - timedelta(days=1)      # declare the SPs     retrieve_values = "[MSA].[CSchema].[DEV_N2G_GetData_ResultsExport] @start_date='{start_date:%Y-%m-%d}'".format(     start_date=start_date)      #connect to the database     database_connection = pypyodbc.connect(driver="{SQL Server}",     server="10.xxx.xxx.xxx", uid="xxxx", pwd="xxxxx", Trusted_Connection="No")       #declare main cursor in SQL     main_cursor = main_connection.cursor()      print("The execution of SPs is in process")     main_cursor.execute(retrieve_values)     main_cursor_results = main_cursor.fetchall()      c_wb = Workbook()     c_s =  c_wb.active     c_s.title = "Data Sheet 1"     c_s['A1'] = "Date"     c_s['B1'] = 'hour'     c_s['C1'] = 'CName'     c_s['D1'] = 'SName'     c_s['E1'] = 'SCname'     c_s['F1'] = 'CS_I'     c_s['G1'] = 'CS_D'     c_s['H1'] = 'PS_I'     c_s['I1'] = 'PS_D'      for index, value in enumerate(main_cursor_results):         try:             # extract from the tuple 'results' the value of each item and store it in every column for all rows             c_s.cell(row=row_main_file, column=1).value = value[0]             c_s.cell(row=row_main_file, column=2).value = value[1]             c_s.cell(row=row_main_file, column=3).value = value[2]             c_s.cell(row=row_main_file, column=4).value = value[3]             c_s.cell(row=row_main_file, column=5).value = value[4]             c_s.cell(row=row_main_file, column=6).value = value[5]             c_s.cell(row=row_main_file, column=7).value = value[6]             c_s.cell(row=row_main_file, column=8).value = value[7]         except:             print("Error in line %s\n data=%s" % (index, value))         row_main_file = row_main_file + 1     c_wb.save("C:\\Users\\xxx\\outputs\\Workbooks\\export_results.xlsx")     print("The writing process for the values.")     colombia_cursor.close()   How can I export the two sets of results from SQL in two worksheets?
I'm using python\pyodbc and would like to access the second result set of a stored procedure. As near as I can tell, pyodbc does not support multiple result sets. Additionally, I can't modify the stored procedure. Are there any options to access the second result set using SQL or some other work-around? Perhaps create a second stored procedure that only returns the second result set of the first?
Is my mobile AMD card being used? Can $\sqrt{n} + \sqrt{m}$ be rational if neither $n,m$ are perfect squares? Can the expression $\sqrt{n} + \sqrt{m}$ be rational if neither $n,m \in \mathbb{N}$ are perfect squares? It doesn't seem likely, the only way that could happen is if for example $\sqrt{m} = a-\sqrt{n}, \ \ a \in \mathbb{Q}$, which I don't think is possible, but how to show it? How do I speed up my design work? I've been a designer for 6 months, having previously had a 1st class honours degree in Graphic Communication. My issue is that I am a Very good designer, but I work too slow. It's beginning to drive a rift between myself and the creative director who desperately wants me to work quicker. I've always been a workaholic even in university, I put in 110% all the time, really work my ass off, but I'm still not fast enough to complete projects quickly, my work is good, but it's not efficient.  Do you guys have any tips to help me speed up? How to typeset a file path? rent a car, rent out a car, hire a car English not my native language. I'm trying to understand what would be correct in British English.  If I want to use a car for some time. I can say, "I want to rent a car". But from my knowledge there may be a  misunderstanding. I can say the same words if I want to give a car to someone to use for some time and I want to receive payment.  So what would be correct and not misunderstanding?   1) I want to use a car for some time = "I want to hire a car" 2) I want to give a car to someone to use for some time = "rent out a car"   Is my understanding correct? Within 300 km of Tokyo: Where for flora, landscape, nature? I plan to visit Japan for 10 days and apportion 5 days to Tokyo. For the remainder, I want to escape the megalopolis and enjoy picturesque backwoods or countryside. Please recommend? Criteria:   No dangerous animals or untamed boondocks. No  or snakes. I won't drive, and must rely on public transport and walking less than 5 km in total.  No shrines, temples or any religious edifice. OPTIONAL: I fancy  , the more  the better.   This instantiates, doesn't duplicate, . Array#each vs. Array#map According to the , when a Shinigami dies, their remaining lifespan is given to the human they saved.     Shinigami who die are reduced to dust, and their remaining lifespan is given to the human they saved.   Since Rem killed L and Watari, she gained their remaining lifespans. Additionally she probably still had some lifespan left. On top of that Misa was already given a lot of lifespan from Gelus (from which she lost 75% again). So does this mean all of this lifespan is transferred to Misa Amane?!  Yet according to her , she dies in 2011 at the age of 26, only seven years after Rem died.  Does this mean that humans are also capable of reducing their own lifespans? Or would the author have made a mistake by letting Misa die as early as she has? I know she lost 75% of her remaining lifespan through the two eye deals, but you'd think that the cumulation of L, Watari and Rem's remaining lifespans would be greater than just one year, wouldn't you? My group of 8 level 3 players are about to run through the Thundertree Ruins and will probably have a hand at fighting the dragon. My question stems from the fact that a single poison breath attack from the dragon will outright kill all but 1 player assuming they fail their saving throws.  I understand this encounter is supposed to be ridiculously deadly, but I don't want to be punishing my players for testing the lengths at which they can fight stuff. A fight should be challenging and they should be able to try and run away, but instant obliteration seems a bit much.  All PCs are level 3 (HP in parenthesis):   Wood elf moon druid  (27) dwarven frenzy barbarian (44) fire genasi archer ranger (37) (pseudodragon companion (12)) wood elf assassin rogue (27) human wild magic sorcerer (22) dragonborn fighter (29) human monk (24) human fighter (32) Zooming to WMS layer after CQL filter in OpenLayers? I created a layer that contains points and I added it to a map as WMS layer in OpenLayers. I did a CQL filter and it works but I'd like to zoom to the selected point when I worked with getextent or getdataextent it doesn't zoom to the right place. It missed with a few Km. Here is my the code of filter:   function filterNom(){             var filterType ="cql";             var filter = document.getElementById('batima').value;             // by default, reset all filters             var filterParams = {cql_filter: null};             if (OpenLayers.String.trim(filter) != "") {                 if (filterType == "cql")                      filterParams["cql_filter"] = "batiment='"+filter+"'";              }             // merge the new filter definitions             wfs_layer.mergeNewParams(filterParams);             var bounds =  new OpenLayers.Bounds             bounds = wfs_layer.getExtent()             map.setCenter(wfs_layer.getExtent(),18);             var center = map.getCenter();             center.transform(new OpenLayers.Projection("EPSG:4326"), new OpenLayers.Projection("EPSG:900913"));             alert(center.toString()); }   and here is the code to add the WMS layer:    wfs_layer = new OpenLayers.Layer.WMS("Patrimoines",         "http:// localhost/geoserver/cite/wms",          {layers: 'cite:patrimoine' , transparent: true },         {isBaseLayer: false, opacity: 1, singleTile: true, visibility: true,          projection: 'EPSG:900913'}); How do I install a different Python version using apt-get? Electric fields in continuous charge distribution My question may be very basic, but I can't think of a reasonable explanation for this.  Consider a solid charged sphere. Now, we have an electric field inside the solid sphere, but at any particular point there are charges infinitesimally close to the point. As I see it, these charges should contribute to an infinite value of the electric field.  One might possibly argue that at any given point, infinitely-close charges are distributed uniformly everywhere and hence their effects cancel out. But at the surface of the sphere the uniformity of infinitely-close charges is not present and hence here we must have infinite field, but that is not the case as well! Where are we going wrong?  Also, if we think of electric field at that point in continuous charge distribution, the contribution of electric field might exist finitely from nearby charges with both charge and distance between them tending to zero, but for the very small charge present exactly there, the electric field contribution from itself must be infinite with charge being finitely small and distance being exactly 0. What's wrong here?  I have strong suspicions, is it sensible and correct to define electric fields at such a close vicinity of other continuous charges? Using Windows 10, I can't run certain commands from PowerShell but they all work correctly using cmd. PowerShell: node --version: node : The term 'node' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + node --version + ~~~~     + CategoryInfo          : ObjectNotFound: (node:String) [], CommandNotFoundException     + FullyQualifiedErrorId : CommandNotFoundException  node.exe --version: no output. node.exe: opens a new black console (node.exe application itself). Get-Host | Select-Object Version: Version ------- 5.1.19041.906  Get-Command node: The term 'node' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + Get-Command node + ~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (node:String) [Get-Command], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException,Microsoft.PowerShell.Commands.GetCommandCommand Get-Command node.exe: CommandType Name Version Source ----------- ---- ------- ------ Application node.exe 14.16.1.0 C:\Program Files\nodejs\node.exe $env:Path output has nodejs &amp; git &amp; other paths. cmd: everything works fine with any command. I have git and nodejs in my PATH env variable. What's wrong with PowerShell, what a strange behavior is this and how to fix it? Is editing sources.list a good idea? This doubt is hitting me since 2-3 days, so I decided to test it myself. What I did is I installed Ubuntu 16.04.4 in VMWare and edited /etc/apt/sources.list and replaced xenial with bionic using:  sudo sed -i 's/xenial/bionic/g' /etc/apt/sources.list   Then I ran  sudo apt-get update &amp;&amp; sudo apt-get upgrade    I was able to upgrade to 18.04, confirmed by using lsb_release -a. However, I encountered some problems like:   apt does not have a stable CLI interface. Use with caution in scripts. unmet dependency of  python3-aptdaemon.pkcompat Release 'bionic-backports' for 'appstream' not found Broken Unity   I solved all the errors and installed gnome and gdm3.   So, I just want to know is it a good idea to edit sources.list? I know that my system might broke but is there any other specific reason not to use this.  Note: I tested this on Ubuntu 16.04 in VMWare to clear my doubts only. Is it possible to build a single mysql query (without variables) to remove all records from the table, except latest N (sorted by id desc)?  Something like this, only it doesn't work :)  delete from table order by id ASC limit ((select count(*) from table ) - N)   Thanks. How to do selective-color in Photoshop? How to make the single color in a photography to be color and other parts changed to B&amp;W?.  Don't know exactly the name of the effect, to be more clear in the following photo I want the green part to be green and other parts( leg and sandal) in B&amp;W..    How to achieve that effect in Photoshop? Using sObject.get() to fetch a field value from a related parent object I have a contact in a generic sObject in apex and while I'm able to easily get detail field values using   sObject.get('MyContactField__c')  I'm not able to get fields off the related parent object, and I'm sure the related field is in memory, based on the debug logs. This returns a runtime error:  sObject.get('Account.MyAccountField__c')  with the error     Invalid field Account.MyAccountField__c' for Contact   How do I get a field value off of a parent on a generic sObject? Why don't applications update by calculating difference? A Jamaican committed marriage fraud about 30 years ago by marrying a US citizen in a marriage where the groom was paid a certain amount of money to marry her. The groom got in legal trouble for an unrelated matter, and the marriage fraud was discovered and the family friend was deported back to Jamaica. She no longer has any paperwork involved with the deportation and she can’t remember any of the details. I do not know if she simply agreed to return to Jamica when the fraud was discovered, or if she made any attempts to mount any type of legal defense in the case. I do know that she was cooperative with the immigration authorities and that they did not have to come looking for her. She would like to come the USA for a two-week visit. The main purpose of the visit is for her to visit a friend (US citizen) who is terminally ill.  I have been looking at 8 U.S.C. 1182 and from my reading of it, it would seem that she would not be admissible to the US because of the previous immigration fraud. My understanding is based on the section that says:     In general.-Any alien who, by fraud or willfully misrepresenting a material fact, seeks to procure (or has sought to procure or has procured) a visa, other documentation, or admission into the United States or other benefit provided under this Act is inadmissible.   What’s not clear to me is if this means that she would be inadmissible permanently or if this would be subject to the 10 year limit.  Can anyone help provide some clarity on this?  If the ban is not permanent are there any tips to being able to increase her chances of being able to get a visa.  She intends to honestly answer all questions during her application process for a visa. Calculating square roots using the recurrence $x_{n+1} = \frac12 \left(x_n + \frac2{x_n}\right)$ Let $x_1 = 2$, and define $$x_{n+1} = \frac{1}{2} \left(x_n + \frac{2}{x_n}\right).$$ Show that $x_n^2$ is always greater than or equal to $2$, and then use this to prove that $x_n − x_{n+1} ≥ 0$. Conclude that $\lim x_n = \sqrt2$.   My question:  So I know how to do this problem but I don't know how to prove that $x_n &gt;0$ for all $n\in \mathbb{N}$.