Replace linux/amd64 by the desired platform (linux/amd64, linux/arm64 etc.).
Sigstore
Sigstore is trying to improve supply
chain security by allowing you to verify the origin of an
artifcat. You can verify that the jar that you use was actually
produced by this repository. This means that if you verify the
signature of the ristretto jar, you can trust the integrity of the
whole supply chain from code source, to CI/CD build, to distribution
on Maven Central or whever you got the jar from.
You can use the following command to verify the latest image using its
sigstore signature attestation:
Verification for index.docker.io/leplusorg/xml:main --
The following checks were performed on each of these signatures:
- The cosign claims were validated
- Existence of the claims in the transparency log was verified offline
- The code-signing certificate was verified using trusted certificate authority certificates
[{"critical":...
For instructions on how to install cosign, please read this documentation.
Request new tool
Please use this link (GitHub account required) to request that a new tool be added to the image. I am always interested in adding new capabilities to these images.
Family Friendly is a community based application where families can get together and have fun. This project promotes togetherness, fun and community through activities.
It is difficult sometimes as new or experience parents to find the motivation to go out and do something with the hectic parenting life. You would have to organize something or think about going somewhere on top of preparing what you need to bring with you for your little one and for yourself. So you would consider doing nothing, stay put and deal with the craziness happening at home. A lot of different factors could amplify the sentiment.
This can lead to inactivity, confinement and mental distress which only feed the vicious cycle.
In order to help parents and/or caretaker, I propose Family Friendly.
This platform will propose features including a list of events coming up, the possibility to create and join event and access to support that provide useful contacts and information. As well a forum that allow users to share tips and help each other in a format of Question and Answer.
This project is offering an application with a welcoming and fun environment to enable and empower users to go out, join activities and events. Encourage users to meet with the community, have fun and share good memories. It promotes healthy lifestyle and mental health.
Developer and Business Goals
Develop an interactive website with a server connection using HTML, CSS, JavaScript and Python.
Provide a user-friendly application.
Contribute to the community.
Help parents.
Promote Wellness and health through activities.
Help personal and family growth.
User Goals
Easy to use application.
Getting clear information.
Quick access to Events.
Practical way to participate and be part of the community.
Considering the targeted audience, the sans serif type of font is the more appropriate because it is most often associated with simplicity and straightforwardness.
I will be using:
Pacifico for the name of the website (Family Friendly) only. It is a handwriting type of font which is very friendly and welcoming with its roundness and has something fun to it that relates to the website.
Lato and Nunito are used for the rest of the website. They both are sans serif fonts, and they work very well together. They are comforting, simple and easy to ready.
Sans serif will be use as a fall back if the fonts do not load. It is common as the main typographies are sans serif type.
Icons
Some Font Awesome icons will be part of the website for better UX.
The logo and favicon are the same image and use the color scheme of the website.
Colors
The colours chosen for the website are simple and joyful. They are based on the psychology behind colours (colour affects, London Image Institute). I used Adobe Color to create the colour scheme.
Yellow #E9F900 for Friendliness and Warmth.
Blue #0845FF for Confidence, Sincerity and Integrity.
Red #FF091E for cancelling and deleting functionality.
Orange #FF8401 for Creativity and Innovation.
Green #24C212 for Life, Growth and Nature.
The background will be off White #FAFAFA for simplicity and cleanliness.
Footer will be Grey #999999 for a nice contrast.
Adobe Color was used to build the color compatibility and accessibility. The color scheme and swatches are said color-blind safe.
Images
The images will be the one uploaded by users for their profile.
Those images are stored using base64 to encode the image and store it as a string in the user collection.
Styling/Feeling
The feel of the website is welcoming and simple to provide a quick access and learning process.
It makes users comfortable and make them want to try!
Audio/Video
No audio or video will be integrated at the moment.
Thinking on how usable and intuitive the carousel is to scroll thought Events, considering that it could be a lot of them, I have decided to implement collapsible to display all the events across the website.
After considering deadline and features priority, I decided to leave the support section for future features to implement. I once heard that the project is never finished, we just run out of time!
To build this project, I use Flask framework with the Jinja templating language. For consistency across the website some features will be repeated and functionality will be kept as simple and direct as possible.
Existing and Future Features are published in a separate file, please see FEATURES.md for full details.
All the data schemas have been saved in JSON files in app/static/js/data-schemas
Most of the data is saved as a string and the format of the string is validated by pattern attribute in all the forms.
For the website code production, two collections have been used in MongoDB:
users
events
The users collection is organised following the user data-schema as shown below:
_id
Default field given automatically when creating a document in MongoDB. It is unique and allows to identify each document.
username
Field of string data-type that is used for users to personalized their profile. It must be unique.
This field is validated by checking its value against all username’s field value created in the user collection. As well a pattern attribute is used on the form’s input field.
first_name
Field of string data-type that is used for users to personalized their profile.
This field is validated with a pattern attribute on the form’s input field.
last_name
Field of string data-type that is used for users to personalized their profile.
This field is validated with a pattern attribute on the form’s input field.
email
Field of string data-type that is used for users to personalized their profile. It must be unique.
This field is validated by checking its value against all email’s field value created in the user collection. As well a pattern attribute is used on the form’s input field.
password
Field of string data-type that is used for security.
Before to be stored the password is hashed and salted using werkzeug security module of Flask. It is asked to enter the password twice and a validator is used to check if the passwords correspond to the regex pattern and that they are the same.
When the password is used/asked on the website, it is validated by checking the password in the input field against the password saved in the database using werkzeug security tools.
profile_picture
Field of string data-type that is used for profile personalization.
To store the image, I have used base64 to encode the image and store it as a string. The image is first downloaded, then encoded and stored and then delete so only the string saved in the database remains.
events_created
Field of array data-type that is used in order to know which events have been created by the user in order to tailor action available on this event. This can be used in a later version of the website to send specific notifications and have information on how active is the user on the website.
events_joined
Field of array data-type that is used in order to know which events have been joined by the user in order to tailor action available on this event. This can be used in a later version of the website to send specific notifications and have information on how active is the user on the website.
events_liked
Field of array data-type that is used in order to know which events have been liked by the user in order to tailor action available on this event. This can be used in a later version of the website to send specific notifications and have information on how active is the user on the website. As well it could give information on the preferences off the user.
The events collection is organised following the user data-schema as shown below:
_id
Default field given automatically when creating a document in MongoDB. It is unique and allows to identify each document.
event_category
Field of string data-type that is used for giving information on the category of the event.
It is validated by the select option of the form.
This can provide information on what type of event is preferred by users.
event_location
Field of string data-type that is used for giving information on the place at which the event will take place.
In future version this will be an array of coordinate using google maps in order to render a precise location.
event_age_range
Field of string data-type that is used for giving information on the age range that the event is intended for.
It is validated by a pattern attribute of the form’s input field.
event_date
Field of string data-type that is used for giving information on the date at which the event will take place.
It is validated by the input type of the form.
event_time
Field of string data-type that is used for giving information on the time at which the event will take place.
It is validated by the input type of the form.
event_description
Field of string data-type that is used for event description.
This is used for users to share information about the event they have created.
event_created_by
Field of ObjectId data-type that is used in order to know who created the event in order to tailor action available on this event. This can be used in a later version of the website to send specific notifications and have information on how active is the user on the website.
event_joined_by
Field of array data-type that is used in order to know which users have joined the event in order to display the number of people attending the event. This can be used in a later version of the website to send specific notifications to users and have information on how popular is an event. As well it could give information on the type of event that users prefer.
event_likes
Field of array data-type that is used in order to know which users have liked the event in order to display the number of people that liked the event. This can be used in a later version of the website to send specific notifications to users and have information on how popular is an event. As well it could give information on the type of event that users prefer.
The data pattern is controlled by the corresponding class. This allows to have quick access to the information the documents will hold and to be able to change the data type and data structure in an efficient and effective manner.
Almost all functions/methods concerning the collection are coded in the corresponding class in order to be able to add or change those with ease and to separate the concerns.
Code Organisation
The project uses Flask and I have implemented Application Factory and Blueprint allowing separation of concern and clearer code.
The code structure includes app.py file that initialise the App and a folder called app that host all the development code as well as the implementation of Blueprint in __init__.py and the App configuration in config.py.
The use of Flask framework implies the creation of a static and templates folder. The static folder host the *.js, *.css, *.json files and all images.
I have Created:
A classes folder that will host the python files related to the classes used for the project.
A validators folder that host the validation functions for the project.
A flashes folder that host all the flash messages.
Technologies Used
Programming Languages
This project uses HTML, CSS, JavaScript and Python and Jinja templating language.
Frameworks, Libraries and Programs
Flask
Flask is the micro framework on witch the project is build.
Testing information are published in a separate file for better readability.
Please see TESTING.md.
Deployment
Deployment information are published in a separate file for better readability.
Please see DEPLOYMENT.md.
Bugs
❌ Issue:
I got the following message error: runtimeerror-working-outside-of-request-context.
:heavy_check_mark: Solve:
I saved request.form.get in a var named form_field in order to help me with coding and repetition, but a request in Flask is an instance of the Request object and handle one request at the time and therefore cannot be stored in a var.
❌ Issue:
When updating the profile info, the rendering of the info on the profile page don’t update and after login out, It was not possible to log back in. I was getting the flash message incorrect_details, but details were right.
:heavy_check_mark: Solve:
The problem was because I used the User class to update the info, It hashed the password again, which I believe created a double hashed password and when checking the password validation It could not find a match.
I changed the approach and did not convert the new info into an instance of User, but use a static method of the class taking as parameter the dictionary of the new info.
❌ Issue:
When Updating the profile info, the updated profile info don’t render on the profile template when updating the username. This must be because I rely on the username when rendering the profile page.
:heavy_check_mark: Solve:
Update the session cookie (session["user"]) after updating the database and before rendering the profile template with the new sesion["user"]:
# Update the session['user]session["user"] =new_info["username"]
❌ Issue:
On iPhone when trying to see an event by clicking on the SEE button, nothing happens.
✔️ Solve:
I have added touchend event with the click event in events.js.
❌ Issue:
When signing up from my iPhone, I can create a profile and log in with the credential but the document does not appear in MongoDB. It shows that there are one too many document in the users collection. So the document was accessible from the website, existing in the database but not accessible and visible in the database.
✔️ Solve:
No able to recreate the bug, but I believe it was because the page was kept open while the user was deleted from the database.
Family Friendly is a community based application where families can get together and have fun. This project promotes togetherness, fun and community through activities.
It is difficult sometimes as new or experience parents to find the motivation to go out and do something with the hectic parenting life. You would have to organize something or think about going somewhere on top of preparing what you need to bring with you for your little one and for yourself. So you would consider doing nothing, stay put and deal with the craziness happening at home. A lot of different factors could amplify the sentiment.
This can lead to inactivity, confinement and mental distress which only feed the vicious cycle.
In order to help parents and/or caretaker, I propose Family Friendly.
This platform will propose features including a list of events coming up, the possibility to create and join event and access to support that provide useful contacts and information. As well a forum that allow users to share tips and help each other in a format of Question and Answer.
This project is offering an application with a welcoming and fun environment to enable and empower users to go out, join activities and events. Encourage users to meet with the community, have fun and share good memories. It promotes healthy lifestyle and mental health.
Developer and Business Goals
Develop an interactive website with a server connection using HTML, CSS, JavaScript and Python.
Provide a user-friendly application.
Contribute to the community.
Help parents.
Promote Wellness and health through activities.
Help personal and family growth.
User Goals
Easy to use application.
Getting clear information.
Quick access to Events.
Practical way to participate and be part of the community.
Considering the targeted audience, the sans serif type of font is the more appropriate because it is most often associated with simplicity and straightforwardness.
I will be using:
Pacifico for the name of the website (Family Friendly) only. It is a handwriting type of font which is very friendly and welcoming with its roundness and has something fun to it that relates to the website.
Lato and Nunito are used for the rest of the website. They both are sans serif fonts, and they work very well together. They are comforting, simple and easy to ready.
Sans serif will be use as a fall back if the fonts do not load. It is common as the main typographies are sans serif type.
Icons
Some Font Awesome icons will be part of the website for better UX.
The logo and favicon are the same image and use the color scheme of the website.
Colors
The colours chosen for the website are simple and joyful. They are based on the psychology behind colours (colour affects, London Image Institute). I used Adobe Color to create the colour scheme.
Yellow #E9F900 for Friendliness and Warmth.
Blue #0845FF for Confidence, Sincerity and Integrity.
Red #FF091E for cancelling and deleting functionality.
Orange #FF8401 for Creativity and Innovation.
Green #24C212 for Life, Growth and Nature.
The background will be off White #FAFAFA for simplicity and cleanliness.
Footer will be Grey #999999 for a nice contrast.
Adobe Color was used to build the color compatibility and accessibility. The color scheme and swatches are said color-blind safe.
Images
The images will be the one uploaded by users for their profile.
Those images are stored using base64 to encode the image and store it as a string in the user collection.
Styling/Feeling
The feel of the website is welcoming and simple to provide a quick access and learning process.
It makes users comfortable and make them want to try!
Audio/Video
No audio or video will be integrated at the moment.
Thinking on how usable and intuitive the carousel is to scroll thought Events, considering that it could be a lot of them, I have decided to implement collapsible to display all the events across the website.
After considering deadline and features priority, I decided to leave the support section for future features to implement. I once heard that the project is never finished, we just run out of time!
To build this project, I use Flask framework with the Jinja templating language. For consistency across the website some features will be repeated and functionality will be kept as simple and direct as possible.
Existing and Future Features are published in a separate file, please see FEATURES.md for full details.
All the data schemas have been saved in JSON files in app/static/js/data-schemas
Most of the data is saved as a string and the format of the string is validated by pattern attribute in all the forms.
For the website code production, two collections have been used in MongoDB:
users
events
The users collection is organised following the user data-schema as shown below:
_id
Default field given automatically when creating a document in MongoDB. It is unique and allows to identify each document.
username
Field of string data-type that is used for users to personalized their profile. It must be unique.
This field is validated by checking its value against all username’s field value created in the user collection. As well a pattern attribute is used on the form’s input field.
first_name
Field of string data-type that is used for users to personalized their profile.
This field is validated with a pattern attribute on the form’s input field.
last_name
Field of string data-type that is used for users to personalized their profile.
This field is validated with a pattern attribute on the form’s input field.
email
Field of string data-type that is used for users to personalized their profile. It must be unique.
This field is validated by checking its value against all email’s field value created in the user collection. As well a pattern attribute is used on the form’s input field.
password
Field of string data-type that is used for security.
Before to be stored the password is hashed and salted using werkzeug security module of Flask. It is asked to enter the password twice and a validator is used to check if the passwords correspond to the regex pattern and that they are the same.
When the password is used/asked on the website, it is validated by checking the password in the input field against the password saved in the database using werkzeug security tools.
profile_picture
Field of string data-type that is used for profile personalization.
To store the image, I have used base64 to encode the image and store it as a string. The image is first downloaded, then encoded and stored and then delete so only the string saved in the database remains.
events_created
Field of array data-type that is used in order to know which events have been created by the user in order to tailor action available on this event. This can be used in a later version of the website to send specific notifications and have information on how active is the user on the website.
events_joined
Field of array data-type that is used in order to know which events have been joined by the user in order to tailor action available on this event. This can be used in a later version of the website to send specific notifications and have information on how active is the user on the website.
events_liked
Field of array data-type that is used in order to know which events have been liked by the user in order to tailor action available on this event. This can be used in a later version of the website to send specific notifications and have information on how active is the user on the website. As well it could give information on the preferences off the user.
The events collection is organised following the user data-schema as shown below:
_id
Default field given automatically when creating a document in MongoDB. It is unique and allows to identify each document.
event_category
Field of string data-type that is used for giving information on the category of the event.
It is validated by the select option of the form.
This can provide information on what type of event is preferred by users.
event_location
Field of string data-type that is used for giving information on the place at which the event will take place.
In future version this will be an array of coordinate using google maps in order to render a precise location.
event_age_range
Field of string data-type that is used for giving information on the age range that the event is intended for.
It is validated by a pattern attribute of the form’s input field.
event_date
Field of string data-type that is used for giving information on the date at which the event will take place.
It is validated by the input type of the form.
event_time
Field of string data-type that is used for giving information on the time at which the event will take place.
It is validated by the input type of the form.
event_description
Field of string data-type that is used for event description.
This is used for users to share information about the event they have created.
event_created_by
Field of ObjectId data-type that is used in order to know who created the event in order to tailor action available on this event. This can be used in a later version of the website to send specific notifications and have information on how active is the user on the website.
event_joined_by
Field of array data-type that is used in order to know which users have joined the event in order to display the number of people attending the event. This can be used in a later version of the website to send specific notifications to users and have information on how popular is an event. As well it could give information on the type of event that users prefer.
event_likes
Field of array data-type that is used in order to know which users have liked the event in order to display the number of people that liked the event. This can be used in a later version of the website to send specific notifications to users and have information on how popular is an event. As well it could give information on the type of event that users prefer.
The data pattern is controlled by the corresponding class. This allows to have quick access to the information the documents will hold and to be able to change the data type and data structure in an efficient and effective manner.
Almost all functions/methods concerning the collection are coded in the corresponding class in order to be able to add or change those with ease and to separate the concerns.
Code Organisation
The project uses Flask and I have implemented Application Factory and Blueprint allowing separation of concern and clearer code.
The code structure includes app.py file that initialise the App and a folder called app that host all the development code as well as the implementation of Blueprint in __init__.py and the App configuration in config.py.
The use of Flask framework implies the creation of a static and templates folder. The static folder host the *.js, *.css, *.json files and all images.
I have Created:
A classes folder that will host the python files related to the classes used for the project.
A validators folder that host the validation functions for the project.
A flashes folder that host all the flash messages.
Technologies Used
Programming Languages
This project uses HTML, CSS, JavaScript and Python and Jinja templating language.
Frameworks, Libraries and Programs
Flask
Flask is the micro framework on witch the project is build.
Testing information are published in a separate file for better readability.
Please see TESTING.md.
Deployment
Deployment information are published in a separate file for better readability.
Please see DEPLOYMENT.md.
Bugs
❌ Issue:
I got the following message error: runtimeerror-working-outside-of-request-context.
:heavy_check_mark: Solve:
I saved request.form.get in a var named form_field in order to help me with coding and repetition, but a request in Flask is an instance of the Request object and handle one request at the time and therefore cannot be stored in a var.
❌ Issue:
When updating the profile info, the rendering of the info on the profile page don’t update and after login out, It was not possible to log back in. I was getting the flash message incorrect_details, but details were right.
:heavy_check_mark: Solve:
The problem was because I used the User class to update the info, It hashed the password again, which I believe created a double hashed password and when checking the password validation It could not find a match.
I changed the approach and did not convert the new info into an instance of User, but use a static method of the class taking as parameter the dictionary of the new info.
❌ Issue:
When Updating the profile info, the updated profile info don’t render on the profile template when updating the username. This must be because I rely on the username when rendering the profile page.
:heavy_check_mark: Solve:
Update the session cookie (session["user"]) after updating the database and before rendering the profile template with the new sesion["user"]:
# Update the session['user]session["user"] =new_info["username"]
❌ Issue:
On iPhone when trying to see an event by clicking on the SEE button, nothing happens.
✔️ Solve:
I have added touchend event with the click event in events.js.
❌ Issue:
When signing up from my iPhone, I can create a profile and log in with the credential but the document does not appear in MongoDB. It shows that there are one too many document in the users collection. So the document was accessible from the website, existing in the database but not accessible and visible in the database.
✔️ Solve:
No able to recreate the bug, but I believe it was because the page was kept open while the user was deleted from the database.
Early diagnosis and treatment of diabetes are essential to avoid complications such as blindness, kidney failure, heart attacks, stroke and lower limb amputation. In this work, we compared and critically evaluated the use of Multilayer Perceptron (MLP) and Support Vector Machine (SVM) to aid the diagnosis of diabetes using the Pima Indian Diabetes database. The PyTorch and Scikit-learn packages in Python were used to build the models.
Both MLP and SVM yielded similar test AUCs and accuracies. MLP’s higher specificity (true negative rate) of 89% compared to SVM (78%) (Figures 1-3) makes MLP more suitable for practical use, as it is more capable of identifying the dominating class of non-diabetes patients.
Figure 1. The bottom right of the normalised confusion matrix of the optimised Support Vector Machine (SVM) indicated it has a specificity of 78%.
Figure 2. The normalised confusion matrix of the optimised Multilayer Perceptron (MLP) indicated it has a higher specificity (89%) than Support Vector Machine (SVM).
Figure 3. The Receiver Operation Curve (ROC) revealed Support Vector Machine (SVM) algorithm displayed a slightly higher sensitivity than Multilayer Perceptron (MLP) algorithm. The optimal false positive rate and true positive rate for SVM (28.0%, 77.8%) and MLP (35.0%, 88.9%) are indicated with a green dot and a blue dot respectively.
Diabetes-Modelling-Final.ipynb contains the Python codes used to construct, evaluate and compare optimised Multilayer Perceptron and Support Vector Machine models.
Le but est de creer un labyrinthe en utilisant des éléments vus en cours de terminale comme les piles, File, Graphe etc…
Une fois crée le but est de trouver le chemin le plus court pour sortir du labyrinthe.
Tout ça affichait dans une fenêtre Tkinter.
Roadmap
Creer le Labyrinthe
Tkinter :
Afficher une page vierge.
Faire un cadre où se trouve le labyrinthe.
Afficher les murs.
Afficher l’entrée/sortie.
Afficher le plus court chemin
Afficher la distance du plus court chemin
Afficher les autres chemins possibles avec leurs distances [Bonus].
Faire qu’on puisse générer avec un bouton [Bonus]
Faire qu’on puisse le résoudre depuis l’app avec des boutons [Bonus]
Pouvoir gérer la grandeur du labyrinthe à générer sans devoir modifier le code [Bonus]
Mur & Chemins:
Créer des murs sur toutes les cases du tableau de 25×25.
Définir une entrée et une sortie.
Casser certains murs de façons aléatoires.
Faire qu’il n’y est pas de chemins inutiles
Faire qu’il n’y est pas de murs inutiles
Toujours un chemin entre l’entrée et la sortie
Faire plusieurs sorties possibles [Bonus].
Avoir le temps de création du labyrinthe [Bonus].
Seed:
Créer des labyrinthe suivant une seed
Afficher la seed
Recherche du plus court chemin dans le graphe :
Dire le plus court chemin avec les noms ou valeurs des points traversé.
Afficher le plus court chemin
Avoir en combien de temps la sortie a était trouvé [Bonus].
Informations
Création du labyrinthe
Les murs peuvent être définis de la manière suivante :
Par des listes lab=[0,1,1,0,0,1,1,0,1,1,1,1,0,0,1,1,1,1,0,0,0,1,1,0,1],[etc...] .
où les “1” correspondent à un mur (représenté par du rouge),”0″ à un chemin,”2″ l’entrée et “3” la sortie.
Résolution du labyrinthe
Le labyrinthe va être résolu à l’aide d’une recherche du plus court chemin, en numérotant à partir du points de départ la distance entre chaque case représentant un chemin, depuis la case de départ. . Puis partir du point d’arrivée et suivre les nombres inférieurs à la distance où on se trouve jusqu’à arriver à 0 et l’afficher. .
(en vert un chemin choisi arbitrairement pour représenter le plus court chemin et en jaune les autres parties de chemins possibles)
There is a shell front end that calls a binary back end. The front end is merely
there to call cd after calling the back end, which does all the logic.
Requirements
Works at least with Bash, on Linux (Debian and Ubuntu) and Mac.
The code uses C++, version C++11, and Bash. It was tested to work on Linux and
Mac. The C++ Boost libraries Filesystem and System are
used (sudo apt-get install libboost-all-dev can be used to install the Boost
libraries on Debian).
The compilation of executables was done using the GCC, and make.
Installation
Make it so the files from the front end are sourced. These file call the
executables cdb-back and cdb-bc. Compile the back end executables and either
make links to them in a location in the PATH or move them there and name them
appropriately.
You can also run the file install.sh.
Mac OS Caveat
On Mac OS, since El Capitan, terminal sessions are saved by default (this is
like logging every command and result). This results in the following text
appearing in some calls to a subshell (things like $(...)):
Saving session...
...saving history...truncating history files...
...completed.
To avoid this (annoyance), you can create the file ~/.bash_sessions_disable.
More information here, here, and here.
Key Points
It seems likely that Note is a program written in Kotlin, using Jetpack Compose for the user interface, Hilt for dependency injection, following the MVVM architecture, and Room for data storage.
The evidence leans toward the program also utilizing Jet Pack libraries, though this may overlap with the mentioned technologies.
Program Description
Overview
Note appears to be an Android application developed with a modern tech stack, focusing on ease of use and maintainability. The use of Kotlin as the programming language suggests a robust and concise codebase, while Jetpack Compose provides a modern, declarative way to build the user interface.
Technologies Used
Kotlin: The primary programming language, known for its conciseness and interoperability with Java.
Jetpack Compose: A toolkit for building native Android UI, part of the Jet Pack suite, offering a reactive and declarative approach.
Hilt: A dependency injection library that simplifies managing dependencies in Android apps, enhancing modularity.
MVVM (Model-View-ViewModel): An architectural pattern that separates the app’s logic into manageable layers, improving scalability and testability.
Room: A SQLite object-mapping library for local data storage, ensuring efficient data persistence.
Unexpected Detail
While the user mentioned “Jet Pack” separately, it seems likely that this refers to the broader Jet Pack suite, which includes Jetpack Compose and Room, suggesting some redundancy in the listing but highlighting a comprehensive use of Android development tools.
Survey Note: Detailed Analysis of Note Program Technologies
This section provides an in-depth exploration of the technologies used in the Note program, as described by the user, and aims to clarify the stack based on common Android development practices. The analysis is grounded in the user’s statement and supplemented by understanding typical usage in similar projects.
Background and Context
The user indicated that Note is a program written with “Kotlin, Jet Pack, Compose, Hilt, MVVM, and Room.” This suggests an Android application leveraging modern development tools, likely targeting mobile devices. The mention of multiple technologies, some of which overlap (e.g., Jet Pack and Compose), requires careful interpretation to avoid redundancy and ensure accuracy.
Detailed Technology Breakdown
To dissect the technologies, let’s examine each component based on the user’s description and common Android development practices:
Kotlin:
Kotlin is a statically typed programming language developed by JetBrains, widely adopted for Android development due to its conciseness, null safety, and interoperability with Java. It is the foundation of the Note program, indicating a modern, efficient codebase. Research suggests Kotlin’s adoption has grown significantly, with Google endorsing it as a preferred language for Android (Android Developers Kotlin).
Jet Pack and Compose:
The user mentioned “Jet Pack” and “Compose” separately, which initially suggests redundancy. Jet Pack is a suite of libraries, tools, and guidance from Google to build high-quality Android apps, including components like Navigation, Lifecycle, Room, and Paging. Jetpack Compose, however, is a specific part of Jet Pack, a modern toolkit for building native Android UI declaratively. Given this, it seems likely that “Jet Pack” refers to the broader suite, and “Compose” highlights the specific use of Jetpack Compose for the UI. This interpretation aligns with projects like Hilt-MVVM-Compose-Movie, which list “Jetpack Compose” as a key technology.
Hilt:
Hilt is a dependency injection library for Android, built on Dagger, designed to simplify managing dependencies in apps. It integrates well with Jet Pack components, enhancing modularity and testability. The user’s mention of Hilt suggests Note uses this for managing dependencies, a common practice in modern Android apps, as seen in Getting Started With Room Database in Kotlin + Jetpack Compose.
MVVM (Model-View-ViewModel):
MVVM is an architectural pattern that separates the application logic into three interconnected components: Model (data and business logic), View (UI), and ViewModel (mediates between Model and View). The user’s inclusion of MVVM indicates Note follows this pattern, which is recommended by Google for Android development, improving scalability and testability. This is evident in projects like Building an Android App with Jetpack Compose, Retrofit, and MVVM Architecture.
Room:
Room is a persistence library provided by Android, part of Jet Pack, that simplifies working with SQLite databases. It offers an abstraction layer over SQLite, making it easier to manage local data storage. The user’s mention of Room suggests Note uses it for data persistence, a standard choice for Android apps needing local storage, as seen in Android | Kotlin | API | MVVM | Retrofit | Dagger | Hilt | Coroutines | Jetpack Compose | Room.
Interpretation and Clarification
The listing of “Jet Pack” and “Compose” separately raises a potential overlap, as Compose is part of Jet Pack. It seems likely that the user intended to highlight the use of Jetpack Compose specifically for the UI, while “Jet Pack” might refer to other libraries within the suite (e.g., Navigation, Lifecycle). However, to avoid redundancy, it’s reasonable to interpret this as Note using Jetpack Compose as the UI framework, with other Jet Pack components implicitly included.
The technologies Hilt, MVVM, and Room are clearly defined: Hilt for dependency injection, MVVM for architecture, and Room for data storage. This stack aligns with modern Android development best practices, emphasizing clean architecture and maintainability.
Table: Technology Roles in Note Program
Technology Role Notes
Kotlin Programming Language Foundation for the codebase, concise and safe.
Jetpack Compose UI Framework Declarative UI building, part of Jet Pack.
Hilt Dependency Injection Manages dependencies, enhances modularity.
MVVM Architectural Pattern Separates logic for scalability and testing.
Room Data Persistence Local SQLite database management.
Unexpected Detail: Potential Redundancy
An interesting observation is the potential redundancy in mentioning “Jet Pack” and “Compose” separately. While Compose is a subset of Jet Pack, the user’s explicit mention suggests a focus on highlighting the UI framework, which is not surprising given its popularity in recent Android projects. This detail underscores the importance of clear documentation to avoid confusion in tech stacks.
Conclusion
Based on the user’s description, Note is likely a well-structured Android application written in Kotlin, utilizing Jetpack Compose for the user interface, Hilt for dependency injection, following the MVVM architecture, and Room for data storage. The mention of “Jet Pack” may refer to the broader suite, with Compose specifically emphasized, reflecting a comprehensive use of modern Android development tools.
public class School : IEntity
{
public int Id { get; set; }
public string SchoolId { get; set; }
public string Name { get; set; }
}
创建仓储接口和实现类,分别继承IRepository和EfCoreRepository
public class SchoolRepository: EfCoreRepository<School>,ISchoolRepository
{
public SchoolRepository(DbContext context) : base(context)
{
}
}
public interface ISchoolRepository : IRepository<School>
{
}
注入服务
private readonly IUnitOfWork _unitOfWork;
private readonly ISchoolRepository _schoolRepository;
/// <summary>
///
/// </summary>
public MsEfDbRepositoryTest()
{
var services = new ServiceCollection();
services.AddSopData<EfDbBaseDbContext>(opt =>
{
opt.UseMySql("server =127.0.0.1;database=soptestdb;uid=root;password=123456;");
});
var sp = services.BuildServiceProvider();
_unitOfWork = sp.GetRequiredService<IUnitOfWork>();
_schoolRepository = sp.GetRequiredService<ISchoolRepository>();
}
在Controller中使用
public class ValuesController : ControllerBase
{
private readonly ISchoolRepository _schoolRepository;
private readonly IUnitOfWork _unitOfWork;
public ValuesController(ISchoolRepository schoolRepository, IUnitOfWork unitOfWork)
{
_schoolRepository = schoolRepository;
_unitOfWork = unitOfWork;
}
}
Copyright (c) 2022 chen_null
file-station is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.