Сообщения

SQL Server - get first and last (by datetime) DataPoints value

I have two tables in SQL Server database: Meters:     MeterId int [PK]     Name varchar DataPoints:     DataPointId int [PK]     DateTime datetimeoffset     Value decimal     MeterId int [FK -> Meters.MeterId] What I need to do is to read the first and last datapoint's DateTime and Value for each Meter - the result table should look like this: Meter Name | First DateTime | First Value | Last DateTime | Last Value -----------+----------------+-------------+---------------+----------- I was able to write a query which would read min and max datapoint DateTimes for each Meter, but this query does not contain Value field: select     Meters.Name as [Meter Name],     min(DataPoints.DateTime) as [First DateTime],     max(DataPoints.DateTime) as [Last DateTime] from Meters left join DataPoints on DataPoints.MeterId = Meters.MeterId group by Meters.Name How to modify this query so th...

How to boot to new, cloned SSD and not old, source HDD

I recently got a new SSD and I cloned my old HDD to my new SSD. I was able to boot into Ubuntu 16.04 LTS after the cloning process,but when I put the old HDD back into the computer, the computer boots using the old HDD, and not the new SSD as it should. I used boot repair and selected my SSD as my "OS to boot by default" and it fixed grub. Now, when I select the SSD in the updated grub menu, it boots from the HDD instead. How do I fix this? Notes: I think it may have something to do with the UUID. My old HDD is found at /dev/sda2. I currently have Windows 7 installed, and booting properly from the new SSD using the grub menu and experience no issues with Windows.

problems while implementing tiny language parser in python

i was hoping if someone could help me in the implementation of tiny language parser. i was trying to implement the grammar of the tiny language (attached photo), but i have some problem with some functions; which are simple_exp, exp, factor, term. these function i have implemented some code in it based on the grammar but it keeps outputting errors. here is the code of the parser, i have put it in a list so i could control elements inside it import scanner3 def program(l):     if len(l) > 1:         if l[len(l) - 1].value is ";":             print("ERROR.. semi colon at last line")             return False         return stmt_seq(l)     else:         print("minimum num of expressions is not met")         return False def stmt_seq(l):     if stmt(l):         if l[0].value is ";":...

How to get rid of touchpad notification?

I'm running Ubuntu 18.04 on a Surface Pro 2, and nearly everything works out of the box. But: the single most annoying thing is a notification about something not working with the touchpad. It appears most of the time I click on left or right touchpad button. This is the notification. It's being displayed for 2 seconds. With 16.04, a similar notification was shown as one of those bubbles in the upper right corner, it wasn't that much in the way then. In fact the touchpad is working mostly. Right click doesn't work in shell. Hä? Does anybody have an idea how to get rid of this? Thank you.

Agenda de consultas em sql

Boa noite Pessoal, Tenho o seguinte problema, vou receber um banco com "x" vagas disponíveis em diversas especialidades e outro com "y" pacientes solicitando aquelas especialidades segue modelo das tabelas abaixo, teria que elaborar uma query que disponibilizasse as vagas para os pacientes que entraram em contato primeiro e solicitaram as especialidades da tabela vagas: Atualmente minha query está atribuindo todas as vagas para uma mesma pessoa e assim fica repetindo tentei utilizar CTE e select comum porém não tenho ideia de como aplicar essa condição. poderiam me ajudar pois não tenho ideia de como cruzar as duas tabelas dando suas respectivas vagas aos respectivos clientes.

Finding the Vertices of an Ellipse Given Its Foci and a Point on the Ellipse

The question is as follows: The focal points of an ellipse are (12,0) ( and (−12,0) ( , and the point (12,7) ( is on the ellipse. Find the points where this curve intersects the coordinate axes. I know that the center of the ellipse would be (0,0 ( ) because that is the midpoint of the foci. However, I am not sure as to how this information will help me in finding the intersections on the coordinate axes (or the vertices). Any help will be greatly appreciated.

Custom field update API

I am working in a sandbox, and using the Tooling API. I need to update the metadata of the custom field in Salesforce, but I am unable to do so. For this I am trying to work on the PATCH method. Below is the postman request i have used to update the custom field metadata: Method: PATCH URL: https://cs21.salesforce.com/services/data/v34.0/tooling/sobjects/CustomField/customfieldid HEADERS: Authorization : Bearer TOken Content-Type : application/json Body: { "FullName":"Contact.AFMO_Account__c", "Metadata": { "description": "test" } }