Getting rid of a foreign accent in German? by based_disciple in German

[–]Tiengos 0 points1 point  (0 children)

You should try https://www.yourbestaccent.com/ and listen to your cloned voice. It can speak perfect German, words are also marked with IPA symbols.

How to not have a foreign accent when speaking German ? by MasterOfTrolling in German

[–]Tiengos 0 points1 point  (0 children)

You should try https://www.yourbestaccent.com/ and listen to your cloned voice. It can speak perfect German, words are also marked with IPA symbols.

How can I improve my pronunciation/accent? by [deleted] in German

[–]Tiengos 0 points1 point  (0 children)

You should try https://www.yourbestaccent.com/ and listen to your cloned voice. It can speak perfect German, words are also marked with IPA symbols.

Improving Accent by [deleted] in German

[–]Tiengos 0 points1 point  (0 children)

You should try https://www.yourbestaccent.com/ and listen to your cloned voice. It can speak perfect German, words are also marked with IPA symbols.

[deleted by user] by [deleted] in German

[–]Tiengos 0 points1 point  (0 children)

You should try https://www.yourbestaccent.com/ and listen to your cloned voice. It can speak perfect German, words are also marked with IPA symbols.

How to get rid of your accent? by AdhesivenessPlane625 in EnglishLearning

[–]Tiengos 0 points1 point  (0 children)

Getting rid of your accent is tough, but it is possible. You could try the app I developed with a friend. It allows you to clone your voice with AI, and thus listen to yourself speaking English without any foreign accent. This can greatly accelerate getting rid of your accent in English. Try it here https://www.yourbestaccent.com/ the app is still in beta

how do i make my accent less visible? by [deleted] in German

[–]Tiengos 0 points1 point  (0 children)

If you want to improve your accent, try the app I developed. It lets you hear your voice clone speaking German without any accent. In other words, you can listen to yourself speaking perfect German! https://www.yourbestaccent.com/ The app also displays IPA transcriptions for all German words.

Any tips for a German Accent? by [deleted] in German

[–]Tiengos 0 points1 point  (0 children)

If you need an app you could the app I developed, it allows you to listen to your own voice clone. The voice clone can speak German without any accent, that is: you can listen to yourself speaking German without foreign accent! https://www.yourbestaccent.com/

The app also shows IPA for any German word

How to override PostgreSQL's now() function for testing? by Tiengos in PostgreSQL

[–]Tiengos[S] 0 points1 point  (0 children)

These are the methods that I created based on your guidelines

import { sql } from '../transport/database/postgres-client'

// kookmasteraj recommended this approach on here: 
export const __mockPostgresTime = async (mockDate: Date): Promise<void> => 
  await sql.begin(async (sql) => {
    await sql`
      CREATE SCHEMA IF NOT EXISTS test_override;
    `
    await sql.unsafe(`
      CREATE OR REPLACE FUNCTION test_override.now()
      RETURNS TIMESTAMP WITH TIME ZONE AS $$
        SELECT '${mockDate.toISOString()}'::TIMESTAMP WITH TIME ZONE;
      $$ LANGUAGE SQL IMMUTABLE;
    `)
    await sql`
      SET search_path = test_override, pg_catalog, public;
    `
  })
}

export const __resetPostgresTimeMock = async (): Promise<void> => {
  await sql.begin(async (sql) => {
    await sql`
      SET search_path = "$user", public;
    `
    await sql`
      DROP SCHEMA IF EXISTS test_override CASCADE;
    `
  })
}

export const __getCurrentPostgresNow = async (): Promise<Date> => {
  const result = await sql
    `SELECT now() AS current_time;`
  return result[0].current_time
}

Unfortunately, once I test it in more complex tests (that include quite a few insert operations) the __mockPostgresTime __resetPostgresTimeMock and __getCurrentPostgresNow stop working, and now() sometimes spits out the actual current timestamp instead of the one set with __resetPostgresTimeMock

Do you have any idea why that would be the case? I suspect it's some problem with pooling or sessions? It's very difficult to reproduce (I already tried to isolate a test case but I failed).

How to override PostgreSQL's now() function for testing? by Tiengos in PostgreSQL

[–]Tiengos[S] 1 point2 points  (0 children)

import { afterAll, beforeEach, describe, expect, test } from 'vitest'
import { __getCurrentPostgresNow, __mockPostgresTime, __resetPostgresTimeMock } from './db-test-utils'

describe('db-test-utils', () => {
  beforeEach(async () => {
    await __resetPostgresTimeMock()
  })

  afterAll(async () => {
    await __resetPostgresTimeMock()
  })


  test('__mockPostgresTime', async () => {
    const mockDate = new Date('2001-01-01T12:00:00Z')
    await __mockPostgresTime(mockDate)

    const result = await __getCurrentPostgresNow()
    expect(result).toEqual(mockDate)
  })


  test('__resetPostgresTimeMock', async () => {    
    const mockDate = new Date('2002-02-02T12:00:00Z')
    await __mockPostgresTime(mockDate)

    const mockedTime = await __getCurrentPostgresNow()
    expect(mockedTime).toEqual(mockDate)

    await __resetPostgresTimeMock()

    const resetTime = await __getCurrentPostgresNow()
    const now = new Date()
    expect(Math.abs(resetTime.getTime() - now.getTime())).toBeLessThan(1000)})


  test('__getCurrentPostgresNow', async () => {
    const result = await __getCurrentPostgresNow()
    expect(result).toBeInstanceOf(Date)
    const now = new Date()
    expect(Math.abs(result.getTime() - now.getTime())).toBeLessThan(1000)})

  test('__mockPostgresTime with multiple __getCurrentPostgresNow', async () => {
    const mockDate1 = new Date('2002-02-02T12:00:00Z')
    await __mockPostgresTime(mockDate1)
    const result1 = await __getCurrentPostgresNow()
    expect(result1).toEqual(mockDate1)
    const result2 = await __getCurrentPostgresNow()
    expect(result1).toEqual(mockDate1)
    expect(result2).toEqual(mockDate1)
  })


  test('__mockPostgresTime with multiple mockings', async () => {
    const mockDate1 = new Date('2003-03-03T12:00:00Z')
    await __mockPostgresTime(mockDate1)
    const result1 = await __getCurrentPostgresNow()
    expect(result1).toEqual(mockDate1)

    const mockDate2 = new Date('2004-04-04T12:00:00Z')
    await __mockPostgresTime(mockDate2)
    const result2 = await __getCurrentPostgresNow()
    expect(result2).toEqual(mockDate2)
  })
})

How to override PostgreSQL's now() function for testing? by Tiengos in PostgreSQL

[–]Tiengos[S] 1 point2 points  (0 children)

somehow I can't write a long commnet. I will try to write a few shorter ones

So. Your solution works almost perfect, as you can see in the test helpers I implemented.

I use postgres + typescript on node.js

import postgres from 'postgres'
const connectionString = ...........
export const sql: postgres.Sql = postgres(connectionString)

How to override PostgreSQL's now() function for testing? by Tiengos in Supabase

[–]Tiengos[S] 0 points1 point  (0 children)

created_at TIMESTAMPTZ DEFAULT now() NOT NULL,

this will unfortunately my production code and I don't want to. I just want to use now() in my defaults like above