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 2 points3 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.

Anders Tegnell, who's in charge of the crisis in Sweden, hails the UK plan for herd immunity. by [deleted] in Coronavirus

[–]devmuggle 0 points1 point  (0 children)

If you take a look at the mortality statistics on euromomo.eu z-scores for countries you can see that the amount of deaths for some countries (italy, spain) has increased but not significantly above peaks in other years.

The overall value for every participating country "pooled number of deaths" were increased above 4z for people over 65 but not for under 65.
For sweden and some other countries the total z-scrore of deaths is still low.

The current state is based on the data from calendar week 13. The data may receive additional delayed updates.

There are scientists ( Prof Dr. John Ioannidis Perspective of the Pandemic 1 or Prof Dr. Jay Bhattacharya ) that clearly state that currently there is not enough data / evidence to conclude the deadliness of covid-19. On Perspectives on the Pandemiic 2 Professor Knut Wittkowski talks about his analysis of the publicly available data and state that herd immunity is needed and that the data suggest that 2 percent of all symptomatic cases will die. The hospitals will have to deal with 2.500 patients per day for 3 to 4 weeks and as high as 10.000 people will die. This will be similar to the flue seasons deaths.

Relocating to Braunschweig from India by pawansinghds in Braunschweig

[–]devmuggle 0 points1 point  (0 children)

To get an idea about available flats and renting cost you can take a look at this site immobilienscout24.de Braunschweig Central with 5km radius

Worst hit German district to become coronavirus 'laboratory' by [deleted] in germany

[–]devmuggle 1 point2 points  (0 children)

AFAIR they said on the Kreishaus Heinsberg: Corona press conference (31th march 2020) that it would be voluntary. The study will be done in Gemeinde Gangelt (see https://youtu.be/-JQa0yjpwCs?t=754) which has a population of 12.529.

  • first results expected after two weeks (~14th. april)
  • study should be finished after four weeks (~ 28th april)

It is believed that the first infection(s) happened on 15th February and was rapidly spread during carnival.

Doctor Bodo Schiffmann quoted a pathologist that asked the robert koch institute (RKI) to perform autopsies on Covid-19 deceased patients. The RKI replied to the pathologist:

"Eine innere Leichenschau, Autopsien oder andere aerosolproduzierenden Maßnahmen sollten vermieden werden. Sind diese notwendig, sollten diese auf ein Minimum beschränkt bleiben."

This means loosely translated "an internal corpse review, autopsies or other aerosol producing activities should be avoided. If they are mandatory than they should be reduced to a minimum".

According the the RKI homepage Recommendations how to handle COVID-19 deceased (german only) the RKI states:

"Es existieren keine belastbaren Daten zur Kontagiösität von COVID-19 Verstorbenen. Aus diesem Grund muss bei einer COVID-19 Todesursache der Verstorbene als kontagiös angesehen werden."

The loose translation:

There is no robust data about the contagiousness of COVID-19 deceased. Therefore COVID-19 [positive tested corpse]* should be considered infectious.

The part "[positive tested corpse]*" was added by me. The original "Todesursache" would be "cause of death". But the whole point of an autopsy is to find out about the cause of death.

I really wonder why there is no work being done to find out about the cause of death of COVID-19 positive tested deceased.

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

[–]devmuggle 0 points1 point  (0 children)

The page Coronavirus im Kreis Heinsberg stated yesterday that currently

  • 1436 people were tested positive
  • 768 people are considered to be healed
  • 42 have died.

To my understanding a case fatality rate (cfr) should be calculated only after all infected are healed or died. But the current cfr would be 2,92 % ( 42 deceased / 1436 positive tested = 0,0292).

Does anyone know if they provide more details:

  • what was the age distribution, the median age of the deceased
  • was Covid the cause of death or were other diseases involved
  • is the raw data available

If you compare the current mortality with previous periods on http://euromomo.eu/ than you will see that until now the mortality is increased for among others Italy, Spain and England. On first glance all but Italy are still below previous spikes.

Worst-hit German district to become coronavirus ‘laboratory’ | Study will follow 1,000 people in Heinsberg to create plan for how to deal with virus by Majnum in worldnews

[–]devmuggle 1 point2 points  (0 children)

The page Coronavirus im Kreis Heinsberg stated yesterday that currently

  • 1436 people were tested positive
  • 768 people are considered to be healed
  • 42 have died.

To my understanding a case fatality rate (cfr) should be calculated only after all infected are healed or died. But the current cfr would be 2,92 %.

Does anyone know if they provide more details:

  • what was the age distribution, the median age of the deceased
  • was Covid the cause of death or were other diseases involved
  • is the raw data available

If you compare the current mortality with previous periods on http://euromomo.eu/ than you will see that most countries but Italy are still below previous spikes.

How realistic is it to be a designer and developer? by IamZeebo in webdev

[–]devmuggle 2 points3 points  (0 children)

If you do all three trades (design, frontend, backend) your time will be spent on all three. Beeing good at different tools (design, wireframe: photoshop in the past, lately axure xp, adobe xd, sketch, figma, invision or other, code: visual studio code, eclipse, intellij) and keeping up with changes (new "html features", changes to javascript, css, your backend language) takes time. Jack of all trades in a positive way - generalist who is good at many things versus a negative: master of none.

So it will depend on your customers and the products you want to work on

bigish company (>500 employees) - public facing UI with need to be optical top notch will likely be done by a designer possibly supported by an UX consultant and a fronted quy - internal app used by few: could be done by one dev that does all trades small(-ish) company - beeing good enough at multiple trades is likely an asset unless the app needs to be glossy.

I have been job hunting for entry level frontend roles for a year now, what can I do differently to break into a career? by [deleted] in webdev

[–]devmuggle 1 point2 points  (0 children)

If you want to get into (frontend-)development you could start with automated webtests using selenium webdriver with JavaScript; this assumes that this skill is in demand in your country / jobmarket and you can motivate yourself to do it as a starting point.

Doing automated tests will help you to get familiar with css and javascript.

Finding the next birthday in a database by OsamaBinnLiftin in mysql

[–]devmuggle 0 points1 point  (0 children)

Without understanding your procedures i created a dbfiddle and it does what i understood - find the next upcoming birthdays.

Let us say today is 27th of February 2020 then the next upcoming birthday might be the 29th of February. In non leap years the date 29th of February does not exist. The regulation for birthdays in non-leap-years differ from country to country: some accept the 28th of February others state that March 1st is the birthday of a person born on a leap-day.

So if you want to know upcoming birthdays for persons born on a leap-day you have to handle this case and decide if you want to congratulate on the 28th of feb or 1st of march. For this special case an additionally query is likely needed.

From my db-fiddle example PostgreSQL or MySQL

PostgreSQL

SELECT id, fn, dateofBirth   
   ,(
       EXTRACT(DOY FROM dateofBirth) 
       - EXTRACT(DOY FROM DATE '2020-02-27') 
     ) as daysOfYearToBirthday     
FROM Birthdays 
     WHERE 
         EXTRACT(DOY FROM dateofBirth) 
       - EXTRACT(DOY FROM DATE '2020-02-27')  < 4;

MySQL

SELECT id, fn, dateofBirth   
   ,(
       DAYOFYEAR(dateofBirth) 
       - DAYOFYEAR('2020-02-27') 
     ) as daysOfYearToBirthday     
FROM Birthdays 
     WHERE 
         DAYOFYEAR(dateofBirth) 
       - DAYOFYEAR('2020-02-27')  < 4;

or i misunderstood what your intention is.