sql – name of cities and departments working on projects 3 and 4 (empty result)

I try to query the following database, we have 3 tables: the project table (projects), the department table (departments) and the employee table (employees)

Database image

I have to get the names of the departments (nom in the table sections) and the city (Ciutat table sections) of the projects (tabla projects) whose project is 3rd and 4th.

This was my attempt at consulting.

Select d.nom, d.ciutat
from departaments as d, empleats as e
where e.codiprojecte in ( select p.codi
            from projectes as p
            where p.codi=’P3’ and p.codi=’P4’);

But no results on the screen, I'm getting empty, could someone help me? Thank you !!

rest – API problems downloading images, empty files, or corrupt images

What I am trying to achieve is this.

I am working on an integration web app that our technicians can use to access data from our crm and sharepoint.

I want to be able to view images stored in Sharepoint in this web app. I think I have 2 options.

  1. I can programmatically create anonymous links to these images and then call them up inline.

  2. Drag them locally to display them.

Since there are only a few pictures, I tend to 2. So I don't understand how to pull them down because they are binary.

I used the Shareplum library. I can just call up a text file like this:

from shareplum import Site
from shareplum import Office365
from shareplum.site import Version

server_url = "https://xxx.sharepoint.com/"
site_url = "sites/Technicians/"

un = "un"
pw = "pw"

authcookie = Office365(server_url, username=un, password=pw).GetCookies()
site = Site(server_url + site_url, version=Version.v2016, authcookie=authcookie)

folder = site.Folder('Shared Documents/Technical client documentation' 
                     '/Clients/Company Name, Inc/System Information')
p = folder.get_image('test.jpg')

So we have from the library.

def get_file(self, file_name):
    response = self._session.get(self.site_url + f"/_api/web/GetFileByServerRelativeUrl('{self.info('d')('ServerRelativeUrl')}/{file_name}')/$value")
    return response.text

I added my own function:

def get_image(self, file_name):
    response = self._session.get(self.site_url + f"/_api/web/GetFileByServerRelativeUrl('{self.info('d')('ServerRelativeUrl')}/{file_name}')/$value")
    print(response)
    if response.status_code== 200:
        with open('/home/bruce/test_scripts/pictestNew.jpg', 'wb') as f:
            #response.raw.decode_content = True
            shutil.copyfileobj(response.raw, f)
    return "ok"

I am not trying to save the image. The code above brings me empty files. I also tried to return response.text.

p = folder.get_image('test.jpg')
p = bytearray(p)

P would then be the returned response.text:

with open('picOut1.jpg', 'wb') as f:
    f.write(p)

That brings me an image file of the right size, but throws in:

Error interpreting the JPEG image file (no JPEG file: starts with 0xef
0xbf

I also posted this on Stackoverflow. (StackOverflow question I know this is frowned upon, but my reasoning is as follows. Here I hope that someone can tell me if I can do what I want at all. The other one can only be done Sure, I screw up the Python I honestly don't know where the problem is right now.

This is my first run with Python and I guess I'm doing something wrong here. Would it just be easier to create a public link to this picture?

8 – Can EntityStorageBase :: loadByProperties () be used to indicate that the field is empty or not?

Only in a narrow area where "empty" means the empty string for the field ('') and saved as such in the DB.

EntityStorageBase::loadByProperties() uses a helper method ::buildPropertyQuery()that chain comparisons with the IN Operator. Therefore, you cannot use negation or special comparison cases (e.g. IS NULL if "empty" means NULL in the DB).

If you don't have simple string comparisons for your field, you'd better skip ::loadByProperties() and with EntityStorageBase::getQuery() to get a query object that you can customize to match an "empty" / "non-empty" query.

Why is the modern page returned empty after the online translation to SP?

The SharePoint adapter translates page documents and lists, but the modern SharePoint page is returned empty after translation. Converting page columns and translating, however, CanvasContent1 columns do not return content from PD (Project Directory). Do machine translation.
Do you have any ideas about custom page columns?

Thanks a lot

Commerce – The rendering context is empty after the IPN payment

I have developed an external payment gateway (Paybox card payment) using the IPN onNotify method.

It worked flawlessly in Commerce 2.13.

Since upgrading to Commerce 2.17, the following error has occurred when Drupal received the IPN request, preventing the validation order.

#0 /web/core/lib/Drupal/Core/Entity/EntityBase.php(395): DrupalCoreEntitySqlSqlContentEntityStorage->save(Object(Drupalcommerce_orderEntityOrder))
#1 /web/modules/contrib/commerce/modules/payment/src/PaymentOrderUpdater.php(89): DrupalCoreEntityEntityBase->save()
#2 /web/modules/contrib/commerce/modules/payment/src/PaymentOrderUpdater.php(59): Drupalcommerce_paymentPaymentOrderUpdater->updateOrder(Object(Drupalcommerce_orderEntityOrder), true)
#3 /web/modules/contrib/commerce/modules/payment/src/PaymentOrderUpdater.php(100): Drupalcommerce_paymentPaymentOrderUpdater->updateOrders()
#4 /web/core/lib/Drupal/Core/EventSubscriber/KernelDestructionSubscriber.php(51): Drupalcommerce_paymentPaymentOrderUpdater->destruct()
#5 (internal function): DrupalCoreEventSubscriberKernelDestructionSubscriber->onKernelTerminate(Object(SymfonyComponentHttpKernelEventPostResponseEvent), 'kernel.terminat...', Object(DrupalComponentEventDispatcherContainerAwareEventDispatcher))
#6 /web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func(Array, Object(SymfonyComponentHttpKernelEventPostResponseEvent), 'kernel.terminat...', Object(DrupalComponentEventDispatcherContainerAwareEventDispatcher))
#7 /vendor/symfony/http-kernel/HttpKernel.php(88): DrupalComponentEventDispatcherContainerAwareEventDispatcher->dispatch('kernel.terminat...', Object(SymfonyComponentHttpKernelEventPostResponseEvent))
#8 /vendor/stack/builder/src/Stack/StackedHttpKernel.php(32): SymfonyComponentHttpKernelHttpKernel->terminate(Object(SymfonyComponentHttpFoundationRequest), Object(SymfonyComponentHttpFoundationResponse))
#9 /web/core/lib/Drupal/Core/DrupalKernel.php(672): StackStackedHttpKernel->terminate(Object(SymfonyComponentHttpFoundationRequest), Object(SymfonyComponentHttpFoundationResponse))
#10 /web/index.php(81): DrupalCoreDrupalKernel->terminate(Object(SymfonyComponentHttpFoundationRequest), Object(SymfonyComponentHttpFoundationResponse))
#11 {main}

I think this is related to https://www.drupal.org/node/3011667, but I can't find how to fix it.

Thanks for any help

Laurent

python – The file object is empty after copying to the database with Psycopg2

In the following example, the contents of the file appear to be empty after executing the copy_expert command, and pd.read_csv reports an error that the file is empty. The file appears to be empty, even if I do this in reverse order (read_csv before copy_expert). Why is the file empty and how can I deal with this scenario?

    file = //download file from S3

    copy_sql = """
                   COPY %s FROM stdin WITH CSV HEADER
                   DELIMITER as ','
                   """
    cursor = self.connection.cursor()
    cursor.copy_expert(sql=copy_sql % table_name, file=file)
    cursor.close()

   df = pd.read_csv(file, dtype={// dtype value})

directx – If I use the vertex shader to perform all operations on the object, can the constant buffer be empty?

The program cycle is

Update();
UpdatePipeline();

in the Update() Constant buffer for every object that has copied this object world matrix into the GPU upload heap after transformations. And in UpdatePipeline()Among other things, installed shaders are called. Since we do all matrix transformations with CPU, the vertex shader only returns the position, right? If so – is it true that performance is increasing?

Now I want to do all the transformations with the GPU, i.e. H. About the vertex shader. It means that in Update() I should just call memcpy() with an empty constant buffer as the source?

Should an empty optional field be shown in the form overview before submitting?

Hye,

FORM FIELDS

Mandatory field; Name, address, etc.
Two optional fields; Overtime and comments.

FLOW

  • Fill out the form
  • Click on the review form
  • Form changes in review mode (all field fields are gone) only summary and receipt
  • Check and submit

QUESTION

If the optional field is empty, should it still be displayed on the overview page with the data empty with the symbol (-) or should it be removed from the form overview?

If it is removed from the overview, does this mean that users who have a field in all fields have a longer summary than users who do not?

thank you in advance

Entities – An attempt is made to list all articles for which the category field is empty

I have a Drupal 7 site and am trying to list all articles (with title) and where the category field is empty (taxonomy). I run this code on my page with -> isNull and without, but without results. Can anyone explain what I'm doing wrong here and why it doesn't work?

$query = db_select('node', 'n')
  ->fields('n', array('nid'))
  ->condition('n.type', 'article') 
  ->condition('n.status', 1)
  ->isNull('n.field_tags')
  ->range(0, 10);

  $results = $query->execute();

I get this error all the time:

PDOException: SQLSTATE (42S22): Column not found: 1054 Unknown column
& # 39; n.field_tags & # 39; in & # 39; where clause & # 39;: SELECT n.nid AS nid FROM {node} n
WHERE (n.type =: db_condition_placeholder_0) AND (n.status =
: db_condition_placeholder_1) AND (n.field_tags IS NULL) LIMIT 10
OFFSET 0; Array ((: db_condition_placeholder_0) => article
(: db_condition_placeholder_1) => 1) in eval () (line 17 of
/sites/site.com/modules/php/php.module(80): eval () & # 39; d code).

Optimization – Are empty Update () methods executed and slow down the game while playing?

From an optimization point of view, is it advisable to delete the predefined update () methods in all my C # scripts if there is no code in them?

Does the game slow down on hundreds / thousands of GameObject (s) with Update () {} empty?
Can they be left blank or is it better to delete them?