I just wrote a java class to generate meshes from a cylinder list stored to a ply file. I tested the files with a hand generated list of 3 cylinders. The resulting file I can open both in Meshlab and Cloudcompare.
When I use the class in my real program I have to write a mesh for more than 13000 cylinders.
Cloudcompare gives me the following error : Reading error(no access right?)
Meshlab this one : error details, unexptected eof
I already checked if my ply file contains the exact number of vertices and faces defined in the header. I also assured, there are no nan (checked for 'n','a', etc in winedit) values contained.
I can reproduce the errors with my test file from the 3 hand made cylinder file by deleting the last line. But as mentioned earlier, I already checked if the line numbers are correct (might be an empty line not caught by my eyes though, as scrolling down half a million lines is impossible).
So are there any programs available to parse the ply file for errors? Open source tools would be appreciated here. Or are the files just to large? 436302 lines to be exact. I use ascii version of ply.
Found a non open source tool called nugraf, which provides information about the corrupted line numbers.
Java seems to print NAN with '?'. For this char i did not check, so problem seems to be solved and I can debug my java software now again.
Please have a look at the following code
with text_io;
use text_io;
procedure hello is
begin
put_line("hello");
new_line(3);
end hello;
When I click "build all" in GPS IDE, I get this error
gnatmake -d -PC:\Users\yohan\firstprogram.gpr
firstprogram.gpr:1:06: literal string expected
firstprogram.gpr:2:01: "end" expected
gnatmake: "C:\Users\yohan\firstprogram.gpr" processing failed
[2013-04-03 13:29:58] process exited with status 4 (elapsed time: 00.47s)
I am very new to Ada, as you can see, this is my first program. Please help.
On the command line, gnatmake will happily compile a file which contains Ada code but has the extension .gpr. GPS knows "better" than that, and insists on treating myfirstprogram.gpr as a GNAT Project file, which of course it isn't.
You'll find life with GNAT much easier if you stick with its file naming conventions: .ads for a spec, .adb for a body, and the file name needs to be the unit name in lower case. In your case, the file should have been called hello.adb.
The simplest approach to creating a GNAT project file in GPS is to go to the Project menu and select New. The only places where you must enter data are on the "Naming the project" page (you might choose firstproject!) and the "Main files" page, where you'd click on the blue + to add hello.adb; you can Forward through the others.
After adding the main file, you can click Apply to install the new project file; now you can Build all and Run.
You may find the GPS tutorial helpful (Help menu, GPS ...)
I have a FORTRAN code which performs a numerical integration. All the computed data are written in an external file (data.out). Here is a simple sketch of the code
OPEN(UNIT=10,FILE='data.out')
DO i=1,n
........
WRITE(10,'(7(E22.16,1x))')a,b,c,d,e,f,g
........
ENDDO
CLOSE(10)
The program keeps running for long time (about 1.5 h) until the numerical integration is finished. During the execution I would like to see the results in the .out file. However, when I try to open the .out file while the .exe is running I get the following message:
"The document data.out is used by another application and cannot be accessed." So, is there a way to open the .out file during the execution? It is important for me to observe the output values (they are not only seven as in the above example) so, it is not convenient to send them in screen output (is reduces significantly the speed of the code).
Many thanks in advance.
* EDIT *
This is another scenario quite similar to the above mentioned case. Here, the integration routine reads the initial conditions from an input file and writes the outputs to another external file. Below I present the corresponding skeleton of the code
OPEN(UNIT=10,FILE='input.par',STATUS='UNKNOWN')
2 READ(10,*,END=1) x_0,y_0
! INTEGRATION LOOP
DO i=1,n
........
ENDDO
OPEN(UNIT=12,FILE='data.out')
WRITE(12,'(7(E22.16,1x))')a,b,c,d,e,f,g
GOTO 2
1 CLOSE(10)
CLOSE(12)
So, the routine opens UNIT 10 reads the initial conditions, performs the integration and at the end of the integration it writes the outputs to UNIT 12. Then, it takes another set of initial conditions and repeat the same procedure until it there is no more initial conditions in UNIT 10. Again, I want to be able to open and monitor UNIT 12. I tried your approach but it does not work properly at this case. I can open UNIT 12 any time I want but the routine does not write all the outputs there. In fact, it writes only the outputs of the last set of initial conditions. Any ideas? I strongly believe that a minor modification to your approach could do the job.
Alternative to printing out the result to the screen, you could just close your file after each write operation and reopen it in the next integration cycle to append the new data to it.
program test
implicit none
integer :: ii
! Create emtpy file
open(10, file='data.out', status='REPLACE', action='WRITE')
close(10)
do ii = 1, 100
!...
! Reopen file, append new information and close it again.
open(10, file='data.out', status='OLD', action='WRITE', position='APPEND')
write(10,'(7(E23.16,1x))') 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0
close(10)
end do
end program test
EDIT: THe main idea is, that before you start any kind of looping, you create an empty file by the first open statement:
open(10, file='data.out', status='REPLACE', action='WRITE')
close(10)
Then, inside the loop you just append to that file, to make sure you do not replace content already being there:
open(10, file='data.out', status='OLD', action='WRITE', position='APPEND')
write(10,'(7(E23.16,1x))') 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0
close(10)
Please note the differences in the arguments passed to the open statement.
The logical way to do this would be to echo the output to the terminal. By default, this is unit 6. So I would change your output to:
WRITE(6,'(7(E22.16,1x))')a,b,c,d,e,f,g
WRITE(10,'(7(E22.16,1x))')a,b,c,d,e,f,g
Try it and see. It may even work.
I have a question that's been bugging me for a while. For our symbolicated crash reports, for internal frameworks that we have the source code for, symbolicated crash reports frequently have offsets instead of line numbers. For instance, the symbolicated report has:
*AppName* 0x0025b0b2 -[*AppSpecificClass AppSpecificMessage*:] + 682
when we'd like to have:
*AppName* 0x001c444d __39-[*AppSpecificClass AppSpecificMessage*] (*AppSpecificClass*.m:145)
I have tried a bunch of different permutations of build settings but I cannot get this to work consistently (we do get line numbers for some parts of the crash).
Thanks for the help,
Rob
What tool you are using?
Works fine here via dwarfdump
7 MyApp 0x0004e4d1 -[MyClassInstance myFunc] (in MyApp) 'MyModule.mm' line 100, column 9 with start address 0x000000000004e4a3
I'm trying to compile some code for basic USB HID functionality. I'm using a PIC18F14K50 with MPLAB 8.43 and the Microchip C18 compiler.
I'm using some standard files from Microchip's website. Here is my C file and here is my header file.
I'm getting the following error when I build:
Executing: "C:\Program Files\Microchip\mplabc18\v3.40\bin\mplink.exe" /p18F14K50 /l"C:\MCC18\lib" /k"C:\MCC18\bin\LKR" "usb_function_hid.o" "usb_device.o" "enumeration.o" "usb_descriptors.o" /u_CRUNTIME /u_DEBUG /z__MPLAB_BUILD=1 /z__MPLAB_DEBUG=1 /o"C:\LPCUSBDK_Labs\Lab1_files\output\Project Lab 1.cof" /M"C:\LPCUSBDK_Labs\Lab1_files\output\Project Lab 1.map" /W
MPLINK 4.40, Linker
Device Database Version 1.3
Copyright (c) 1998-2011 Microchip Technology Inc.
Error - could not find definition of symbol 'HIDDescriptor1' in file './usb_function_hid.o'.
Errors : 1
Link step failed.
The HIDDescriptor1 symbol appears in 2 places in the code: PasteBin line 173 of the C file and PasteBin line 356 of the header file.
This code comes straight from Microchip. I'm not sure why it wouldn't be linking. I think either it's designed for another version of the compiler, I'm missing some external dependency, or I'm missing some compiler/linker switches.
Any ideas on what I need to do to get this to build?
In the header file, you have HIDDescriptor1 defined externally. So when you compile usb_function_hid.c, it will compile fine until you try to link it. Then, it cant find that symbol.
It seems that you have to define HIDDescriptor1 in your own code. Or else it is somewhere else in the source that you downloaded, and you need to link that in as well. But it surely isn't defined in the .c file.
EDIT:
I downloaded and installed the Microchip Application Libraries. There is no longer any mention of HIDDescriptor1 in any of the source. However, usb_function_hid.h details another structure that I assume is a replacement:
//USB HID Descriptor header as detailed in section
//"6.2.1 HID Descriptor" of the HID class definition specification
typedef struct _USB_HID_DSC
{
BYTE bLength; //offset 0
BYTE bDescriptorType; //offset 1
WORD bcdHID; //offset 2
BYTE bCountryCode; //offset 4
BYTE bNumDsc; //offset 5
//USB_HID_DSC_HEADER hid_dsc_header[HID_NUM_OF_DSC];
/* HID_NUM_OF_DSC is defined in usbcfg.h */
} USB_HID_DSC;
Browsing the example projects, there are many many HID projects, all which build just fine with the C18 compiler. I recommend downloading this library again; you may have an incomplete or older library. The highlighted project below is for the PIC18F14K50.