Tinymce toolbar icons sometimes do not display - reactjs

I'm using timymce with react.js. It works fine, but once in a while the toolbar icons don't display, and instead, I get some characters displayed. I'm assuming that it can't reach the server to get the icons. I want to create a local copy of the icons. I read that I should add:
import "tinymce/icons/default";
but when I do that, I get the error message:
ReferenceError: tinymce is not defined
./node_modules/tinymce/icons/default/icons.js
C:/react/andiamo-web/node_modules/tinymce/icons/default/icons.js:1
1 | tinymce.IconManager.add('default', {
2 | icons: {
3 | 'accessibility-check': '<svg width="24" height="24"><path d="M12 2a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2c0-1.1.9-2 2-2zm8 7h-5v12c0 .6-.4 1-1 1a1 1 0 01-1-1v-5c0-.6-.4-1-1-1a1 1 0 00-1 1v5c0 .6-.4 1-1 1a1 1 0 01-1-1V9H4a1 1 0 110-2h16c.6 0 1 .4 1 1s-.4 1-1 1z" fill-rule="nonzero"/></svg>',
4 | 'action-next': '<svg width="24" height="24"><path fill-rule="nonzero" d="M5.7 7.3a1 1 0 00-1.4 1.4l7.7 7.7 7.7-7.7a1 1 0 10-1.4-1.4L12 13.6 5.7 7.3z"/></svg>',
Any ideas?
EDIT: Once in a while, tinymce does not display at all (not just the toolbar, but the whole component). Maybe I need to look into hosting my own copy and not rely on the online version?
Thanks
Tom

Related

Nurbs curve parameters in Maya?

I get a Maya .ma file, I want to understand the parameters for nurbsCurve, the file has contents like this:
createNode nurbsCurve; # create a nurbsCurve
setAttr -k off ".v"; # set attribute about knots?
setAttr ".cc" -type "nurbsCurve" # attribute setting
3 1 0 no 3
6 0 0 0 1 1 1
4 # 4 stand for the below has 4 coordiniates
7.82436 0.545707 8.54539
7.86896 0.545707 9.61357
7.28368 0.53563 9.8433
6.06638 0.53563 9.89412
;
...
I don't understand what the line 3 1 0 no 3 and 6 0 0 0 1 1 1 stands for, anybody understand what these lines stand for?
Here's what I know so far, only the first three figures.
[3] [1] [0]
corresponds to:
[degree] [span] [index of the form: open/closed/periodic]

t-sql - select all combintations of groups of rows in single table

Ok, I have a table like this:
ThingID SubthingID ThingLevel
1 1 0
1 2 0
1 3 0
1 4 0
2 14 1
2 17 1
3 22 1
3 950 1
I need to select groups of subthings such that I end up with one subthing from a level 0 thing, and all the combinations of subthings, one each from the level 1 things. Note that each subthing belongs to its thing - they're not interchangeable. So there can't be, say, a combination of thing 2 with subthing 950. Also, things come in two levels - level 0 and level 1. A level 1 thing is also level 1, and a level 0 thing is always level 0 - really, it means that level 1 things can be combined with other level 1 or 0 things, but level 0 things can only be combined with level 1 things.
So the output would look like:
GroupID ThingID SubthingID ThingLevel
1 1 1 0
1 2 14 1
1 3 22 1
2 1 2 0
2 2 14 1
2 3 22 1
3 1 3 0
3 2 14 1
3 3 22 1
. . . .
. . . .
. . . .
x 1 4 0
x 2 17 1
x 3 950 1
There are multiple level 0 things, each with one to many subthings. There are multiple level 1 things, each with one to many subthings.
Offhand it would seem like nexted loops would be the answer:
For each level 0 thing begin
for each level 1 thing subthing begin
etc...
But that's obviously not going to handle variable numbers of level one things.
Is there a way to do this with recursion?

IndexedFaceSet creates extra faces in x3d file

I have created an x3d file using x3dom. Following is the structure of the file. Copy the following code into text editor and save it as .x3d file. For imgage texture you can consider any jpg file and place it at the same location as x3d.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN"
"http://www.web3d.org/specifications/x3d-3.0.dtd">
<X3D profile='Interchange' version='3.0'
xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance'
xsd:noNamespaceSchemaLocation='http://www.web3d.org/specifications/x3d-3.0.xsd'>
<Scene>
<NavigationInfo type='"EXAMINE" "WALK" "FLY" "ANY"'/>
<DirectionalLight intensity="0.8" direction="0 1 0"/>
<DirectionalLight intensity="0.9" direction="0 -1 0"/>
<DirectionalLight intensity="0.6" direction="1 0 -1"/>
<DirectionalLight intensity="0.6" direction="-1 0 -1"/>
<DirectionalLight intensity="0.6" direction="-1 0 1"/>
<DirectionalLight intensity="0.6" direction="1 0 1"/>
<Shape>
<Appearance>
<Material ambientIntensity="0.2" diffuseColor="0.004 0.004 0.004" emissiveColor="0 0 0" shininess="0.2" specularColor="0 0 0" transparency="0"/>
<ImageTexture url="Penguins.jpg"/>
</Appearance>
<IndexedFaceSet convex="true" coordIndex="0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 -1 " ccw="true">
<Coordinate point="132.2349 0 329.9732 123.0347 0 336.9273 109.9391 0 350.0229 102.985 0 359.223 82.26761 0 386.6317 69.30841 0 436.438 74.03987 0 470.4683 78.77134 0 504.4987 104.8261 0 548.8805 132.2349 0 569.598 191.8598 0 569.598 191.8598 0 689.9727 911.8589 0 689.9727 1032.234 0 569.598 1032.234 0 270.3483 852.2339 0 270.3483 852.2339 0 210.7232 371.8596 0 210.7232 371.8596 0 329.9732"/>
</IndexedFaceSet>
</Shape>
<Viewpoint description="Center of Space" fieldOfView="0.785" position="553.1368 60 450.348"/>
</Scene>
</X3D>
Looking it from the top view the 3D object looks like this,
enter image description here
And from the bottom view it looks like this,
enter image description here
I have checked all the points and they are in proper sequence but not sure why these two extra faces are created. Anything I am doing wrong here?
You draw a non-convex shape, therefor you need to set convex to false, in addition if you want to see your shape from "behind" you need to set solid to false.
This works:
<IndexedFaceSet convex="false" solid="false" coordIndex="0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 -1">
(you dont need ccw, its true by default)

Draw a 3d rectangular box(rectangular prism ?) in wpf

I am using the following code to form a cube. It uses triangles for each face. How can I make a rectangular box by modifying its values. I dont have much idea on the indices property used here.
<GeometryModel3D.Geometry>
<MeshGeometry3D
Positions = "-1,-1,1 1,-1,1 1,1,1 -1,1,1"
TriangleIndices = "0 1 2 2,3,0"
TextureCoordinates="0,1 1,1 1,0 0,0"
/>
</GeometryModel3D.Geometry>
here you go
<GeometryModel3D.Geometry>
<MeshGeometry3D Positions = "0 0 0 1 0 0 0 1 0 1 1 0 0 0 1 1 0 1 0 1 1 1 1 1"
TriangleIndices = "2 3 1 2 1 0 7 1 3 7 5 1 6 5 7 6 4 5 6 2 0 2 0 4 2 7 3 2 6 7 0 1 5 0 5 4"/>
</GeometryModel3D.Geometry>
this will produce a cube geometry
I would suggest you to understand how it work so you can make other objects too
here is a nice tutorial on WPF 3D
http://www.codeproject.com/Articles/24727/WPF-D-Part-of-n

Plot with image in gnuplot error

I'm trying to plot with image using gnuplot but it always returns me "Reading ras files from sequential devices not supported". Think of a file named "test.txt" includes:
6 5 4 3 1 0
3 2 2 0 0 1
0 0 0 0 1 0
0 0 0 0 2 3
0 0 1 2 4 3
0 1 2 3 4 5
Using gnuplot:
gnuplot> plot "test.txt" matrix w image
gnuplot> Reading ras files from sequential devices not supported
Reading ras files from sequential devices not supported
What can I do about it? Is there any software that I haven't installed in my computer?
I'm using openSuse and I'm not very familiar with it yet.
Thank you in advance

Resources