Skip to content

Instantly share code, notes, and snippets.

View olivierchatry's full-sized avatar

Olivier Chatry olivierchatry

View GitHub Profile
export default Ember.Component.extend({
world: Ember.inject.service()
model: null
activityAction: -> (
@currentModel.set 'activity.action.type', 'move'
return MoveAction.create(activity: @currentModel, world: @get('world'))
).property("model")
newActivity: (attrs) ->
return false unless @can('manage project', @currentModel)
time = this.get('world').get('time')
endDate = moment(time).add(1, 'days').startOf('day')
startDate = moment(time).startOf('day')
activityAction = @store.createRecord 'activityAction'
activityAction.save().then =>
activity = @store.createRecord 'activity',
property(
'activities.isFulfilled',
'activities.@each.action.isSettled'
)
canPlayOrScrub: false,
canPlayOrScrubObserver: function() {
if (this.get('activities.isFulfilled'))
{
let allGood = this.get('activities').every(
(activity) => {
if (activity.get('action.isSettled'))
return true;
Ember.addObserver(activity, "action.isSettled", this, 'canPlayOrScrubObserver');
return false;
destroyWithRelation(model, relations) {
let previousPromise = null;
let values = []
relations.forEach( (relation) => {
if (previousPromise) {
previousPromise = previousPromise.then(
() => { return model.get(relation) }
)
} else {
previousPromise = model.get(relation)
==22022==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 1728 byte(s) in 27 object(s) allocated from:
#0 0x7f9403befa0a in malloc (/lib64/libasan.so.2+0x98a0a)
#1 0x412726 in mesh_prepare_write src/mesh.c:44
#2 0x41b816 in mesh_op src/mesh.c:211
#3 0x446930 in tool_brush_iter src/tools.c:213
#4 0x4488e6 in tool_iter src/tools.c:355
#5 0x488aa3 in goxel_mouse_in_view src/goxel.c:378
#6 0x4e2a8a in gui_iter src/gui.cpp:898
.name And we're stayin' alive, stayin' alive
ld 0xcacacaca, r3 ; barrier value
xor r2, r2, r2 ; set the default offset for the barrier
:start
sub r3, 1, r3 ; make the barrier change a bit, more fun to watch, each new process will get a new value.
ld 4 , r4 ; number of fork per process, make sure it is reset after each fork.
add r2, 4, r2 ; make the barrier move, each new process will get a new value.
run(function() {
var post = env.store.createRecord('post', {});
env.store.createRecord('comment', { message: post });
post.get('comments')
.then(function(comments) {
assert.equal(comments.get('length'), 1);
return post.save();
})
test("A hasMany updated link should not remove new children when the parent record has children already with feedback from the server after save", function(assert) {
Post.reopen({
comments: DS.hasMany('comment', { async: true })
});
Comment.reopen({
message: DS.belongsTo('post', { async: true })
});

Library

We us proj4js ( http://proj4js.org/ ), which is a javascript port of Proj ( https://proj.org/ ) for doing our projections. This is a well known, and use, library. It is the default projection library for GDAL.

Parameters, datum shift, etc.

All the coordinate system definitions come from http://epsg.io ( you can get it directly with https://epsg.io/[EPSG], so for example NAD50 UTM32 would be : https://epsg.io/23032, and the description we are using : https://epsg.io/23032.proj4 )

The value we get for EPSG:23032 is : +proj=utm +zone=32 +ellps=intl +towgs84=-87,-98,-121,0,0,0,0 +units=m +no_defs