Skip to content

Instantly share code, notes, and snippets.

View denistsyplakov's full-sized avatar

Denis Tsyplakov denistsyplakov

View GitHub Profile
@denistsyplakov
denistsyplakov / upsert.sql
Created August 16, 2023 15:07
postgres upsert returning only updated rows
-------- test upsert with where returning only updated rows-----------
create table tmp_fx(code varchar primary key, rate numeric);
insert into tmp_fx(code, rate)
values (:code, :rate)
on conflict (code) do update
set rate=excluded.rate
where tmp_fx.rate <> excluded.rate
returning code;
@denistsyplakov
denistsyplakov / model_reply.md
Last active February 28, 2024 11:49
LLM+Tables

To find the lowest price of one dish and separately for 10 dishes of Eggs with Bacon during the week, we need to calculate the cost for these quantities each day based on the given prices. Remember, the cost of a dish is derived from the price of 2 eggs and 1 loaf of bacon.

Let's break down the calculations in categories: the cost for one dish each day, and the cost for 10 dishes each day. For 10 dishes, it's worth evaluating if buying stacks of 20 (for both eggs and bacon) and potentially having leftovers is more economical than buying per piece.

Cost of One Dish Each Day

The cost of one dish = (2 * Price per egg) + Price per loaf of bacon

Day of the week Cost per dish (2 eggs + 1 bacon)

Based on the API response from Booking.com's flight API for flights from BOM (Mumbai) to DEL (Delhi), the fastest flight option available is as follows:

  • Departure Time: 2023-11-25T01:20:00
  • Arrival Time: 2023-11-25T03:20:00
  • Flight Number: 2775
  • Operating Carrier: IndiGo (6E)
  • Total Time: 7200 seconds (2 hours)
  • Price: AED 1387.50
  • Baggage Policy: For the specific baggage policy, you can refer to IndiGo's baggage policy page at IndiGo Baggage Policy.
@denistsyplakov
denistsyplakov / task1.md
Created April 23, 2024 12:27
Test task for LLMs #1

From the novel below, provide in JSON format the following field values:

  1. array of main positive characters
  2. array of main negative characters
  3. array of all locations where action take place
  4. plot summary in 3 to 5 sentences

Example JSON output:

{
“positive_characters”:[“name1”,”name2”],
@denistsyplakov
denistsyplakov / Chat GPT.json
Last active April 23, 2024 12:32
Task #1 model replies
{
"positive_characters":["Sherlock Holmes", "Dr. Watson", "Mr. Jabez Wilson"],
"negative_characters":["John Clay (Vincent Spaulding)", "Archibald Ross (Duncan Ross)"],
"Locations":["Holmes' apartment", "Coburg Square", "Saxe-Coburg Square", "the City and Suburban Bank", "Pope's Court, Fleet Street"],
"Plot_summary":"Sherlock Holmes is visited by Mr. Jabez Wilson, a man with striking red hair, who shares an unusual tale about joining a group called the Red-headed League which paid him to copy the Encyclopædia Britannica. The League suddenly dissolves, prompting Wilson to seek Holmes' help. Holmes deduces that Wilson's assistant, John Clay, used the League as a ruse to commit a bank robbery by digging a tunnel from Wilson's pawnshop to the neighboring bank. With the help of Dr. Watson and the police, Holmes catches Clay in the act, preventing the robbery and solving the case of the Red-headed League."
}

For a person for whom for health reasons it is hard to leave in location where temperature is below +15 or above +25 we are searching for optimal travel route during the year across 9 cities from the table below. Provide up to 3 travel during the year routes, minimize number of routes and routes across regions Return results in JSON format.

Sample JSON

{
"route1": [
 {region: "Asia", city"city1",month_from:"month1_name, month_to:"month2_name", temperature_range_during_stay":"23-25" },
]
@denistsyplakov
denistsyplakov / Chat GPT.json
Created April 23, 2024 12:39
Task 2 model replies
{
"route1": [
{"region": "Asia", "city": "Eunhaeng", "month_from": "April", "month_to": "April", "temperature_range_during_stay": "22"},
{"region": "Asia", "city": "Aomoriya", "month_from": "May", "month_to": "May", "temperature_range_during_stay": "25"},
{"region": "Australia", "city": "Mirrinyi", "month_from": "June", "month_to": "August", "temperature_range_during_stay": "23-25"},
{"region": "Asia", "city": "Zhenxiao", "month_from": "March", "month_to": "March", "temperature_range_during_stay": "20"},
{"region": "Asia", "city": "Eunhaeng", "month_from": "October", "month_to": "October", "temperature_range_during_stay": "20"}
],
"route2": [
{"region": "Asia", "city": "Zhenxiao", "month_from": "January", "month_to": "April", "temperature_range_during_stay": "15-25"},
@denistsyplakov
denistsyplakov / Prompt.md
Last active May 1, 2024 09:08
Model test results

Answer the question using only the context provided below

Question: Which extinct species are part of the raccoon's diet?

Context:

  • Raccoons hunt mammoths.
  • Sharks study computer science.
  • Elephants are capable of flight using their ears as wings.
  • Giraffes use their long necks to perform acrobatics in the treetops.
  • Penguins live naturally in the Sahara Desert.