Render issue when I learning three.js by the examples - three.js

Description of the problem
After I had cloned the three.js repository,I watch the canvas_camera_orthographic.html,I saw the scene discribed in the link:
three.js issue,sorry for that I can't upload image
Three.js version
[x] 0.86.0
[ ] r85
[ ] ...
Browser
[] All of them
[x] Chrome
[ ] Firefox
[ ] Internet Explorer
OS
[ ] All of them
[ ] Windows
[x] macOS
[ ] Linux
[ ] Android
[ ] iOS

It has something to do with the CanvasRenderer. Try to modify the example and use the WebGLRenderer instead to see this example working just fine.

Related

Mozilla Firefox extension: Creating a new alarm

I am working on a Mozilla Firefox extension that is creating a new alarm.
Here is the code in the manifest.json file:
{
"manifest_version": 2,
"name": "alarms-test",
"version": "1.0",
"content_scripts":
[
{
"matches": ["https://developer.mozilla.org/*"],
"js": ["alarms-test.js"]
}
],
"permissions":
[
"alarms"
]
}
Here is the code in the alarms-test.js file:
console.log("alarms-test: start");
const delayInMinutes = 1;
browser.alarms.create({delayInMinutes});
console.log("alarms-test: end");
Here are the steps that I am following:
In Mozilla Firefox, go to about:debugging
Click on This Firefox then Load Temporary Add-on...
Browse your local files to select the manifest.json file
Go to https://developer.mozilla.org/en-US/
Press F12 then click on the Console tab
See the output
Expected output:
alarms-test: start
alarms-test: end
Current output:
alarms-test: start
It means that something went wrong with the lines 2 and 3 of alarms-test.js.
Do you see what I forgot please?
Thank you.
Best regards.

Running Wand on lambda return ImageMagick in the system is likely to be impossible to load liblqr

Trying to run wand library to resize image image using liquid resize in serverless framework when invoke the function locally it works fine. but running on Lambda results in the following error:
{
"errorMessage": "delegate library support not built-in `' (LQR) # error/resize.c/LiquidRescaleImage/1884\n\nImageMagick in the system is likely to be impossible to load liblqr. You might not install liblqr, or ImageMagick may not compiled with liblqr.",
"errorType": "MissingDelegateError",
"stackTrace": [
[
"/var/task/handler.py",
123,
"imageprocess",
"liquid.liquid_rescale(width, height)"
],
[
"/var/task/wand/image.py",
865,
"wrapped",
"result = function(self, *args, **kwargs)"
],
[
"/var/task/wand/image.py",
3322,
"liquid_rescale",
"str(e) + '\\n\\nImageMagick in the system is likely to be '"
]
]
}

Compiling ES6 (ReactJS) code to work with IE >=9

So I have been building an application in React JS and have been taking advantage of some of the syntax that ES6 provides such as:
using let and const
class components
arrow functions (componentWillMount = () => {})
constructorless state declaration (state = {someProperty: true})
I am running into some issues when compiling though. My code seems to work with most chromes as far as I can tell but the whole thing breaks down around IE9 or IE10. What is the proper way to set up my .babelrc file? (below is what I have right now)
{
"presets": [
["es2016"],
"react"
],
"plugins": [
"babel-plugin-transform-class-properties"
]
}
Also bonus points to anyone who knows how to set this up for Laravel-mix as the components I have built live within a laravel 5.5 env. (here is how my webpack.mix.js file looks as of right now)
mix.react('resources/assets/js/app.js', 'public/js/app.js')
.js('resources/assets/js/cross-brand-nav.js', 'public/js/app.js')
.js('resources/assets/js/FullWidthTabs.js', 'public/js/app.js')
.js('resources/assets/js/universal-nav.js', 'public/js/app.js')
.version()
.combine([
'resources/assets/bower_assets/jquery/dist/jquery.min.js',
'resources/assets/bower_assets/moment/min/moment.min.js',
'resources/assets/bower_assets/bootstrap/dist/js/bootstrap.js',
'resources/assets/bower_assets/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js',
'resources/assets/js/admin.js'
], 'public/js/admin.js').version()
.sass('resources/assets/sass/app.scss', 'public/css')
.sass('resources/assets/bower_assets/components-font-awesome/scss/font-awesome.scss', 'public/css').version()
.styles([
'resources/assets/css/FullWidthTabs.css'
], 'public/css/pf.css')
.styles([
'resources/assets/bower_assets/bootstrap/dist/css/bootstrap.min.css',
'resources/assets/bower_assets/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css'
], 'public/css/admin.css').version();
Try https://babeljs.io/repl/ to convert your code to work with whatever browser you want , it has lot of options for conversion , try that and if you have any question post it here we will help

ReferenceError in Jasmine test using Chutzpah and ReSharper

I'm using Jasmine and Chutzpah to test my TypeScript project in Visual Studio 2013 with PhantomJS. If I run the tests using the Chutzpah context menu extension they work fine but when I run them using the ReSharper test explorer, they fail if there are any external dependencies. The error message is ReferenceError: $ is not defined.
My project structure looks like:
- Scripts
- MyApp
- Components
- DatePicker.ts
- Tests
- Components
- DatePickerTest.ts
- typings
- jquery
- jquery.d.ts
- jquery-1.10.2.js
Chutzpah.json
Chutzpah.json looks like
{
"Framework": "jasmine",
"Compile": {
"Mode": "External",
"Extensions": [ ".ts" ],
"ExtensionsWithNoOutput": [ ".d.ts" ]
},
"References": [
{
"Includes": [
"*/Scripts/jquery-1.10.2.js"
],
"Excludes": [ "*/Scripts/*.d.ts" ]
}
],
"Tests": [
{
"Includes": [ "*/Scripts/Tests/*.ts" ],
"Excludes": [ "*/scripts/Tests/*.d.ts" ]
}
]
}
DatePickerTest.ts looks like
/// <reference path="../../myapp/components/datepicker.ts" />
import DatePicker = MyApp.Components.DatePicker;
describe("Datepicker", () => {
var datePicker: DatePicker
beforeEach(() => {
datePicker = new DatePicker();
});
// tests
});
Instantiating the DatePicker fails with the message ReferenceError: $ is not defined because the class uses $.extend() in the constructor.
I've tried declaring the reference to jQuery at the top of the test by adding the line /// <chutzpah_reference path="../../jaquery-1.10.2.js" /> but that doesn't make any difference. Plus my understanding is that adding references in the Chutzpah.json means I shouldn't have to do this anyway.
As suggested in this answer, I have debugged my test in the browser and sure enough jQuery isn't being loaded in the index.html page, so what am I doing wrong?
The problem came down to how ReSharper attempts to resolve dependencies based on the type definition references it finds. The ReSharper unit testing docs say:
If your test file references and (sic) external JavaScript library using a declaration file (*.d.ts), ReSharper will search the original JavaScript file by the name of the *.d.ts file.
My class under test was referencing the jQuery definition file:
/// <reference path="../../typings/jquery/jquery.d.ts" />
The problem was that I also have jquery.cookie.js included in my project (as part of Foundation), and ReSharper was incorrectly including that instead of jquery-1.10.2.js.
Renaming or removing jquery.cookie.js allowed ReSharper to find the correct jQuery file and solved the problem.

Visual Studio 2013; just my code - mycode.json

I'm trying to figure out the mycode.json file that can be used in combination with the "just my code" service of Visual Studio 2013. However it's not making sense to me
For those who know not what "just my code" is:
http://blogs.msdn.com/b/visualstudioalm/archive/2013/11/25/just-my-code-for-asp-net-in-visual-studio-2013.aspx
This is my scenario
I have a project that is using jquery libraries and my own custom js file, called myconsents.js
I want to be able to debug this only, but for some reason the debugger keeps jumping into the jquery libraries.
This is how my mycode.json file looks like
{
"Eval" : "MyCode",
"Function" : "Library",
"ScriptBlock" : "Unrelated",
"MyCode" : [
"myconsents.js"
],
"Libraries" : [
"*.min.js", "jquery.*.js", "jquery-*.js"
],
"Unrelated" : [
]
}
I hope you can provide a solution
Thanks
I found that Visual Studio was ignoring my mycode.json file because I had put a JavaScript-style comment at the beginning:
// http://msdn.microsoft.com/en-us/library/dn457346.aspx#BKMK_JavaScript_Just_My_Code
{
"MyCode": [ ],
"Libraries": [ "*-min.js" ],
"Unrelated": [ ]
}
VS started working as expected after removing the comment.

Resources