I am looking at u-boot after 5 years. It seems that adding a custom board under boards/ti is not trivial anymore.
I copied board/ti/am335x to board/ti/pm335x
Then copied include/configs/am335x_evm.h to include/configs/pm335x_evm.h
Added the board entry to
arch/arm/mach-omap2/am33xx/Kconfig
by copying:
config TARGET_AM335X_EVM to config TARGET_PM335X_EVM.
In am335x_evm_defconfig:
How does CONFIG_AM33XX directly select board/ti/am335x ?
I replaced CONFIG_AM33XX to CONFIG_TARGET_PM335X_EVM=y
Why does my board never get selected even after specifying TARGET_PM335X_EVM=y
Why does config and compilation fail?
How do you add a new board ?
Related
I'm currently developing a QGIS plug-in.
When i start editing a layer either with with edit(QgsVectorLayer) or with QgsVectorLayer.startediting() this RuneTimeError happens the majority of runs: RuntimeError: wrapped C/C++ object of type QgsVectorLayer has been deleted. I can run 10 times the script and have no error and then run it another 10 times and get 10 times in a row the error. It feels completely random.
As i understood by reading post such as Understanding the "underlying C/C++ object has been deleted" error it might be a garbage collector problem C++ side. But none of the post i saw was about QgsVectorLayer so i'm not really sure it applies.
It really annoys me to the point where i start creating empty layers to store modified features instead of editing.
I tried to move start editing before the loop as i was thinking to continually start editing and commit changes for each feature might cause the issue but the error still appears.
Then i thought it might be the use of break at the end but removing it doesn't resolve the error.
As it is the first time i really use PyQGIS i spent sometimes reading the developer cookbook or searching online (Anita Graser - creating and editing a new vector layer) but i could not find any solutions.
I tried with different version, LTR or not. With another computer by despair but the issue is still here.
I also read somewhere that the progress bar was the issue, so i removed the feedback in my script also without success.
Here are some code example :
nodesLayer = self.parameterAsVectorLayer(parameters, self.INPUT_NODE, context)
arcsLayer = self.parameterAsVectorLayer(parameters, self.INPUT_LINE, context)
# Fill node Id_line_x
# Create spatial index
index = QgsSpatialIndex(nodesLayer.getFeatures())
for line in arcsLayer.getFeatures():
# Construct a geometry engine to speed up spatial relationship
engine = QgsGeometry.createGeometryEngine(line.geometry().constGet())
engine.prepareGeometry()
# Get potential neighbour
candidateIds = index.intersects(line.geometry().boundingBox())
request = QgsFeatureRequest().setFilterFids(candidateIds)
for node in nodesLayer.getFeatures(request):
# Get real neighbour
if engine.intersects(node.geometry().constGet()):
# Fill the Id_line fields for the number of neighbour
for fld in range(1, node["Nb_seg"] + 1):
if node["fk_Id_line_%d" %fld] == NULL:
with edit(nodesLayer):
node["fk_Id_line_%d" %fld] = line["Id_line"]
nodesLayer.updateFeature(node)
break
And the exact error :
Traceback (most recent call last):
File "/some/path/to/a/file.py", line 331, in processAlgorithm
nodesLayer.updateFeature(node)
RuntimeError: wrapped C/C++ object of type QgsVectorLayer has been deleted
Hope the example is enough. The goal of the code is for the nodes to be aware of their surroundings without going through the lines. it's just for treatment and those fields would be removed in the final output.
I am trying to make modifications to a vbscript that uses the line:
Session("Variable") = "MyVariable String"
This line requires it to be ran within a different program which is not available where I am doing my development. This line is NOT important to the development that I am doing and I just need it to NOT blow up with 'undefined variable session' when I am running with 'Option explicit'. What class, dictionary, variable type, or whatever do I need to create in order for that line to work without warnings/errors? I am currently just commenting them out, but when I copy and paste my code back in production I have to go back through and hope that I have uncommitted all of them back out. I'd rather just add a for instance "Set Session = New FooSomething" at the top of the code that will make it work and just remove that line when I add to production code. Thanks for your time.
I have a Fortran 77 code like this, more or less:
nMaxRow=100
nMaxStep=100
! initialization of the matrix if Step=1
do step=1,nMaxStep
if (step.eq.1) then
do ii=1,nMaxRow
do jj=1,nMaxStep
A(ii,jj)=0
end do
end do
end if
!now for each step and for each row update the cell of the matrix
do ii=1,nMaxRow
A(ii,step)=X(ii) !X(ii) is a number associated with the specific ow at that specific step
end do
!Now I want to write the updated matrix at this step into a text file,
!How can I do that????
end do !close the do step...
Is it possible to update the values of the matrix and write the updated matrix at that specific step into a text file? I mean, without appending the results each step...
I found out that for Fortran 90 the 'REPLACE' command exists... but I couldn't find anything similar for Fortran 77.
One simple idea would be deleting the file just before writing a new one... but I don't like it and I don't know how to do it anyway.
If the file is already open (from the previous writing), you can just go the the start of the file using
rewind(unitnumber)
and start writing again. It will delete the original content of the file and start again. If you wan't to go back just be several records, you can use backtrace(), but you probably don't want that here.
If it isn't open, just open it and start writing. Unless you open it of appending, it will overwrite the original content.
I'm using iText to generate PDF files. I want to disallow editing of the PDF, but allow the reader to extract pages. Here's my code to set encryption:
writer.setEncryption(null, null, 0xffffffff, PdfWriter.STANDARD_ENCRYPTION_128);
The third parameter specifies permissions. I'm using 0xffffffff instead of the individual iText flags ALLOW_PRINTING etc. This will ask iText to enable everything. But this is what I get in the PDF file:
I should think I should be allowed to enable extraction but disable editing, but am not certain. Here are the permissions bits per Adobe:
(From here, but be warned it's 30 meg)
So turn off bits 6 and 11 but leave on the others (especially bits 5 and 10), and that would turn off editing but allow extraction. In any case, by specifying 0xffffffff I would think that everything would be allowed; but instead everything except extraction is allowed.
I've skimmed the iText source code for setting permissions and don't see anything that would cause this. Here is the relevant code from PdfEncryption.setupAllKeys:
permissions |= (revision == STANDARD_ENCRYPTION_128 || revision == AES_128 || revision == AES_256) ? 0xfffff0c0
: 0xffffffc0;
permissions &= 0xfffffffc;
The first line is doing an OR and so wouldn't remove any permissions; the second line is setting the two right-most bites to 0, per the PDF specification.
I'm wondering if it's an iText thing, a PDF thing or if I'm doing something else wrong.
Thanks
A similar issue already has been raised here.
Using encryption actually is counter-productive as it can only be used to remove permissions, not to add them.
According to this, it might be helpful to completely unlock the PDF first:
PdfReader reader = new PdfReader(file.toURI().toURL());
PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(
file.getAbsolutePath().replace(".pdf", "_UNLOCKED.pdf")));
stamper.close();
reader.close();
Afterwards you can grab the output and start from scratch (mess around with the permission bits). Hope this helps.
EDIT: If you don't have access to the password, the iText sources can be modified. Simply comment out if (!reader.isOpenedWithFullPermissions()) throw ... (line 121 and 122 in version 5.5.0) in com.itextpdf.text.pdf.PdfStamperImp.
I store my settings using QSettings class and sometimes, it gives me a strange behavior.
I use this to add a value :
QSettings _settings("MyCompany", "AppName")
_settings.setValue("lastfile", "SomeString");
And this to remove all values :
QStringList indexes = _settings.allKeys();
foreach(QString index, indexes)
_settings->remove(index);
And it seems to work randomly. Sometimes it add or remove the value to the .plist file (I checked it using _settings.fileName()) and sometimes nothing change.
My question, which is kind of implicit, is what am I missing and how to make it work normally?
Set the format with: -
QSettings::setDefaultFormat(QSettings::NativeFormat);