Skip to content

Instantly share code, notes, and snippets.

View srinathperera's full-sized avatar

Srinath Perera srinathperera

View GitHub Profile
@srinathperera
srinathperera / gist:a8ea5c33e4c091f5a4fd6ec22ff6d8d1
Created March 6, 2023 01:41
ChatGPT on Growing Cinnamon in Rathnapura
We are considering growing cinammon in Kalawana, Ratnapura area in Sri Lanka. Use six hat methods to analyze this. Ratnapura's climate is classified as tropical. The rainfall in Ratnapura is significant, with precipitation even during the driest month. The climate here is classified as Af by the Köppen-Geiger system. The average annual temperature in Ratnapura is 24.3 °C | 75.7 °F. The rainfall here is around 4460 mm | 175.6 inch per year. The Ratnapura is situated close to the equator, making summers difficult to define.
Sure, let's use the Six Thinking Hats method to analyze growing cinnamon in Kalawana, Ratnapura area in Sri Lanka.
White Hat:
Looking at the information provided, Ratnapura seems to have a suitable climate for growing cinnamon. The average annual temperature is warm enough, and the rainfall is sufficient. Also, cinnamon is a tropical plant, so the Af classification of the climate seems to be a good fit.
Red Hat:
However, it's important to consider the potential challenges of growing cinn
Q - write a code for a service in ballerina to add two integers x and y and return the result
Answer:
import ballerina/http;
// define the service
service /add {
// define the resource and the method it responds to
resource function add(http:Request request, http:Response response) {
// parse the query parameters "x" and "y"
import json
import pandas as pd
import re
def load_ballerina_docs(file_name):
with open(file_name) as json_file:
data = json.load(json_file)
rows = data["contentIndex"]
def adjust_predictions4nighbourhood(y_test, predict_test):
slack = 5
y_test = y_test.values
length = len(y_test)
adjusted_forecasts = np.copy(predict_test)
for i in range(length):
if y_test[i] == predict_test[i]:
adjusted_forecasts[i] = predict_test[i]
elif predict_test[i] == 1: #FP
if np.sum(y_test[i-slack:i+slack]) > 0:

X-ray: Automating Root-Cause Diagnosis of Performance Anomalies in Production Software

Numerous studies have reported that configuration and similar human errors are the largest source of errors in deployed systems [10, 11, 24, 25, 30, 32, 34, 58],

profilers - what, root cause - why

What

X-ray currently supports four metrics: execution latency, CPU utilization, file system usage, and network use ( user can choose one to analysis)

from every a1 = PizzaOder
-> a2 = PizzaOder[custid=a1.custid]
insert into ReturningCustomers
a1.custid as custid a2.ts as ts
from every a1 = PizzaOder -> a2 = PizzaOder[custid=a1.custid]
insert into ReturningCustomers
a1.custid as custid a2.ts as ts
from a1 = PizzaOder,
PizzaOder[custid!=a1.custid]*,
a2 = PizzaOder[custid=a1.custid]
insert into ReturningCustomers
a1.custid as custid a2.ts as ts
select from PizzaOrders[price <= 20 and distance>1km]
insert into NBNOrders id, price, distance
select from PizzaOrders[price <= 20 and distance>1km]
insert into NBNOrders id, price, distance