问:
Proper way of using Redux and RTKQ in NextJs with code-splitting
This is a topic that's been discussed a lot through github issues and by now I've noticed two main opinions: It's not possible or it should not be done at all.
The argument for both sides is that redux is not meant for it, that the .replaceReducer function is only meant for the purposes of hot-reloading (even though redux itself mentions it as a possibility for code-splitting).

The goal

Anyway, what I would like to achieve (ideally) is a system that only sends the relevant slices and relevant redux code for a specific route in NextJs. And (even more ideally) when navigating between pages the store should just get extended and not re-created.

My initial approach

My first idea was to implement a recipe from the link above, attaching and exposing the injectReducer function onto my store during the store setup:

```<code>const store = configureStore({
  reducer: {
    globals,
    [rtkqApi.reducerPath]: rtkqApi.reducer
  },
  middleware: (getDefaultMiddleware) => getDefaultMiddleware().concat(rtkqApi.middleware)
});

store.dynamicReducers = {};
store.injectDynamicReducer = (name, reducer) => {
  if (Object.keys(store.dynamicReducers).includes(name)) {
    return;
  }
  store.dynamicReducers[name] = reducer;
  store.replaceReducer(
    combineReducers({
      globals,
      [rtkqApi.reducerPath]: rtkqApi.reducer,
      ...store.dynamicReducers
    })
  );
};

const makeStore = () => store;

export const wrapper = createWrapper(makeStore);

export const injectReducer = (sliceName, reducer) => store.injectDynamicReducer(sliceName, reducer);
</code>```

So basically every page would have a globalsSlice, containing the user info and some other global data, and Redux Toolkit Query API slice (which would then be code-split using RTKQ injectEndpoints functionality).

With this setup, each page that wants to inject its own custom slice (reducer) would do something like this:

```<code>const SomePage = () => {
  const someData = useSelector(somePageSliceSelectors.selectSomeData);
  return (
    <Fragment>
      <Head>
        <title>Some Page</title>
      </Head>
    </Fragment>
  )
};

export default SomeRoute;

injectReducer('somePageSlice', somePageReducer);

export const getServerSideProps = wrapper.getServerSideProps((store) => async (context) => {
  // Whatever necessary logic we need
});
</code>```

Initially this seemed to have worked fine, but then when I realized that next-redux-wrapper works by calling the makeStore factory on every request, and I'm manipulating and mutating a global store object, there has to be something wrong with this, ie a race condition that I haven't been able to cause by testing. Also another problem occurres when using Redux Toolkit Query. For example, if I need to get a cookie from the original request (the one that nextjs receives) and then re-send it to another API endpoint that is handled by redux toolkit query, I would need to extract the cookie from the request context, to which I don't have access unless I do something like this:

```<code>export const makeStore = (ctx) => {
  return configureStore({
    reducer: ...,
    middleware: (getDefaultMiddleware) =>
      getDefaultMiddleware({
        thunk: {
          extraArgument: ctx,
        },
      }).concat(...),
  });
};
</code>```

which further implies that I should definitely not be mutating the global store object.

So then I thought alright, instead of manipulating the global store I could try doing it in GSSP:

```<code>export const getServerSideProps = wrapper.getServerSideProps((store) => async (context) => {
         store.injectDynamicReducer('somePageSlice', somePageReducer);
    });
</code>```

But no luck here, the slice does not get loaded and the state does not get constructed. It is my guess that the Provider in the _app gets rendered before this, but I'm not sure.

In conclusion, I'd like to know whether anyone has tried and succeeded in implementing redux code splitting using RTK, RTKQ and NextJs. Also, I would like to ask an addition question: Is it necessary? What I mean by this is, if I were to not code-split at all, and send all slices on every request, how performance impactful would this be? Also, since I'm not sure exactly how the NextJs bundler works and how code chunking is done: If a certain page receives a slice it doesn't use at all, will it only receive its initial state or all of its logic (all the selectors, reducers and actions)? If not then maybe this isn't so bad, since initial states are just empty objects.

I hope I've presented the problem clearly enough, as it is a very complex problem, but feel free to ask follow up questions if something doesn't make sense.

Thanks in advance.

Body:
This is a topic that's been discussed a lot through github issues and by now I've noticed two main opinions: It's not possible or it should not be done at all.
The argument for both sides is that redux is not meant for it, that the .replaceReducer function is only meant for the purposes of hot-reloading (even though redux itself mentions it as a possibility for code-splitting).

The goal

Anyway, what I would like to achieve (ideally) is a system that only sends the relevant slices and relevant redux code for a specific route in NextJs. And (even more ideally) when navigating between pages the store should just get extended and not re-created.

My initial approach

My first idea was to implement a recipe from the link above, attaching and exposing the injectReducer function onto my store during the store setup:

const store = configureStore({
  reducer: {
    globals,
    [rtkqApi.reducerPath]: rtkqApi.reducer
  },
  middleware: (getDefaultMiddleware) => getDefaultMiddleware().concat(rtkqApi.middleware)
});

store.dynamicReducers = {};
store.injectDynamicReducer = (name, reducer) => {
  if (Object.keys(store.dynamicReducers).includes(name)) {
    return;
  }
  store.dynamicReducers[name] = reducer;
  store.replaceReducer(
    combineReducers({
      globals,
      [rtkqApi.reducerPath]: rtkqApi.reducer,
      ...store.dynamicReducers
    })
  );
};

const makeStore = () => store;

export const wrapper = createWrapper(makeStore);

export const injectReducer = (sliceName, reducer) => store.injectDynamicReducer(sliceName, reducer);

So basically every page would have a globalsSlice, containing the user info and some other global data, and Redux Toolkit Query API slice (which would then be code-split using RTKQ injectEndpoints functionality).

With this setup, each page that wants to inject its own custom slice (reducer) would do something like this:

const SomePage = () => {
  const someData = useSelector(somePageSliceSelectors.selectSomeData);
  return (
    <Fragment>

        <title>Some Page</title>

    </Fragment>
  )
};

export default SomeRoute;

injectReducer('somePageSlice', somePageReducer);

export const getServerSideProps = wrapper.getServerSideProps((store) => async (context) => {
  // Whatever necessary logic we need
});

Initially this seemed to have worked fine, but then when I realized that next-redux-wrapper works by calling the makeStore factory on every request, and I'm manipulating and mutating a global store object, there has to be something wrong with this, ie a race condition that I haven't been able to cause by testing. Also another problem occurres when using Redux Toolkit Query. For example, if I need to get a cookie from the original request (the one that nextjs receives) and then re-send it to another API endpoint that is handled by redux toolkit query, I would need to extract the cookie from the request context, to which I don't have access unless I do something like this:

export const makeStore = (ctx) => {
  return configureStore({
    reducer: ...,
    middleware: (getDefaultMiddleware) =>
      getDefaultMiddleware({
        thunk: {
          extraArgument: ctx,
        },
      }).concat(...),
  });
};

which further implies that I should definitely not be mutating the global store object.

So then I thought alright, instead of manipulating the global store I could try doing it in GSSP:

export const getServerSideProps = wrapper.getServerSideProps((store) => async (context) => {
         store.injectDynamicReducer('somePageSlice', somePageReducer);
    });

But no luck here, the slice does not get loaded and the state does not get constructed. It is my guess that the Provider in the _app gets rendered before this, but I'm not sure.

In conclusion, I'd like to know whether anyone has tried and succeeded in implementing redux code splitting using RTK, RTKQ and NextJs. Also, I would like to ask an addition question: Is it necessary? What I mean by this is, if I were to not code-split at all, and send all slices on every request, how performance impactful would this be? Also, since I'm not sure exactly how the NextJs bundler works and how code chunking is done: If a certain page receives a slice it doesn't use at all, will it only receive its initial state or all of its logic (all the selectors, reducers and actions)? If not then maybe this isn't so bad, since initial states are just empty objects.

I hope I've presented the problem clearly enough, as it is a very complex problem, but feel free to ask follow up questions if something doesn't make sense.

Thanks in advance.


来源: stackexchange

问:
woocommerce import order with custom order status
I'm trying to import an orders file with a custom order status.

Code for new custom status:

```<code>register_post_status(
    'wc-cc-shipping',
    array(
        'label'                     => 'CC Awaiting shipping',
        'public'                    => true,
        'show_in_admin_status_list' => true,
        'label_count'               => _n_noop( 'CC shipping (%s)', 'CC shipping (%s)' ),
    )
);
</code>```

On the site, everything works as excepted.

but when I'm trying to import a csv file with this custom order status, it does not recognize this order status.

So my first question is, is it possible to import with different order statuses?

and if it is possible, what status name do I need to point in my csv file? to the wc-cc-shipping (like in the example)?

ContentLicense: CC BY-SA 4.0

Body:
I'm trying to import an orders file with a custom order status.

Code for new custom status:

register_post_status(
    'wc-cc-shipping',
    array(
        'label'                     => 'CC Awaiting shipping',
        'public'                    => true,
        'show_in_admin_status_list' => true,
        'label_count'               => _n_noop( 'CC shipping (%s)', 'CC shipping (%s)' ),
    )
);

On the site, everything works as excepted.

but when I'm trying to import a csv file with this custom order status, it does not recognize this order status.

So my first question is, is it possible to import with different order statuses?

and if it is possible, what status name do I need to point in my csv file? to the wc-cc-shipping (like in the example)?


问:
Javascript array in VSCode is being split between multiple lines
I am working with arrays in VSCode, when it saves on format the array is split up to one item per linescreenshot of array formatting.
All my arrays equal over 12000 lines, i might be missing something but cannot find any options in VSCode.
Any help in the right direction would be appreciated.
Many Thanks

I  tried to create a very long array and on saving the array was split up into thousands of lines with one item per line, i expected the array to stay multiple items a line but instead the formatter split it up into one item per line.


问:
How can we use datediff in cubejs for mongodb?
I want to use datediff in cubejs -> dimensions, it works with sql but it is not working with mongodb, here is for the sql:

```<code>dimensions: {
   expiringIn: {
       sql: `DATEDIFF(hour, GETDATE(), ${CUBE.expiryDate})`,
       type: `number`,
   },
 }
</code>```

when I try to use the same method for mongodb, it gives an error, what is the equivalent method name for mongo?

Body:
I want to use datediff in cubejs -> dimensions, it works with sql but it is not working with mongodb, here is for the sql:

dimensions: {
   expiringIn: {
       sql: `DATEDIFF(hour, GETDATE(), ${CUBE.expiryDate})`,
       type: `number`,
   },
 }

when I try to use the same method for mongodb, it gives an error, what is the equivalent method name for mongo?


问:
How can I have my top container position relative to its parent in CSS?
I cannot seem to find why the padding it not relative to its parent and does not remove the white line

body {
  color: #40514e;
  margin: 0;
  text-align: center;
  font-family: "Merriweather", serif;
  font-size: 100%;
}

h1 {
  color: #66bfbf;
  font-size: 5.625rem;
  margin: 50px auto 0 auto;
  font-family: "Sacramento", cursive;
}

/* review font size on h2*/

h2 {
  color: #66bfbf;
  font-family: "Montserrat", sans-serif;
  font-size: 2.5rem;
  font-weight: normal;
  padding-bottom: 10px;
}

h3 {
  color: #11999e;
  font-family: "Montserrat", sans-serif;
}

p {
  line-height: 2;
}

hr {
  border: dotted #eaf6f6 6px;
  border-bottom: none;
  width: 4%;
  margin: 100px auto;
}

a {
  color: #11999e;
  font-family: "Merriweather", serif;
  margin: 10px 20px;
  text-decoration: none;
}

a:hover {
  color: #eaf6f6;
}

/* check this div background-color*/

div {
  background-color: #e4f9f5;
}

/* remember to check the padding on the .top-container*/

.top-container {
  background-color: #e4f9f5;
  position: relative;
  padding-top: 562.5%;
  margin-top: 50px;
}

.middle-container {
  margin: 100px 0;
}

.bottom-container {
  background-color: #66bfbf;
  padding: 50px 0 20px;
}

.pro {
  text-decoration: underline;
}

.intro {
  width: 30%;
  margin: auto;
}

.contact-message {
  width: 40%;
  margin: 40px auto 60px;
}

.copyright {
  color: #eaf6f6;
  font-size: 0.75rem;
  padding: 20px o;
}

.top-cloud {
  position: absolute;
  right: 300px;
  top: 40px;
}

.boiler-plate {
  width: 25%;
  float: left;
  margin-right: 40px;
}

.Cheeseburger {
  width: 25%;
  float: right;
  margin-left: 40px;
}

.btn {
  background: #11cdd4;
  /* background-image: -webkit-linear-gradient(top, #11cdd4, #22A39F); */
  background-image: -moz-linear-gradient(top, #11cdd4, #22a39f);
  background-image: -ms-linear-gradient(top, #11cdd4, #22a39f);
  background-image: -o-linear-gradient(top, #11cdd4, #22a39f);
  background-image: linear-gradient(to bottom, #11cdd4, #22a39f);
  -webkit-border-radius: 8;
  -moz-border-radius: 8;
  border-radius: 8px;
  font-family: Montserrat, sans-serif;
  color: #ffffff;
  font-size: 20px;
  padding: 10px 20px 10px 20px;
  text-decoration: none;
}

.btn:hover {
  background: #30e3cb;
  background-image: -webkit-linear-gradient(top, #30e3cb, #97dece);
  background-image: -moz-linear-gradient(top, #30e3cb, #97dece);
  background-image: -ms-linear-gradient(top, #30e3cb, #97dece);
  background-image: -o-linear-gradient(top, #30e3cb, #97dece);
  background-image: linear-gradient(to bottom, #30e3cb, #97dece);
  text-decoration: none;
}

/* .bottom-cloud needs further tweaking the cloud8*/

.bottom-cloud {
  left: 250px;
  bottom: 300px;
  margin-right: 30px;
}

.skill-row {
  width: 50%;
  margin-top: 100px auto 100px auto;
  text-emphasis: left;
}
```


问:
PWA install button not showing on Android tablet
I have a pwa which is working fine for Desktop, Google Phone etc. But on a tablet I don't see any option (chrome or firefox ) to install it. Even if I visit YouTube, there is no install button or any such option. Please help me.

My chrome version is 81.0.4044.138 and Android version is 10

I'm new to this PWA and very confused as its working perfect on mac, or pc as well. Please help me. Thanks in advance.


问:
SQL CLR streams data and is unsafe I need a safe solution
I have a SQL server C# CLR function that streams results. because of that I open a new connection inside the CLR and because of that I need to create the CLR unsafe. Now I want to move to sql container on linux and there are only safe assemblies allowed.

If there some way to come around that I can stream the data with a context connection? It is no solution to cache all the data as list and return it complete. The amount of data is to much and I will get memory trouble.

Or should I bring my CLR outside of the SQL server as a web service and I call the web service with a CLR? is that possible? sounds strange CLR calls a web service that calls the same sql server and streams the data...

OR is there another idea that I have not focused?

My CLR looks like (shorten pseudo), there are intern more complex classes and code

```<code>   [SqlFunction
    (
    DataAccess = DataAccessKind.Read,
    IsDeterministic = true,
    IsPrecise = true,
    SystemDataAccess = SystemDataAccessKind.Read,
    FillRowMethodName = "FillMethod",
    TableDefinition = ...
    )]
  public static IEnumerable GetData(DateTimeOffset timeRangeStart, DateTimeOffset timeRangeEnd, int maxRecords, int lcid, string filterClause)
  {
    // runs a query to get all need parameters to open a new connection.
    var connectionString = ContextConnectionGetConnectionString();
    using connection = new Connection(connectionString)
    connection.Open();
    var complexScript = CreateTheScript(...);
    var command = connection.CreateCommand(complexScript)
    var streamReader = command.ExecuteReader();

      try
      {
        foreach (var items in readData(streamReader))
        {
          yield return items;
        }
      }
      finally
      {
        CloseStream(streamReader, streamConnection);
        command.Dispose();
      }
  }
</code>```

I think there's a lot of context missing. Like, what is in complexScript and why can't that be just a normal (i.e. non-CLR) stored procedure (or function)?

the query string contains a sql like language with virtual table names that is parsed and build to work on the current database. The Tables in the database are also splited like segments and with the timerange only the segment tables in that time range values are will be added to the query that is executed at the end.

CLR function is used in other views and from SQL server reports

Body:
I have a SQL server C# CLR function that streams results. because of that I open a new connection inside the CLR and because of that I need to create the CLR unsafe. Now I want to move to sql container on linux and there are only safe assemblies allowed.

If there some way to come around that I can stream the data with a context connection? It is no solution to cache all the data as list and return it complete. The amount of data is to much and I will get memory trouble.

Or should I bring my CLR outside of the SQL server as a web service and I call the web service with a CLR? is that possible? sounds strange CLR calls a web service that calls the same sql server and streams the data...

OR is there another idea that I have not focused?

My CLR looks like (shorten pseudo), there are intern more complex classes and code

   [SqlFunction
    (
    DataAccess = DataAccessKind.Read,
    IsDeterministic = true,
    IsPrecise = true,
    SystemDataAccess = SystemDataAccessKind.Read,
    FillRowMethodName = "FillMethod",
    TableDefinition = ...
    )]
  public static IEnumerable GetData(DateTimeOffset timeRangeStart, DateTimeOffset timeRangeEnd, int maxRecords, int lcid, string filterClause)
  {
    // runs a query to get all need parameters to open a new connection.
    var connectionString = ContextConnectionGetConnectionString();
    using connection = new Connection(connectionString)
    connection.Open();
    var complexScript = CreateTheScript(...);
    var command = connection.CreateCommand(complexScript)
    var streamReader = command.ExecuteReader();

      try
      {
        foreach (var items in readData(streamReader))
        {
          yield return items;
        }
      }
      finally
      {
        CloseStream(streamReader, streamConnection);
        command.Dispose();
      }
  }

I think there's a lot of context missing. Like, what is in complexScript and why can't that be just a normal (i.e. non-CLR) stored procedure (or function)?

the query string contains a sql like language with virtual table names that is parsed and build to work on the current database. The Tables in the database are also splited like segments and with the timerange only the segment tables in that time range values are will be added to the query that is executed at the end.

CLR function is used in other views and from SQL server reports


问:
Laravel script only give 500 server error
I try to run a script on my server, but only getting page says 500 Server Error.
The server is on Ubuntu 20.04. PHP 8.2 and all required modules is installed.

No error is nginx error.log.

script/storage/logs/laravel.log ouput:

[2022-12-22 17:51:41] production.ERROR: SQLSTATE[HY000] [2002] No such
file or directory (SQL: select * from pages where status = 1 order
by page_order asc)
{"view":{"view":"/var/www/prod/stream.caaymanx.live/resources/views/_particles/footer.blade.php","data":[]},"exception":"[object]
(Spatie\LaravelIgnition\Exceptions\ViewException(code: 0):
SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from
pages where status = 1 order by page_order asc) at
/var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Database/Connection.php:759)

```<code>[stacktrace]
#0 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Database/Connection.php(898): Illuminate\\Database\\Connection->runQueryCallback()
#1 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Database/Connection.php(877): Illuminate\\Database\\Connection->tryAgainIfCausedByLostConnection()
#2 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Database/Connection.php(721): Illuminate\\Database\\Connection->handleQueryException()
#3 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Database/Connection.php(404): Illuminate\\Database\\Connection->run()
#4 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2635): Illuminate\\Database\\Connection->select()
#5 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2624): Illuminate\\Database\\Query\\Builder->runSelect()
#6 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3160): Illuminate\\Database\\Query\\Builder->Illuminate\\Database\\Query\\{closure}()
#7 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2623): Illuminate\\Database\\Query\\Builder->onceWithColumns()
#8 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(699): Illuminate\\Database\\Query\\Builder->get()
#9 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(683): Illuminate\\Database\\Eloquent\\Builder->getModels()
#10 /var/www/prod/stream.caaymanx.live/resources/views/_particles/footer.blade.php(11): Illuminate\\Database\\Eloquent\\Builder->get()
#11 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(109): require('...')
#12 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(110): Illuminate\\Filesystem\\Filesystem::Illuminate\\Filesystem\\{closure}()
#13 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php(58): Illuminate\\Filesystem\\Filesystem->getRequire()
#14 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(70): Illuminate\\View\\Engines\\PhpEngine->evaluatePath()
#15 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/View/View.php(139): Illuminate\\View\\Engines\\CompilerEngine->get()
#16 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/View/View.php(122): Illuminate\\View\\View->getContents()
#17 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/View/View.php(91): Illuminate\\View\\View->renderContents()
#18 /var/www/prod/stream.caaymanx.live/resources/views/site_app.blade.php(120): Illuminate\\View\\View->render()
#19 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(109): require('...')
#20 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(110): Illuminate\\Filesystem\\Filesystem::Illuminate\\Filesystem\\{closure}()
#21 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php(58): Illuminate\\Filesystem\\Filesystem->getRequire()
#22 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(70): Illuminate\\View\\Engines\\PhpEngine->evaluatePath()
#23 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/View/View.php(139): Illuminate\\View\\Engines\\CompilerEngine->get()
#24 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/View/View.php(122): Illuminate\\View\\View->getContents()
#25 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/View/View.php(91): Illuminate\\View\\View->renderContents()
#26 /var/www/prod/stream.caaymanx.live/resources/views/errors/404.blade.php(22): Illuminate\\View\\View->render()
#27 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(109): require('...')
#28 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(110): Illuminate\\Filesystem\\Filesystem::Illuminate\\Filesystem\\{closure}()
#29 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php(58): Illuminate\\Filesystem\\Filesystem->getRequire()
#30 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(70): Illuminate\\View\\Engines\\PhpEngine->evaluatePath()
#31 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/View/View.php(139): Illuminate\\View\\Engines\\CompilerEngine->get()
#32 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/View/View.php(122): Illuminate\\View\\View->getContents()
#33 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/View/View.php(91): Illuminate\\View\\View->renderContents()
#34 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Http/Response.php(69): Illuminate\\View\\View->render()
#35 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Http/Response.php(35): Illuminate\\Http\\Response->setContent()
#36 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php(57): Illuminate\\Http\\Response->__construct()
#37 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php(87): Illuminate\\Routing\\ResponseFactory->make()
#38 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(615): Illuminate\\Routing\\ResponseFactory->view()
#39 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(543): Illuminate\\Foundation\\Exceptions\\Handler->renderHttpException()
#40 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(449): Illuminate\\Foundation\\Exceptions\\Handler->prepareResponse()
#41 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(366): Illuminate\\Foundation\\Exceptions\\Handler->renderExceptionResponse()
#42 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(51): Illuminate\\Foundation\\Exceptions\\Handler->render()
#43 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(143): Illuminate\\Routing\\Pipeline->handleException()
#44 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#45 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#46 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle()
#47 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#48 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#49 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle()
#50 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#51 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle()
#52 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#53 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle()
#54 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#55 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Http\\Middleware\\HandleCors->handle()
#56 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#57 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Http\\Middleware\\TrustProxies->handle()
#58 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#59 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(165): Illuminate\\Pipeline\\Pipeline->then()
#60 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(134): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter()
#61 /var/www/prod/stream.caaymanx.live/public/index.php(51): Illuminate\\Foundation\\Http\\Kernel->handle()
#62 {main}
</code>```

I have tried to reinstall composer.

Body:
I try to run a script on my server, but only getting page says 500 Server Error.
The server is on Ubuntu 20.04. PHP 8.2 and all required modules is installed.

No error is nginx error.log.

script/storage/logs/laravel.log ouput:

[2022-12-22 17:51:41] production.ERROR: SQLSTATE[HY000] [2002] No such
file or directory (SQL: select * from pages where status = 1 order
by page_order asc)
{"view":{"view":"/var/www/prod/stream.caaymanx.live/resources/views/_particles/footer.blade.php","data":[]},"exception":"[object]
(Spatie\LaravelIgnition\Exceptions\ViewException(code: 0):
SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from
pages where status = 1 order by page_order asc) at
/var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Database/Connection.php:759)

[stacktrace]
#0 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Database/Connection.php(898): Illuminate\\Database\\Connection->runQueryCallback()
#1 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Database/Connection.php(877): Illuminate\\Database\\Connection->tryAgainIfCausedByLostConnection()
#2 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Database/Connection.php(721): Illuminate\\Database\\Connection->handleQueryException()
#3 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Database/Connection.php(404): Illuminate\\Database\\Connection->run()
#4 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2635): Illuminate\\Database\\Connection->select()
#5 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2624): Illuminate\\Database\\Query\\Builder->runSelect()
#6 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3160): Illuminate\\Database\\Query\\Builder->Illuminate\\Database\\Query\\{closure}()
#7 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2623): Illuminate\\Database\\Query\\Builder->onceWithColumns()
#8 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(699): Illuminate\\Database\\Query\\Builder->get()
#9 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(683): Illuminate\\Database\\Eloquent\\Builder->getModels()
#10 /var/www/prod/stream.caaymanx.live/resources/views/_particles/footer.blade.php(11): Illuminate\\Database\\Eloquent\\Builder->get()
#11 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(109): require('...')
#12 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(110): Illuminate\\Filesystem\\Filesystem::Illuminate\\Filesystem\\{closure}()
#13 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php(58): Illuminate\\Filesystem\\Filesystem->getRequire()
#14 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(70): Illuminate\\View\\Engines\\PhpEngine->evaluatePath()
#15 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/View/View.php(139): Illuminate\\View\\Engines\\CompilerEngine->get()
#16 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/View/View.php(122): Illuminate\\View\\View->getContents()
#17 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/View/View.php(91): Illuminate\\View\\View->renderContents()
#18 /var/www/prod/stream.caaymanx.live/resources/views/site_app.blade.php(120): Illuminate\\View\\View->render()
#19 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(109): require('...')
#20 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(110): Illuminate\\Filesystem\\Filesystem::Illuminate\\Filesystem\\{closure}()
#21 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php(58): Illuminate\\Filesystem\\Filesystem->getRequire()
#22 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(70): Illuminate\\View\\Engines\\PhpEngine->evaluatePath()
#23 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/View/View.php(139): Illuminate\\View\\Engines\\CompilerEngine->get()
#24 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/View/View.php(122): Illuminate\\View\\View->getContents()
#25 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/View/View.php(91): Illuminate\\View\\View->renderContents()
#26 /var/www/prod/stream.caaymanx.live/resources/views/errors/404.blade.php(22): Illuminate\\View\\View->render()
#27 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(109): require('...')
#28 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(110): Illuminate\\Filesystem\\Filesystem::Illuminate\\Filesystem\\{closure}()
#29 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php(58): Illuminate\\Filesystem\\Filesystem->getRequire()
#30 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(70): Illuminate\\View\\Engines\\PhpEngine->evaluatePath()
#31 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/View/View.php(139): Illuminate\\View\\Engines\\CompilerEngine->get()
#32 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/View/View.php(122): Illuminate\\View\\View->getContents()
#33 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/View/View.php(91): Illuminate\\View\\View->renderContents()
#34 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Http/Response.php(69): Illuminate\\View\\View->render()
#35 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Http/Response.php(35): Illuminate\\Http\\Response->setContent()
#36 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php(57): Illuminate\\Http\\Response->__construct()
#37 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php(87): Illuminate\\Routing\\ResponseFactory->make()
#38 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(615): Illuminate\\Routing\\ResponseFactory->view()
#39 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(543): Illuminate\\Foundation\\Exceptions\\Handler->renderHttpException()
#40 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(449): Illuminate\\Foundation\\Exceptions\\Handler->prepareResponse()
#41 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(366): Illuminate\\Foundation\\Exceptions\\Handler->renderExceptionResponse()
#42 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(51): Illuminate\\Foundation\\Exceptions\\Handler->render()
#43 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(143): Illuminate\\Routing\\Pipeline->handleException()
#44 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#45 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#46 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle()
#47 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#48 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#49 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle()
#50 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#51 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle()
#52 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#53 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle()
#54 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#55 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Http\\Middleware\\HandleCors->handle()
#56 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#57 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Http\\Middleware\\TrustProxies->handle()
#58 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#59 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(165): Illuminate\\Pipeline\\Pipeline->then()
#60 /var/www/prod/stream.caaymanx.live/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(134): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter()
#61 /var/www/prod/stream.caaymanx.live/public/index.php(51): Illuminate\\Foundation\\Http\\Kernel->handle()
#62 {main}

I have tried to reinstall composer.


问:
How to delete/hide SharePoint online feature from classic site like Site Feed etc
How to delete/hide any feature (_layouts/15/ManageFeatures.aspx) like "Site Feed", "Community Site Feature" etc. permanently from SharePoint online classic site?

I didn't see any attribute or method available in PowerShell script or CSOM to achieve this.


问:
How can i resolve .net MAUI dependencies errors?
i'm with a big problem, hope someone can help me.
Well, I made the Visual Studio 2022 Preview download, having focus on .NET MAUI. But after creating a new Project, i have dependencies errors, especifically Nuget packages...

Click to See Image

I did try to update the packages, but the buttons are desabled* and i got that message as shown in the image bellow: "implicit reference by sdk. to update the package, update the sdk it belongs to"

Click to See Image

I checked if there are updates in .NET SDK, but it says that its all up to date!!!

I have no ideas what should i do to fix it

1 - Update .NET SDK
2 - Reinstall VS 2022 Preview
3 - ReDownload all Nuget Packages


问:
How to smoothen data from fluctuating sensor values
I have a rocking piston vaccum pump conected to a pressure sensor. The sensor is providing data for a digital gauge on a screen. Due to the principle of working of a rocking piston pump the data on the pressure sensor fluctuates very rapidly from high to low. (This is due to the piston expanding and compressing I guess). Hence, the gauge needle is rapidly shaking between the high and low values.

How can I show a fixed needle reading pointing at the highest reading of the pressure sensor?

Do I just add a delay in showing the data? Taking the average while doing so?

Your help is very much appreciated.

Thank you in advance.


问:
How do I install and run Test.Tasty.Patterns
I want to use the following for testing the ReadP Monad Parser.
https://hackage.haskell.org/package/tasty-1.4.3/docs/Test-Tasty-Patterns-Parser.html . How can I install it correctly?

When trying to import

I get

```<code>Test.hs:7:1: error:
    Could not load module `Test.Tasty.Patterns'
    it is a hidden module in the package `tasty-1.4.3'
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
  |
7 | import Test.Tasty.Patterns
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^
Failed, two modules loaded.
</code>```

When trying the :set -v and :set -package tasty-hunit-patterns

I get:

```<code>*** initializing unit database:
package flags [-package-id ghc-9.0.1{unit ghc-9.0.1 True ([])},
               -package-id bytestring-0.10.12.1{unit bytestring-0.10.12.1 True ([])},
               -package-id base-4.15.0.0{unit base-4.15.0.0 True ([])},
               -package-id time-1.9.3{unit time-1.9.3 True ([])},
               -package-id hpc-0.6.1.0{unit hpc-0.6.1.0 True ([])},
               -package-id filepath-1.4.2.1{unit filepath-1.4.2.1 True ([])},
               -package-id process-1.6.11.0{unit process-1.6.11.0 True ([])},
               -package-id array-0.5.4.0{unit array-0.5.4.0 True ([])},
               -package-id integer-gmp-1.1{unit integer-gmp-1.1 True ([])},
               -package-id containers-0.6.4.1{unit containers-0.6.4.1 True ([])},
               -package-id ghc-boot-9.0.1{unit ghc-boot-9.0.1 True ([])},
               -package-id binary-0.8.8.0{unit binary-0.8.8.0 True ([])},
               -package-id ghc-prim-0.7.0{unit ghc-prim-0.7.0 True ([])},
               -package-id ghci-9.0.1{unit ghci-9.0.1 True ([])},
               -package-id rts-1.0{unit rts-1.0 True ([])},
               -package-id transformers-0.5.6.2{unit transformers-0.5.6.2 True ([])},
               -package-id deepseq-1.4.5.0{unit deepseq-1.4.5.0 True ([])},
               -package-id ghc-boot-th-9.0.1{unit ghc-boot-th-9.0.1 True ([])},
               -package-id pretty-1.1.3.6{unit pretty-1.1.3.6 True ([])},
               -package-id template-haskell-2.17.0.0{unit template-haskell-2.17.0.0 True ([])},
               -package-id directory-1.3.6.1{unit directory-1.3.6.1 True ([])},
               -package-id text-1.2.4.1{unit text-1.2.4.1 True ([])},
               -package-id random-1.2.1-e1879819ad2512292cbd29842949fd250c449266{unit random-1.2.1 True ([])},
               -package-id QuickCheck-2.14.2-ddd3158346bc1397aa376f2d5b48d0fd800681db{unit QuickCheck-2.14.2 True ([])},
               -package tasty{package tasty True ([])},
               -package tasty-hunit{package tasty-hunit True ([])},
               -package tasty-hunit-patterns{package tasty-hunit-patterns True ([])}]
loading package database C:\tools\ghc-9.0.1\lib\package.conf.d
loading package database C:\Users\tqx98\AppData\Roaming\cabal\store\ghc-9.0.1\package.db
cannot satisfy -package tasty-hunit-patterns
    (use -v for more information)
</code>```

And on when trying to install, I get:

```<code>PS D:\CurrentDir\code> cabal install tasty-hunit-patterns
cabal.exe: Unknown package "tasty-hunit-patterns".
</code>```

EDIT

I have now tried to add the package with stack as suggested in the comments. I get his output:

```<code>PS D:\Redo_haskell_folder\code> stack install Test.Tasty.Patterns.Parser
Error: [S-8506]
Error parsing targets: Directory not found: Test.Tasty.Patterns.Parser
PS D:\Redo_haskell_folder\code> stack install Test.Tasty.Patterns
Error: [S-8506]
Error parsing targets: Directory not found: Test.Tasty.Patterns
PS D:\Redo_haskell_folder\code> stack exec -- ghc --version
The Glorious Glasgow Haskell Compilation System, version 9.2.5
</code>```

This would be the typically procedure of using stack what am I missing?

Body:
I want to use the following for testing the ReadP Monad Parser.
https://hackage.haskell.org/package/tasty-1.4.3/docs/Test-Tasty-Patterns-Parser.html . How can I install it correctly?

When trying to import

I get

Test.hs:7:1: error:
    Could not load module `Test.Tasty.Patterns'
    it is a hidden module in the package `tasty-1.4.3'
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
  |
7 | import Test.Tasty.Patterns
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^
Failed, two modules loaded.

When trying the :set -v and :set -package tasty-hunit-patterns

I get:

*** initializing unit database:
package flags [-package-id ghc-9.0.1{unit ghc-9.0.1 True ([])},
               -package-id bytestring-0.10.12.1{unit bytestring-0.10.12.1 True ([])},
               -package-id base-4.15.0.0{unit base-4.15.0.0 True ([])},
               -package-id time-1.9.3{unit time-1.9.3 True ([])},
               -package-id hpc-0.6.1.0{unit hpc-0.6.1.0 True ([])},
               -package-id filepath-1.4.2.1{unit filepath-1.4.2.1 True ([])},
               -package-id process-1.6.11.0{unit process-1.6.11.0 True ([])},
               -package-id array-0.5.4.0{unit array-0.5.4.0 True ([])},
               -package-id integer-gmp-1.1{unit integer-gmp-1.1 True ([])},
               -package-id containers-0.6.4.1{unit containers-0.6.4.1 True ([])},
               -package-id ghc-boot-9.0.1{unit ghc-boot-9.0.1 True ([])},
               -package-id binary-0.8.8.0{unit binary-0.8.8.0 True ([])},
               -package-id ghc-prim-0.7.0{unit ghc-prim-0.7.0 True ([])},
               -package-id ghci-9.0.1{unit ghci-9.0.1 True ([])},
               -package-id rts-1.0{unit rts-1.0 True ([])},
               -package-id transformers-0.5.6.2{unit transformers-0.5.6.2 True ([])},
               -package-id deepseq-1.4.5.0{unit deepseq-1.4.5.0 True ([])},
               -package-id ghc-boot-th-9.0.1{unit ghc-boot-th-9.0.1 True ([])},
               -package-id pretty-1.1.3.6{unit pretty-1.1.3.6 True ([])},
               -package-id template-haskell-2.17.0.0{unit template-haskell-2.17.0.0 True ([])},
               -package-id directory-1.3.6.1{unit directory-1.3.6.1 True ([])},
               -package-id text-1.2.4.1{unit text-1.2.4.1 True ([])},
               -package-id random-1.2.1-e1879819ad2512292cbd29842949fd250c449266{unit random-1.2.1 True ([])},
               -package-id QuickCheck-2.14.2-ddd3158346bc1397aa376f2d5b48d0fd800681db{unit QuickCheck-2.14.2 True ([])},
               -package tasty{package tasty True ([])},
               -package tasty-hunit{package tasty-hunit True ([])},
               -package tasty-hunit-patterns{package tasty-hunit-patterns True ([])}]
loading package database C:\tools\ghc-9.0.1\lib\package.conf.d
loading package database C:\Users\tqx98\AppData\Roaming\cabal\store\ghc-9.0.1\package.db
cannot satisfy -package tasty-hunit-patterns
    (use -v for more information)

And on when trying to install, I get:

PS D:\CurrentDir\code> cabal install tasty-hunit-patterns
cabal.exe: Unknown package "tasty-hunit-patterns".

EDIT

I have now tried to add the package with stack as suggested in the comments. I get his output:

PS D:\Redo_haskell_folder\code> stack install Test.Tasty.Patterns.Parser
Error: [S-8506]
Error parsing targets: Directory not found: Test.Tasty.Patterns.Parser
PS D:\Redo_haskell_folder\code> stack install Test.Tasty.Patterns
Error: [S-8506]
Error parsing targets: Directory not found: Test.Tasty.Patterns
PS D:\Redo_haskell_folder\code> stack exec -- ghc --version
The Glorious Glasgow Haskell Compilation System, version 9.2.5

This would be the typically procedure of using stack what am I missing?


问:
get all files from directory as blob on browser using javascript
I am currently fetching single file from public folder of my app as below

```<code>import Pdf from "../assets/sample/Sample.pdf";
const response = await axios({
    method: "post",
    url: Pdf,
    responseType: "blob",
});
</code>```

I would like to get the content of whole of sample directory where multiple files are stored.

please look at the path of pdf where its stored in sample directory.

i am trying to find out what should be the response type be for a directory?

i could achieve by making multiple calls, but i want am trying to find a way to do in single call.

```<code>const getFilesFromFolder = async () => {
    const response = await axios.all([
        makeRequestForSingleFile(Pdf),
        makeRequestForSingleFile("/src/assets/sample/Sample.docx"),
        makeRequestForSingleFile("/src/assets/sample/Sample.ppt"),
    ]);
    return response.map(obj => obj.data);
};
</code>```

Body:
I am currently fetching single file from public folder of my app as below

import Pdf from "../assets/sample/Sample.pdf";
const response = await axios({
    method: "post",
    url: Pdf,
    responseType: "blob",
});

I would like to get the content of whole of sample directory where multiple files are stored.

please look at the path of pdf where its stored in sample directory.

i am trying to find out what should be the response type be for a directory?

i could achieve by making multiple calls, but i want am trying to find a way to do in single call.

const getFilesFromFolder = async () => {
    const response = await axios.all([
        makeRequestForSingleFile(Pdf),
        makeRequestForSingleFile("/src/assets/sample/Sample.docx"),
        makeRequestForSingleFile("/src/assets/sample/Sample.ppt"),
    ]);
    return response.map(obj => obj.data);
};


问:
Type of property '' circularly references itself in mapped type
Type of property 'caller' circularly references itself in mapped type '{ [K in keyof Function]-?: PathImpl<K & string, Function[K]>; }'.ts

Is there a work around within this problem? I'm using MUI with Vite, react and typescript. What's really weird is I already did the same thing in another component but that problem wasn't present there

What's weird is that when I remove something relating to react-hook-forms the problem now references something also react-hook-form. I've also seen this issue within github but never quite got an answer.


问:
java integration test with jetty jersey application with nebula graph database
I have a Jetty HTTP Server to run a JAX-RS or Eclipse Jersey application.

I want to have an integration test with the Nebula graph

how can I implement tests with Nebula Graph as:

tests run in separate env (independent of local or production env)

my integration test run in nebula graph as docker or any other solution

my ci-cd runs those tests easily

my developers produce data and assert them after saving


问:
Can someone explain these poor SVM scores on a binary classification problem?
I am testing out different SVM kernels on a cats vs dogs image dataset. The problem is the training and test accuracy is really poor. I could never increase my accuracy on the test set over 0.47. The best I could do was increase the training accuracy to 0.97 by changing parameters on the rbf and the poly kernel. Maybe I messed up while I was preparing my data? The basic steps I did was read each picture, turn it grayscale and turn it into an appropriate array. Afterwards I just create a dataframe and normalise the pixel values of the images(the code is below). Another guess of mine is the dataset is just bad when it comes to the svm model? The pictures are very different and random? Can anyone help me figure out why the accuracy scores never go up? Why the model is showing such poor performance? (I have tried different values of C, gamma, degree parameters in their respective kernels without success).

```<code>
catimages = []
dogimages = []
for img in glob.glob("/home/mr_robot/Downloads/cd/PetImages/Cat/*.jpg"):
    image = Image.open(img)
    rez = image.resize((28,28))
    gray = ImageOps.grayscale(rez)
    array = np.array(gray)
    catimages.append(array)
a = np.array(catimages, dtype=object)
z = a.reshape(12498, 784)
catdata = pd.DataFrame(z)
catdata.insert(loc=0, column="label", value=0)
for img in glob.glob("/home/mr_robot/Downloads/cd/PetImages/Dog/*.jpg"):
    image2 = Image.open(img)
    rez2 = image.resize((28,28))
    gray2 = ImageOps.grayscale(rez2)
    array2 = np.array(gray2)
    dogimages.append(array2)
a2 = np.array(dogimages, dtype=object)
z2 = a.reshape(12498, 784)
dogdata = pd.DataFrame(z2)
dogdata.insert(loc=0, column="label", value=1)
data = pd.concat([catdata,dogdata])
data = data.sample(frac=1)

</code>```

Any help would be greatly appreciated!

Body:
I am testing out different SVM kernels on a cats vs dogs image dataset. The problem is the training and test accuracy is really poor. I could never increase my accuracy on the test set over 0.47. The best I could do was increase the training accuracy to 0.97 by changing parameters on the rbf and the poly kernel. Maybe I messed up while I was preparing my data? The basic steps I did was read each picture, turn it grayscale and turn it into an appropriate array. Afterwards I just create a dataframe and normalise the pixel values of the images(the code is below). Another guess of mine is the dataset is just bad when it comes to the svm model? The pictures are very different and random? Can anyone help me figure out why the accuracy scores never go up? Why the model is showing such poor performance? (I have tried different values of C, gamma, degree parameters in their respective kernels without success).

catimages = []
dogimages = []
for img in glob.glob("/home/mr_robot/Downloads/cd/PetImages/Cat/*.jpg"):
    image = Image.open(img)
    rez = image.resize((28,28))
    gray = ImageOps.grayscale(rez)
    array = np.array(gray)
    catimages.append(array)
a = np.array(catimages, dtype=object)
z = a.reshape(12498, 784)
catdata = pd.DataFrame(z)
catdata.insert(loc=0, column="label", value=0)
for img in glob.glob("/home/mr_robot/Downloads/cd/PetImages/Dog/*.jpg"):
    image2 = Image.open(img)
    rez2 = image.resize((28,28))
    gray2 = ImageOps.grayscale(rez2)
    array2 = np.array(gray2)
    dogimages.append(array2)
a2 = np.array(dogimages, dtype=object)
z2 = a.reshape(12498, 784)
dogdata = pd.DataFrame(z2)
dogdata.insert(loc=0, column="label", value=1)
data = pd.concat([catdata,dogdata])
data = data.sample(frac=1)

Any help would be greatly appreciated!


问:
Django: Template doesn't exist but on production
I have started another app inside my django project, and i already have multiple apps inside but only one return template doesnt exit but on production only, my project is deployed on heroku.

I have done million of searches but couldnt find the solution.

my static files and database are hosted on AWS

settings.py

```<code>BASE_DIR = Path(__file__).resolve().parent.parent
INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'erecruit',
    'compensation',
    'PMS',
    'crispy_forms',
    'forms_fieldset',
    'django_filters',
    'storages',
    'gunicorn',
    'foundation_filefield_widget',
]
TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        # 'DIRS': [BASE_DIR + "/templates", ],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

AWS_ACCESS_KEY_ID = 'xxxx'
AWS_SECRET_ACCESS_KEY = 'xxx'
AWS_STORAGE_BUCKET_NAME = 'xxxxx'
AWS_DEFAULT_ACL = 'public-read'
AWS_S3_CUSTOM_DOMAIN = f'{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com'
AWS_S3_OBJECT_PARAMETERS = {'CacheControl': 'max-age=86400'}

AWS_LOCATION = 'static'
STATIC_URL = f'https://{AWS_S3_CUSTOM_DOMAIN}/{AWS_LOCATION}/'
STATICFILES_STORAGE = "storages.backends.s3boto3.S3StaticStorage"

DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
AWS_S3_FILE_OVERWRITE = False
AWS_QUERYSTRING_AUTH = False
AWS_S3_VERIFY=False
AWS_S3_USE_SSL = False

STATICFILES_DIRS = (os.path.join(BASE_DIR, "static"),)
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')

MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR,'media')

django_heroku.settings(locals())
</code>```

view.py

```<code>@login_required(login_url='loginPage')
def home(request):
    perm = 0
    for i in request.user.groups.all():
        if i.name == 'PMSupervisors': perm = 1
    if perm == 0:
        context = {}
        return render(request, 'PMS/pms_home.html',context)
    if perm == 1:
        print('this username is a supervisor')
        context = {}
        return redirect('supervisor_home')
</code>```

urls.py

```<code>
urlpatterns = [
    path('PMS/', include('PMS.urls')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_URL)

urlpatterns = [path('', views.home, name='PMS-home'),]
</code>```

here is a picture of the error

Body:
I have started another app inside my django project, and i already have multiple apps inside but only one return template doesnt exit but on production only, my project is deployed on heroku.

I have done million of searches but couldnt find the solution.

my static files and database are hosted on AWS

settings.py

BASE_DIR = Path(__file__).resolve().parent.parent
INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'erecruit',
    'compensation',
    'PMS',
    'crispy_forms',
    'forms_fieldset',
    'django_filters',
    'storages',
    'gunicorn',
    'foundation_filefield_widget',
]
TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        # 'DIRS': [BASE_DIR + "/templates", ],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

AWS_ACCESS_KEY_ID = 'xxxx'
AWS_SECRET_ACCESS_KEY = 'xxx'
AWS_STORAGE_BUCKET_NAME = 'xxxxx'
AWS_DEFAULT_ACL = 'public-read'
AWS_S3_CUSTOM_DOMAIN = f'{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com'
AWS_S3_OBJECT_PARAMETERS = {'CacheControl': 'max-age=86400'}

AWS_LOCATION = 'static'
STATIC_URL = f'https://{AWS_S3_CUSTOM_DOMAIN}/{AWS_LOCATION}/'
STATICFILES_STORAGE = "storages.backends.s3boto3.S3StaticStorage"

DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
AWS_S3_FILE_OVERWRITE = False
AWS_QUERYSTRING_AUTH = False
AWS_S3_VERIFY=False
AWS_S3_USE_SSL = False

STATICFILES_DIRS = (os.path.join(BASE_DIR, "static"),)
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')

MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR,'media')

django_heroku.settings(locals())

view.py

@login_required(login_url='loginPage')
def home(request):
    perm = 0
    for i in request.user.groups.all():
        if i.name == 'PMSupervisors': perm = 1
    if perm == 0:
        context = {}
        return render(request, 'PMS/pms_home.html',context)
    if perm == 1:
        print('this username is a supervisor')
        context = {}
        return redirect('supervisor_home')

urls.py

urlpatterns = [
    path('PMS/', include('PMS.urls')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_URL)

urlpatterns = [path('', views.home, name='PMS-home'),]

here is a picture of the error


问:
How to get Yearly and Quarterly Data from NSEpy for a stock?
In Python, we can download daily data (1 row for 1 day) from NSEpy using the below code:

```<code>from datetime import date
from nsepy import get_history
sbin = get_history(symbol='SBIN',
                   start=date(2015,1,1),
                   end=date(2015,1,10))
</code>```

But I want to know how can we download Yearly and Quarterly Data.

By yearly I mean, 1 record showing OHLC for 1 year.

I know the data is readily available with NSE because we can check that on the NSE website.
Link: https://www1.nseindia.com/products/dynaContent/equities/equities/histHighLowSearch.htm

Body:
In Python, we can download daily data (1 row for 1 day) from NSEpy using the below code:

from datetime import date
from nsepy import get_history
sbin = get_history(symbol='SBIN',
                   start=date(2015,1,1),
                   end=date(2015,1,10))

But I want to know how can we download Yearly and Quarterly Data.

By yearly I mean, 1 record showing OHLC for 1 year.

I know the data is readily available with NSE because we can check that on the NSE website.
Link: https://www1.nseindia.com/products/dynaContent/equities/equities/histHighLowSearch.htm


问:
Maui flyoutitem is not redirecting properly
I'm working on a school project lately and I'm pretty new to Maui. I have already implemented CRUD using SQLite database and this works fine so far.

But I have a problem. In my AppShell, I have a side-navigation and two of the three links in them work pretty good so far. But everytime I click on the last of the 3 FlyoutItem's, the navigation gets disabled and I can't move anymore. The pages still "switches", but the view stays the same.

This is my Navigation Bar in the AppShell:

```<code><?xml version="1.0" encoding="UTF-8" ?>
<Shell
    x:Class="test_project.AppShell"
    xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:local="clr-namespace:test_project"
    xmlns:views="clr-namespace:test_project.Views"
    FlyoutBackgroundColor="#8319A8"
    Shell.FlyoutBehavior="Locked"
    FlyoutWidth="300">

    <FlyoutItem Title="Home" Icon="house_white.png">
        <ShellContent ContentTemplate="{DataTemplate local:MainPage}" />
    </FlyoutItem>
    <FlyoutItem Title="Albums" Icon="plus_white.png">
        <ShellContent ContentTemplate="{DataTemplate views:AlbumListPage}" />
    </FlyoutItem>
    <FlyoutItem Title="Songs" Icon="upload_icon.png">
        <ShellContent ContentTemplate="{DataTemplate views:SongListPage}" />
    </FlyoutItem>

</Shell>

</code>```

Did anyone ever have a similar problem? I already checked the DataTemplate part, this should actually work since its the right name and everything was made properly.

Body:
I'm working on a school project lately and I'm pretty new to Maui. I have already implemented CRUD using SQLite database and this works fine so far.

But I have a problem. In my AppShell, I have a side-navigation and two of the three links in them work pretty good so far. But everytime I click on the last of the 3 FlyoutItem's, the navigation gets disabled and I can't move anymore. The pages still "switches", but the view stays the same.

This is my Navigation Bar in the AppShell:

<?xml version="1.0" encoding="UTF-8" ?>
<Shell
    x:Class="test_project.AppShell"
    xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:local="clr-namespace:test_project"
    xmlns:views="clr-namespace:test_project.Views"
    FlyoutBackgroundColor="#8319A8"
    Shell.FlyoutBehavior="Locked"
    FlyoutWidth="300">

    <FlyoutItem Title="Home" Icon="house_white.png">
        <ShellContent ContentTemplate="{DataTemplate local:MainPage}" />
    </FlyoutItem>
    <FlyoutItem Title="Albums" Icon="plus_white.png">
        <ShellContent ContentTemplate="{DataTemplate views:AlbumListPage}" />
    </FlyoutItem>
    <FlyoutItem Title="Songs" Icon="upload_icon.png">
        <ShellContent ContentTemplate="{DataTemplate views:SongListPage}" />
    </FlyoutItem>

</Shell>

Did anyone ever have a similar problem? I already checked the DataTemplate part, this should actually work since its the right name and everything was made properly.


问:
Documentation tool for IT systems
we are about to document an old legacy system. And I would like to know
if someone knows of a good documentation product. Especially the feature og make a layerd diagrams/flows.
Like you can drill down in a level structure of a diagram to get more details.
Like a top component could be a e.g. Integration API. next under level could be each API endpoints.
next level (when you click on a endpoint) could be a detail description of that endpoint.

But also for other thiings like document user interfaces or databases..

Do such tool exists?

Kind Regards

We are using archimate today, not able todo that with that tool.

Title: Documentation tool for IT systems


问:
How to allow duplicate user in .net core identity
.Net core identity allows us to set false to unique email but we want to allow duplicate username

because a username can be applied to multiple district id in our application.

Our clients don't want to concatenation like (username + district id)

So let me know if there is any proven solution for it . Thanks in advance


问:
how to run a VVC reference software
I have installed the VVC reference software but I am facing a problem on how to run the code, like extracting a code from the file to the reference software. What are the steps of doing that?

I tried to open a project on VS 2017, after opening the software I tried to use encoderApp as my startup project then setting active solution plateform to be x64 and for active solution configuration as Release. I aslo wrote the file name on the commend argument then setting working file onto working directory then click on the windows debugger.

Title: how to run a VVC reference software


问:
"this.debug" function is not a function, "Emit attempted before Angular Webpack plugin initialization." generate in in angular universal
I am trying to use angular universal
so i've downloaded the demo from the official site from this link angular universal demo

I am using
Node version -- 18.12.1

Angular Version -- 15.0.0

Angular Universal -- 15.0.0

Typescript -- 8.4.2

when I try to run it with npm run dev:ssr
it give me an error

```<code>Build at: 2022-12-22T12:18:55.895Z - Hash: abcbe7cb30cd2bd2 - Time: 4868ms

./server.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
Error: Emit attempted before Angular Webpack plugin initialization.

Error: Failed to initialize Angular compilation - NGCC failed.

...
Build at: 2022-12-22T12:18:56.490Z - Hash: 128203be3cd31df8 - Time: 5454ms
✔ Browser application bundle generation complete.
this.debug is not a function
</code>```

it build successfully but doesn't work eventually

this is the server.ts file

```<code>import 'zone.js/node';

import { ngExpressEngine } from '@nguniversal/express-engine';
import * as express from 'express';
import { join } from 'path';

import { AppServerModule } from 'src/app/app.server.module';
import { APP_BASE_HREF } from '@angular/common';
import { existsSync } from 'fs';

// The Express app is exported so that it can be used by serverless Functions.
export function app() {
  const server = express();
  const distFolder = join(process.cwd(), 'dist/browser');
  const indexHtml = existsSync(join(distFolder, 'index.original.html')) ? 'index.original.html' : 'index';

  // Our Universal express-engine (found @ https://github.com/angular/universal/tree/main/modules/express-engine)
  server.engine('html', ngExpressEngine({
    bootstrap: AppServerModule,
  }));

  server.set('view engine', 'html');
  server.set('views', distFolder);

  // TODO: implement data requests securely
  server.get('/api/**', (req, res) => {
    res.status(404).send('data requests are not yet supported');
  });

  // Serve static files from /browser
  server.get('*.*', express.static(distFolder, {
    maxAge: '1y'
  }));

  // All regular routes use the Universal engine
  server.get('*', (req, res) => {
    res.render(indexHtml, { req, providers: [{ provide: APP_BASE_HREF, useValue: req.baseUrl }] });
  });

  return server;
}

function run() {
  const port = process.env['PORT'] || 4000;

  // Start up the Node server
  const server = app();
  server.listen(port, () => {
    console.log(`Node Express server listening on http://localhost:${port}`);
  });
}

// Webpack will replace 'require' with '__webpack_require__'
// '__non_webpack_require__' is a proxy to Node 'require'
// The below code is to ensure that the server is run only when not requiring the bundle.
declare const __non_webpack_require__: NodeRequire;
const mainModule = __non_webpack_require__.main;
const moduleFilename = mainModule && mainModule.filename || '';
if (moduleFilename === __filename || moduleFilename.includes('iisnode')) {
  run();
}

export * from './server';

</code>```

this is tsconfig.server.json

```<code>{
  "extends": "./tsconfig.app.json",
  "compilerOptions": {
    "outDir": "./out-tsc/app-server",
    "module": "commonjs",
    "types": ["node"]
  },
  "files": [
    "src/main.server.ts",
    "server.ts"
  ],
  "angularCompilerOptions": {
    "entryModule": "./src/app/app.server.module#AppServerModule"
  }
}

</code>```

this is app.server.module.ts

```<code>import { NgModule } from '@angular/core';
import { ServerModule } from '@angular/platform-server';

import { AppModule } from './app.module';
import { AppComponent } from './app.component';

@NgModule({
  imports: [
    AppModule,
    ServerModule,
  ],
  providers: [
    // Add server-only providers here.
  ],
  bootstrap: [AppComponent],
})
export class AppServerModule {}

</code>```

in the app.module.ts file

```<code>...
imports: [
    BrowserModule.withServerTransition({ appId: 'serverApp' }),
...
</code>```

Body:
I am trying to use angular universal
so i've downloaded the demo from the official site from this link angular universal demo

I am using
Node version -- 18.12.1

Angular Version -- 15.0.0

Angular Universal -- 15.0.0

Typescript -- 8.4.2

when I try to run it with npm run dev:ssr
it give me an error

Build at: 2022-12-22T12:18:55.895Z - Hash: abcbe7cb30cd2bd2 - Time: 4868ms

./server.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
Error: Emit attempted before Angular Webpack plugin initialization.

Error: Failed to initialize Angular compilation - NGCC failed.

...
Build at: 2022-12-22T12:18:56.490Z - Hash: 128203be3cd31df8 - Time: 5454ms
✔ Browser application bundle generation complete.
this.debug is not a function

it build successfully but doesn't work eventually

this is the server.ts file

import 'zone.js/node';

import { ngExpressEngine } from '@nguniversal/express-engine';
import * as express from 'express';
import { join } from 'path';

import { AppServerModule } from 'src/app/app.server.module';
import { APP_BASE_HREF } from '@angular/common';
import { existsSync } from 'fs';

// The Express app is exported so that it can be used by serverless Functions.
export function app() {
  const server = express();
  const distFolder = join(process.cwd(), 'dist/browser');
  const indexHtml = existsSync(join(distFolder, 'index.original.html')) ? 'index.original.html' : 'index';

  // Our Universal express-engine (found @ https://github.com/angular/universal/tree/main/modules/express-engine)
  server.engine('html', ngExpressEngine({
    bootstrap: AppServerModule,
  }));

  server.set('view engine', 'html');
  server.set('views', distFolder);

  // TODO: implement data requests securely
  server.get('/api/**', (req, res) => {
    res.status(404).send('data requests are not yet supported');
  });

  // Serve static files from /browser
  server.get('*.*', express.static(distFolder, {
    maxAge: '1y'
  }));

  // All regular routes use the Universal engine
  server.get('*', (req, res) => {
    res.render(indexHtml, { req, providers: [{ provide: APP_BASE_HREF, useValue: req.baseUrl }] });
  });

  return server;
}

function run() {
  const port = process.env['PORT'] || 4000;

  // Start up the Node server
  const server = app();
  server.listen(port, () => {
    console.log(`Node Express server listening on http://localhost:${port}`);
  });
}

// Webpack will replace 'require' with '__webpack_require__'
// '__non_webpack_require__' is a proxy to Node 'require'
// The below code is to ensure that the server is run only when not requiring the bundle.
declare const __non_webpack_require__: NodeRequire;
const mainModule = __non_webpack_require__.main;
const moduleFilename = mainModule && mainModule.filename || '';
if (moduleFilename === __filename || moduleFilename.includes('iisnode')) {
  run();
}

export * from './server';

this is tsconfig.server.json

{
  "extends": "./tsconfig.app.json",
  "compilerOptions": {
    "outDir": "./out-tsc/app-server",
    "module": "commonjs",
    "types": ["node"]
  },
  "files": [
    "src/main.server.ts",
    "server.ts"
  ],
  "angularCompilerOptions": {
    "entryModule": "./src/app/app.server.module#AppServerModule"
  }
}

this is app.server.module.ts

import { NgModule } from '@angular/core';
import { ServerModule } from '@angular/platform-server';

import { AppModule } from './app.module';
import { AppComponent } from './app.component';

@NgModule({
  imports: [
    AppModule,
    ServerModule,
  ],
  providers: [
    // Add server-only providers here.
  ],
  bootstrap: [AppComponent],
})
export class AppServerModule {}

in the app.module.ts file

...
imports: [
    BrowserModule.withServerTransition({ appId: 'serverApp' }),
...


问:
What's the difference between a dma_addr_t and a bus address?
Ok, here's what I'm doing.

Get vendor ID and device ID of my SMBus and use it in pci_get_dev() to get pdev.

Get the dev using &pdev->dev and save it to struct device *smbus_dev

Map a page to DMA using dma_map_page(smbus_dev, pfn_to_page(PHYS_PFN((unsigned long)addr)), offset_in_page(addr), Size, DMA_TO_DEVICE).

So (3) gives me back a dma_addr_t that I'm naming dma_handle.

On another place (edk2 uefi) I have SmBusLib implemented, and I'm able to use SmBusReadDataByte(IN UINTN SmBusAddress, OUT RETURN_STATUS *Status OPTIONAL). Problem is when I use my dma_handle as the argument SmBusAddress the function returns an error claiming that (((SmBusAddress) >> 16) & 0x3f) != 0 and for some reason I don't not why it should not be.

So at this point I'm guessing dma_addr_t returned from dma_map_page() is not equal the SmBusAddress I'm supposed to pass. Anyone knows if that is correct? And how am I supposed to "convert" dma_addr_t to SmBusAddress?


问:
How to convert trained models (ResNet) into inference-models PyTorch?
I trained the model and then saved it as shown in the figure (right side), and I would like to convert it as shown in the figure (left side).

I found the script for RepVGG using python.

I would like to know how I can convert for ResNet that I got the model from this code.