Categories
Development

LINQ Projection and loading child objects

Having an issue with projection and getting child objects to load. The following is simplified code to represent the logic I’m trying to implement, not the actual code. public class TicketItem { public int TicketItemId { get; set; } public string TicketReason { get; set; } public Station Station { get; set; } public TicketOwner […]

Categories
Development

Upadate users name in mysql

I am a beginner in MySQL, i would like to change the ‘root’ user into ‘test’, but i doesn’t work, what am i doing wrong ? All topic on internet are about password but nothing about changing name issue. CREATE DATABASE wordpress; GRANT ALL PRIVILEGES on *.* TO ‘root’@’localhost’ WITH GRANT OPTION; update user set […]

Categories
Development

How to prevent multiple calls to get_queryset() in django?

In my views.py, I have a custom get_queryset() that filters records on the user. When I update or create a specific record, I need information from the queryset to set some fields, so I end up with multiple calls to get_queryset(). If get_queryset() becomes more complex, my performance may decrease a bit. def update(self, request, […]

Categories
Development

How to check Shipment lines before confirming?

I’m trying to cycle though the SOShipLines before confirming to validate the data. I’ve got the override to work, but can’t seem to figure out how I move through the records. The error (which is set to always trip) always returns 0 lines. I’m pretty sure I need to be looking at the shiporder variable […]

Categories
Development Linux

Seeing wired stripes when trying to install kali linux

I tried to install kali linux on my HP probook 450. While trying to install i experienced some wired artifacts but if I choose Live mode then everything works just fine.

Categories
Development

Adding wrapper for graphQL queries – HOC or Render props

I am trying to do a wrapper for the graphQL queries, I tried this const GQLWrapper = ({ query, children}) => ( <Query query={query}> {({ loading, error, data }) => { if (loading) { return null } if (error) { <QueryError /> } const { gqlData } = data.page return ( <div> {children} </div> ) […]

Categories
Development

scala multiline (triple-quotes) line number suppression

I have a long multi-line string as: val jsonString: String = “”” |{ | “No”: 1234, | “Date”: { | “Year”: 2020, | “Month”: 2, | “Day”: 18 | }, | “Owner”: { | “FirstName”: “John”, | “SurName”: “Doe” | } |} |”””.stripMargin which is printed by REPL as: jsonString: String = ” //1 { […]

Categories
Development

Can’t find process listed by `jobs` command

I am using jobs command to control the number of compute-intensive processes. I want to not run more than max_cnt processes at a time, and stop only when all the processes have stopped. I use the below script to accomplish this, however, this code always lists one process running even after everything has executed and […]

Categories
Development

Finding the cumulative sum of a list in Python 3.8

I’m trying to create a function that takes a list as an argument and then gives back a new list with the cumulative sum of that list. For example: [1,7,-3,9,-2] would become [1,8,5,14,12] I am also trying to use a “for” loop for this function.

Categories
Development

how to display multiple array variables in one HTML tabel?

My controller code <?php defined(‘BASEPATH’) OR exit(‘No direct script access allowed’); class Students extends CI_Controller { function __construct(){ parent:: __construct(); $this->load->model(‘StudentsModel’); } /*******************************************************/ /************* Function for login process **************/ /*******************************************************/ public function index() { if ($this->session->userdata(‘SchoolLoggein’) == TRUE){ $result[‘class_total_strn’] = $this->StudentsModel->class_total_strn(); $result[‘school_house_list’] = $this->StudentsModel->school_house_list(); // getting school house strength individual $result[‘class_house_strn’] = $this->StudentsModel->class_house_strn(); $result[‘school_gender_list’] = […]