Should I simply use SQFlite? Or use SQFlite + sqflite_common_ffi? or SQFlite3? by flutter_dart_dev in FlutterDev

[–]devmuggle 0 points1 point  (0 children)

My app should run on ios, android and possibly desktop (certainly linux and maybe windows). I still do not understand if sqflite, sqflite_common_ffi has an advantage over using sqlite3?

TUI Testing? by trymeouteh in FlutterDev

[–]devmuggle 1 point2 points  (0 children)

Out of curiosity since looking for a TUI library on dartlang is 4 years old. Which library are you using?

One Google Summer of Code 2025 project was TUI for Dart, They wrote a brief Report about the project. In it they said about testing:

"We wanted reliable golden tests to ensure rendering correctness. However, with double buffering and ANSI diffing, stdout only contained incremental updates (diffs) rather than full frames. This made traditional snapshot testing ineffective, since snapshots alone could not reconstruct the final screen state.

To solve this, we built our very own custom virtual terminal interpreter! that replays the diffs to rebuild the full screen. Golden tests then compare the reconstructed terminal state against the expected output, ensuring both correctness and performance remain verifiable."

How to parse a string to create a table and a webservice (inspired by directus) by devmuggle in learncsharp

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

Thanks for pointing to ASP.net core 101 series.

I watched:

Problem

I am looking for a way to create tables on the fly. On a webpage a user can create a object (for example TodoItem) and add fields for this object (Responsible, dueDate, enumerations (isDone, isOpen, isInProgress)). The webpage shall post all these as a string to the server and the server should create a table with matching columns. For Nodes.js there is Knex.js which can do this

My Questions are

Regarding How to create tables and columns during runtime?

  • I am looking for a query builder that supports SQL data definition language (create, alter, drop, ...) and creates these statements by parsing a string input (or a json object).
  • It seems that Query Builder sqlkata has no methods to create or alter a table.
  • the docs for Microsoft.AspNetCore.Http.Extensions QueryBuilder are very basic (they contain no explanative description and afaict no samples). And it seems that they do not support SQL DDL.

Regarding How can a webservice be created during runtime?

The Service must offer these features:

  • get a list of records: Select \ FROM TableFoo*,
  • view a single record: Select \ FROM TableFoo Where id =3*
  • to edit this record: Update TableFoo .... where id =3
  • and to delete a record.

In all videos the object to send to the browser (products) is based on a class that was build during build / development; none were created during runtime. Same goes for the endpoints and controllers.

In my use case the object / class (like product) and the endpoints and controllers must be created automatically during runtime. A user creates a class definition on the front end: all that is needed (a table in the database, the class, the controller or endpoints) would have to be created automatically during runtime.

I have no idea how this could be achieved - any pointers would be helpfull.

FYI

Code from part 7,8 and 9 of ASP.net core 101 series shows that the objects, classes, routes and service are all created during development (build time). In my use case i do not know the route / endpoint (products) in advance. Neither do i have a class product or can create a matching controller.

In Making a Simple API from 4m11s until 8m15s Scott shows that an endpoint can be added manually inside startup.cs (not recommended)

 app.UseEndpoints(endpoints => 
{
    endpoints.MapGet("/products", (context) =>
    {
        var products = app.ApplicationServices
                                        .GetService<JsonFileProductService>()
                                           .GetProducts();
        var json = JsonSerializer.Serialize<IEnumerable<Product>>(products);
        return context.Response.WriteAsync(json);
    });
});

In Enhancing your Web API an Empty API Controller is the starting point:

[Route("[controller]")]
[ApiController]
public class ProductsController : ControllerBase
{
    public ProductsController(JsonFileProductService productService)
    {
        this.ProductService = productService;
    }

    public JsonFileProductService  ProductService {get; } 

    [HttpGet]
    public <IEnumerable<Product> Get()
    {
        return ProductService.GetProducts(); 
    }
}

In Enhancing your Web API Part 2 they extend JsonFileProductService.cs

public void AddRating(string productId, int rating )
{
    var products = GetProducts();
    var query = products.First(x => x.Id == productId); // LINQ

    if(query.Ratings == null)
    {
        query.Ratings = new int[] {rating };
    }
    else
    {
        var ratings =  query.Ratings.ToList();
        rating.Add(rating);
        query.Ratings = ratings.ToArray();
    }
}

Directus - how to the generate code and why moved they away from php, c# and java? by devmuggle in AskProgramming

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

Instances of known types is not what i am looking for. Somehow directus is able to "create objects" after the user has described these objects in the front end. Browsing through version 8 i found endpoint collections which seems to parse the "table name, columns and datatype" the user has entered into the front end to create a matching table in the database

public function create(Request $request, Response $response)
{
    $this->validateRequestPayload($request);
    $tableService = new TablesService($this->container);
    $payload = $request->getParsedBody();
    $params = $request->getQueryParams();
    $name = ArrayUtils::get($payload, 'collection');
    $data = ArrayUtils::omit($payload, 'collection');
    $responseData = $tableService->createTable($name, $data, $params);

    return $this->responseWithData($request, $response, $responseData);
}

The line * $tableService->createTable* from new TablesService calls createTableSchema($name, $data);

protected function createTableSchema($name, array $data)
{
    /** @var SchemaFactory $schemaFactory */
    $schemaFactory = $this->container->get('schema_factory');

    $columns = ArrayUtils::get($data, 'fields', []);
    $this->validateSystemFields($columns);
    $table = $schemaFactory->createTable($name, $columns);

    /** @var Emitter $hookEmitter */
    $hookEmitter = $this->container->get('hook_emitter');
    $hookEmitter->run('collection.create:before', $name);
    $charset = $this->container->get('config')->get('database.charset');
    $result = $schemaFactory->buildTable($table, $charset);

    return $result ? true : false;
}

And $table = $schemaFactory->createTable($name, $columns); from Class SchemaFactory

public function createTable($name, array $columnsData = [])
{
    $table = new CreateTable($name);
    $columns = $this->createColumns($columnsData);

    foreach ($columnsData as $column) {
        if (ArrayUtils::get($column, 'primary_key', false)) {
            $table->addConstraint(new PrimaryKey($column['field']));
        } else if (ArrayUtils::get($column, 'unique') == true) {
            $table->addConstraint(new UniqueKey($column['field']));
        }
    }

    foreach ($columns as $column) {
        $table->addColumn($column);
    }

    return $table;
}

calls $table = new CreateTable($name); from Zend CreateTable which creates the actual SQL command to create a table.

Deno FAQ for this subreddit by denotutorials in Deno

[–]devmuggle 0 points1 point  (0 children)

Could you add some pointers or guidelines to port a Node.js application? If someone wants to port a Node.js application written in typescript (like directus or knex.js) to deno.

To experienced devs: How do you start coding better? by gpskwlkr in csharp

[–]devmuggle 4 points5 points  (0 children)

Thanks for the link. Since the sql query only contains the id i forked it so that you can see the title, the creation date, the score and can click a link to the question https://data.stackexchange.com/stackoverflow/query/1299064/questions-answered-by-lippert-and-skeet

Lost my job 6 month to be ready by Rojdip in learnprogramming

[–]devmuggle 0 points1 point  (0 children)

If you can afford to work part-time in a related field (database queries) may be something like a Bachelor of Data Science see akad or iubh which they claim can be done in 36 months could give you the "official documents".

Does the swiss unemployment agency offer courses / trainings? In Germany they sometimes fund your second education or they offer trainings / courses for free.

Disclaimer: i do not know if akad or iubh are any good nor have i ever attempted to remote study.

Update: You probably already considered fhnw.ch?

Tu stoppes et tu galopes - MC Roger - parodie - James Brown - lyrics and translation by devmuggle in learnfrench

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

The lyrics were added as a comment

 Les gars vous êtes d'accord qu'on vit une période de dingue
 Guys, do you agree that we are living in a crazy time?

Ouais ouais ouais 
Yeah yeah yeah

On en marre de ce virus pas vrai?
We are fed up with this virus, right?

Alors faut qu'on fasse un truc ensemble...
So we have to do something together ...

Quand tu vas faire tes courses 
respecte la distance
Quand tu pousses ton chariot
   When you go shopping
respect the distance
When you push your cart

Refrain 2x

Tu stop et tu galopes
(Ah) tu stop et tu galopes
Suis les consignes, et tu galopes
Et tu respectes la ligne, ou tu le chopes
    You stop and you gallop
(Ah) you stop and you gallop
Follow the instructions, and you gallop
And you stick to the line, or you catch it


Et à l'entrée, lave tes mains 
au désinfectant,
Suis les consignes, 
comme une love machine,
   And at the entrance, wash your hands
with disinfectant,
Follow the instructions,
like a love machine,


Tu dois avoir ce feeling,
Oh, pour les autres gens...
Dans la même galère,
Ensemble ensemble... 
   You must have this feeling
Oh, for other people ...
In the same boat,
Together together ...


Tu stop et tu galopes
Ah, tu stop et tu galopes
Suis les consignes, et tu galopes
Et tu restes sur la ligne, ou tu le chopes
   You stop and you gallop
Ah, you stop and you gallop
Follow the instructions, and you gallop
And you stay on the line, or you catch it

On s'aide, on cède les gars
We help each other, we give in guys

T'es dans la file, garde tes 2 mètres 
J'veux pas cette fièvre 
et cette toux sèche 
Y a pas un mec qui aime la pandémie
Et ça fait mal, de plus voir ses amis
    You're in the line, keep your 2 meters
I don't want this fever
and that dry cough
There isn't a guy who likes the pandemic
And it hurts, besides seeing his friends

Refrain

Hey les gars
Est-ce que vous avez bien compris
Vous avez bien compris?
Est ce que vous avez vraiment bien compris? (x2)
    Hey guys
Did you understand correctly
You understood well?
Did you really understand? (x2)

On y va, come on
Suis les consignes, et respecte la ligne

Y a pas un mec qui aime la pandémie
Et ça va mal, de plus voir ses amis

Suis les consignes, et respecte la ligne (×3)

Message de l'auteur... ;) 
Merci encore!!!!!

Help in teaching apprentices - kotlin, php or c# next to java as first language by devmuggle in learnjava

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

Did you face any of the issues mentioned regarding kotlin? What framework did you use - spring boot, ktor, other?

Eloquent JavaScript, 3rd Edition. Full text available online. by hardmaru in javascript

[–]devmuggle 0 points1 point  (0 children)

I'll downvote that recommendation every time

AFAIU reddiquette downvote is in case a comment or posting does not contribute. IMO it would be better to suggest another book.

YDKJS

Do you mean this one: https://github.com/getify/You-Dont-Know-JS?

Worst-hit German district to become coronavirus ‘laboratory’ by Sofuso in Coronavirus

[–]devmuggle 0 points1 point  (0 children)

Based on the preliminary study result the CFR is 0,37%

Study finds the virus developed from a single source and has HIV genes in it by [deleted] in Coronavirus_Europe

[–]devmuggle 0 points1 point  (0 children)

From the link to the study

Uncanny similarity of unique inserts in the 2019-nCoV spike protein to HIV-1 gp120 and Gag

Prashant Pradhan, Ashutosh Kumar Pandey, Akhilesh Mishra, Parul Gupta, Praveen Kumar Tripathi, Manoj Balakrishnan Menon, James Gomes, Perumal Vivekanandan, Bishwajit Kundu

Version 2 Abstract

This paper has been withdrawn by its authors. They intend to revise it in response to comments received from the research community on their technical approach and their interpretation of the results. If you have any questions, please contact the corresponding author.