how hard would it be to learn enough to be able to make a decent looking website without having to use sqaurespace/carbonmade?
By 4k30 sy Go To Posthow hard would it be to learn enough to be able to make a decent looking website without having to use sqaurespace/carbonmade?When you say learn enough, do you mean essentially from scratch? Or do you mean using some templates provided by other hosting sites or just available around the internet?
Also, what kind of functionality does the site need to have? Do users need to be able to register and login? Is there going to be user generated content? Are users going to need to query a database or something (like a sports stat site)?
If you want to experiment with something I made, check the project I linked last page: https://github.com/kibner/mdx-documentation-site
It lets you create a website (that mostly leans towards documentation) by essentially just writing markdown (what Discord uses). My gf has been using it to document the rules and other content of a tabletop Star Wars game we are playing: https://sw-eote-srd.vercel.app
By Kibner Go To PostWhen you say learn enough, do you mean essentially from scratch? Or do you mean using some templates provided by other hosting sites or just available around the internet?thank you. thinking of a simple portfolio site like this. I'm thinking by the time I have a portfolio in 10-15 years, maybe I can learn to make it myself and save some money.
Also, what kind of functionality does the site need to have? Do users need to be able to register and login? Is there going to be user generated content? Are users going to need to query a database or something (like a sports stat site)?
If you want to experiment with something I made, check the project I linked last page: https://github.com/kibner/mdx-documentation-site
It lets you create a website (that mostly leans towards documentation) by essentially just writing markdown (what Discord uses). My gf has been using it to document the rules and other content of a tabletop Star Wars game we are playing: https://sw-eote-srd.vercel.app
With all that said, I still really like this site for teaching the basics that web pages are built on: https://htmldog.com/
By 4k30 sy Go To Postthank you. thinking of a simple portfolio site like this. I'm thinking by the time I have a portfolio in 10-15 years, maybe I can learn to make it myself and save some money.In the grand scheme of things, that is pretty easy. Learning to do it from scratch and be able to understand what you did and what is happening will likely take multiple months. Especially if you want your site to load much faster than that.
If you are really serious about it, I would use a static site generator like https://www.gatsbyjs.com/ because of how it handles loading images. It has a ton of free hosting support, too.
Extremely beginner's java question here:
Learning objects/classes, and doing simple programs like 'creating boxes'. Can anyone tell me would there be a reason the instructor's correct answer in the main is given as :
I could email the guy but I'd like to know if I'm making a fatal error first.
Learning objects/classes, and doing simple programs like 'creating boxes'. Can anyone tell me would there be a reason the instructor's correct answer in the main is given as :
System.out.print("What is the width of the box? ");and not what I was doing:
width = keyboard.nextInt();
myBox.setWidth(width);
System.out.print("Box width: "+'\n');Mine is calling setWidth(), which assigns the int entered to width in the class. These are both the same right (our setWidth() class is the same)?
myBox.setWidth(keyboard.nextInt());
I could email the guy but I'd like to know if I'm making a fatal error first.
By Punished* Go To PostExtremely beginner's java question here:They're effectively the same, but typically splitting something out makes it more readable. Their solution also allows reuse of that number if need be, but that doesn't seem particularly important.
Learning objects/classes, and doing simple programs like 'creating boxes'. Can anyone tell me would there be a reason the instructor's correct answer in the main is given as :
and not what I was doing:
Mine is calling setWidth(), which assigns the int entered to width in the class. These are both the same right (our setWidth() class is the same)?
I could email the guy but I'd like to know if I'm making a fatal error first.
Yeah, breaking stuff out like the instructor did makes things a bit more readable, easier to reuse parts of that code, and also slightly easier to debug. It is usually a good idea to write like that when possible, imo. There are times when it would not be a good idea, but you will learn those as you get experience and making things more readable, more reusable, and more easily debuggable is always a good default.
Guys, wondering can anyone provide some advice here. I've just learnt some very basic Java arrays stuff and I want to make a missing letter game, for a young child to practice spellings. How would I make a loop to iterate through a word and add a dash in place of each letter, one by one?
The idea is call a word from array. "_unished", ask the kid to write the entire word with the missing letter, test for equality against the original, then move onto the next letter: "P_nished".
I'm using toCharArray to turn my string array elements to chars, and I can manually change the character by calling its index position, but I would want it looped because the length of the words will differ.
I haven't looked at what String builder is yet either, if that would help me
The idea is call a word from array. "_unished", ask the kid to write the entire word with the missing letter, test for equality against the original, then move onto the next letter: "P_nished".
I'm using toCharArray to turn my string array elements to chars, and I can manually change the character by calling its index position, but I would want it looped because the length of the words will differ.
I haven't looked at what String builder is yet either, if that would help me
I am not in the mind-space to think about the problem properly, but there should be a ".length" or ".count" or similar property to get the length of an array. Then you just use a for loop using that count as the limit and the current iteration to use as the index of the string so that you can loop through each character of the string, no matter the length. Something like:
I don't know Java anymore, so the syntax is wrong, but hopefully you get the idea.
string puzzleWord = "punished";
for(int i = 0; i < puzzleWord.length; i++){
char letter = puzzleWord[i];
// do stuff
}
I don't know Java anymore, so the syntax is wrong, but hopefully you get the idea.
If Java StringBuilder is like the .Net version, it is used for better performance when concatenating a string once you get to the fourth concatenation or so. Until that point, the normal way of concatenating strings is faster. i.e.:
string someString = "abc" + "def" + "bar"
Thanks for having a think Kibner. My problem might've been clearer if I posted a snippet but anyway I've realised my main problem was I had screwed up the loops through a string array and char array. I was iterating through the string part twice.
Slaenters, I'm back with more questions about my java spelling program, and I'm too intimidated by StackOverflow to ask there.
My program has three sections: enter size of array, enter elements of array (these two would be done by a teacher) and thirdly the spelling test section (for the student). When I put it all in the main method it works fine (see here), but it's broken when I put it into individual methods and I don't know why. As it stands, the program just ends after inputting the words (
fwiw, here's my test program).
I suppose the real question is how do I pass values/array elements between methods? There's a wealth of stackoverflow answers to this that amount to "create instance variables" but I'm not sure that helps me when I am initialising the array in a loop.
My program has three sections: enter size of array, enter elements of array (these two would be done by a teacher) and thirdly the spelling test section (for the student). When I put it all in the main method it works fine (see here), but it's broken when I put it into individual methods and I don't know why. As it stands, the program just ends after inputting the words (
fwiw, here's my test program).
I suppose the real question is how do I pass values/array elements between methods? There's a wealth of stackoverflow answers to this that amount to "create instance variables" but I'm not sure that helps me when I am initialising the array in a loop.
Punished, I want to answer this for you and it is probably a simple answer but I may not be able to get to it for a couple days. Definitely bump this on the weekend if no one has gotten to you by then.
I believe your issue is in enterWords, you're redeclaring wordList, instead of updating the class variable. It may be worth doing a quick read up on variable scoping.
You create a new string array at line 29 called wordList, and then add words to it. Later, in spellingTest you're looping through the class variable worldList, which won't have any of the words you entered in enterWords.
I'm fairly sure that changing line 29 to
You create a new string array at line 29 called wordList, and then add words to it. Later, in spellingTest you're looping through the class variable worldList, which won't have any of the words you entered in enterWords.
I'm fairly sure that changing line 29 to
wordList = new String[numWords];should fix it
Doh! Thanks very much Jesal. I'm relieved because as I was amending my code (throwing poop at the wall) I started giving myself various exception errors so I feared that there was going to be something more complicated involved.
Gentlemen, I have some python questions for which any help would be appreciated.
https://github.com/gitforbrains/tickets/blob/main/prog
1. Why won't my ticket_cost from the buy_tickets function actually return a value when I'm printing the output?
2. On the concessions part, I need to return both the cost and the list that is created. Any advice on how to structure the code to achieve this? As least the concessions list is being returned, obviously the cost part isn't because there's no return statement.
https://github.com/gitforbrains/tickets/blob/main/prog
1. Why won't my ticket_cost from the buy_tickets function actually return a value when I'm printing the output?
2. On the concessions part, I need to return both the cost and the list that is created. Any advice on how to structure the code to achieve this? As least the concessions list is being returned, obviously the cost part isn't because there's no return statement.
Did a quick rewrite of it Punished
https://onecompiler.com/python/3wue37uch
In general, it seems like you're mixing methodologies a lot throughout.
Firstly, at the top of your file you had defined no_of_adults and no_of_children, but at the bottom in the call to output, you were trying to use adult_tickets and child_tickets, which didn't exist at that point, so I changed it.
Second, you capture movie outside of the functions, but then you check if it's in the films list inside a `while True:`
The issue that creates is that if move isn't in film, you get trapped in an infinite loop. I fixed that by moving the capture of the movie to inside the while loop, this allows the user to try again
Inside tickets_buy, you were setting the value for ticket_cost, adult_tickets, and child_tickets. The issue here is that those variables are scoped only to that function, so you end up not being able to access them later. For tickets_buy, I added to global declaration to define that I wanted to update the global values for use later, you can read more on globals here: https://www.w3schools.com/python/python_variables_global.asp
Your question about why ticket_cost from buy_tickets never returned, is because you weren't setting the global value, and you also weren't doing anything with the return value. If you wanted to capture the returned value you could have done
"ticket_cost = tickets_buy()"
Inside concessions, your worry about returning multiple values is something python excels at, you can just return them as a comma separated list (it's just a tuple), and then capture it in the same way.
What you end up with is two of the ways of capturing the output of a function, either by setting a global value or by returning values. Personally I prefer the later, and tend to avoid globals where possible
Hopefully this helps
https://onecompiler.com/python/3wue37uch
In general, it seems like you're mixing methodologies a lot throughout.
Firstly, at the top of your file you had defined no_of_adults and no_of_children, but at the bottom in the call to output, you were trying to use adult_tickets and child_tickets, which didn't exist at that point, so I changed it.
Second, you capture movie outside of the functions, but then you check if it's in the films list inside a `while True:`
The issue that creates is that if move isn't in film, you get trapped in an infinite loop. I fixed that by moving the capture of the movie to inside the while loop, this allows the user to try again
Inside tickets_buy, you were setting the value for ticket_cost, adult_tickets, and child_tickets. The issue here is that those variables are scoped only to that function, so you end up not being able to access them later. For tickets_buy, I added to global declaration to define that I wanted to update the global values for use later, you can read more on globals here: https://www.w3schools.com/python/python_variables_global.asp
Your question about why ticket_cost from buy_tickets never returned, is because you weren't setting the global value, and you also weren't doing anything with the return value. If you wanted to capture the returned value you could have done
"ticket_cost = tickets_buy()"
Inside concessions, your worry about returning multiple values is something python excels at, you can just return them as a comma separated list (it's just a tuple), and then capture it in the same way.
What you end up with is two of the ways of capturing the output of a function, either by setting a global value or by returning values. Personally I prefer the later, and tend to avoid globals where possible
Hopefully this helps
Yeah, avoid globals when possible. When things like them get into the mix, "state management" becomes more and more important and more and more difficult. You can Google the term to find more information, but state management is always a pain in the ass.
Many, many thanks Jesal. I'll have to do some practicing and fiddling about to make sure that gets into my brain.
The course I was on barely covered python, so I've only got a very superficial grasp on the basics - had no idea about globals or state management. Really don't enjoy Python especially compared to Java. Some of that could be down to using Jupyter instead of PyCharm because Intellij is very good.
The course I was on barely covered python, so I've only got a very superficial grasp on the basics - had no idea about globals or state management. Really don't enjoy Python especially compared to Java. Some of that could be down to using Jupyter instead of PyCharm because Intellij is very good.
i remember there being an indie game genuinely containing code like that, something yandere simulator something
By Mister Go To Posti remember there being an indie game genuinely containing code like that, something yandere simulator somethingI bet a lot of indie games have horrendous code. I'm sure Undertale is a mess.
I learned a lot about how transactions in MSSQL work these past few weeks, if anyone would be interested in me writing up a post.
By reilo Go To PostDo it. Maybe give a primer on how transactions work in general, too.Aight, will try to work on typing something up after work. Will probably be pretty lengthy. I know enough to be dangerous, but, hey, I was able to get "nested"* transactions working correctly!
*MSSQL doesn't really do nested transactions and my write-up will cover what that means.
If anyone has questions or corrections to my post below, please don't be shy! I'm still learning this stuff but wanted to share some of what I have learned, so far.
What is a transaction in SQL?
A transaction in SQL is an atomic operation that allows multiple SQL statements to execute within the same context. Other processes updating the database while the transaction run do not update the context that the transaction is running in. This makes it much easier to avoid data corruption when executing multiple queries that depend on each other.
A transaction does not actually update a database until it is committed.
If a transaction encounters an error or some other condition is met, it can be subject to a rollback, which undoes all changes within the transaction up that point, leaving the database essentially untouched.
Disclaimer!
The entirety of this post is focused around specifically TSQL and MS SQL Server (MSSQL). TSQL is the dialect of SQL that MSSQL uses. What I explain below may not pertain to any other dialect of SQL or SQL server product. Do not expect MySQL or PostgreSQL or anything else to behave in exactly this manner.
How do I create a transaction?
The syntax for this is super easy:
That's it! Everything that comes after that statement is part of the same transaction.
How do I commit a transaction?
At any point after a transaction was created, use this statement:
How do I rollback a transaction?
This is also super easy. At any point after a transaction was created, use this statement:
It can't be this easy, right?
Only in trivial cases. Sometimes you may only want to commit or rollback based on certain logic. Or if there was a MSSQL error. In that case, you need to know a few things about how MSSQL actually processes in transactions.
@@TRANCOUNT
The command @@TRANCOUNT is a counter that describes how many transactions have not been resolve by a commit or rollback. Its scope is the current connection. So, each time you make a new connection to the database, a new instance of @@TRANCOUNT is created. @@TRANCOUNT defaults to 0.
There are a few ways @@TRANCOUNT is updated:
Due to how ROLLBACK TRANSACTION affects @@TRANCOUNT, you will want to check its value before committing to be sure there is an outstanding transaction to commit. The code to do so often looks similar to this:
In addition, a stored procedure will throw an error if @@TRANCOUNT is different at the start of the stored procedure than it is at the end. Changes can be made to @@TRANCOUNT during a stored procedure, just the final value needs to end up being the same as the initial.
Nested transactions
MSSQL doesn't really support nested transactions. In short, nothing is actually committed until the outermost transaction is committed. This is important to understand if you are doing something like using a stored procedure to call multiple other stored procedures, each with their own transactions.
Normally, a transaction cannot be rolled back after a successful BEGIN TRANSACTION statement. However, if an inner transaction rolls back, then every statement up to that point is also rolled back. Even "successful" commits. Very useful in the above scenario to ensure that either every stored procedure succeeds or none of them do.
Tomorrow (hopefully), I will post some a sample template that I have been working on lately that includes lots of error handling and logging. There is most definitely a better way to do it than I did, but it will at least be an example to look at.
What is a transaction in SQL?
A transaction in SQL is an atomic operation that allows multiple SQL statements to execute within the same context. Other processes updating the database while the transaction run do not update the context that the transaction is running in. This makes it much easier to avoid data corruption when executing multiple queries that depend on each other.
A transaction does not actually update a database until it is committed.
If a transaction encounters an error or some other condition is met, it can be subject to a rollback, which undoes all changes within the transaction up that point, leaving the database essentially untouched.
Disclaimer!
The entirety of this post is focused around specifically TSQL and MS SQL Server (MSSQL). TSQL is the dialect of SQL that MSSQL uses. What I explain below may not pertain to any other dialect of SQL or SQL server product. Do not expect MySQL or PostgreSQL or anything else to behave in exactly this manner.
How do I create a transaction?
The syntax for this is super easy:
BEGIN TRANSACTION
That's it! Everything that comes after that statement is part of the same transaction.
How do I commit a transaction?
At any point after a transaction was created, use this statement:
COMMIT TRANSACTION
How do I rollback a transaction?
This is also super easy. At any point after a transaction was created, use this statement:
ROLLBACK TRANSACTION
It can't be this easy, right?
Only in trivial cases. Sometimes you may only want to commit or rollback based on certain logic. Or if there was a MSSQL error. In that case, you need to know a few things about how MSSQL actually processes in transactions.
@@TRANCOUNT
The command @@TRANCOUNT is a counter that describes how many transactions have not been resolve by a commit or rollback. Its scope is the current connection. So, each time you make a new connection to the database, a new instance of @@TRANCOUNT is created. @@TRANCOUNT defaults to 0.
There are a few ways @@TRANCOUNT is updated:
- each time BEGIN TRANSACTION is called on the current connection, @@TRANCOUNT is incremented by 1
- each time BEGIN TRANSACTION is called on the current connection, @@TRANCOUNT is decremented by 1
- each time ROLLBACK TRANSACTION is called on the current connection, @@TRANCOUNT is set to 0
Due to how ROLLBACK TRANSACTION affects @@TRANCOUNT, you will want to check its value before committing to be sure there is an outstanding transaction to commit. The code to do so often looks similar to this:
IF @@TRANCOUNT > 0
BEGIN
COMMIT TRANSACTION
END
In addition, a stored procedure will throw an error if @@TRANCOUNT is different at the start of the stored procedure than it is at the end. Changes can be made to @@TRANCOUNT during a stored procedure, just the final value needs to end up being the same as the initial.
Nested transactions
MSSQL doesn't really support nested transactions. In short, nothing is actually committed until the outermost transaction is committed. This is important to understand if you are doing something like using a stored procedure to call multiple other stored procedures, each with their own transactions.
Normally, a transaction cannot be rolled back after a successful BEGIN TRANSACTION statement. However, if an inner transaction rolls back, then every statement up to that point is also rolled back. Even "successful" commits. Very useful in the above scenario to ensure that either every stored procedure succeeds or none of them do.
Tomorrow (hopefully), I will post some a sample template that I have been working on lately that includes lots of error handling and logging. There is most definitely a better way to do it than I did, but it will at least be an example to look at.
For the record, MySQL doesn't do transactions correctly either. Though they have come along way in mysql 8 vs anything older.
Is that only if you reference the outer? I would have thought a hard flush on the inner would force the commit?
i.e. if you want the outermost transactions unique ID, that is auto generated by the DB, to be referenced in the inner transactions. MySQL can be funny about that with foreign keys.
Or if any of your inner queries aren't part of the grander transaction (for e.g. logging the return result of an API call) but you want an ID from the outer transaction as a reference.
MySQL doesn't handle those circumstances correctly at all. Particularly if you have foreign key relationships setup. It's technically meant to be possible by the raw SQL spec. But in anything < 8.0 the basic recommendation is to just remove all foreign key relations.
By Kibner Go To PostNested transactions
MSSQL doesn't really support nested transactions. In short, nothing is actually committed until the outermost transaction is committed. This is important to understand if you are doing something like using a stored procedure to call multiple other stored procedures, each with their own transactions.
Is that only if you reference the outer? I would have thought a hard flush on the inner would force the commit?
i.e. if you want the outermost transactions unique ID, that is auto generated by the DB, to be referenced in the inner transactions. MySQL can be funny about that with foreign keys.
Or if any of your inner queries aren't part of the grander transaction (for e.g. logging the return result of an API call) but you want an ID from the outer transaction as a reference.
MySQL doesn't handle those circumstances correctly at all. Particularly if you have foreign key relationships setup. It's technically meant to be possible by the raw SQL spec. But in anything < 8.0 the basic recommendation is to just remove all foreign key relations.
If you want to do stuff like that in MSSQL, I think you have to use Output Parameters and SCOPE_IDENTITY() (if the id is an Identity column). I actually spent all of today identifying, reproducing, and fixing an issue with my transaction template because I didn't account for a particular kind of nesting scenario that I should have and it uses those functions. You can find the updated template with syntax highlighting here: https://pastebin.com/BrFEaGj7
The template also supports nesting sprocs that use the same template, as long as they are called like so:
The end result is that if any of the sprocs fail, all will be rolled back and only the error messages for the first failure will be logged to a couple error table as well as passed all the way back to the caller.
Forgive me for lack of comments, it's been a long day.
CREATE PROCEDURE [dbo].[_SaveFoobars] @Foobars NVARCHAR(MAX)
, @IsSubSproc BIT = 0
, @IsSuccess BIT = NULL OUTPUT
, @ErrorNumber INT = NULL OUTPUT
, @ErrorSeverity INT = NULL OUTPUT
, @ErrorState INT = NULL OUTPUT
, @ErrorProcedure NVARCHAR(128) = NULL OUTPUT
, @ErrorLine INT = NULL OUTPUT
, @ErrorMessage NVARCHAR(4000) = NULL OUTPUT
AS
BEGIN
BEGIN TRY
BEGIN TRANSACTION
DECLARE
@SprocName NVARCHAR(128) = N'_SaveFoobars'
, @ParameterName NVARCHAR(128) = N'Foobars'
, @RowCount INT
SELECT *
INTO #TmpFoobars
FROM OPENJSON(@Foobars)
WITH (
Id UNIQUEIDENTIFIER '$.Id'
, Value BIT '$.Value'
)
DECLARE @FoobarId UNIQUEIDENTIFIER
SELECT TOP 1 @FoobarId = Id FROM #TmpFoobars
SET @RowCount = @@ROWCOUNT
WHILE @RowCount <> 0
BEGIN
IF EXISTS(SELECT 1 FROM dbo._Foos WHERE Id = @FoobarId)
-- update existing record
BEGIN
UPDATE db
SET db.Value = tmp.Value
FROM dbo._Foos AS db
INNER JOIN #TmpFoobars AS tmp ON db.Id = tmp.Id
WHERE db.Id = @FoobarId
END
ELSE
-- create new record
BEGIN
INSERT INTO dbo._Foos( Id
, Value)
SELECT TOP 1 @FoobarId
, Value
FROM #TmpFoobars
WHERE Id = @FoobarId
END
-- delete current row from tmp table and get id of next row
DELETE #TmpFoobars WHERE Id = @FoobarId
SELECT TOP 1 @FoobarId = Id FROM #TmpFoobars
SET @RowCount = @@ROWCOUNT
END
IF @@TRANCOUNT > 0
BEGIN
COMMIT TRANSACTION
SET @IsSuccess = 1
END
END TRY
BEGIN CATCH
IF @@TRANCOUNT > 0
BEGIN
ROLLBACK TRANSACTION
END
IF @IsSuccess <> 0
BEGIN
SELECT @IsSuccess = 0
, @ErrorNumber = ERROR_NUMBER()
, @ErrorSeverity = ERROR_SEVERITY()
, @ErrorState = ERROR_STATE()
, @ErrorProcedure = ERROR_PROCEDURE()
, @ErrorLine = ERROR_LINE()
, @ErrorMessage = ERROR_MESSAGE()
BEGIN TRANSACTION
BEGIN
INSERT INTO dbo.TransactionErrors( SprocName
, [When]
, ErrorNumber
, ErrorSeverity
, ErrorState
, ErrorProcedure
, ErrorLine
, ErrorMessage)
VALUES ( @SprocName,
GETDATE(),
@ErrorNumber
, @ErrorSeverity
, @ErrorState
, @ErrorProcedure
, @ErrorLine
, @ErrorMessage)
INSERT INTO JsonInputParameters(TransactionErrorId, Name, Json)
VALUES (SCOPE_IDENTITY(), @ParameterName, @Foobars)
END
COMMIT TRANSACTION
END
END CATCH
IF @IsSubSproc = 0 OR @IsSubSproc IS NULL
BEGIN
SELECT @IsSuccess AS IS_SUCCESS
, @ErrorNumber AS ERROR_NUMBER
, @ErrorSeverity AS ERROR_SEVERITY
, @ErrorState AS ERROR_STATE
, @ErrorProcedure AS ERROR_PROCEDURE
, @ErrorLine AS ERROR_LINE
, @ErrorMessage AS ERROR_MESSAGE
END
RETURN
END
go
The template also supports nesting sprocs that use the same template, as long as they are called like so:
EXEC dbo._SaveFooBars @Foobars
, 1
, @IsSuccess OUTPUT
, @ErrorNumber OUTPUT
, @ErrorSeverity OUTPUT
, @ErrorState OUTPUT
, @ErrorProcedure OUTPUT
, @ErrorLine OUTPUT
, @ErrorMessage OUTPUT
The end result is that if any of the sprocs fail, all will be rolled back and only the error messages for the first failure will be logged to a couple error table as well as passed all the way back to the caller.
Forgive me for lack of comments, it's been a long day.
So I'm back in school and probably gonna finish my major for applied computing with an emphasis in programming. Afaik it's pretty much CS just less emphasis on theory and no heavy math. Which btw I only had to take 1 math class which I did during Spring and it was basically a glorified English class where I had to use R for visualizations. But at least I can say I kinda know R.
Anyway my academic advisor got me clearance to skip the Intro to programming classes because of my experience. Yet the class I'm taking rn which is a core/required class for my major and emphasis is basically a intro to programming class. The only thing new to me thus far is Python. Also a little frustrating when I'm rampaging through all these classes since I've gotten As across the board as in I've yet to get less than A on any single thing that has been graded and the major oriented classes I've taken thus far have been fairly simple. Basically I'm just kinda annoyed I'm paying thousands of dollars just so I can finally get my foot in the door when it's looking like if money to finish school wasn't an obstacle I was good enough all along lol.
And not to continue tooting my own horn but I keep being surprised by the outcomes of my finals. Even when I took a CS class at community college and learned C++, I was shocked I got an A on the Final. Then for stats class where we used R last semester my teacher was so impressed with my final project that he's going to use it as an example for future classes.
Anyway my academic advisor got me clearance to skip the Intro to programming classes because of my experience. Yet the class I'm taking rn which is a core/required class for my major and emphasis is basically a intro to programming class. The only thing new to me thus far is Python. Also a little frustrating when I'm rampaging through all these classes since I've gotten As across the board as in I've yet to get less than A on any single thing that has been graded and the major oriented classes I've taken thus far have been fairly simple. Basically I'm just kinda annoyed I'm paying thousands of dollars just so I can finally get my foot in the door when it's looking like if money to finish school wasn't an obstacle I was good enough all along lol.
And not to continue tooting my own horn but I keep being surprised by the outcomes of my finals. Even when I took a CS class at community college and learned C++, I was shocked I got an A on the Final. Then for stats class where we used R last semester my teacher was so impressed with my final project that he's going to use it as an example for future classes.
When you go to community college and bring your own pencil, I think that's at least a C. It's probably in the teacher's manual that if the student comes to class with an actual pencil, the minimum grade is a C. But what do I know, I'm not into community.
Though I did graduate college. That happened, I have receipts. And maybe a diploma somewhere.
Though I did graduate college. That happened, I have receipts. And maybe a diploma somewhere.
I am terrible at coming up with my own UI design for complicated editors.
The client wants a simplified editor that lets them create an html table in sharepoint.
The count and name of columns has to be dynamic. Also, a column can have sub-columns and that has to be dynamic, too. And each cell in the table can have a dynamic number of unique values.
I was thinking about a tree view, but then that wouldn't really show them how it looks on the page (and these are very much not technical people that will be using this editor). I'm cobbling something together and will try to remember to share a screenshot when I have something, but, man. This is complicated for me.
A sample image of a simplified version of a table they want to be able to create with the editor instead of having to write their own html:
The client wants a simplified editor that lets them create an html table in sharepoint.
The count and name of columns has to be dynamic. Also, a column can have sub-columns and that has to be dynamic, too. And each cell in the table can have a dynamic number of unique values.
I was thinking about a tree view, but then that wouldn't really show them how it looks on the page (and these are very much not technical people that will be using this editor). I'm cobbling something together and will try to remember to share a screenshot when I have something, but, man. This is complicated for me.
A sample image of a simplified version of a table they want to be able to create with the editor instead of having to write their own html:
If anyone is looking to implement Azure SSO with an ASP.Net app, this is the most comprehensive and up-to-date guide/sample I have found: https://github.com/Azure-Samples/ms-identity-aspnet-webapp-openidconnect.
God, don't. It's expensive but I recommend using a SaaS provider to handle Enterprise SSO. Consumer-grade, whatever.
By reilo Go To PostGod, don't. It's expensive but I recommend using a SaaS provider to handle Enterprise SSO. Consumer-grade, whatever.Maybe I am misunderstanding but a developer would still need to write custom code in their apps to use those SSO services, right? If so, how is that any different than using Azure Active Directory? If not, please give me a name to look up.
It basically obfuscates it for you and you just build a simple webform for submission. You reduce it down from the 50 or so steps listed in that guide to like three on the front-end. Something like Otka will then just deliver the user profile data downstream if you're already signed in to Azure AD, for example, and at that point it just becomes about mapping your profile attributes.
But really, if all you're doing is integrating that single SSO, you probably want custom as it's probably a one-and-done deal. BUT, if anyone ever is like "yea but we need another Enterprise SSO login from x source here, too" then I highly recommend going third-party for that.
Simple stuff like Google, Apple, Facebook SSO you want to do yourself since it's just tame OAuth 2.0 flows.
But really, if all you're doing is integrating that single SSO, you probably want custom as it's probably a one-and-done deal. BUT, if anyone ever is like "yea but we need another Enterprise SSO login from x source here, too" then I highly recommend going third-party for that.
Simple stuff like Google, Apple, Facebook SSO you want to do yourself since it's just tame OAuth 2.0 flows.
By reilo Go To PostIt basically obfuscates it for you and you just build a simple webform for submission. You reduce it down from the 50 or so steps listed in that guide to like three on the front-end. Something like Otka will then just deliver the user profile data downstream if you're already signed in to Azure AD, for example, and at that point it just becomes about mapping your profile attributes.Gotcha, thanks for the explanation! With this particular implementation, the client already has access to Azure AD, extensively uses PowerApps, wants to have a SSO for both, and also manage roles and permissions via AD. Also, there are users that are not part of their org's AD but they still want to have and manage accounts for in this already existing app.
But really, if all you're doing is integrating that single SSO, you probably want custom as it's probably a one-and-done deal. BUT, if anyone ever is like "yea but we need another Enterprise SSO login from x source here, too" then I highly recommend going third-party for that.
Simple stuff like Google, Apple, Facebook SSO you want to do yourself since it's just tame OAuth 2.0 flows.
So, I want to move on from Java, I'm really annoyed that every job and project I've had has been some legacy bs :|
I've been looking at golang, elixir, and flask but I'm still undecided which one to learn.
If anyone has any advice/suggestion, I would be grateful :)
I've been looking at golang, elixir, and flask but I'm still undecided which one to learn.
If anyone has any advice/suggestion, I would be grateful :)
Python (Django / Flusk) and Ruby (Rails + Spree for e-commerce frameworks) are always marketable programming languages. As is modern Javascript and specifically Node.js / Express.js if you want to stay on the backend/API side of things. I would start with two of those of your choice.
Speaking of Java, I had to re-factor the Google Pay integration and get rid of the deprecated API this past week, and gah, I don't like Java 😂
Speaking of Java, I had to re-factor the Google Pay integration and get rid of the deprecated API this past week, and gah, I don't like Java 😂
My mind is struggling not being able to create perfectly sized arrays in C because variable length arrays can be unsafe. Common functions like scanf are also inherently unsafe unless you take specific steps to avoid buffer overflow. It's wild, but is a different challenge than my day-to-day.
It has taken me many hours and at least four refactoring overhauls, but I think I finally have some C code to parse user input into an unsigned long that I am comfortable with.
I still need to touch it up a bit so that the user gets as many chances as they want to enter a valid input without having to restart the program, but I think I'm done for the moment.
#include <errno.h>
#include <inttypes.h>
#include <iso646.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#define INPUT_FORMAT_STRING_LENGTH ((const uint8_t)(11))
bool has_fgets_erred(const char *fgets_result);
uint32_t parse_ulong_string(const char *ulong_string);
bool is_valid_ulong(unsigned long ulong_value);
int main(void) {
printf("Enter a number to use as the ceiling when calculating prime numbers: \n");
char input_buffer[INPUT_FORMAT_STRING_LENGTH];
const char *fgets_result = fgets(input_buffer, INPUT_FORMAT_STRING_LENGTH, stdin);
if (has_fgets_erred(fgets_result)) {
printf("Unknown error reading from console.\n");
return EXIT_FAILURE;
}
const uint32_t prime_ceiling = parse_ulong_string(input_buffer);
if (not is_valid_ulong(prime_ceiling)) {
printf("Error validating input. Please restart and try again.\n");
return EXIT_FAILURE;
}
printf("%"PRIu32, prime_ceiling);
return EXIT_SUCCESS;
}
bool has_fgets_erred(const char *fgets_result) {
return fgets_result == NULL;
}
uint32_t parse_ulong_string(const char *ulong_string) {
errno = 0;
const unsigned long parsed_number = strtoul(ulong_string, NULL, 0);
if (errno not_eq 0) {
if (errno == ERANGE) {
printf("Out of range error when parsing unsigned long from string.\n");
} else {
printf("Unknown error when parsing unsigned long from string.\n");
}
return 0;
}
return (uint32_t) parsed_number;
}
bool is_valid_ulong(const unsigned long ulong_value) {
return ulong_value > 0;
}
I still need to touch it up a bit so that the user gets as many chances as they want to enter a valid input without having to restart the program, but I think I'm done for the moment.
Apparently you can pass functions as parameters in C so I can do function callbacks now.
You have no idea how powerful this makes me feel.
You have no idea how powerful this makes me feel.
By reilo Go To PostPython (Django / Flusk) and Ruby (Rails + Spree for e-commerce frameworks) are always marketable programming languages. As is modern Javascript and specifically Node.js / Express.js if you want to stay on the backend/API side of things. I would start with two of those of your choice.
Speaking of Java, I had to re-factor the Google Pay integration and get rid of the deprecated API this past week, and gah, I don't like Java 😂
Forgot to reply.
Thanks for the suggestions, I've decided on Node.js / Express + React combo, maybe even React Native down the line.