Categories
Mastering Development

I am having a very strange issue using styled-components. I have a style rule which should be applied to <tr> elements on focus: const TableStyles = styled.table` width: 100%; table-layout: auto; border-collapse: collapse; tr:focus { background-color: #e7f0ff; } `; This rule works for the table rows in the table body but does not work for […]

Categories
Mastering Development

how to make a qsort function and sort array of pointers to structs

i’m trying to make a qsort function from scratch that sorts an array of pointers to structs this is the code i have right now static void swap(int *a, int *b) { int tmp = *a; *a = *b; *b = tmp; } void _qsort(void* list, int list_len, int left, int right, int(*comp)(const struct shpg_item […]

Categories
Mastering Development

Singly linked List Find max,min

**This is a singly linked list and the professor wants me 2 find max min from define limit of singly list list ( similar 2 find array but use singly linked list instead ) however when i want 2 remove the number in singly linked list even if i’m not finish with it it get […]

Categories
Mastering Development

How can Function have instance methods?

MDN says that Function object has instance and prototype properties (e.g. name is an instance property of Function). So I can do this: function testA() { console.log(“testA”); } console.log(testA.name); console.log(Function.name); But how? Function is an object constructor function. The only way to pass proprties to its instances is through .this keyword that saves them to […]

Categories
Mastering Development

recursive binarySearch with array of strings

My function works for the first 4 elements, but returns -1 for 12 and 14..even though there in the array. I’ve tried changing some of the if statements and using .compare but haven’t had any luck. Any ideas? Thanks /** Searches the array anArray[first] through anArray[last] for a given value by using a binary search. […]

Categories
Mastering Development

Unexpected surprise (?) from the updater methods of JDBC ResultSet

We have some data in a MySQL database that we are accessing via JDBC. Depending upon the value read from the database, we wanted to play some “tricks” in the code. I read the documentation on the updater methods of ResultSet and I was heartened to find the following text repeated for all the updateXXX […]

Categories
Mastering Development

Loop not working properly and key output wrong

Ok, I’m going to start showing my code: import requests import json import csv import pandas as pd with open(‘AcoesURLJsonCompleta.csv’, newline=”) as csvfile: urlreader = csv.reader(csvfile, delimiter=’,’) for obj_id in urlreader: headers = {‘user-agent’: ‘Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36’} jsonData = requests.get(row, headers=headers).json() mapper = ( (‘Ticker’, ‘ric’), […]

Categories
Mastering Development

sbt – not able to authenticate with proxy

I am trying to compile my SBT project and stuck on a point. Not sure what I am doing wrong. I am using intelij IDEA and have configured proxy in IDE. It works for all my maven Java project without any issue. However, shows error for sbt. build.sbt import sbt._ val sparkVersion = “2.3.0” val […]

Categories
Linux Mastering Development

check whether the second line is empty

I have a .csv file that contains 3 columns like this: Name,Last,Value pablo,car,20 Is there any way to check whether the second line of this .csv file is empty? Something like this: if second-line-empty; then echo “empty” else echo “not empty” fi In this case, all three fields in the 2nd line should be empty […]

Categories
Mastering Development

how to upload an image in comments?

i have a small form in my blog detail view and it has a name,last name,email and an image field. the first three work fine but when i add the imagefield in the form, the form wont save from the page but it works from admin page. this is my views.py: def campaign_detail_view(request, id): template_name […]