text:
How to unit test a component with TranslateService and the translate pipe?

I'm submitting a ...  (check one with "x")
[ ] bug report => check the FAQ and search github for a similar issue or PR before submitting
[x] support request => check the FAQ and search github for a similar issue before submitting
[ ] feature request

Question
How to test a component that uses TranslateService and the translate pipe?
I have a root module with:
TranslateModule.forRoot({
      loader: {
        provide: TranslateLoader,
        useFactory: HttpLoaderFactory,
        deps: [HttpClient]
      }
    })

// AoT requires an exported function for factories
export function HttpLoaderFactory(httpClient: HttpClient) {
  return new TranslateHttpLoader(httpClient, "assets/i18n/", ".json");
}

also, inside my main component (with router-outlet) I have:
export class AppComponent {
  constructor(private translate: TranslateService) {
    translate.addLangs(["en", "it"]);
    translate.setDefaultLang('en');

    let browserLang = translate.getBrowserLang();
    translate.use(browserLang.match(/en|it/) ? browserLang : 'en');
  }
}

and finally, in my Component that I want to test I have this:
export class AboutComponent implements OnInit, OnDestroy {
  pageHeader: any = { title:'', strapline: '' };
  private i18nSubscription: Subscription;
  constructor(private translate: TranslateService) {}
  ngOnInit() {
    this.i18nSubscription = this.translate.get('ABOUT')
      .subscribe((res: any) => {
        this.pageHeader = {
          title: res['TITLE'],
          strapline: res['STRAPLINE']
        };
      });
  }

  ngOnDestroy() {
    if (this.i18nSubscription) {
      this.i18nSubscription.unsubscribe();
    }
  }
}

Now I want to test 'AboutComponent'. But how?
At the moment I have this:
beforeEach( async(() => {
    TestBed.configureTestingModule({
      imports: [ TranslateModule.forRoot() ],
      declarations: [ AboutComponent, PageHeaderComponent ]
    });
    fixture = TestBed.createComponent(AboutComponent);
    comp = fixture.componentInstance;
    fixture.detectChanges();
    return fixture.whenStable().then(() => fixture.detectChanges());
  }));

Obviously I have to say to my test that I'm using 2 languages (en and it), but I don't know which is the right way to do that.
At the moment both TemplateService and pipes aren't working.
For instance, I created this to test the result of a traslate pipe:
    it('should display the about page', () => {
      const element: DebugElement = fixture.debugElement;
      fixture.detectChanges();
      const message: DebugElement[] = element.queryAll(By.css('small'));
      expect(message.length).toBe(2);
     expect(message[0].nativeElement.textContent.trim()).toBe('');
      expect(message[1].nativeElement.textContent.trim()).toBe('Not implemented yet');
    });

and the result is this error:
Expected 'ABOUT.NOT_IMPLEMENTED' to be 'Not implemented yet'.

Thank u.
Please tell us about your environment:

ngx-translate version: 7.2.0

Angular version: 4.3.4

Browser: [all]

If you unit test your component, then you should mock the service.
So in the spec instead of importing TranslateModule you should add this to your providers:
{provide: TranslateService, useClass: TranslateServiceStub}
And then do something like this:
`export class TranslateServiceStub{
public get(key: any): any {
	Observable.of(key);
}

}`
or you return the key with a suffix, so you know "the service was called".
Because when you unit test your component, you should rely on that external dependencies (like the translateService) are already tested and they are working.

Can anyone suggest on my issue #627

@kartheininger If I do that I receive this error
The pipe 'translate' could not be found

because I'm using both TranslateService and pipe.
To be more accurate:
I don't wanna test ngx-translate, but that it is applying the correct translation. Obviously I don't want to show "BLABLA.BLALA" instead of "Hello".
I saw while developing that if you make a stupid error all translations of the page will be broken, so I want to be sure that everything is working in the right way.
In fact, I want to test that my component is shown with the right labels also changing the language. So, I'm not testing ngx-translate.

@kartheininger Also, adding TranslatePipe to my declarations I get this:
Failed: this.translate.get(...) is undefined

Have you tried to use the real pipe and the mock i suggested together? I don`t know if thats working, because in our app we mocked both in tests.
If you use the pipe too, then i would add a mock for the pipe too. I copied a small example within https://github.com/ngx-translate/core/issues/635
I personally would just let the mocks return the key a bit modified e.g. with a 1 at the end. So you know the pipe/service was called. I hope i got you right and thats what you wanna test :)

@kartheininger
Have you tried to use the real pipe and the mock i suggested together? I don`t know if thats working, because in our app we mocked both in tests.

yes. Using Service mock and the real pipe I get this error: "Failed: this.translate.get(...) is undefined"
Using the Pipe mock doesn't change anything.
My problem is that I don't wanna use mocks. I can't test that my components are ok, without to know that translations are correct.
I don't wanna test TranslateService or other, but that they are applying the right translations in my component.
I want to be sure that all texts are defined in all files and that are applied in the right place. I cannot release a multi language application in production without to now that all label, texts and so on are working very well.
That because I use strings to get translations (for instance "ABOUT.TITLE") and a simple typo could break translation and my app will show a wrong label. That is a big problem in production.
I think that this is a use case where mocks are very bad. It should be possibile to apply real translations. Only with real translations I will be sure that everything will be ok in production.

I updated your mock because you forgot to add "return":
export class TranslateServiceStub{

	public get(key: any): any {
		return Observable.of(key);
	}
}

but now I'm receiving:
Failed: this.translate.onTranslationChange is undefined

It isn't so simple to mock this service.

If that method in your test is missing, then you need to add it to the Stub :)
It should probably return the same type then the real implementation, therefore have a look here: https://github.com/ngx-translate/core/blob/master/src/translate.service.ts
You need to mock all the methods you are calling :)
In our tests we do not need more methods mocked, as the user cannot change his language without leaving the app and reloading it (user settings are done in a different system :))

@kartheininger Any example mock that you are using in your.  I am having problem with TranslateDirective.  Do I need to mock this too?  It will be nice to include a unit testing example project in your  examples folder.

By the way, to save you time of mocking manually everything
you can use something like this library I wrote -
https://github.com/hirezio/jasmine-auto-spies
Where you could do something like -
translateServiceSpy =  createSpyFromClass(TranslateService, null, ['get', 'use', 'anyOtherObservableMethod')
and get a simple API of -
translateServiceSpy.get.and.nextWith(anyValue)
It will also auto mock your sync methods as well (without having to specify them).

I'm just coming up to speed on this stack and was trying to wrap some tests around an Ionic component. I ran across this same problem and solved it by looking at translate.service.spec.ts (https://github.com/ngx-translate/core/blob/master/tests/translate.service.spec.ts) and the comments in this thread.
Essentially I had to define TranslateModule in imports and provide it a TranslateLoader called FakeLoader which wrapped my manually defined translations (it'd be nice to use the actual file here). Next I had to get the TranslateService instance and set the language to use in my test.
import { ComponentFixture, TestBed, getTestBed } from '@angular/core/testing';
import {Injector} from "@angular/core";
import { IonicModule, Platform, NavController } from 'ionic-angular';
import { TranslateModule, TranslateLoader, TranslateService } from '@ngx-translate/core';
import { By }              from '@angular/platform-browser';
import { DebugElement }    from '@angular/core';
import {Observable} from 'rxjs/Observable';

import { CardsPage } from './cards';

import {
  PlatformMock,
  NavMock,
} from '../../../test-config/mocks-ionic';

let translations: any = {"CARDS_TITLE": "This is a test"};

class FakeLoader implements TranslateLoader {
  getTranslation(lang: string): Observable<any> {
    return Observable.of(translations);
  }
}

describe('CardsPage (inline template)', () => {
  let comp:      CardsPage;
  let fixture:   ComponentFixture<CardsPage>;
  let de:        DebugElement;
  let el:        HTMLElement;
  let translate: TranslateService;
  let injector:  Injector;

  it('true is true', () => expect(true).toBe(true));

  beforeEach(() => {
    TestBed.configureTestingModule({
      declarations: [CardsPage],
      imports: [
        IonicModule.forRoot(CardsPage),
        TranslateModule.forRoot({
          loader: {provide: TranslateLoader, useClass: FakeLoader},
        })
      ],
      providers: [
        { provide: Platform, useClass: PlatformMock },
        { provide: NavController, useClass: NavMock },
      ]
    });
    injector = getTestBed();
    translate = injector.get(TranslateService);

    fixture = TestBed.createComponent(CardsPage);

    comp = fixture.componentInstance;

    de = fixture.debugElement.query(By.css('ion-title'));
    el = de.nativeElement;
  });

  it('should include the title of the cards page', () => {
    translate.use('en');
    fixture.detectChanges();
    expect(el.textContent).toContain('This is a test')
  });
});

This seems like a crazy amount of configuration and mocking for every component but I'm new to the Angular stack...

@pherris Nice work! Spent so much time trying to get that damn translatemodule to work.

This is a crazy amount of extra work and becomes very cumbersome if this has to be included in every test. There must be an easier way, or not?

@kgish You could probably create a custom object for the testingmodule and import it into each test?

Yes indeed.
Based on https://github.com/ngx-translate/core/issues/471, I tried extracting all of the translation-specific stuff into a separate helper module, but was unable to come up with a simple solution.
Any hints or tips would be greatly appreciated.

Hi,
Not sure if this is helpful to anyone. I'm new to unit testing, but i'm using Jest. Here's my mock:
`import { Pipe, PipeTransform } from '@angular/core';
export class HttpLoaderMock {
getTranslation() {
return {
"HELLO": "Hello",
"SETTINGS.LANGUAGE.DESCRIPTION": ""
}
}
}
export class TranslateServiceMock {
setDefaultLang(){}
}
@Pipe({
name: "translate"
})
export class TranslatePipeMock implements PipeTransform {
public name: string = "translate";
public transform (query: string, ...args: any[]): any {
    return query;
}

}`
In the getTranslation function, I will be loading it with the default (English) language translation as time goes on.

I've got everything I need mocked out (translate pipe and setDefaultLang) using Jest. I'll see if I can pull together a complete spec with just the translation piece in it (at the moment, it's all mixed-in with project-specific code)

Thanks to @pherris, @Ks89  and https://stackoverflow.com/a/43833423 one possible solution that checks all supported languages is.
ADVANTAGE: Uses real translation files/contents (json) to validate element contents. In case keys are change inside translation file (json) tests will fail.
ATTENTION: code most probably will not compile. serves as an example what steps are to be done.
import { async, TestBed } from '@angular/core/testing';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { TranslateModule, TranslateLoader, TranslateService } from '@ngx-translate/core';

import { NotFoundPageComponent, NotFoundPageModule } from '@app/areas/public';

import * as de from '@assets/i18n/de.json';
import * as en from '@assets/i18n/en.json';

import { NotFoundPagePage } from './not-found-page.po';

const TRANSLATIONS = {
    DE: de,
    EN: en
};

class JsonTranslationLoader implements TranslateLoader {
    getTranslation(code: string = ''): Observable<object> {
        const uppercased = code.toUpperCase();

        return of(TRANSLATIONS[uppercased]);
    }
}

describe('NotFoundPage:', () => {
    describe('i18n:', () => {
        let page: NotFoundPagePage;
        let component: NotFoundPageComponent;
        let service: TranslateService;

        beforeEach(async(() => {
            TestBed.configureTestingModule({
                imports: [
                    NoopAnimationsModule,
                    TranslateModule.forRoot({
                        loader: { provide: TranslateLoader, useClass: JsonTranslationLoader },
                    }),
                    NotFoundPageModule
                ]
            });

            service = TestBed.get(TranslateService);

            page = new NotFoundPagePage(TestBed);
            component = page.component;

            // calls internally
            // detectChanges() -> whenStable().then(() => detectChanges());
            return page.waitForCompoentToBecomeStable();
        }));

        Object.keys(TRANSLATIONS).forEach((k) => {
            const key = k.toLowerCase();

            describe(`${key}:`, () => {
                beforeEach(() => {
                    service.use(key);

                    page.detectChanges();
                });

                it('should have translated value as username hint', async () => {
                    service.get('LOGIN_FORM.USERNAME').subscribe((translated) => {
                        const text = page.getUsernameInputPlaceholderText();

                        expect(text).toBe(translated);
                    });
                });

                it('should have translated value as password hint', () => {
                    service.get('LOGIN_FORM.PASSWORD').subscribe((translated) => {
                        const text = page.getPasswordInputPlaceholderText();

                        expect(text).toBe(translated);
                    });
                });
            });
        });
    });
});

I have added a test example here if you still need it: https://github.com/ngx-translate/example/blob/master/src/app/app.component.spec.ts

I've never used ionic, but maybe @danielsogl could help out?

I can verify that Oliver (ocombe)'s test example code worked.  Thanks Oliver!!

Yes, this may work but it is still quite inconvenient to have to include all of this boiler-plate code in every test that depends on ngx-translate. There must be a better option possible?

Can't @kgish more. I don't want to include all of the components into my test file

Angular provides a module HttpClientTestingModule for mocking HttpClient. Why not follow the same pattern here and provide this as a first-party module for testability of your project?

I was able to run tests with configuration mentioned above, but, on one of my test's, when I used the pipe I got this error "Error: Parameter "key" required" but when I switched to directive it did work?
// does not work

        {{data.status | translate}}

// works

        {{data.status}}

@kbirger

import { Injectable, NgModule, Pipe, PipeTransform } from '@angular/core';
import { TranslateLoader, TranslateModule, TranslatePipe, TranslateService } from '@ngx-translate/core';
import { Observable, of } from 'rxjs';

const translations: any = {};

class FakeLoader implements TranslateLoader {
  getTranslation(lang: string): Observable<any> {
    return of(translations);
  }
}

@Pipe({
  name: 'translate'
})
export class TranslatePipeMock implements PipeTransform {
  public name = 'translate';

  public transform(query: string, ...args: any[]): any {
    return query;
  }
}

@Injectable()
export class TranslateServiceStub {
  public get<T>(key: T): Observable<T> {
    return of(key);
  }
}

@NgModule({
  declarations: [
    TranslatePipeMock
  ],
  providers: [
    { provide: TranslateService, useClass: TranslateServiceStub },
    { provide: TranslatePipe, useClass: TranslatePipeMock },
  ],
  imports: [
    TranslateModule.forRoot({
      loader: { provide: TranslateLoader, useClass: FakeLoader },
    })
  ],
  exports: [
    TranslatePipeMock,
    TranslateModule
  ]
})
export class TranslateTestingModule {

}

agree with @kbirger
@ocombe, please take a look

import { Injectable, NgModule, Pipe, PipeTransform } from '@angular/core';
import { TranslateLoader, TranslateModule, TranslatePipe, TranslateService } from '@ngx-translate/core';
import { Observable, of } from 'rxjs';

const translations: any = {};

class FakeLoader implements TranslateLoader {
  getTranslation(lang: string): Observable<any> {
    return of(translations);
  }
}

@Pipe({
  name: 'translate'
})
export class TranslatePipeMock implements PipeTransform {
  public name = 'translate';

  public transform(query: string, ...args: any[]): any {
    return query;
  }
}

@Injectable()
export class TranslateServiceStub {
  public get<T>(key: T): Observable<T> {
    return of(key);
  }
}

@NgModule({
  declarations: [
    TranslatePipeMock
  ],
  providers: [
    { provide: TranslateService, useClass: TranslateServiceStub },
    { provide: TranslatePipe, useClass: TranslatePipeMock },
  ],
  imports: [
    TranslateModule.forRoot({
      loader: { provide: TranslateLoader, useClass: FakeLoader },
    })
  ],
  exports: [
    TranslatePipeMock,
    TranslateModule
  ]
})
export class TranslateTestingModule {

}

imports: [                 HttpClientTestingModule,                 TranslateModule.forRoot({                     loader: {provide: TranslateLoader, useClass: TranslateFakeLoader},                 })]

Has this testing module been integrated into the library? Or will it be?

@AndreiShostik
With Angular 9 and Ngx translate 12, the TranslateTestingModule does not seem to be working anymore. The TranslateModule is ignoring the provided mocked service and pipe. Is anyone else experiencing this issue?

Hello there. One guy in my team used a mocked class and a spy. The lines with the '<====' are the most important ones. Works for Angular 8 and 9
The mocked class: i18n.pipe.mock.ts
`import {Pipe, PipeTransform} from '@angular/core';
// noinspection AngularMissingOrInvalidDeclarationInModule
@Pipe({name: 'i18n'})
export class I18nPipeMock implements PipeTransform {
transform(value: number): number {
return value;
}
}`
Your Component, here: PageErrorMessageComponent for Example. Its templade uses I18 Pipe:
`import {async, ComponentFixture, TestBed} from '@angular/core/testing';
import {PageErrorMessageComponent} from './page-error-message.component';
import {NO_ERRORS_SCHEMA} from '@angular/core';
import {I18nPipeMock} from '../../pipes/i18n.pipe.mock'; /I18 Pipe Mock, refers to the mocked class. Replace with your path <====/
describe('PageErrorMessageComponent', () => {
let component: PageErrorMessageComponent;
let fixture: ComponentFixture;
let i18nSpy; /<====/
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [PageErrorMessageComponent, I18nPipeMock], /I18 Pipe Mock   <====/
schemas: [NO_ERRORS_SCHEMA],
})
.compileComponents();
i18nSpy = spyOn(I18nPipeMock.prototype, 'transform'); /I18 Pipe Mock   <====/
}));
beforeEach(() => {
fixture = TestBed.createComponent(PageErrorMessageComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});`

Hello there. One guy in my team used a mocked class and a spy. The lines with the '<====' are the most important ones. Works for Angular 8 and 9
The mocked class: i18n.pipe.mock.ts
import {Pipe, PipeTransform} from '@angular/core';

// noinspection AngularMissingOrInvalidDeclarationInModule
@Pipe({name: 'i18n'})
export class I18nPipeMock implements PipeTransform {
  transform(value: number): number {
    return value;
  }
}

Test spec to your Component "PageErrorMessageComponent", here: page-error-message.component.spec.ts for Example. PageErrorMessageComponent´s template uses I18 Pipe.
import {async, ComponentFixture, TestBed} from '@angular/core/testing';

import {PageErrorMessageComponent} from './page-error-message.component';
import {NO_ERRORS_SCHEMA} from '@angular/core';
import {I18nPipeMock} from '../../pipes/i18n.pipe.mock'; /*I18 Pipe Mock, refers to the mocked class. Replace with your path <====*/

describe('PageErrorMessageComponent', () => {
  let component: PageErrorMessageComponent;
  let fixture: ComponentFixture<PageErrorMessageComponent>;
  let i18nSpy; /*<====*/

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [PageErrorMessageComponent, I18nPipeMock], /*I18 Pipe Mock   <====*/
      schemas: [NO_ERRORS_SCHEMA],
    })
    .compileComponents();
    i18nSpy = spyOn(I18nPipeMock.prototype, 'transform'); /*I18 Pipe Mock   <====*/
  }));

  beforeEach(() => {
    fixture = TestBed.createComponent(PageErrorMessageComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
  });

  it('should create', () => {
    expect(component).toBeTruthy();
  });
});

Does anyone try it and confirm that it works?

The next code works fine for me:
import { NgModule } from '@angular/core';
import { TranslateLoader, TranslateModule, TranslateFakeLoader } from '@ngx-translate/core';

@NgModule({
  imports: [
    TranslateModule.forRoot({
      loader: {
        provide: TranslateLoader,
        useClass: TranslateFakeLoader
      },
    })
  ],
  exports: [
    TranslateModule
  ]
})
export class TranslateTestingModule {

}

Then simple import it
TestBed.configureTestingModule({
	declarations: [...]
	imports: [
		TranslateTestingModule
	]
});

Hello @Ks89 and everyone.
Hope you're doing well !
You can try ngx-translate-testing package to see if you can figure out with your problem. But you need to upgrade your project Angular version to at least version 6 as said in Installation section.

Hello everyone,
I am trying to use this TranslateTestingModule:
import { Injectable, NgModule, Pipe, PipeTransform } from '@angular/core';
import { TranslateLoader, TranslateModule, TranslatePipe, TranslateService } from '@ngx-translate/core';
import { Observable, of } from "rxjs";

const translations: any = {};

class FakeLoader implements TranslateLoader {
  getTranslation(lang: string): Observable<any> {
    return of(translations);
  }
}

@Pipe({
  name: 'translate'
})
export class TranslatePipeMock implements PipeTransform {
  public name = 'translate';

  public transform(query: string, ...args: any[]): any {
    return query;
  }
}

@Injectable()
export class TranslateServiceStub {
  public get<T>(key: T): Observable<T> {
    return of(key);
  }

  public setDefaultLang(key: string) {
    return key;
  }

  public use(key: string) {
    return key;
  }
}

@NgModule({
  declarations: [
    TranslatePipeMock
  ],
  providers: [
    { provide: TranslateService, useClass: TranslateServiceStub },
    { provide: TranslatePipe, useClass: TranslatePipeMock },
  ],
  imports: [
    TranslateModule.forRoot()
  ],
  exports: [
    TranslatePipeMock,
    TranslateModule
  ]
})
export class TranslateTestingModule {

}

But simple test like this one is failing for me:
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';

import { SomeComponent } from './some.component';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { TranslateTestingModule } from "../../../mocks/TranslateTesting.module";

fdescribe('SomeComponent', () => {
  let component: SomeComponent;
  let fixture: ComponentFixture<SomeComponent>;

  beforeEach(waitForAsync(() => {
    TestBed.configureTestingModule({
      imports: [ HttpClientTestingModule, TranslateTestingModule ],
      declarations: [ SomeComponent ]
    })
    .compileComponents();
  }));

  beforeEach(() => {
    fixture = TestBed.createComponent(SomeComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
  });

  it('should create', () => {
    expect(component).toBeTruthy();
  });
});

With the following error:
Chrome 98.0.4758.80 (Linux x86_64) SomeComponent should create FAILED
        TypeError: Cannot read properties of undefined (reading 'subscribe')
            at TranslatePipe.transform (node_modules/@ngx-translate/core/__ivy_ngcc__/fesm2015/ngx-translate-core.js:1563:1)
            at ɵɵpipeBind1 (node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:25820:1)
            at SomeComponent_Template (ng://SomeComponent.js:275:33)
            at executeTemplate (node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:9614:1)
            at refreshView (node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:9480:1)
            at refreshComponent (node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:10651:1)
            at refreshChildComponents (node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:9277:1)
            at refreshView (node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:9530:1)
            at renderComponentOrTemplate (node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:9594:1)
            at tickRootContext (node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:10825:1)
Chrome 98.0.4758.80 (Linux x86_64): Executed 1 of 55 (1 FAILED) (0 secs / 0.059 secs)
Chrome 98.0.4758.80 (Linux x86_64) SomeComponent should create FAILED
        TypeError: Cannot read properties of undefined (reading 'subscribe')
            at TranslatePipe.transform (node_modules/@ngx-translate/core/__ivy_ngcc__/fesm2015/ngx-translate-core.js:1563:1)
            at ɵɵpipeBind1 (node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:25820:1)
            at SomeComponent_Template (ng:///SomeComponent.js:275:33)
            at executeTemplate (node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:9614:1)
            at refreshView (node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:9480:1)
            at refreshComponent (node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:10651:1)
            at refreshChildComponents (node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:9277:1)
            at refreshView (node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:9530:1)
            at renderComponentOrTemplate (node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:9594:1)
Chrome 98.0.4758.80 (Linux x86_64): Executed 1 of 55 (1 FAILED) (skipped 54) (0.119 secs / 0.059 secs)

Anybody could point what am I missing?

how to load translate JSON file in karma?

I am coming quite late on this question but you can just require('path/to/en.json') and should just work if it's valid JSON

authors: AndreiShostik Aracturat Gleam01 ImMortex Ks89 Notifium Zhichao-Hong chaimmw dsebastien erhimanshugarg kartheininger kbirger kgish kgorol leemon20 mrctrifork ocombe pherris ronjoy4 ryboucher shairez victorpers vutienthinh yavin5 yuezhizizhang


text:
Mustache Integration

Create a module supporting Mustache templates. The actual integration will be based on Jersey MVC. Late we may create modules for  Freemarker and JSP templates.
This module will depend on bootique-jersey, and template rendering will be done via JAX-RS.

done integrating Jersey MVC.. Will need to tweak that for sanity.

source: gharchive/issue

repo: nhl/bootique-mvc

license_type: permissive

license_source: github-api


text:
How can we not introduce external pictures?

I want to upload pictures only from my website, how can I limit it?

Why don't you try addImageBlobHook?

license: MIT


text:
Internal: aim to reduce number of package dependencies from ~25 to <20

If possible.

The packages are just in the Suggests section and are all related to various data preparation processes and vignettes, so I think my concern about number of dependencies is probably unnecessary actually.
Going to leave the issue open for now, in case there are ways we can streamline that list anyway.

Understood - and I'm making an assumption that the rule of thumb for dependencies that I've seen cited around the web ("try to keep below 20") probably only applies to Depends, not Suggests - so as I said maybe we're fine here and can close the issue.

repo: nhs-r-community/NHSRdatasets


text:
🛑 Auth is down

In fa8396e, Auth ($AUTH_URL) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Auth is back up in 5a999a1 after 5 minutes.

repo: nhs-work/test-upptime


text:
🛑 Auth is down

In 8d8ff11, Auth ($AUTH_URL) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Auth is back up in 28641fc after 6 minutes.


text:
Create initial sass folder structure

The structure is a combination of ITCSS by Harry Roberts
and how NHSUK currently structures components and elements

👍

source: gharchive/pull-request

authors: Demotive teneightfive

repo: nhsalpha/betahealth

license: mit

license_source: bigquery


text:
Added blank SCSS commenting template

I have added the SCSS commenting template, so we can fill them out at a later date.

Looks good @Ross-Clark, congrats on your 1st commit to this repo!

authors: AdamChrimes Ross-Clark

repo: nhsuk/nhsuk-frontend


text:
Changed the name of the Scripting API Example package to a shorter one

[X] This contribution adheres to CONTRIBUTING.md.

What does this Pull Request accomplish?
The name of the scripting API example package was reduced as build failures occurred due to its length.
Why should this Pull Request be merged?
With the current name, the build of the scripting API example package fails.
What testing has been done?
N/A

LGTM! (I can't actually approve)

authors: rtzoeller zszilagy


text:
Expand home

v 1.0
Contact form works, responsive design improved, project layout correct, project information props correct

v 1.0.0 pr

repo: nic-vo/nv-portfolio


text:
Lightning macaroon loading & API key in config

See individual commits, it should be easier to review that way.
I intend to contribute a few more things later.

Fantastic, thank you. Look forward to seeing your ideas!

authors: Kixunil nickfarrow

repo: nickfarrow/BTCPyment


text:
dotNET server with MySql DB : json parsing error

Hi,
I'm using the dotNet server version with mysql database. I modified the necessary and the project is running well with visual studio 2013. But there is a json parsing error when showing the map
maps.js:62 error status: parsererror
maps.js:63 errorThrown: SyntaxError: Unexpected token B
maps.js:64 Object {readyState: 4, responseText: "{ "locations": [8BA21D90-3F90-407F-BAAE-800B04B1F5…B04B1F5EC,8BA21D90-3F90-407F-BAAE-800B04B1F5ED] }", status: 200, statusText: "OK"}abort: (a)arguments: nullcaller: nulllength: 1name: ""prototype: m.extend.ajax.v.abortconstructor: (a)__proto__: Object__proto__: ()<function scope>always: ()complete: ()done: ()error: ()fail: ()getAllResponseHeaders: ()getResponseHeader: (a)overrideMimeType: (a)pipe: ()progress: ()promise: (a)readyState: 4responseText: "{ "locations": [8BA21D90-3F90-407F-BAAE-800B04B1F5EB,8BA21D90-3F90-407F-BAAE-800B04B1F5EC,8BA21D90-3F90-407F-BAAE-800B04B1F5ED] }"setRequestHeader: (a,b)state: ()status: 200statusCode: (a)statusText: "OK"success: ()then: ()__proto__: Object

Hi,
I want to add that when using a debug string into the DbJsonReader, the call for "locations", it means call for the prcGetAllRoutesForMap the json has a wrong format. not like "routes"
 { "locations": [8BA21D90-3F90-407F-BAAE-800B04B1F5EB,8BA21D90-3F90-407F-BAAE-800B04B1F5EC,8BA21D90-3F90-407F-BAAE-800B04B1F5ED] }

 { "routes": [{ "sessionID": "8BA21D90-3F90-407F-BAAE-800B04B1F5ED", "userName": "gpsTracker1", "times": "(Jan 3 2007 08:43PM - Jan 3 2007 08:45PM)" },{ "sessionID": "8BA21D90-3F90-407F-BAAE-800B04B1F5EC", "userName": "gpsTracker2", "times": "(Jan 3 2007 08:40PM - Jan 3 2007 08:42PM)" },{ "sessionID": "8BA21D90-3F90-407F-BAAE-800B04B1F5EB", "userName": "gpsTracker3", "times": "(Jan 3 2007 08:37PM - Jan 3 2007 08:39PM)" }] }

I'm not 100% sure that the the dotNet version and the php version are compatible. Why are you mixing up the two?
n

I need to integrate the gps tracker into as a module into an other project.
But it's ok now. I fixed it by changing the select query into the prcGetAllRoutesForMap like this :
 ....
 SELECT CONCAT('{ "latitude":"', CAST(latitude AS CHAR),'", "longitude":"',
 CAST(longitude AS CHAR), '", "speed":"', CAST(speed AS CHAR), '", "direction":"',
 CAST(direction AS CHAR), '", "distance":"', CAST(distance AS CHAR), '", "locationMethod":"',
  locationMethod, '", "gpsTime":"', DATE_FORMAT(gpsTime, '%b %e %Y %h:%i%p'), '",
 "userName":"', userName, '", "phoneNumber":"', phoneNumber, '", "sessionID":"',
 CAST(sessionID AS CHAR), '", "accuracy":"', CAST(accuracy AS CHAR), '",
 "extraInfo":"', extraInfo, '" }') json
 FROM ...

cool, very good.
n

repo: nickfox/GpsTracker


text:
Improve setup documentation

The setup docs are missing details of adding the app to INSTALLED_APPS
Add a change log

#7

repo: nickmoreton/wagtail-honeypot


text:
issue while running spm design

Hi Nickson,
i ran this script. I think the first and second step for installation have to be swapped because after logging into root using sudo -i, the cloned repo is not visible. so would have to git clone again.
Another issue, I installed openlane successfully and ran the test design using :
bash-4.1$ ./flow.tcl -design spm
And I am getting the following error:
couldn't read file "/root/openlane_build_script/work/tools/openlane_working_dir/pdks/sky130A/libs.tech/openlane/config.tcl": permission denied
I have called the docker from root itself.,but still its showing permission denied.
could you help me resolve this issue?

Hi Praharsha,
Please find the resolution to below 2 issues assuming that you had correctly run the docker command from ~/openlane directory:

couldn't read file "/root/openlane_build_script/work/tools/openlane_working_dir/pdks/sky130A/libs.tech/openlane/config.tcl": Execute
export PDK_ROOT=<absolute path to where skywater-pdk and open_pdks reside>
**For eg.**export PDK_ROOT= /home//Desktop/work/tools/openlane_working_dir/pdks

post executing the above command invoke docker as:
docker run -it -v $(pwd):/openLANE_flow -v $PDK_ROOT:$PDK_ROOT -e PDK_ROOT=$PDK_ROOT -u $(id -u $USER):$(id -g $USER) openlane:rc2
Add the export variable (PDK_ROOT) to your environment or you will have to execute the same every time you restart your terminal.
2)For permission denied while invoking docker:
Add your user to docker group with below command
sudo usermod -aG docker ${USER}
Hope that resolves the issues.
-Nickson

I have a similar issue with reading config.tcl file but for a different reason, it says that no such file or directory, and the file exists and has all permissions.
if anyone can help. thanks in advance.
Regards,
Younis

authors: MohamedAliYounis njose939 praharshapm


text:
二段階認証を有効にしたアカウントでログインできない

概要
niconicoアカウントの二段階認証を有効にすると、このアプリケーションでログインできないと思われる。（メールアドレスまたはパスワードが違うというエラーとなる）
二段階認証の設定は https://account.nicovideo.jp/my/account から行える。
環境

macOS 10.13.3
Version 1.0.0

ええ、まだ未対応です。。(近々やっちゃいます)

authors: abouthiroppy y-yu

repo: nicohaco/nicohaco


text:
Password?

I Connected To My Pi via SSH after install and the password is incorrect... it used to be "raspberry" (the default) now i cant login

The installation script does not change the password. Depending on what you enter at the promt, it may change your hostname, so maybe you are trying to connect to the wrong hostname?

authors: Marrley nicokaiser

repo: nicokaiser/rpi-audio-receiver


text:
Multiple aggregators (aka multiple measures)

Is it possible to display two different aggregators in the same pivot table ?
lets say sum aggregator and count.

Unfortunately not. Please see this FAQ entry.

Hi Nicolas,
I was working on a Qlik sense custom extension that's built upon pivottable.js that you have created.But it limits us from adding multiple measures.
Could you please guide me what changes should i make so that i'll be able to achieve my desired output ?

@MaySahu unfortunately this is not possible.

authors: MaySahu nicolaskruchten numjcp

repo: nicolaskruchten/pivottable


text:
generate isl::managed_copy functions

This function avoids the need to write
isl::manage(isl_*_copy(object))
by replacing it with
isl::managed_copy(object)
when the user wants to keep the C object alive after the C++ wrapper is
deleted.  It also allows the user to ignore the type of the C object
thanks to overloading.
We have it in PollyLabs issue tracker https://github.com/PollyLabs/isl/issues/9

Sure it will go in PollyLabs, it will have to be rebased anyway so it
will may have a different message.
On 04/08/17 15:20, Tobias Grosser wrote:

@tobig commented on this pull request.
This looks very good! Thanks a lot!
Some very minor comments:

I commonly prefix this with "cpp:" in the title line
Are there two spaces before "It also allows"?
Can you add a signed-off line?
I would likely describe in the first sentence of the commit
message /what/ this does, rather what it replaces.

Any chance you can push such reviews to the public PollyLabs/isl
review threads. I think it would be nice to have a public record how
patch reviews for isl can look like.
PS: I try to give very detailed comments to make these patches
upstream quality. These are obviously only suggestions, please choose
and pick what you believe makes sense.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/nicolasvasilache/isl/pull/20#pullrequestreview-54364049,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABcTa4Goq-EhfNeSYrTtcmP95EpwHXSEks5sUxq7gaJpZM4OtshH.

repo: nicolasvasilache/isl


text:
fix: correct MCA scores and SCF

fix erroneous dot product when computing scores (closes #65 ) credits to @mschulzie
add conjugate when computing total squared covariance in CrossDecomposer (closes #64 ) @mschulzie
streamline covariance and squared covariance fraction for MCA

Codecov Report

Merging #66 (8e43d15) into main (f65f54b) will increase coverage by 0.14%.
The diff coverage is 93.02%.

@@            Coverage Diff             @@
##             main      #66      +/-   ##
==========================================
+ Coverage   91.46%   91.60%   +0.14%
==========================================
  Files          39       40       +1
  Lines        2600     2692      +92
==========================================
+ Hits         2378     2466      +88
- Misses        222      226       +4

Impacted Files
Coverage Δ

xeofs/models/mca_rotator.py
59.82% <76.47%> (+1.18%)
:arrow_up:

xeofs/models/mca.py
90.74% <92.30%> (+0.26%)
:arrow_up:

tests/models/test_complex_mca_rotator.py
94.11% <94.11%> (ø)

tests/models/test_complex_mca.py
100.00% <100.00%> (ø)

tests/models/test_mca.py
100.00% <100.00%> (ø)

tests/models/test_mca_rotator.py
100.00% <100.00%> (ø)

xeofs/models/decomposer.py
97.93% <100.00%> (+0.02%)
:arrow_up:

authors: codecov-commenter nicrie

repo: nicrie/xeofs


text:
Deprecated _config.yml option

The gems option is being replaced with plugins in jekyll 3.5.0
Ref: https://jekyllrb.com/news/2017/06/15/jekyll-3-5-0-released/

Fixed! Thanks for the help :-)

authors: migueldemoura nielsenramon

repo: nielsenramon/chalk


text:
New features

It is possible ignoring all the Symfony http exceptions (most of us use them in order to ease the normal flow)
A version can be set from the config file
A set of default tags can be set from the config file

First of all, thx for the PR. I'll add some individual comments tomorrow when time permits. In general feature-specific PRs are simpler to review. ;-)
The tags & version features look ok so far, but regarding the http_exceptions: why would you ignore either all exceptions or none?
The reasoning behind the explicit 404 ignoral is that this kind of exception is triggered a lot e.g.

Bots/Apps looking for robots.txt/apple-touch-icon/manifest.json/you-name-it
Dev-Tools searching for source maps
Invalid links/resources
…

and might be of any real interest after some time while all other exceptions (especially all kind of server exceptions) should continue to be monitored so they can be handled appropriately.
I'd let the 404 stay and make them e.g. mutually exclusive or re-implement the 404er as a subset of 'all'. This could maybe be extended so that one could pick which kind of exceptions (401, 404, 429, …) should be ignored… But that could be implemented in a follow-up.

Yep, you are right, I could enhance the ignore functionality in order to ignore specific type of httpexception. If you are not in a hurry I can do it next week ;)
Basically, I coded that way beacuse all the HttpExceptions we use in our poject are part of a well controlled flow. But I see your point!

No hurry, can't wait to see the implementation… ;-)

@nietonfir I've fixed the code according to your review. You'll find it in the BelkaLab:new_feats branch 👋

authors: bertuz nietonfir

repo: nietonfir/RaygunBundle


text:
Enhanced Insulin Flexibility: Introducing U-100 and U-200 Concentration Options in Trio

To improve Trio’s flexibility and personalization, we could introduce an option allowing users to select their insulin concentration—either U-100 or U-200 insulin. This feature would provide the following benefits:
1.	Personalized Dosing Precision: Users who need higher or lower concentrations for various lifestyle needs or insulin resistance can set their concentration type. Once chosen, Trio could automatically adjust the bolus and basal doses, preventing dosing errors and ensuring accurate insulin delivery.
2.	Reduced Manual Calculations: By automating the adjustments based on concentration, Trio would eliminate the need for users to calculate conversions manually, enhancing convenience and safety.
3.	Broader User Compatibility: Offering both U-100 and U-200 options could attract a wider range of users, accommodating those who prefer higher concentrations due to higher insulin needs or to minimize injection volumes.
This update could align with Trio’s commitment to personalized and advanced diabetes management, helping users manage insulin with greater ease and confidence.

I have a son using Lyumjev U-200 in Trio for the last 6 months or more. Doing this was challenging as many things has to be changed to do this successfully. Another challenge is that Lyumjev U-200 is "not" 200% of U-100, something the manufactorer also admits to on their webpages. Our experience is that Lyumjev U-200 is around 170% as powerful as U-100...! It should be allowed for differences between the insulin types available with U-200., both with regard to insulin brands and possibly also individual metabolism.
Secondly, this work could be started with enhancing the Trio documentation regarding the use of U-200 insulin. What settings should be changed, how much and why?
We have had to change the more obvious settings like:

Basal
Carb Ratio
Insulin Sensitivity Factor

But we have also had to change the following as well:

Max SMB Basal Minutes
Max UAM SMB Basal Minutes
Autosens Max
Autosens Min

Other settings that might be needed to be looked at, depending on your usage:

Recommended Bolus Percentage
Max IOB
Max COB
Adjustment Factor
Simoid Adjustment Factor
Weighted Average of TDD
SMB Delivery Ratio

and this makes the following settings even more important that they are correct:

Insulin Curve
Insulin DIA
Insulin Peak Time

The current Bolus calculator in Trio is a Nightmare for us, as it does not take the CR settings into account at all. We are looking really forward to the new bolus calculator in Trio version 1.0.0...!!!
The upcoming Remote functionality in Trio and LoopFollow will also be affected by U-200, especially the Remote Bolus function where the user must remember that they ar using U-200 and manually calculate the needed Bolus (Trio provides info about needed Bolus, but multiplying that with 1.7x in your head is not always that easy - in our case).
As there seems to be an increasing amount of users using U-200 insulin, supporting this directly in Trio would be very helpful for those users...!
There might also be more loopers interested in using U-200 insulin, as:

Insulin is delivered almost twice as fast as with U-100 insulin (since each Omnipod pulse is 0.05U of U-100 isnulin, but almost twice that with U-200 insulin)

All Omnipods have a max bolus of 30U, and for people with considerable insulin resistancy it is not uncommon to have to use very aggressive CR settings. My son has a CR of between 0.8-1.0 g/U. Without U-200 insulin this limits meals that Trio can handle resonably efficient to 30g (boys between 15-25 years of age, can often eat 60g or 90g - which creates a number of challenges - especially since they typically do not like to have to handle their diabetes manually)...! Using U-200 insulin makes us able to automate handling of meals up to 60g of carbs, and potentially more using fat/protein entries...!

As insulin resistance is increasing dramatically in the population, and using GLP-1/GIP is not always recommended when kids are still developing - any help in this area would be very helpful and welcome...!

The claim that Lyumjev U-200 is only about 170% as potent as U-100 is not officially confirmed by Eli Lilly, but it’s a perception shared by some users based on personal experience. Lyumjev U-200 is designed to be twice as concentrated as Lyumjev U-100, meaning each unit in the U-200 version should deliver roughly the same glucose-lowering effect as in U-100, but in half the volume. However, differences in how the body absorbs and processes the U-200 concentration can lead to variability in perceived strength or effectiveness.
Here are the factors contributing to this perception include:
1.	Absorption Rates: Higher concentration insulins can sometimes behave differently in terms of how quickly and consistently they’re absorbed.
2.	Injection Volume: Lower injection volume with U-200 can change the speed or effectiveness of insulin action, sometimes leading users to feel that U-200 doesn’t match the expected 200% potency.
3.	Individual Metabolism: Personal factors like skin absorption, metabolic rate, and insulin resistance can impact how strongly someone feels the effects of U-200 insulin compared to U-100.
Though Lyumjev U-200 is officially intended to have the same potency per unit as U-100, these practical differences have led some to conclude it may feel closer to around 170% as potent rather than a full 200%.

I use Lyumjev u200 and just reduced my basal rates by about 30 percent, same for ISF and my CR.  If this updates does make it, I'm assuming I would have to redo all of that. TBH, I think people who are on u200 and also using an AID, would be knowledgeable enough for the right correction factors. Also, take into consideration that if someone ,who does not use anything but u100, selects u200 accidentally can really cause issues. Just a thought.

Thanks for your thoughts on this! I use Lyumjev U200 as well, and for my setup, I set both bolus and basal rates at 50% of the U100 settings, while keeping my carb ratio (CR) and insulin sensitivity factor (ISF) unchanged. I also find the warning window helpful, as it prompts confirmation before dosage selection.

Please see issue #264. Maybe its easier to append findings and suggestions to that and keep it all in one central issue.

Please see https://github.com/nightscout/Trio/issues/264 for this. Closing this because duplicate. Please post the observatrions there.

repo: nightscout/Trio


text:
BytePairEncodingCore.d.ts: 'TextDecoder' refers to a value, but is being used as a type here. Did you mean 'typeof TextDecoder'?

I get an error in line 7 in the file BytePairEncodingCore.d.ts:
export declare const decoder: TextDecoder;

Should this be changed to?
export declare const decoder: typeof TextDecoder;

hi Michael, what's your stack? how are you using gpt-tokenizer? the d.ts files are autogenerated by TS during build time and are correct.

authors: michael-engelhardt niieani

repo: niieani/gpt-tokenizer


text:
[Feature Request] Large Monitor, Single App Window Size Concern

First of all, thank you for creating AeroSpace.
Apologies if this is already solved. I am using a 28-inch monitor. When only one application is open, the window stretches across the entire screen, making it too wide and challenging to navigate efficiently.
It might be helpful to have a feature that allows for managing the window size or position in such scenarios.
This is the result I am aiming for. The window could be also be on the left or right, not just center.

Also endorsing this one. In yabai I am using space specific padding to achieve this, so maybe that could be a possible solution without restricting window sizes etc?

In yabai I am using space specific padding to achieve this

What is the point of using ultra-wide screen, if you effectively cut left and right gaps from it?
I'm not joking, it's real question to better understand use case for workspace-specific gaps

My current setup on an ultrawide:
1 work: docs/terminal | code | localhost
2 leisure: (gap) | browser | (gap)
3 focused work: (gap) | browser | code | (gap)

The thing is I am still trying to divide the workspaces for the task at hand. So when I'm just browsing the web I don't really need all that screen real estate and having one window span the entire screen makes it harder to navigate (as @juniusfree  pointed out). The idea behind workspace three is that sometimes having too many windows open makes it harder for me to focus, so having just two, or only an editor makes it easier.

@Marty-W thanks for the explanation, I get it now
When you mentioned workspace-specific gaps, I assumed that you'd just make all workspaces that are assigned to the ultrawide monitor have big gaps, but I get it now. You only put big gaps for workspaces that only have one or so windows
That's an interesting use case for workspace-specific gaps

Currently, it's possible to have monitor-specific gaps
gaps.outer.top = [{ monitor."built-in" = 0 }, 24] # (1)

That's how it can be extended to support workspace-specific gaps:
gaps.outer.top = [{ monitor."built-in" = 0 }, { workspace.1 = 10 }, 24] # (2)

But I think we can do even better to support a pattern like "window count" (I'm brainstorming, it's not a final design, though I encourage you to share your thoughts)
# (3)
gaps.outer.left = [{ window-count-range."1..2" = 200 }, 0]
gaps.outer.right = [{ window-count-range."1..2" = 200 }, 0] # Ugh, there is no way to conjugate conditions :(

# (4)
gaps.outer.left = [{ if.window-count-range = "1..2", if.monitor = "ultrawide-monitor-name-pattern", value = 200 }, 0]
gaps.outer.right = [{ if.window-count-range = "1..2", if.monitor = "ultrawide-monitor-name-pattern", value = 200 }, 0]
# Yay! Conjugated conditions!

Note to myself: I should stop turning TOML into a programming language, it'd be easier if AeroSpace used Lua for configuration
Note: When I refer to "monitor pattern" I mean monitor pattern name as in https://nikitabobko.github.io/AeroSpace/guide.html#assign-workspaces-to-monitors

window-count-range

Or more correctly: tiling-window-count-range (floating windows shouldn't be counted)

I like the proposed solution using the tiling-window-count-range and monitor filter.

New proposal #278
[gaps]
outer.left = 'test %{workspace-tiling-windows-count} <= 2 && echo 100'
outer.right = 'test %{workspace-tiling-windows-count} <= 2 && echo 100'

As an alternative idea for solving this issue, what about introducing configuration options (per monitor) to set maximum window sizes and alignment? To me, these feel more intuitive for solving the root usability issues.
e.g., for @Marty-W's scenarios:

1 work: docs/terminal | code | localhost
2 leisure: (gap) | browser | (gap)
3 focused work: (gap) | browser | code | (gap)

Let's say the monitor width is 3440px, the alignment is set to "center" and the max width is set to 1500.
In scenario 1, each windows takes ~1146px, which is less than the max width, so the look is the same as the vertical tiling today.
In scenario 2, the window would have taken the full 3440px, but is instead maxed out at 1500px. Additionally, the window would be aligned in the center.
In scenario 3, each window maxes out at 1500px and because thee two windows combined still don't reach the full monitor width, they are aligned in the center, leaving a 220px gap on each side (440px total).

@ryanflegel good suggestion, thanks!

@ryanflegel so essentially instead of making gaps bigger you suggest to restrict windows max width/height. Makes perfect sense. I think my "bigger gaps" suggestion and yours can coexist
Good suggestion, thanks!

If this gets implemented, I would 100% use this, the biggest issue for me is that I am using ultrawide screen, and 1 full screen is not really useable

Just to add that the way fyabai (a popular fork of Yabai) solves this problem is like the max window size thing described above... I have it configured that way so that for instance:

If I have only a single window open it is centered and at a specific size
Two windows take up more space overall but still don't quite expand to fill the whole screen
Three or more windows are large enough that the behaviour becomes more like the default (i.e. screen is filled)

And part of my use case for this is actually for Screen sharing purposes - my colleagues don't have Ultrawide monitors so if I share my entire screen the text for them is tiny, so what I prefer to do is use Zoom's "Share a region of the screen" and I set that region right over the "one window" size.
I could tell the screen sharing to share a window rather than the screen, but if I do that then I can't switch application on the share easily.  Using the region based share I can move between workspaces to show other single-window applications

Personally, I find the lack of tiling on ultrawide monitors manageable with floating windows. However, a feature that would improve my workflow would be the ability to automatically switch to a floating layout when the monitor for a workspace or window exceeds a certain width threshold.
Or more generally, the ability to callback when switching between monitors.

Using the count method is sub optimal in my opinion and doesn't suit all possible scenarios well.
I have certain workspaces that I like to have large gaps e.x. a workspace with messengers on my ultra-wide, where I usually have 2 messenger windows open and don't need them to occupy all the space available.
I would like to be able to manually set gaps per workspace, that's all.
Unfortunately the provided solution

That's how it can be extended to support workspace-specific gaps:
gaps.outer.top = [{ monitor."built-in" = 0 }, { workspace.1 = 10 }, 24] # (2)

doesnt seem to work for me and AeroSpace gives an error that "the table is expected to have a single key monitor".
How do I make it work?

I prototyped a quick-and-dirty solution for myself, since this is the only feature blocking my use of Aerospace:
https://github.com/sdoerner/AeroSpace/commit/a9560e39c2d582e93edcb71a50821e3567e17a27
Probably not merge-worthy because I assume you want to fix this in a way that allows more customization with your mini scripting language. Happy to polish some of this up though if you think it would work with your final design (e.g. moving visibleRectPaddedByOuterGaps into Workspace).
I struggled a bit with naming. maxWidth doesn't exactly fit into gaps, as it's rather the opposite of a gap. However, I do find this modeling with maxWidth useful because I have a two different monitors at home/work and only one of them is widescreen.

I am already using aerospace; I would say implementing some sort of max-window-size will make life so much easier for users with ultrawide screens

new to aerospace, but is could this be solved with "ghost windows"?  i have an ultrawide and i was wondering if its possible to add a empty space window so i can control how my real windows take up space.

authors: Marty-W RW21 juniusfree lamdor nadeemkhedr nikitabobko pk1m ryanflegel sdoerner stevewardle zakroma

repo: nikitabobko/AeroSpace


text:
Implement Sessions

Closes #12.

This is exciting! :partying_face:

@fancycade This should be god to go. I've opened #24 and #25 and #26 based on things that I noticed when implementing this.

authors: fancycade niklaslong

repo: niklaslong/olm-elixir


text:
Arabic font rendering

Hey guys, I've seen this issue opened before, however I can't get it to work properly for a custom Arabic font.
Here is how the HTML looks: http://prntscr.com/ckxcp3
And how the html2canvas 0.5.0-alpha1 looks: http://prnt.sc/ckxd1v
As you can see, the characters are all tangled up. Any ideas?
Update:
On line 2321 I replaced !hasUnicode with hasUnicode, which works almost perfect:
http://prnt.sc/ckxnjo
Now the font looks perfect, but normal characters "!" and "(" have wrong direction.
Update2:
Managed to find a fix based on n-a-g-r-o-m' solution [https://github.com/niklasvh/html2canvas/issues/686]

check out
http://stackoverflow.com/questions/30555379/html2canvas-image-capturing-issue-with-utf-8-characters
similar issue

For version  0.5.0-beta3
Change:
var textList = (!this.options.letterRendering || noLetterSpacing(container)) && !hasUnicode(container.node.data) ? getWords(characters) : characters.map(function(character)
To:
var textList = (!this.options.letterRendering || noLetterSpacing(container)) || !hasUnicode(container.node.data) ? getWords(characters) : characters.map(function(character)
Change the && to ||
And it works perfect for Arabic without any CSS modifications

sounds like the problem is fixed,
just be ware of word-wrap : break-word style, it still splits the Arabic/Persian words into separate characters.

For version 0.5.0-beta3
Change:
var textList = (!this.options.letterRendering || noLetterSpacing(container)) && !hasUnicode(container.node.data) ? getWords(characters) : characters.map(function(character)
To:
var textList = (!this.options.letterRendering || noLetterSpacing(container)) || !hasUnicode(container.node.data) ? getWords(characters) : characters.map(function(character)
Change the && to ||
And it works perfect for Arabic without any CSS modifications

Worked for me along with letter-spacing: normal

don't use word-break: break-word;

RTL support added in https://github.com/niklasvh/html2canvas/pull/2653

I faced the same issue in version 1.4.1 and fixed it by using
letter-spacing: normal;

in the wrapping element

authors: Ali492 FireWall-e RashwanSharif S4Mi TarekAlQaddy niklasvh sevenLee vali-mint


text:
fix #2299 and #2296 and #2009 and #493

A similar PR may already be submitted!
Please search among the Pull request before creating one.
Thanks for submitting a pull request! Please provide enough information so that others can review your pull request:
Before opening a pull request, please make sure all the tests pass locally by running npm test.
Summary

This PR fixes/implements the following bugs/features

[x] Bug 1: opacity
[x] Feature 1: text-stroke
[x] Feature 2: css filter

Explain the motivation for making this change. What existing problem does the pull request solve?

Test plan (required)
Demonstrate how the issue/feature can be replicated. For most cases, simply adding an appropriate html/css template into the reftests should be sufficient. Please see other tests there for reference.
Code formatting
Please make sure that code adheres to the project code formatting. Running npm run format will automatically format your code correctly.
Closing issues

Fixes #

I think opacity is an attribute that can affect child elements and should be placed in effects

I wonder why this pull request is not merged.

Can you make a build release I mean a single .js file like html2canvas.js of this please?

Can you make a build release I mean a single .js file like html2canvas.js of this please?

You can download the artifacts from the CI routine. However, here you go: https://github.com/niklasvh/html2canvas/suites/1187063696/artifacts/17429870 :)

Can you make a build release I mean a single .js file like html2canvas.js of this please?

You can download the artifacts from the CI routine. However, here you go: https://github.com/niklasvh/html2canvas/suites/1187063696/artifacts/17429870 :)

Thank you very much for your help.

Only opacity and text-stroke are working. But filter is not working, nothing heppen on adding filter.
Here is my testing image:
In browser:

After save:

Opacity and text-stroke are working perfectly. But there is still problem with filter! [I add  -webkit-filter: contrast(200%); filter: contrast(200%) in this, but I also tried with blur and sepia, these are also not working :( ]

FYI, @niklasvh

大佬你解决了opacity的bug吗

大佬你解决了opacity的bug吗

解决了。你可以试试；不行可以找我

大佬你解决了opacity的bug吗

解决了。你可以试试；不行可以找我

确实解决了，谢谢大佬。还有个下划线和删除线的粗细bug大佬了解吗


text:
Update array.php

fixes #1096
Pull Request Type
What kind of change does this PR introduce?
[ ] Solved an issue/task
[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:
What is the current behavior?

Issue Number: [Insert Issue Number (if applicable)]
What is the new behavior?

Other information

Merged

This is an automated message from Fork, Commit, Merge [BOT].

Thank you for your contribution! Your pull request has been merged. The files have been reset for the next contributor.
What's next?
If you're looking for more ways to contribute, I invite you to check out my other projects. Just click here to find more. These projects contain real issues that you can help resolve. You can also check out the Influences section in the README to find more projects similar to this one.
Also please leave a star to this project if you feel it helped you, i would really appreciate it.
I look forward to seeing your contributions!

repo: nikohoffren/fork-commit-merge


text:
Error when loading plugin

[19:37:08] [Server thread/ERROR]: [ModernPluginLoadingStrategy] Could not load plugin 'gringotts-towny-2.12.4-SNAPSHOT.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: org/gestern/gringotts/api/dependency/Dependency
at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:127) ~[pufferfish-1.19.3.jar:git-Pufferfish-61]
at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:35) ~[pufferfish-1.19.3.jar:git-Pufferfish-61]
at io.papermc.paper.plugin.entrypoint.strategy.ModernPluginLoadingStrategy.loadProviders(ModernPluginLoadingStrategy.java:150) ~[pufferfish-1.19.3.jar:git-Pufferfish-61]
at io.papermc.paper.plugin.storage.SimpleProviderStorage.enter(SimpleProviderStorage.java:35) ~[pufferfish-1.19.3.jar:git-Pufferfish-61]
at io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enter(LaunchEntryPointHandler.java:36) ~[pufferfish-1.19.3.jar:git-Pufferfish-61]
at org.bukkit.craftbukkit.v1_19_R2.CraftServer.loadPlugins(CraftServer.java:428) ~[pufferfish-1.19.3.jar:git-Pufferfish-61]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:275) ~[pufferfish-1.19.3.jar:git-Pufferfish-61]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1103) ~[pufferfish-1.19.3.jar:git-Pufferfish-61]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:318) ~[pufferfish-1.19.3.jar:git-Pufferfish-61]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.NoClassDefFoundError: org/gestern/gringotts/api/dependency/Dependency
at java.lang.Class.forName0(Native Method) ~[?:?]
at java.lang.Class.forName(Class.java:467) ~[?:?]
at org.bukkit.plugin.java.PluginClassLoader.(PluginClassLoader.java:78) ~[pufferfish-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:123) ~[pufferfish-1.19.3.jar:git-Pufferfish-61]
... 9 more
Caused by: java.lang.ClassNotFoundException: org.gestern.gringotts.api.dependency.Dependency
at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:185) ~[pufferfish-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:152) ~[pufferfish-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?]
at java.lang.Class.forName0(Native Method) ~[?:?]
at java.lang.Class.forName(Class.java:467) ~[?:?]
at org.bukkit.plugin.java.PluginClassLoader.(PluginClassLoader.java:78) ~[pufferfish-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:123) ~[pufferfish-1.19.3.jar:git-Pufferfish-61]
... 9 more

Adding mine as well for visibility
24.05 04:16:21 [Server] ERROR Could not load plugin 'gringotts-towny-2.12.4-SNAPSHOT.jar' in folder 'plugins' 24.05 04:16:21 [Server] INFO org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: org/gestern/gringotts/api/dependency/Dependency 24.05 04:16:21 [Server] INFO at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:127) ~[paper-1.19.4.jar:git-Paper-538] 24.05 04:16:21 [Server] INFO at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:35) ~[paper-1.19.4.jar:git-Paper-538] 24.05 04:16:21 [Server] INFO at io.papermc.paper.plugin.entrypoint.strategy.modern.ModernPluginLoadingStrategy.loadProviders(ModernPluginLoadingStrategy.java:116) ~[paper-1.19.4.jar:git-Paper-538] 24.05 04:16:21 [Server] INFO at io.papermc.paper.plugin.storage.SimpleProviderStorage.enter(SimpleProviderStorage.java:39) ~[paper-1.19.4.jar:git-Paper-538] 24.05 04:16:21 [Server] INFO at io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enter(LaunchEntryPointHandler.java:36) ~[paper-1.19.4.jar:git-Paper-538] 24.05 04:16:21 [Server] INFO at org.bukkit.craftbukkit.v1_19_R3.CraftServer.loadPlugins(CraftServer.java:424) ~[paper-1.19.4.jar:git-Paper-538] 24.05 04:16:21 [Server] INFO at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:273) ~[paper-1.19.4.jar:git-Paper-538] 24.05 04:16:21 [Server] INFO at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1104) ~[paper-1.19.4.jar:git-Paper-538] 24.05 04:16:21 [Server] INFO at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:320) ~[paper-1.19.4.jar:git-Paper-538] 24.05 04:16:21 [Server] INFO at java.lang.Thread.run(Thread.java:833) ~[?:?] 24.05 04:16:21 [Server] INFO Caused by: java.lang.NoClassDefFoundError: org/gestern/gringotts/api/dependency/Dependency 24.05 04:16:21 [Server] INFO at java.lang.Class.forName0(Native Method) ~[?:?] 24.05 04:16:21 [Server] INFO at java.lang.Class.forName(Class.java:467) ~[?:?] 24.05 04:16:21 [Server] INFO at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:76) ~[paper-api-1.19.4-R0.1-SNAPSHOT.jar:?] 24.05 04:16:21 [Server] INFO at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:123) ~[paper-1.19.4.jar:git-Paper-538] 24.05 04:16:21 [Server] INFO ... 9 more 24.05 04:16:21 [Server] INFO Caused by: java.lang.ClassNotFoundException: org.gestern.gringotts.api.dependency.Dependency 24.05 04:16:21 [Server] INFO at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:183) ~[paper-api-1.19.4-R0.1-SNAPSHOT.jar:?] 24.05 04:16:21 [Server] INFO at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:150) ~[paper-api-1.19.4-R0.1-SNAPSHOT.jar:?] 24.05 04:16:21 [Server] INFO at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?] 24.05 04:16:21 [Server] INFO at java.lang.Class.forName0(Native Method) ~[?:?] 24.05 04:16:21 [Server] INFO at java.lang.Class.forName(Class.java:467) ~[?:?] 24.05 04:16:21 [Server] INFO at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:76) ~[paper-api-1.19.4-R0.1-SNAPSHOT.jar:?] 24.05 04:16:21 [Server] INFO at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:123) ~[paper-1.19.4.jar:git-Paper-538] 24.05 04:16:21 [Server] INFO ... 9 more 24.05 04:16:21 [Server] ERROR ebean.properties not found 24.05 04:16:21 [Server] INFO DataSourcePool [Gringotts] autoCommit[false] transIsolation[SERIALIZABLE] min[2] max[20] 24.05 04:16:21 [Server] INFO SubClassFactory parent ClassLoader [org.bukkit.plugin.java.PluginClassLoader] 24.05 04:16:22 [Server] INFO Entities enhanced[0] subclassed[2]

Hi there!
It appears that Gringotts is absent. For Gringotts Towny to function, Gringotts is required as it holds all the essential functionalities. Gringotts Towny essentially provides Towny support.
Feel free to download it from Spigot at the following link:
https://www.spigotmc.org/resources/gringotts.42071/
❤

authors: Nicheven adabugra nikosgram

repo: nikosgram/gringotts-towny


text:
一次性key和m3u8的如何下载

anquanniu的视频，m3u8地址token单次失效的，key也是单次失效的
拿到m3u8 地址了，不过提示报错如下：

19:30:02.552 / (NORMAL) 开始解析 https://play.qiqiuyun.net/sdk_api/video/hls_stream/shd.m3u8?resNo=xxxxx&token=xx.eyJsZXZlbCI6xxxxLY&ssl=1

19:30:03.694 / (NORMAL) 获取m3u8 key... https://play.qiqiuyun.net/sdk_api/video/hls_clef/shd?resNo=57ced0419ce74xxxxx8e8&token=eyJ0exxxxxxRo&ssl=1

19:30:03.975 / (NORMAL) 写出meta.json

19:30:04.061 / (NORMAL) 开始下载文件

19:30:04.235 / (ERROR) **指定的密钥大小对于此算法无效**。

看download文件夹里面的mata.json是正常的，正常获取了key iv 和地址：
{
  "m3u8": "https://play.qiqiuyun.net/sdk_api/video/hls_stream/shd.m3u8?resNo=xxxxx&token=eyJ0exxxxxqB8&ssl=1",
  "m3u8BaseUri": "https://play.qiqiuyun.net/sdk_api/video/hls_stream/",
  "updateTime": "2022-02-0xxx",
  "m3u8Info": {
    "originalCount": 242,
    "count": 242,
    "vod": true,
    "targetDuration": 20,
    "totalDuration": 2425.88,
    "segments": [
      [
        {
          "index": 0,
          "method": "AES-128",
          "key": "YWIwdxxxxxx2eTM=",
          "iv": "0x8e0xxxxxx",
          "duration": 10.08,
          "segUri": "https://esd7a3b2c54r-pub.pubssl.qiqiuyun.net/7325/xxxxxx/lrYBkDT1cmRxxxxx7d0c88e8"
        },
        {
          "index": 1,
          "method": "AES-128",
          "key": "YWIwdxxxxxx",
          "iv": "0xe5xxxxxxxx",
          "duration": 10.0,
          "segUri": "https://esd7a3b2c54r-pub.pubssl.qiqiuxxxxxxx7d0c88e8"
        },

@IGbaolan 大佬 问题解决了嘛

可以利用f12把m3u8地址ban掉 让他只被下载器发起请求
不过程序已经不再支持气球云了

把 UA 搞成 iPhone 的就可以下载了

authors: IGbaolan aehyok ifreesec nilaoda


text:
lack of error-trapping of incomplete model declarations and general logic of codeProcessIfThenElse

We do not trap this case:
code <- nimbleCode({
    y~dnorm(0,1)
    some_name  # incomplete declaration
})
m <- nimbleModel(code)
# Error in code[[i]][[1]] : object of type 'symbol' is not subsettable

The issue is that codeProcessIfThenElse asssumes it can use code[[1]].
More generally, the logic in codeProcessIfThenElse seems off. It checks for codeLength > 1 as if there are legit cases of codeLength == 1, but as far as I see, there are no such cases. All declarations, loops, {, and if have their parsed code being length more than 1.

Actually, {} and f() are of length 1. We catch the latter elsewhere and the former is ignored.

repo: nimble-dev/nimble


text:
Integrate Flow to CoroutineTemplate

https://github.com/nimblehq/android-templates/issues/87
What happened 👀
Integrate Flow to CoroutineTemplate
Insight 📝

get users data from API to demonstrate SharedFlow
show error to demonstrate SharedFlow
Add loading state to demonstrate StateFlow
Remove LiveData related component

Proof Of Work 📹
https://user-images.githubusercontent.com/13492460/122552566-a6466080-d060-11eb-972b-90338e66e945.mp4
Log according to the above usage
2021-06-18 18:12:10.062 21357-21357/co.nimblehq.coroutine.staging D/HomeFragment$bindViewModel$1$1$invokeSuspend$$inlined$collect: Result : [UserEntity(id=26, name=, username=, email=, address=Address(street=, suite=, city=, zipCode=, geo=Geo(latitude=, longitude=)), phone=, website=)]
2021-06-18 18:13:24.234 21357-21357/co.nimblehq.coroutine.staging D/HomeFragment$bindViewModel$1$1$invokeSuspend$$inlined$collect: Result : [UserEntity(id=7, name=, username=, email=, address=Address(street=, suite=, city=, zipCode=, geo=Geo(latitude=, longitude=)), phone=, website=)]
2021-06-18 18:13:26.112 21357-21357/co.nimblehq.coroutine.staging D/HomeFragment$bindViewModel$1$1$invokeSuspend$$inlined$collect: Result : [UserEntity(id=501, name=, username=, email=, address=Address(street=, suite=, city=, zipCode=, geo=Geo(latitude=, longitude=)), phone=, website=)]

Awesome! Will review soon 😁

@chornerman Could you please add [#86] at your PR title also?
And if you have 2 parts of it, can you add [Part1/2] for helping us on reviewing? 🥺

@lydiasama I believe the #86 is for Jetpack Compose related PR, also this PR has only one part 🙏🏼 , but I will ensure that both Jetpack Compose PRs have #86 in the description and will add [PartX/2] to them.

authors: Tuubz chornerman lydiasama

repo: nimblehq/android-templates


text:
[#133] Adding the test step for the newproject.sh test script

https://github.com/nimblehq/android-templates/issues/133
What happened 👀
As we discussed recently in the Retrospective Meeting, the current process to initialize a project via the newproject.sh script is not being tested when the CI runs. This causes us into trouble when there are changes under the hood of the template implementation that breaks the script or are executed but the project is not buildable.
The solution does not only do we run the unit test on the template like a normal project, but we have to also test our init script that works as expected.
Insight 📝
Here is the solution to verify newproject.sh script:

Firstly, I added gradle command to build the project and execute UnitTest on the generated project to make sure the script works properly.
The second step is adding a new workflow to execute newproject.sh for 2 templates on Github Actions.

Proof Of Work 📹

All checks should be passed ✅

Executing script on local

https://user-images.githubusercontent.com/6950766/146744440-b565e0ec-dab6-407d-bff8-09050ea8b5f3.mov

could you please update the PoW, @hoangnguyen92dn - since this script will be run only to the later PR when it's merged, the current statement from the PoW isn't valid to see if the PR is working as expected

besides, I just realize that we are not committing build/ or app/build/ so these were redundant from the original script
https://github.com/nimblehq/android-templates/pull/151/files#diff-19da73e7c5533edd3285c63a0b88034c9e92dfd1e71a28dbccb78154cdef2b28R119

since this script will be run only to the later PR when it's merged, the current statement from the PoW isn't valid to see if the PR is working as expected

@sleepylee The workflow will be executed include Verify the script step, so I think it's acceptable rather than verifying once merged to develop 🤔

besides, I just realized that we are not committing build/ or app/build/ so these were redundant from the original script

I don't fully get your review 🤔  I added the build and execute all the UnitTest to make sure the generated project is buildable and ready for use. Then on CI, these steps will help us to alert the code changes that affected the script.

@hoangnguyen92dn

The workflow will be executed include Verify the script step...
okay, so the result is published on this current PR as well, which is ok 👌  but I would still recommend to make some screenshot of how the scripts passed from your local running. When we say "just check the CI state" it's not directive enough as Reviewers might not know what workflow should they look for if they are not reading all the changes. Besides, such comment would work when we do a refactor or adding test, writing a test feature like now we should elaborate better what has been changed.

I don't fully get your review 🤔 ....
re: removing build/ and app/build/ please follow the line I pointed from the script - the change was not included in this PR, I just found that from the original implementation it's not necessary.

removing build/ and app/build/ please follow the line I pointed from the script - the change was not included in this PR, I just found that from the original implementation it's not necessary.

Got it. In my opinion, I think we can leave it there, just in case users build the template before executing the script, then the generated project will be clean to start development.

@hoangnguyen92dn then maybe "gradlew clean" is a better approach? 🤔

removing build/ and app/build/ please follow the line I pointed from the script - the change was not included in this PR, I just found that from the original implementation it's not necessary.

Got it. In my opinion, I think we can leave it there, just in case users build the template before executing the script, then the generated project will be clean to start development.

@hoangnguyen92dn then maybe "gradlew clean" is a better approach? 🤔

I don't see where gradlew clean is being called as @sleepylee suggested, was there a change in the decision?

I don't see where gradlew clean is being called as @sleepylee suggested, was there a change in the decision?

@Tuubz Sorry I forgot to push the latest update. The gradlew clean added in here
https://github.com/nimblehq/android-templates/pull/151/files#diff-19da73e7c5533edd3285c63a0b88034c9e92dfd1e71a28dbccb78154cdef2b28R112

authors: Tuubz hoangnguyen92dn sleepylee


text:
Please do not use uppercase header. use dbghelp.h instead. Cross compiling always needs lowercase header.

/home/cqwrteur/toolchains_build/ninja/src/minidump-win32.cc:18:10: fatal error: 'DbgHelp.h' file not found
   18 | #include <DbgHelp.h>
      |          ^~~~~~~~~~~
1 error generated.

https://github.com/trcrsired/windows-msvc-sysroot/tree/main/include

PR welcome :)
Regarding mt.exe: I'm not sure how to fix that.

DbgHelp.h is the Windows SDK header name, lower case dbghelp.h is the mingw-w64 name.

minidump-win32.cc is only enabled for MSVC target, maybe you can try GNU target (aarch64-w64-windows-gnu) instead?
https://github.com/ScintillaOrg/ninja-build/ninja/9d31ebba91515097e64184ca5bd460f6a7d6dfe5/src/minidump-win32.cc#L15-L20

DbgHelp.h is the Windows SDK header name, lower case dbghelp.h is the mingw-w64 name.
minidump-win32.cc is only enabled for MSVC target, maybe you can try GNU target (aarch64-w64-windows-gnu) instead?
https://github.com/ninja-build/ninja/blob/9d31ebba91515097e64184ca5bd460f6a7d6dfe5/src/minidump-win32.cc#L15-L20

That is the problem. Cross-compiling Windows MSVC target is impossible unless you make the header lowercase. For, Windows case does not matter but it matters for linux.
I am using msvc's target for the same behavior as gcc or it just fails to compile

https://github.com/trcrsired/windows-msvc-sysroot/blob/main/include/dbghelp.h
@zufuliu
Everything must be lowercase since even Microsoft is not consistent with their own shit

Regarding the mt.exe issue, it was caused by llvm-mt requiring libxml2 as a dependency, which I hadn't built. This oversight was entirely my own, as confirmed by the LLVM team.

@zufuliu Also ninja uses windows.h, based on your logic, you should use Windows.h instead.
Just use lowercase header and it should all be okay. Plus I think $ARCH-windows-gnu targets can also use this minidump. I will submit a PR

I have submitted a PR #2545

See:
https://github.com/trcrsired/windows-msvc-sysroot
https://github.com/trcrsired/llvm-releases/releases

based on your logic, it should use Windows.h instead.

tested clang with -Wnonportable-include-path, it does not warn on change file case, so PR #2545 is OK to me.

authors: jhasse trcrsired zufuliu

repo: ninja-build/ninja


text:
[RESOLVED] High ICMP ping response time

Problem started at 16:29:14 on 2023.04.14
Problem name: High ICMP ping response time
Host: MF-FG
Severity: Warning
Operational data: Value: 286ms
Original problem ID: 16969
Event details in Zabbix: http://192.168.232.99/tr_events.php?triggerid=23132&eventid=16969

Problem has been resolved in 2m 0s at 16:31:14 on 2023.04.14
Problem name: High ICMP ping response time
Host: MF-FG
Severity: Warning
Original problem ID: 16969


text:
qform referenced before being defined

From https://neurostars.org/t/fmriprep-issue-with-validate-node-qform/6169:

My command line is:
fmriprep /netapp/vol7_u923/COSIMAGE/cosimage_ml/repos/fmriprep/dataset /netapp/vol7_u923/COSIMAGE/cosimage_ml/repos/fmriprep/derivative participant --fs-license-file /netapp/vol7_u923/COSIMAGE/cosimage_ml/repos/fmriprep/ --use-aroma --fs-no-reconall --participant_label sub-07
Here is the copy of the crash file:
Node: fmriprep_wf.single_subject_07_wf.func_preproc_task_rest_wf.bold_reference_wf.validate
Working directory: /netapp/vol7_u923/COSIMAGE/cosimage_ml/repos/fmriprep/work/fmriprep_wf/single_subject_07_wf/func_preproc_task_rest_wf/bold_reference_wf/validate

Node inputs:

in_file = /netapp/vol7_u923/COSIMAGE/cosimage_ml/repos/fmriprep/dataset/sub-07/func/sub-07_task-rest_bold.nii

Traceback (most recent call last):
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/plugins/multiproc.py”, line 69, in run_node
result[‘result’] = node.run(updatehash=updatehash)
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py”, line 479, in run
result = self._run_interface(execute=True)
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py”, line 585, in _run_interface
return self._run_command(execute)
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py”, line 678, in _run_command
result = self._interface.run(cwd=outdir)
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/core.py”, line 382, in run
runtime = self._run_interface(runtime)
File “/usr/local/miniconda/lib/python3.7/site-packages/niworkflows/interfaces/images.py”, line 423, in _run_interface
if np.allclose(new_qform, qform) and qform_code > 0:
UnboundLocalError: local variable ‘qform’ referenced before assignment

Fixed in #466.

repo: nipreps/niworkflows


text:
Upload single file

Hello, is there the possibility to upload a file without select it, but defining a path from where upload it? Thank you

This is a HTML browser component feature, input type=File see link , not a Angular feature.  I would say this is not possible as it would break the security restriction of the browser not having access to the local file system until after the 'Choose File' button is clicked.

repo: nishantmc/angular-material-fileupload


text:
Fix leaveOpen option of SXSSFWorkbook

This PR closes #1140

LGTM

authors: Bykiev tonyqus

repo: nissl-lab/npoi


text:
[MRG] All-resolution inference

Re-created PR #402.

Thanks @bthirion I will re-implement the things that I had addressed in your original PR, and no force-push this time.

Hi @bthirion We have to address the CircleCI error. Other than that this LGTM.

Once #415 has passed and merged, I'll merge this.

authors: bthirion kchawla-pi

repo: nistats/nistats


text:
Promote location in MEntity

For some unknown historical reasons, the location was only provided to some specific model entities. By extending it to all entities, this simplify clients that need to process, visit or filter entities.
The unresolved question is: what is the best behavior for entities that lack a location? (eg fictive ones or those created internally without relation with source-code. There is not a lot of them but there is some).

location is nullable for all entities. This is simple but will cause boring null management. Eg. most of previous location attributes where not nullable, thus clients should be changed (not a lot I think).
location is not nullable for all entities. This is simpler but need some place-holder object for fictive location. ie some location objects that mean "no location".
location is nullable for some entities and not nullable for others (covariant redefinition). This is complex and have the combined drawbacks of the two previous without any of the advantages. But this is the simpler to implement on the existing code base; thus this is the one currently presented by the PR ;)

My choice goes to the not nullable + fictive location, but I would like to have your opinion before hacking all the clients.

ping @xymus and @Morriar for the API issue.

test this please

test this please

+1 for the not nullable + placeholder

reroll: solve conflicts and location is not nullable

authors: Morriar privat

repo: nitlang/nit


text:
No icon in Ubuntu Studio 16.04

Nitroshare 0.3.1 doesn't show any tray icon in Xfce 4.12, unless it is called with:
env XDG_CURRENT_DESKTOP=gnome nitroshare

Is this still showing up in 16.04? If so, I can spin up a virtual machine with XFCE installed and try to reproduce it.

Yes. Not showing up in 16.04.

Okay, I'll take a look at this tomorrow.

I don't have any PPA configured, so it must be official package from http://packages.ubuntu.com/xenial/nitroshare

$ echo $DESKTOP_SESSION
ubuntustudio

Installed 0.3.3 from PPA. Still the same problem.
$ nitroshare
QSystemTrayIcon::setVisible: No Icon set

The message in the terminal is unrelated. Qt is simply complaining because the tray icon is shown before the image is assigned to it, which is a necessary workaround for a completely different issue.

So, what is the resolution?

I'll have to keep trying to reproduce this. Until I can reproduce the bug, it will be essentially impossible to fix. I will see if I can try Ubuntu Studio in a VM sometime this weekend.

I have Nitroshare installed on Ubuntu 16.04 XFCE.
No icon is howing although Nitroshare is running and receives files just fine.

So the problem is with XFCE.

@techtonik Okay. Makes sense.
OTOH, it would be more user freindly if the Nitroshare interface was accessible by other means other than the tray icon. Because at this moment, Nitroshare on my XFCE is kind of useless. 😞

@peterkahl have you tried command line?

I couldn't figure out how to invoke the command line.
But I fixed the XFCE tray icon problem. The icon is now visible and my problem is solved.
Thanks for your help!

On 3 Jun 2017, at 17:29, anatoly techtonik notifications@github.com wrote:
@peterkahl have you tried command line?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

I know this thread is really old but @peterkahl how did you fix the XFCE tray Icon problem, I have the same issue.

@StephanieF although I am now using i3 I think that KDE folks at https://ubuntustudio.org/ will be able to help as well. At least they should know common problems when packaging applications for KDE.

Thank you very much for the help @techtonik I'll check it out.

authors: StephanieF nathan-osman peterkahl techtonik

repo: nitroshare/nitroshare-desktop


text:
Tips on mocking MongoClientWithPagination with mongomock?

Hi,
Just wondering if there are any tips with for mocking MongoClientWithPagination with mongomock for testing purposes (mongomock just uses the plain MongoClient from pymongo i believe)? Thanks for any help in advance and awesome package!

Hi,
Well, I'm not an expert with mongomock so I don't know if my answer will fit your use case. I've been taking a look to mongomock library and I think  all that would have to be done is patch the collection import in Database class:
class PatchedCollection(mongomock.Collection):
    def paginate(self, limit=mongonator.DEFAULT_LIMIT, ordering=mongonator.DESCENDING,
                 ordering_field=mongonator.DEFAULT_ORDERING_FIELD, **kwargs):
        return Paginate(self, limit=limit, ordering_field=ordering_field, ordering_case=ordering, **kwargs).paginate()

with patch('mongomock.database.Collection', new=PatchedCollection):
    # TODO

So, guessing you're using pytest, you could do something similar to this (you can adapt it to another python test library):

import mongomock
import mongonator
import pytest
from mongonator import Paginate
from unittest.mock import patch

def dummy_method(mongo_collection):
    for paginated_data in mongo_collection.paginate(limit=3, projection={'votes': True}):
        yield paginated_data.response

@pytest.fixture(scope='session', autouse=True)
def fake_paginator():
    class PatchedCollection(mongomock.Collection):
        def paginate(self, limit=mongonator.DEFAULT_LIMIT, ordering=mongonator.DESCENDING,
                     ordering_field=mongonator.DEFAULT_ORDERING_FIELD, **kwargs):
            return Paginate(self, limit=limit, ordering_field=ordering_field, ordering_case=ordering,
                            **kwargs).paginate()

    with patch('mongomock.database.Collection', new=PatchedCollection) as _fixture:
        yield _fixture

def test_fake():
    collection = mongomock.MongoClient().db.collection
    objects = [dict(votes=1), dict(votes=2), dict(votes=2), dict(votes=3), dict(votes=8), dict(votes=3)]

    # Add some fake data
    for obj in objects:
        collection.insert_one(obj)

    # Call method
    response = dummy_method(collection)

    for obj in response:
        assert len(obj) == 3

Let me know if this helps you!

perfect, this looks like exactly what i was looking for, thanks so much!!

Great! I'm glad I can help you.

authors: eexwhyzee nitxiodev

repo: nitxiodev/py-mongonnator


text:
add devShell outputs for nodejs ad python

This adds devShell and devShells outputs to the python and nodejs default builders
That means, flake outputs generated by makeFlakeOutputs will be suitable for use with nix develop or direnv.

So cool that I only needed to change the input url to point to this branch to test :-)
The devshell part is working, but:

NODE_PATH is very long and I worry it might get too long in big projects - I think it'd be better to point to a composed directory
the PATH doesn't include the node_modules binaries, so running e.g. eslint doesn't work, and since there's no composed node_modules I can't point a symlink to that, so tools like nps don't find the binary to call
(sidenote) am I correct in that the default app actually also includes the devDependencies?

I tried building the package with nix build . but that complained about not having defaultPackage defined so instead I ran nix build .#default which did make the package. I then tried to symlink the modules with ln -s result/lib/node_modules/MY_PKG/node_modules and then I noticed that there's no .bin directory in there either so ./node_modules/.bin/eslint still didn't work.

Ah - another issue: ESM apps don't support NODE_PATH.
So setting NODE_PATH in devShell is not a 100% solution, instead the only way is to symlink node_modules.

another issue: When I try to specify a nodejs version, the devshell attributes disappear.
I can't find how to specify the version, the below is just a guess
flake.nix:
{
  inputs.dream2nix.url = "github:nix-community/dream2nix/devShells";
  outputs = inp:
    inp.dream2nix.lib.makeFlakeOutputs {
      # modify according to your supported systems
      systems = [ "x86_64-linux" ];
      config.projectRoot = ./.;
      source = ./.;
      settings = [{
        subsystemInfo.nodejsVersion = 18;
      }];
    };
}

Also, devShell should ignore the systems attribute and only build for the current system, right? I don't see that in the PR but I don't know how that works with mkShell.

@wmertens
Could you check if my last commit 9901487fc5c616799ad2de7451af1823fc97065f resolves the issues? I stopped exporting NODE_PATH and instead create a node_modules directory now.

I tried building the package with nix build . but that complained about not having defaultPackage defined so instead I ran nix build .#default which did make the package.

defaultPackage is a deprected flake attribute. If you use a newer nix version, it will automatically default to packages.${system}.default.

another issue: When I try to specify a nodejs version, the devshell attributes disappear.

That is because the dream-lock.json file which you earlier created by executing nix run .#resolveImpure or nix run .#default.resolve is now invalid, because of the nodejsVersions change. Just re run the resolve command and the devShell attribute should re-appear.

@wmertens Thanks for your detailed review. I think the last commit should solve all your points.
Could you test it once again? Thanks.

@DavHau Nice, node_modules works :-)
Now I'm struggling to get the correct Node.js version. I am trying
      settings = [{
        nodejs = 18;
        subsystemInfo.nodejsVersion = 18;
      }]

but they don't work, the resolution is version 14.
Then, the devShell doesn't have nodejs in the path, but that's just a matter of
        passthru.devShell = pkgs.mkShell {
          path = [
            nodejs
          ];
          buildInputs = [
            nodejs
          ];

in the builder. I wonder if electron should also be in there for electron projects?

BTW, would it not be best to then make the package with the composed node_modules, now that we have it split out and working including .bin?

Ok, so when I use https://github.com/wmertens/dream2nix/commit/f30dce390b9fa30ca744703082701ff3b4c46503 I can get node in my devShell. I'm using this flake:
{
  inputs = {
    dream2nix.url = "github:nix-community/dream2nix/devShells";
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.05";
    dream2nix.inputs.nixpkgs.follows = "nixpkgs";
  };

  outputs = inp:
    inp.dream2nix.lib.makeFlakeOutputs {
      # modify according to your supported systems
      systems = [ "x86_64-linux" "aarch64-darwin" "x86_64-darwin" ];
      config.projectRoot = ./.;
      source = ./.;
      settings = [{
        subsystemInfo.nodejs = 18;

        # This also removes dev deps from the devShell :-(
        # subsystemInfo.noDev = true;
      }];
    };
}

I now found another issue: I'd like to keep the dev dependencies out of the production bundle. I tried setting noDev but then the dream-lock doesn't include the dev dependencies at all.
Perhaps the dream-lock should put dev dependencies under the devDependencies key, and then the package doesn't use them but the devShell does?

@wmertens f30dce390b9fa30ca744703082701ff3b4c46503 does not seem to make any difference for me. Packages which are inside buildInputs are automatically added to the path.
With the current PR, I observe this behavior:
$ nix develop
$ ls $(which node)
/nix/store/liq2m5v995wh5kzbvw9il4p4iwniwsjq-nodejs-14.19.3/bin/node
ls /nix/store/liq2m5v995wh5kzbvw9il4p4iwniwsjq-nodejs-14.19.3/bin
corepack  node  npm  npx

BTW, would it not be best to then make the package with the composed node_modules, now that we have it split out and working including .bin?

We could do that but its still a trade-off. It would add +1 derivation for each dependency. Launching many small builds does introduce more overhead. But in terms of caching it might be better, for sure. I currently need to focus on a few other things. If you want to work on a PR, feel free.
I'll try to have a look at the nodejs version problem though and the peerDependency handling mentioned in another thread.

I now found another issue: I'd like to keep the dev dependencies out of the production bundle. I tried setting noDev but then the dream-lock doesn't include the dev dependencies at all.
Perhaps the dream-lock should put dev dependencies under the devDependencies key, and then the package doesn't use them but the devShell does?

Currently the dream-lock does not have a concept of different kind of dependencies. The schema should probably be extended at some point. For now we could store that information under the _subsystem key which is a free form that can be utilized by each subsystem differently.

I now found another issue: I'd like to keep the dev dependencies out of the production bundle. I tried setting noDev but then the dream-lock doesn't include the dev dependencies at all.
Perhaps the dream-lock should put dev dependencies under the devDependencies key, and then the package doesn't use them but the devShell does?

Actually devDendencies are required to build the production bundle. Therefore we cannot remove them as build inputs. But we can purge them from the final closure after the build, maybe inside fixupPhase ?

Ooh I missed all this, I was having too much fun changing the translation and builder layers :sweat_smile:
I'll have a PR soon, still fixing some build issues. Might make a broken draft PR for comments.

Might make a broken draft PR for comments.

Sounds good

BTW, I needed that path = [nodejs]; for devShell to work in direnv. Since direnv doesn't start a subshell, I presume it doesn't have the same environment and it probably uses the path only.

If I use direnv with use flake in .envrc it works completely fine and it adds nodejs/bin to my PATH. I'd really like to understand what is different on your side.
direnv: loading ~/synced/projects/github/dream2nix/examples/eslint/.envrc
direnv: using flake
direnv: nix-direnv: using cached dev shell
direnv: export +AR +AS +CC +CONFIG_SHELL +CXX +HOST_PATH +IN_NIX_SHELL +LD +NIX_BINTOOLS +NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +NIX_BUILD_CORES +NIX_CC +NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +NIX_CFLAGS_COMPILE +NIX_ENFORCE_NO_NATIVE +NIX_HARDENING_ENABLE +NIX_INDENT_MAKE +NIX_LDFLAGS +NIX_STORE +NM +NODE_PATH +OBJCOPY +OBJDUMP +RANLIB +READELF +SIZE +SOURCE_DATE_EPOCH +STRINGS +STRIP +buildInputs +buildPhase +builder +configureFlags +depsBuildBuild +depsBuildBuildPropagated +depsBuildTarget +depsBuildTargetPropagated +depsHostHost +depsHostHostPropagated +depsTargetTarget +depsTargetTargetPropagated +doCheck +doInstallCheck +dontAddDisableDepTrack +name +nativeBuildInputs +out +outputs +patches +phases +propagatedBuildInputs +propagatedNativeBuildInputs +shell +shellHook +stdenv +strictDeps +system ~PATH ~XDG_DATA_DIRS

authors: DavHau wmertens


text:
mkdocs-based documentation site

[x] Add mkdocs-based site generator

smaller closure size

[x] Render reference documentation from options json

this time options are nested
and visible in the toc/navigation
html output customizable via jinja doc

[x] Remove mdbook site and transfer content
[x] Smaller fixes

header hierachy in modules.md
uses admonition syntax from mkdocs now

[ ] Port core.docs module. Maybe do this in another PR?
[x] Add missing markdown files to navigation
[x] Add missing reference documentation to navigation
[x] Add missing options from submodules
[X] Check/Adapt CI to build/publish the site

@DavHau gave me his okay to merge this, via chat. Categorization (and documentation) of modules needs more work. But I think it's a step in the right direction.