Categories
Mastering Development

number of rows return different in mysql

For query first i make the aggregated table,pre-processing table like using below query query no. 1 DROP VIEW IF EXISTS aggregated; CREATE VIEW aggregated as SELECT `date`, district, town, locality, vendor, freq_kind, bandwidth, circle_id, SUM(data_total), SUM(capacity), CASE WHEN (SUM(IFNULL(data_total,0))/SUM(IFNULL(capacity,0))) * 100 < 50 THEN 1 ELSE 0 END AS productivity FROM ( SELECT circle_id, `date`, […]

Categories
Mastering Development

how to make aggregate table on week on week month on moth

i have latest version of mysql .i used to store data on daily based to store big data around 15,00,000 rows in a table. column name like date,circle_id,district,town,locality,vendor,type,x1,x2,x3,x4 i need to filter sum of x1 and x2 for the particular date and also i need to calculate the avg on week on week ,month of […]

Categories
Linux Mastering Development

Bluetooth keeps changing from A2dp to headset and loses connection on Debian Buster with JBL 4 Speaker

since over a year I am having trouble with the bluetooth connection to my JBL 4 speaker. It looses connection again and again. I created a script according to what I found on the internet to reconnect via keyboard short cut. Sometimes it is connected with it within a view seconds sometimes I had to […]

Categories
Development

NHibernate Parent and Child Tables have different number of keys in their composite

I’m struggling a bit with an NHibernate mapping within a console app. Here is the summary: It’s a one to many relationship. PARENT_TABLE (one) to CHILD_TABLE (many) PARENT_TABLE has a composite key consisting of two keys: Vendor and Invoice Id(x => x.Invoice).Column(“INVOICE”); References(x => x.Distribution).Column(“INVOICE”); CHILD_TABLE has a composite key consisting of three: Vendor, Invoice, […]

Categories
Development

Inserting csv into MySQL database with python library mysql.connector

I have trouble with insert of csv data into MySQL tabel with mysql.connector . The code I use looks like this : import mysql.connector import csv andreport = ‘testowa.csv’ cnx = mysql.connector.connect( user=’xxxxx’, password=’xxxxx’, host=’xxxxxx’, database=’xxxxx’) cursor = cnx.cursor() with open(andreport, ‘r’) as csv_data: for row in csv_data: cursor.execute( “INSERT INTO flex(date, Store, Vendor, Shelf)” […]

Categories
Development

Formset Factory Make Fields Required

I am using a modelformset_factory in Django to have a user fill out an unknown number of fields. I have made the fields required but in the HTML rendering Django does not add required to the HTML element, looking around online this seems to be a common issue but I have not seen any valid […]

Categories
Development JSON

i need to get data from json but

i have an API that return data type of _HttpClientResponse cause i am using httpClient, i decode the result to string using the below var reply = await memoryResponse.transform(utf8.decoder).join(); when i print the result I/flutter (23708): String I/flutter (23708): {“results”: [{“IPAddress”:”192.1.1.1″,”Description”:”Windows 2016 Server”}, {“IPAddress”:”192.1.1.1″,”Description”:”Windows 2016 Server”},{“IPAddress”:”192.1.1.1″,”Description”:”Windows 2016 Server”}]} then decode it with json.decod var memJasonData […]