天道酬勤,学无止境

问答

How to verify if localization is working correctly in Bot framework

I have used RView and MAT tools to create resource files for french language as described in https://docs.microsoft.com/en-us/bot-framework/dotnet/bot-builder-dotnet-formflow-localize to localize the form flow. How can I verify if the localization is working correctly. Basically I need a way to test the form flow in my emulator in French language. What's the best/right way to set the CurrentUICulture or to test this out?

2022-01-25 05:40:59   c#   botframework   formflow

Pass ValueTuple instead of arguments [duplicate]

This question already has answers here: In C# 7 is it possible to deconstruct tuples as method arguments (7 answers) Closed 2 years ago. Is it possible to do in this way (or maybe I need specific version of C#)? Function<int,int,int,int> triSum = (a,b,c) => {return a+b+c;}; var tup = (1,2,3); triSum(tup); //passing one tuple instead of multiple args Update: I mean passing tuple instead of separate arguments. public void DoWrite(string s1, string s2) { Console.WriteLine(s1+s2); } public (string,string) GetTuple() { //return some of them } //few lines later DoWrite(GetTuple());

2022-01-25 05:40:48   c#   tuples   parameter-passing   valuetuple

Redirecting to backend via htaccess Yii2

I am trying to redirect my url to the admin ( backend ) part on domain/admin via htaccess. Still not very familiar with .htaccess and what I did so far is Main .htaccess in the root directory: #adding the charset AddDefaultCharset utf-8 #hide the structure Options -Indexes #if dir is symbol, follow it Options FollowSymlinks #engine on RewriteEngine #if there is admin word in the URI go on the next rule RewriteCond %{REQUEST_URI} ^/admin$ #load the backend index file, append the group to the url (QSA) and stop rewriting (L) RewriteRule ^admin(/.+)$ /backend/web/$1 [QSA,L] #everything different

2022-01-25 05:40:44   php   .htaccess   redirect   mod-rewrite   yii2

How to add package views to master view in Laravel?

Alright so I'm building multiple packages in my Laravel project, however each package has some administration side with it for example blogs and forums. Now I got my main project, which doesn't do more than supply a pure foundation for all packages. I got my admin template with it's own main navigation, now I was wondering if there would be a way to dynamically load in extensions of this menu from the packages? Here's the structure of the whole thing: Resources - views - cp - homer //Name of the template - master.blade.php - components - nav.blade.php Now inside my package I would have the

2022-01-25 05:40:38   laravel   laravel-blade

Versioning an angular application in production

I have multi module application, where some of my modules are lazily loaded, and so the output files in dist folder looks like this 1.d2ef1******8da.chunk.js, 2.dsfd3******8da.chunk.js and like wise. The problem is, if I create a new build for the production, then the hash changes and so the file names. Suppose a user has not refreshed the page, they still will try to lazily load the old file which will be shown as file not found. In such case my page hangs. How should I handle it ?

2022-01-25 05:40:32   javascript   angular   typescript

Make cursor corresponding array with multiple rows followed by same row id's

I have a DB in which id's are change after few rows, then same I'd in some rows then change I'd. What I want that, the same I'd values will be populated listview's in one line, then when the Ids are same, they are all in one row. And thus the next rows populate with same rows which have same ID's. My DB columns and rows are as follows: Verse_id -------words_id----------words_ar------ translate_bn-- 1-----------------------1---------------Mamun-----------Assistant--- 1-----------------------2--------------- Salam------------Operator------ 1-----------------------3---------------John------------

2022-01-25 05:40:26   arrays   database   rows   android-cursoradapter   android-cursor

How to position elements inside a ListView?

Good morning. I made this screen and it works like a charm on high resolutions. Problem is, I want to support lower resolutions like Nexus 4 (768x1280). So when I run this on an emulator (Nexus 4 size) and I touch the input fields, the keyboard either: blocks the inputs, or moves the two buttons at the bottom and overlaps them on something else. So, to solve it I wrapped the entire layout on a ListView(), but now the bottom buttons, which are wrapped on a Row(), just won't stay at the bottom. This is my code without the ListView and working on high res, but not on low: return Form( Stack(

2022-01-25 05:40:20   dart   flutter   flutter-layout

Get the value for the previous point of time. Clickhouse. IOT case

I have the table with keys (time, facility). For each key, the (value) received from the sensor is stored. For instance: ┌─date───────┬facility┬value┬ │ 2017-09-09 │ 10002 │ 10 │ │ 2017-09-10 │ 10001 │ 12 │ │ 2017-09-12 │ 10002 │ 15 │ │ 2017-09-15 │ 10001 │ 17 │ └────────────┴────────┘─────┘ I want to calculate an increase in the current value compared to the previous one. Something like this: ┌─date───────┬facility┬─value─┬ │ 2017-09-12 │ 10002 │ 15/10 │ // 15 current, 10 previous for facility 10002 │ 2017-09-15 │ 10001 │ 17/12 │ // 17 current, 12 previous for facility 10002 └────────────┴──”

2022-01-25 05:40:12   Clickhouse

Spark Small ORC Stripes

We use Spark to flatten out clickstream data and then write the same to S3 in ORC+zlib format, I have tried changing many settings in Spark but still the resultant stripe sizes of the ORC file getting created are very small (<2MB) Things which I tried so far to decrease the stripe size, Earlier each file was 20MB in size, using coalesce I am now creating files which are of 250-300MB in size, but still there are 200 stripes per file i.e each stripe <2MB Tried using hivecontext instead of sparkcontext by setting hive.exec.orc.default.stripe.size to 67108864, but spark isn't honoring these

2022-01-25 05:40:07   hadoop   apache-spark   presto   amazon-athena

Creating flac file or flac stream using BASS dll with Delphi

I am playing with BASS from http://www.un4seen.com/. I need to create a flac file(16bits) or flac stream from user speaking on Microphone. I have seen this demo in BASS source code. There is a bassenc_flac.dll as well with these functions: function BASS_Encode_FLAC_Start(handle:DWORD; options:PChar; flags:DWORD; proc:ENCODEPROCEX; user:Pointer): HENCODE; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassencflacdll; function BASS_Encode_FLAC_StartFile(handle:DWORD; options:PChar; flags:DWORD; filename:PChar): HENCODE; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external

2022-01-25 05:40:01   delphi   audio   encode   flac   bass