« first day (3857 days earlier)      last day (1074 days later) » 

12:30 AM
Thank you, but one of the problems with using trello.com, miro.com, clickup.com is that the financial firm who employs me would have problems with uploading data into some free online website. Therefore, I'm looking for a a Free Kanban board template for Excel or Powerpoint that I can download online off the internet.
 
 
3 hours later…
3:34 AM
I am having such a hard time keeping my net question score positive.
 
 
2 hours later…
mr5
5:54 AM
@crazyTech GitHub is free and has Kanban board.
 
hey guys, does anyone know how to change the database state dynamically?
 
mr5
state like open and close?
 
no
0
Q: How to use select tag to change database state dynamically in ASP.NET MVC Core?

d4rk4ng31I have a table in my database called dbo.Assets. One of the columns in the table is an integer type column called state that corresponds to the enum: public enum AssetState { [Display(Name = "Non-functional")] non_functional, [Display(Name = "Under-Maintenance")] under_maintenance...

@mr5 Any ideas?
 
mr5
that is not changing the state of the database
 
then what is that called?
Editing a table?
 
mr5
5:59 AM
it's changing the value of a column
database > table > row > column
that is the hierarchy
 
yep. changed the title
is that fine now?
 
mr5
you need to use the UPDATE query
this should get you started: w3schools.com/sql/sql_update.asp
are you using EF?
 
yes
but, how do I run an SQL query using JS?
So I use AJAX here?
 
mr5
then from controller or service, you need to access the Database's context to access the table.
then do the querying
you don't execute SQL from client side, that is dang gerous
Web API exist for that reason.
 
But, how do I call the controller? select tag does not have asp-controller
 
mr5
6:04 AM
you make a service out of it
 
I do have one, which provides a DbContext
public class DbService
{
	private readonly DatabaseContext databaseContext;

	public DbService(Data.DatabaseContext databaseContext)
	{
		this.databaseContext = databaseContext;
	}

	public IList<Models.Alert> Alerts => databaseContext.Alerts.ToList();
	public IList<Models.Asset> Assets => databaseContext.Assets.ToList();
	public IList<Models.Location> Locations => databaseContext.Locations.ToList();
}
 
mr5
ITableNameHereService
{
     Task<ReturnType> Create();
     Task<ReturnType> Update();
     Task<ReturnType> Read();
     Task<ReturnType> Delete();
}
err
that is not a good structure.
look up DAO
 
By service you mean one which you can 'inject' into the view, correct?
 
mr5
the EF tools generator can already do all the things I said
yeah or the viewmodel
 
So, I currently am injecting that into my View
@model AdminPortal.Web.Models.MapView
@inject Services.DbService dbService

@{

	IList<SelectListItem> selectListItems = new List<SelectListItem>();
	foreach (var location in dbService.Locations)
	{
		selectListItems.Add(new SelectListItem
		{
			Value = location.Id.ToString(),
			Text = location.LocationName + " (" + location.City + ")",
		});
	}

}

<div class="d-flex flex-column">
	<table class="table">
		<thead>
			<tr>
				<th>Functional</th>
				<th>Under Maintenance</th>
				<th>Non Functional</th>
 
mr5
6:08 AM
start from here:
1 min ago, by mr5
look up DAO
 
ok
 
mr5
so you'll get a better picture on how to do it properly
 
mhmm
 
mr5
data access object
 
0
Q: asp.net mvc dao

HL8I'm looking for a book or an online tutorial on asp.net using C# that teaches how to setup MVC and DAO. In Visual Studio, I first create an "ASP.NET Web Application", then I add the Controller, Model and DAO Class Libraries. I then want to understand the concept of Entity Base Creator Class. H...

 
mr5
6:11 AM
database {
    tableA_reference
    tableB_reference
    ...
}
 
Nope, the link's broken :( Gotta look somewhere else.
 
mr5
ItableA_service {
    crud()
}
 
@mr5 Is that the structure of a typical DAO?
 
mr5
ItableA_service would have a reference to the database.
yes
ah no
that is not the dao
 
then?
 
mr5
6:12 AM
the dao is the service
 
ItableA_service?
 
mr5
6 mins ago, by mr5
ITableNameHereService
{
     Task<ReturnType> Create();
     Task<ReturnType> Update();
     Task<ReturnType> Read();
     Task<ReturnType> Delete();
}
also this
 
8 mins ago, by d4rk4ng31
public class DbService
{
	private readonly DatabaseContext databaseContext;

	public DbService(Data.DatabaseContext databaseContext)
	{
		this.databaseContext = databaseContext;
	}

	public IList<Models.Alert> Alerts => databaseContext.Alerts.ToList();
	public IList<Models.Asset> Assets => databaseContext.Assets.ToList();
	public IList<Models.Location> Locations => databaseContext.Locations.ToList();
}
So, this is completely wrong?
 
mr5
not wrong but bound to be a chaos in the making
 
Because, it still does reference the tables
 
mr5
6:15 AM
yeah but you have databaseContext.Alerts.ToList()
if some event from your app calls that property and you have a million records, that would be chaotic
 
You mean, conversion to list would be chaotic?
 
mr5
storing million of data in memory is chaotic
that is why database is invented NOT to exactly do that.
 
oh! So you mean, I don't need to by default store all of it?
 
mr5
wut
 
Like, instead of converting all records to list, I only fetch the ones which are required and then convert those to list?
 
mr5
6:19 AM
yes
but that is filtering
which will be covered by DAO implementation
 
So, I remove that class entirely?
 
mr5
depends to you
 
wdym?
I mean, I have to create a DAO instead of that chaos, no?
 
mr5
the decision is up to you
you want to be a "legacy" programmer, do that chaotic thing :D
 
oh!
okay, DAO it is
So, I convert that to DAO, and then what?
wait
lemme first convert to DAO
wait a minute
By DAO, you mean building that interface thing?
 
mr5
6:26 AM
yeah
 
Aw man! People told me that was unnecessary duplication. EF was made to avoid exactly that!
Okay, wait. We've an answer
 
mr5
oh
then that's prolly more right
I saw the implementation where they use th .AsNoTracking() thing but I am inexperienced still with EF
 
7:24 AM
@mr5, done
I have posted an answer too :)
 
 
7 hours later…
2:10 PM
Ryan Donovan on May 08, 2021
In our last session, we will learn how to create audio visualizations with the p5.sound.js library. We will start by learning how to upload and play a sound file in the p5.js web editor. We will first talk about what amplitude is and how we can program a p5.js sketch to react to the amplitude…
 
2:41 PM
@Squirrelkiller not anytime soon
 
 
2 hours later…
4:50 PM
@d4rk4ng31 doing a ToList() enumerates the result right away. Call ToList() on result you're happy with after querying the db. What I'd do is return IQueryable (should be a method called AsQuerayble or sth like that), which doesn't' yet send the SQL command and query that with LINQ in the DB Service like (Getall(), GetById(), GetBySomeOttherProperty())etc
and only query the database when needed. You can also just keep IEnumerable until you have to enumerate the end result and then and only then call ToList()
I'm here to ask a question as well, actually! how do you go about appsettings in Azure Functions apps? local.settings.json is not designed to be published and I end up having to manually input those in a config in the pipeline or the app service, but many of them stay the same despite of the environment and I just need to copy them over
 
if you use AsQueryable(), then you are only making an in-memory queryable of the data you already have
you either start with an IQueryable or you use in-memory
also, my recommendation is to use the api of the repository pattern
make a service dedicated to operate with the database
keep all database actions encapsulated so dont expose queryables and stuff like that
that way, you keep your data access isolated and dont leak implementations to your domain and other services
 
yes, that's what I meant. I think this would work: public IQueryable<Models.Alert> Alerts => databaseContext.Alerts;
 
I would just make a function for the desire that your other code has
if your code needs to find records within a certain timeframe, make a function
public IList<Alert> ListAlertsBetween(DateTime start, DateTime end) {...}
as for your settings, are the app settings just variables for your service?
perhaps environment variables are easier to use
 
hmmm I usually create an interface with those 4 CRUD methods that return IQueryable, then a service on top of it acting as a mediator that makes those queries and maps to viewmodels
using automapper
 
if they are secret values, then you should use the secrets service that Azure... might have
 
5:01 PM
KeyVault :)
 
^ that
iDunno Azure... so... :D
 
you AWS kinda guy?
 
Yo how do I compile and run a java file
 
I'm only asking cause it's changed with Azure Functions (serverless computing backend services) how the settings are dealt with
@Squirrelkiller
probs worth asking on a java chat
 
I got javac running by going 1) cd src 2) javac -d ../bin -classpath ../bin path/tofile.java
 
5:04 PM
I am an AWS kinda guy, yes
@Squirrelkiller you are in the correct chat room /s
 
Oh I thought Wiet is someone who knows this stuff anyway
 

Java

Dedicated to the discussion of the Java programming language a...
I dont know my Java stuff when I am in C# land :D
 
lol right
 
also, I dont know javac...
my hatred for command line tools still exists in javaland
also... CLASS-FRIGGING-PATH?!
do you live in 2001?
 
software dev lecturer makes us use java so...yes
 
5:06 PM
does that software dev lecturer live in 2001?
 
tbf they do use gitlab and intellij
Although I literally two days ago recommended to add the .idea folder to their .gitignore
 
XD
 
5:23 PM
@DuckLing what I use is serverless, so I have a dedicated spot for my variables
do you use anything to manage your projects?
 
you mean source control?
azure devops. building my build/release pipelines there too
you can either replace the variables in one of the pipelines or in the hosted app service. normally they get copied over from a json file if not substituted, but not with Azure Functions. that's the annoyance I'm facing
 
devops would be your CI/CD
 
affirmative
 
what I mean is the project management
the thing that describes what resources you need
and what needs to be deployed
 
I'm not sure o,O
 
5:27 PM
terraform for example
how do you deploy your azure functions?
 
PR to dev, dev triggers build pipeline, new dev build triggers release pipeline
 
but...
 
release pipeline copies files across to app svc
i don't use anything like the tool you provideed
 
what if you need a message queue
how does that get created?
 
by time scheduled jobs
 
5:30 PM
and how do they know what to create?
 
or by other services that run on some sort of trigger and place messages on queues
 
no, I mean... how do you create the queue
 
I don't know how this works in AWS world but in azure
you create queues via libraries. we'll usually have a queue per environment
 
do-something-dev, *-test *-live
 
5:32 PM
resources:
    Resources:
        CommandsHangman:
            Type: 'AWS::SNS::Topic'
            Properties:
                TopicName: 'wietbot-commands-hangman'
I specify that this project needs an SNS topic (which is basically a notification queue)
when I deploy this, a new SNS topic would be created
 
Azure Storage is detached from the application
 
when I redeploy, then it just looks if I changed stuff and updates it accordingly
 
it's a separate entity, they can exist on their own, you only connect your app to a storage account via connection string
 
this resources file is my source of truth for how my environment should look like
so, if you have a project and you want a message queue or notification queue, how do you create it?
 
makes sense, my reference would be a queue names specified in my config file
 
5:34 PM
do you add a line in your devops pipeline to create it?
 
nope
 
do you manually go to the Azure website to create it?
do you create it via cli/scripts?
 
pipelines have nothing to do with storage account
you have a library that you use to add a message on the queue, you specify queue name (take from your config) and it creates that queue if it doesn't exist
backend functions are also triggered based on the queue name you provide as an attribute or a config setting
does that answer your question?
 
> you have a library that you use to add a message on the queue, you specify queue name (take from your config) and it creates that queue if it doesn't exist
can you listen to a queue that doesnt exist yet?
 
in azure, storage account is only connected to the app by a connection string and it consists of blob container storage (files), queues, tables (nosql) and fileshare (volume)
 
5:38 PM
or name any resource that you need to have created
 
you can, yes, it will never get triggered
it won't complain that it can't find it
(maybe it even creates it when starts listening but not sure)
 
or for example, if you need a file server or a database server
do those get created on the fly when you try to access them?
 
queues are the least strict i'd say
and I can see why
the libraries will have CreateIfNotExist() methods for blob containers and shit
 
I see...
what we do with AWS is basically set up the environment for the functions
we could do environment management like creating new file servers and queues etc when they dont exist yet, but that is all at the cost of the runtime
and you want the runtime to be fast
so, you want to apply all those things on deployment
and with queues and file servers, variable stores and secrets as well
I think it would be interesting to see what the serverless framework offers you
it works for Azure and GCP but it is mainly designed for AWS
 
ah nice, i guess it looks like a bit more work but it's also more organized, but I may be in the wrong
 
5:50 PM
I havent worked with it with Azure yet though... so not sure how well it would work
but I do think you would want to have such a project manager for the long run
generally speaking, it is less work, but it is more raw
especially on AWS
 
I kinda took upon me looking at cost management and trying to push more testing and documenting in my place
soooo I'm ddefinitely interested
 
I dont use a web framework for example, I just have a function that has an ApiGatewayRequest as input and has an ApiGatewayResponse as output (basically an HttpRequest and HttpResponse)
 
you mean a backend function triggered on HTTP for UI applications?
that's in a separate assembly and doesn't consume UI resources?
 
well... a backend function triggered on http requests
regardless of where they come from
 
ah yes
 
5:54 PM
but for a ui application, you still need to invoke that http function
 
we use those for the microservices
 
and deal with responsiveness in whatever way the ui application needs
Azure Functions are just a simple way of making a web service, right?
 
but yeah I did think of this recently! the only thing I thought of is that serverless need to spin up sometimes
 
so you always have a http request and response, I guess
 
Azure Functions are console apps that can be triggered in bazillion different ways - including HTTP
can be service bus, can be http, can be queue, can be orchestration.... many more
so yeah you can use them in the way you described
i just wonder about them being serverless and not always available as need to spin up
but they manage workers beautifully - can scale to infinity:)
of course that's configurable so you don't go bankrupt haha but it's also dead cheap
retries/concurrency/batch sizes are all configurable
 
5:58 PM
when I say serverless, I mean serverless.com
not sure if they actually host the functions as serverless functions
 
i tghink this is kinda what azure functions are
they're reaaaaallly powerful
multi language support too
 
heh
meanwhils AWS has the same support + ruby + go + custom-made
 
hang on
does serverless.com have anything to do with AWS? except it offers the integration? or are you talking about two different things here
 
6:25 PM
AWS Lambda has support for jvm, .net, python, node, ruby, go and custom runtimes
serverless.com is just a manager for your project
it offers that it deploys your code
 
doesn't AWR have CI/CD? or sprint boards?
AWS
I'm thinking AWR- Advanced Web Ranking haha
been dealing with their api recently
 
AWS does have CI/CD
at my work, we do use DevOps though
but to be fair, at this point, I see CI/CD as pick your poison
 
6:43 PM
fair enough
 

« first day (3857 days earlier)      last day (1074 days later) »