collada2gltf converter can't produce *.json file - collada

I am reading a book: Programming 3D Applications with HTML5 and WebG , it involve a Vizi framework.
All the examples load the *.json file instead of *.gltf file. Why?
When I load *.gltf, it doesn't load any result, and the collada2gltf converters only produce *.gltf, *.bin, *.glsl files and so on.
What should I do?

.gltf is a JSON file. Try to open it with a text editor and see for youself. .bin and .glsl files are just additional resources, linked from .gltf file. Those are geometry buffers and shaders respectively. So to make it work you should make sure that all the files produced with the converter are also available to a web browser you running your code in.
Also you can try to add -e CLI flag to collada2gltf and it'll embed all the resources into result .gltf file.

Related

.gitattributes for linguist doesn't work correctly with gitlab

I have a (private) project on Gitlab which uses GameMaker, and the .yy files were being detected as Yacc. I looked up how to change this, so I came across .gitattributes files, as described here and here. I created a .gitattributes file in the project directory with the following content:
*.yy linguist-language=GameMaker JSON
*.yy linguist-detectable=true
*.yyp linguist-language=GameMaker JSON
*.yyp linguist-detectable=true
The files are no longer being detected as Yacc, but they are also not detected as "GameMaker JSON", Gitlab now shows the repository as 100% GameMaker Language. I have tried both *.yy linguist-detectable syntax without the =true and with it, I have tried writing GameMaker-JSON with hyphens instead of spaces, and I have confirmed that the .gitattributes file was pushed onto the main branch (which is the only branch). How can I resolve this so that the .yy and .yyp files get recognized correctly, am I missing something?
It seems I mistakenly assumed that linguist allows you to specify custom language names in .gitattributes, but to my current knowledge, that is unfortunately not possible. I will henceforth specify to mark .yy and .yyp files as JSON in my project (refer to this comment I made), which I have already confirmed to work correctly.
My intention was to mark files that are specifically used as GameMaker project files or asset files (which are created and used by the GameMaker editor and not intended to be edited manually) differently from other files with JSON syntax (GameMaker also allows you to parse data from JSON files within your game code, these files would usually use the .json extension and not .yy or .yyp).
For now, it seems advisable for GameMaker projects to either specify .yy and .yyp as JSON or specify them to not be counted by linguist at all, since they aren't code that is manually written by the user.

How to debug a .zip generator algorithm?

I'm trying to implement a minimal version of .zip file generation following this spec: https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT
I don't actually need compression, I just need a way to string together a bunch of files into a single widely adopted archive format with the capability to stream in file data while streaming out the zip.
So far I'm partially successful, 7-zip and windows built in zip extractor can extract them just fine, winrar and macos built in zip extractor are giving me corrupted archive errors.
I can't for the life of me find the actual problem(s?) though, as far as I can tell the .zips are built 100% to the specification but the spec is a big wall of text and with swooping changes from one zip file version to the next along with legacy attributes taking on new functions it is tad confusing.
Does anyone know of an extraction tool that can give me more specific errors than just "archive is corrupt"?
Or perhaps a zip generation utility where I can pick and choose between all the different ways of building a zip file so I can go and compare the results byte by byte?
Does anyone know of an extraction tool that can give me more specific errors than just "archive is corrupt"?
The unzipada tool # Zip-Ada project will do exactly that
Testing archive ko.zip
raised ZIP.ARCHIVE_CORRUPTED : Bad (or no) end-of-central-directory
[C:\Ada\za\unzipada.exe]
Zip.Find_First_Offset at zip.adb:589
Unzip.Extract at unzip.adb:667
Unzipada at unzipada.adb:259
By browsing the code (like: zip.adb, line 589) you can narrow down the corrupt archive issues. For building the tool, download the sources and follow the readme.txt file. There are also pre-built binaries for Windows.

po2html missing html template

I have no coding experience but I need to convert a .po file into an .html file. I am learning how to use this translate toolkit.
I am using translate tool kit here: http://docs.translatehouse.org/projects/translate-toolkit/en/latest/commands/html2po.html
Managed to get far as to install python and things.
I have gotten as far as below, and am unsure how to proceed.
Folder xh has example.po (which has relevant msgids and msgstr) and also example.html (which is blank)
C:\Users\bob>po2html -i C:\Users\bob\Desktop\xh -o C:\Users\bob\Desktop\xh
processing 1 files...
po2html: WARNING: Error processing: input C:\Users\Oh\Desktop\xh\example.po, output C:\Users\Oh\Desktop\xh\example.html, template None: must have template file for HTML files
[###########################################] 100%
How do I create this html template and what does it look like (My only knowledge is that you can create a HTML file in notepad, but I'm not sure what to put in it so example.html is blank atm)

asciidoctor-maven-plugin: use infodoc file to include javascript in the html output

I 'd like to include a custom javascript and stylesheet in my asciidoctor html output. The infodoc feature looks like a good choice for this.
Where do I put the infodoc.html file and where do I put the javascripts/css files, so the asciidoctor-maven-plugin picks them up correctly? My training.adoc file is in src/main/asciidoc.
Putting the infodoc.html in src/main/asciidoc doesn't work (at least not if there's a training-infodoc.html file in the same directory), but that training-infodoc.html file in src/main/asciidoc does work.
And the css and js files also just go in src/main/asciidoc.
Filestructure which works:
src/main/asciidoc
src/main/asciidoc/training.adoc
src/main/asciidoc/training-infodoc.html
src/main/asciidoc/website/trainingWebsite.css
src/main/asciidoc/website/trainingWebsite.js

How to create a thumbnail view using system libraries in Linux

I want to create a thumbnail view of a file type similar to thumbnails displayed in gnome/kde.
Wondering if anyone knows which libraries gnome/kde uses to display thumbnail view of different file types in Linux.
It appears there is a D-BUS specification for sending requests to a cross-toolkit Thumbnailing service called Tumber: http://gezeiten.org/post/2009/10/Using-Tumbler-in-Client-Applications
But documentation seems to be very sparse.
ImageMagick is a command-line tool and the library. This library has interfaces for C++ and Perl. Or you can also try GraphicsMagick.
The utility 'convert' from ImageMagick is often used for this.
http://www.cyberciti.biz/tips/howto-linux-creating-a-image-thumbnails-from-shell-prompt.html has an example that I have adapted here.
Given two directories, images/ and thumbnails/, this little script will convert all the images into thumbnails in the other directory, with 'thumb.' at the start of the filename :
#!/bin/bash
for i in images/*
do
echo "Prcoessing $i ..."
/usr/bin/convert -thumbnail 200 "$i" thumbnails/thumb.$(basename "$i")
done

Resources