php – dompdf salvar arquivo em diretório apenas usando a IDE

Estou com algumas duvidas referentes ao dompdf, gostaria de saber como salvar o arquivo pdf direto pela IDE sem a necessidade de usar um navegador, além disso gostaria de gerar um loop para gerar vários pdfs independentes, cada um com suas informações especificas.

    $dompdf = new DOMPDF();
$html = "<p>Este é um teste</p>";
$dompdf->loadHtml($html);
$papel = array(0, 0, 595.28, 841.89);
$dompdf->set_paper( 'A4', 'portrait');
$dompdf -> render();
$data_salvar  = date_create();
$nome_arquivo = date_timestamp_get($data_salvar);
$nomeFinal = $nome_arquivo.".pdf";
$output = $dompdf->output();
$arquivo = "relatorios_gerados/".$nome_arquivo.".pdf";
if(file_put_contents($arquivo,$output) <> false) {
    // Define o caminho onde será salvo
    $dompdf->stream("C:wamp64wwwgeraDocDocumentosGerados", array ( "Attachment" => false ));

quando executo na IDE recebo o retorno

%PDF-1.7
1 0 obj
<< /Type /Catalog
/Outlines 2 0 R
/Pages 3 0 R >>
endobj
2 0 obj
<< /Type /Outlines /Count 0 >>
endobj
3 0 obj
<< /Type /Pages
/Kids (6 0 R
)
/Count 1
/Resources <<
/ProcSet 4 0 R
/Font <<
/F1 8 0 R

/MediaBox (0.000 0.000 595.280 841.890)

endobj
4 0 obj
(/PDF /Text )
endobj
5 0 obj
<<
/Producer (�� d o m p d f 1 . 0 . 2 + C P D F)
/CreationDate (D:20210607065733+02’00’)
/ModDate (D:20210607065733+02’00’)

endobj
6 0 obj
<< /Type /Page
/MediaBox (0.000 0.000 595.280 841.890)
/Parent 3 0 R
/Contents 7 0 R

endobj
7 0 obj
<< /Filter /FlateDecode
/Length 77 >>
stream
x��2�300P@&�ҹ�B�M���-L�L�,BR����B��5�KR^�������
!^
�! ���
endstream
endobj
8 0 obj
<< /Type /Font
/Subtype /Type1
/Name /F1
/BaseFont /Times-Roman
/Encoding /WinAnsiEncoding

endobj
xref
0 9
0000000000 65535 f
0000000009 00000 n
0000000074 00000 n
0000000120 00000 n
0000000274 00000 n
0000000303 00000 n
0000000452 00000 n
0000000555 00000 n
0000000703 00000 n
trailer
<<
/Size 9
/Root 1 0 R
/Info 5 0 R
/ID()

startxref
812
%%EOF

ide – VS Code is no more suggesting Pygame methods for me

I’ve been using Pygame a lot. And I’m cuurently coding in VS Code. Last week, I have installed JAVA and started learning it’s basics. However, from the moment I installed the JDK, VS Code have changed (the theme, the code suggestions…) . So when I got back to Python and Pygame, I noticed that VS Code is not suggesting the methods and functions for me when I start typing. I also noticed that this issue is happening mostly with Pygame as everything is working properly with the standard Python library.
So what can I do ?

Btw, what are these suggestions called (I think they have a specific name) ?

What is the best IDE for Android development?

I want to practice JAVA development for android for study purposes, but the IDE’s on the market are too heavy for my humble notebook. I already tested Android Studio, JetBrain, Eclipse and Visual Studio Code with extensions, but I was not happy. So I thought of using an Android Online IDE that supports JAVA and Kotlin, would anyone indicate any IDE Online that you have already used or know someone who used it?


I searched Stackoverflow for the best place to post my question and I believe that this is the best place and has the purpose of helping programmers, if you are in the wrong place, please direct. :]

Thanks

Online IDE (Browser-based) IDE

I am wondering if there are any good web-based IDEs ( that can be used directly through their websites).
I am learning a few programming languages such as Python, JavaScript, C++, C#, etc.
I came across a few of them, but not sure which one is good.
I do not mind if something is particularly made for a particular programming language.
Are they as nearly good as Netbeans, Pycharm, etc?

java – Maven project using EclipseLink for persistence runs on IDE, but fails when running from a built jar

I’m working on a maven project using eclipselink 2.7.8 for persistence. When I run it on my IDE (Netbeans 12.0) it works perfectly well, but when I attempt to run it from a built jar it doesn’t.

This is the stack trace when I use the jar

Exception in thread "main" Local Exception Stack:
Exception (EclipseLink-30005) (Eclipse Persistence Services - 2.7.8.v20201217-ecdf3c32c4): org.eclipse.persistence.exceptions.PersistenceUnitLoadingException
Exception Description: An exception was thrown while searching for persistence archives with ClassLoader: jdk.internal.loader.ClassLoaders$AppClassLoader@2cdf8d8a
Internal Exception: javax.persistence.PersistenceException: Exception (EclipseLink-28018) (Eclipse Persistence Services - 2.7.8.v20201217-ecdf3c32c4): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit (MyPersistenceUnit) failed.
Internal Exception: java.lang.NullPointerException
        at org.eclipse.persistence.exceptions.PersistenceUnitLoadingException.exceptionSearchingForPersistenceResources(PersistenceUnitLoadingException.java:129)
        at org.eclipse.persistence.jpa.PersistenceProvider.createEntityManagerFactoryImpl(PersistenceProvider.java:118)
        at org.eclipse.persistence.jpa.PersistenceProvider.createEntityManagerFactory(PersistenceProvider.java:191)
        at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:80)
        ...
Caused by: javax.persistence.PersistenceException: Exception (EclipseLink-28018) (Eclipse Persistence Services - 2.7.8.v20201217-ecdf3c32c4): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit (MyPersistenceUnit) failed.
Internal Exception: java.lang.NullPointerException
        at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.createPredeployFailedPersistenceException(EntityManagerSetupImpl.java:2109)
        at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:2085)
        at org.eclipse.persistence.internal.jpa.deployment.JPAInitializer.callPredeploy(JPAInitializer.java:104)
        at org.eclipse.persistence.jpa.PersistenceProvider.createEntityManagerFactoryImpl(PersistenceProvider.java:107)
        ... 15 more
Caused by: Exception (EclipseLink-28018) (Eclipse Persistence Services - 2.7.8.v20201217-ecdf3c32c4): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit (MyPersistenceUnit) failed.
Internal Exception: java.lang.NullPointerException
        at org.eclipse.persistence.exceptions.EntityManagerSetupException.predeployFailed(EntityManagerSetupException.java:233)
        ... 19 more
Caused by: java.lang.NullPointerException
        at org.eclipse.persistence.internal.jpa.metadata.MetadataProject.hasEntity(MetadataProject.java:1441)
        at org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataAnnotatedElement.isOneToMany(MetadataAnnotatedElement.java:693)
        at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.ClassAccessor.buildAccessor(ClassAccessor.java:609)
        at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.ClassAccessor.addAccessorFields(ClassAccessor.java:438)
        at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.ClassAccessor.addAccessors(ClassAccessor.java:410)
        at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.ClassAccessor.preProcess(ClassAccessor.java:1225)
        at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EmbeddableAccessor.preProcess(EmbeddableAccessor.java:304)
        at org.eclipse.persistence.internal.jpa.metadata.MetadataProject.processStage1(MetadataProject.java:1851)
        at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.processORMMetadata(MetadataProcessor.java:579)
        at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:629)
        at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:2006)
        ... 17 more

My persistence.xml:

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
      <persistence-unit name="MyPersistenceUnit" transaction-type="RESOURCE_LOCAL">
        <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
        ...
        <exclude-unlisted-classes>false</exclude-unlisted-classes>
        <properties>
            <property name="javax.persistence.jdbc.url" value="jdbc:h2:./bd/MyPersistenceUnit"/>
            <property name="javax.persistence.jdbc.user" value=""/>
            <property name="javax.persistence.jdbc.driver" value="org.h2.Driver"/>
            <property name="javax.persistence.jdbc.password" value=""/>
            <property name="javax.persistence.schema-generation.database.action" value="create"/>
        </properties>
    </persistence-unit>
</persistence>

My pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    
    <modelVersion>4.0.0</modelVersion>
    <groupId>xxxx.xxxxx</groupId>
    <artifactId>Service</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>
    
    <properties>      
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
    </properties>
    
    <dependencies>
        <dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>eclipselink</artifactId>
            <version>2.7.8</version>
        </dependency>
        
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <version>1.4.194</version>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>5.7.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>5.7.0</version>
            <scope>test</scope>
        </dependency>

        <dependency>          
            <groupId>org.fusesource.jansi</groupId>
            <artifactId>jansi</artifactId>
            <version>2.3.2</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
            <type>jar</type>
        </dependency>        
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                        <id>example</id>
                        <configuration>
                            <archive>
                                <manifest>
                                    <mainClass>xxxx.xxxxx.service.demonstration.MainDemo</mainClass>
                                </manifest>
                            </archive>
                            <descriptorRefs>
                                <descriptorRef>jar-with-dependencies</descriptorRef>
                            </descriptorRefs>
                            <appendAssemblyId>false</appendAssemblyId>
                        </configuration>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>

</project>

I suspect that it’s something to do with how maven is building the jar, since it works fine on the IDE. I have tried to utilize different eclipselink versions too, but that didn’t seem to help (I started this project using 2.5.2 but updated after I had problems due to incompatibilities with some Java 8 features)

godot – Is it better to connect signals in source code or with the IDE feature?

In Godot IDE, what are the advantages and the caveats of using the visual IDE to connect signals to listerners instead of doing this:

var state: bool

onready var countdown: Timer = $Countdown

func _ready() -> void:
    state = true
    countdown.connect("end", self, "_toggle")

func _toggle() -> void:
    state = not state
```

ide – Is editor choice discrimination real?

I used to depend on IDEs for my programming, but in the past few months have switched over to vim. I’ve found that despite vim’s steeper learning curve, there have been definite benefits once I got accustomed to it.

Now, this is a personal choice, and I for one wouldn’t try to impose some editor or IDE on my coworker. But do interviewers often judge job applicants (either consciously or subconsciously) on their editor/IDE choice? Would a traditional option like vim or Emacs be frowned upon, so that it’s worth hiding one’s true preferred editor during an interview?

godot – How to inspect child nodes in IDE debugger?

On the debugger panel you will see the members variables of the current class/script and the local variables of the current function. The node you want is neither. Thus a solution is to store it in a variable.

However, if you want to access a different node while debugging there is another way…

While debugging, you can go to the Scene panel (on the top left of the editor by default), and you will see two tabs:

  • Local: contains the scene tree for editing (which is what you have access normally).
  • Remote: contains the current scene tree of the game that is running.

Use the Remote tab to get to nodes you want. When you select them, their current state will appear on the inspector panel (on the right of the editor by default).