Categories
Database Development

How to distribution count between rows SQL Server

Unequal division = distribution How to retrieve output with example : CREATE TABLE yourTable ( id varchar(55), code int, count1 int, count2 int ); INSERT INTO yourTable (id, code,count1,count2) VALUES (‘no-29’, 12345, 4, 1), (‘no-29’, 32346, 4, 1) always count1-count2 and results distribution between others rows with same id: example : 4-1 = 3 and […]

Categories
User Help

Using NPP, is there a method to numerically sort values separated by commas (single column)?

I have a large JSON csv file of values (one column). In order to remove duplicates, I need to first Replace All CRs then use TextFX Sort Lines function, then Replace All the CRs with commas (such that the JSON file is back in good order). Is there a NPP plugin or NPP method I […]

Categories
Mastering Development

XSLT gourping and sum

Hi Below is the input xml, <Data> <Entry> <Employee>12345</Employee> <Time_Blocks> <Calculation_Tags Descriptor="Afternoon Shift Allowance"> <ID type="Time_Calculation_Tag_ID">TIME_CALCULATION_TAG-6-102</ID> </Calculation_Tags> <Calculation_Tags Descriptor="Working Hours"> <ID type="Time_Calculation_Tag_ID">TIME_CALCULATION_TAG-6-90</ID> </Calculation_Tags> <Quantity>8</Quantity> </Time_Blocks> <Time_Blocks> <Calculation_Tags Descriptor="Afternoon Shift Allowance"> <ID type="Time_Calculation_Tag_ID">TIME_CALCULATION_TAG-6-102</ID> </Calculation_Tags> <Calculation_Tags Descriptor="Working Hours"> <ID type="Time_Calculation_Tag_ID">TIME_CALCULATION_TAG-6-90</ID> </Calculation_Tags> <Quantity>4</Quantity> </Time_Blocks> <Time_Blocks> <Calculation_Tags Descriptor="Food Allowance"> <ID type="Time_Calculation_Tag_ID">TIME_CALCULATION_TAG-6-102</ID> </Calculation_Tags> <Quantity>4</Quantity> </Time_Blocks> </Entry> </Data> Current output: 12345;Afternoon […]

Categories
Mastering Development

Android JsonArrayRequest GET method is populating my ArrayList asyncronously

I’m trying to fetch Zones from my database in android studio. I have checked the API using Postman, so my get_zones API works just fine. However, in Android, I’m calling this method in onCreateView() since this is a fragment. And in some mysterious way, the output would be like: 1,12,123,1234,12345,123456… Instead of: 1,2,3,4,5,6 I have […]

Categories
Mastering Development

How to call stored proc in DB2 with Array as input parameters

I am having scenario where I have to call my stored proc in DB2 database. This stored proc requires input parameters as ARRAY. So can you please let me know how can I call this? I tried with all different options but it’s not working and throwing error in SQL query. "call storeproc(ARRAY[123,133])" "call storeproc([123,133])" […]

Categories
Mastering Development

Binary Search, JavaScript

What i’m doing wrong? I need to use binary search to find the value of the isbn, using sorting function and after display finding book. var bookList=[]; //create the Book constructor function Books(title,isbn, price){ var obj = this; this.title = title; this.isbn = isbn; this.price = price.toFixed(2); } //instantiate new books var book1 = new […]

Categories
Mastering Development

Python get html element by Xpath

I try to get an HTML Element by the XPath, I tried it this way but it always returns an empty String. Can anybody tell me, how I get the Element by its X-Path ? for x in list_href_einrichtungen: url = ‘https://pflegefinder.bkk-dachverband.de/’ + x source_code = requests.get(url) plain_text = source_code.text soup = BeautifulSoup(plain_text) **doc = […]

Categories
Mastering Development

How can I implement a custom AuthentificationManager class for Firebase Auth?

I am trying to code a class that manages authentification for an app. The problem is, when I try to register a new user, it doesn’t register it in the firebase console, therefore, the current user is null. Here is the code public void registerNewUser(String email, final String username, String password, String confirmPassword) { if(password.equals(confirmPassword)) […]

Categories
Mastering Development

Bidirectional entity relationship saves id null using Spring

I’m learning about Spring boot with JpaRepository and I’m stagnant with this problem. I’m triying to save a list of objects but they save with id null of all objects in the bidirectional relationship, I saw a lot of examples and all it worked ok, even I have another project with the same example but […]

Categories
Development

Must declare the scalar variable “@qty”

How do I get the quantity value from table BatchQuantity into @qty? This is the query: I have marked in the query where the focus is. DECLARE @batchID INT DECLARE @qty int INSERT Batch(number,productID, recievedDate) SELECT ‘123A’, 12345, GETDATE() SELECT @batchID = scope_Identity() INSERT BatchQuantity(batchID, quantity, issued, writtenoff) OUTPUT INSERTED.QUANTITY into @qty ——- MY MAIN […]