• Ever wanted an RSS feed of all your favorite gaming news sites? Go check out our new Gaming Headlines feed! Read more about it here.

turbobrick

Member
Oct 25, 2017
13,058
Phoenix, AZ
Yeah I agree with writing our own. I think we're very cautious of liability, so we'd rather outsource this to Hackerrank than potentially get sued.

yeah, kinda seems like you're stuck with it for the time being. Unless you can convince your company to use a better service.

That said, what would be the correct answer to the second question? Does that mean only HTML? I know there's autofocus, but I didn't think every browser supported that. So I would use JS with focus()
 

Dave.

Member
Oct 27, 2017
6,138
My work started using HackerRank to help with interviewing, as a company wide policy thing.

I'm on the other end of it... MAn the data HAckerRank collects on users answering the tests is wild. It tracks when you switch windows, where your mouse goes, when you select something and then change your answer, it tracks *every keystroke* in the open ended quizzes, it tracks *everything.* That's fuckin wild.

I'm against these in general, I think they're wrong, but just as an FYI if you get a HackerRank questionaire from an employer be aware of what they track on you and report to the company.
Very interesting, thank you!
 

grmlin

Member
Oct 25, 2017
10,276
Germany
I'm also doing this for more than 15 years I think, and tests like this are something, and I usually suck at them hahaha.

I still find most problems in websites immediately, at some point you just have seen it all. Thank god I'm building applications with React these days, using mature UI frameworks. I don't miss building custom websites for customers one second.

Boy, how times have changed. When I started doing this it was like "write some markup, make it pretty and add some click handlers to it".
Now it's "create an application, all the business logic, all the markup, the styles, the ci, just fucking everything".
 

Zoe

Member
Oct 25, 2017
14,228
Here's another:

g3IG73.png


"We want to make the page such that..."

My flag for this was "That sentence is very awkward," and I thought it would be confusing for a non-native English speaker, but even me, a native english speaker, I'm like "Want to make the page such that ..."

I use that kind of wording all the time :(
 

The Albatross

Member
Oct 25, 2017
38,956
yeah, kinda seems like you're stuck with it for the time being. Unless you can convince your company to use a better service.

That said, what would be the correct answer to the second question? Does that mean only HTML? I know there's autofocus, but I didn't think every browser supported that. So I would use JS with focus()

For me, I'd consider the autofocus attr to be the "right" answer. I think it's supported in every major browser. I'd actually prefer a comment box or something on teh quiz so people could explain their answer too.
 

The Albatross

Member
Oct 25, 2017
38,956
I use that kind of wording all the time :(

I think it's fine for regular communication, I use a whole bunch of weirdly formal constructed sentences too... But for an official exam for like, getting a job, I feel like nobody should have to struggle through the sentences in order to answer the technical part of the quiz.
 

FrakEarth

Member
Oct 25, 2017
3,271
Liverpool, UK
I've been playing around with CSS 3D Transforms tonight, figuring out how to put together a camera that can follow an object... and I also wrote my own Sprite class with animation states so I could use some spritesheets with this example. This is probably really easy with three.js or something similar, but this is just TypeScript / CSS Transforms / Simple HTML structure - I wanted to see what was doable with CSS...




At the moment WASD is just mapped to direct 2D movement forwards and backwards with turns left and right, there's no acceleration physics/inertia yet...

I was playing about with a split viewport and put together a track prototype too




I'm aware that the hill background isn't right / bugs out...

I've been using SignalR a bit at work (web sockets) - I think if I could find the time to pull some things together I might be able to make a fun little demo, maybe even allow a janky mulitplayer of sorts -- but at the moment I'm just messing about in my spare time.

I've got collision detection working with the bounds of a level, but I would need to implement stuff like - sprite billboarding (making other karts / obstacles always face the camera and use the correctly angled sprite), an underlying image map to let the update-routine know about things like road-surface/rough-terrain/non-drivable-areas/boost, I'd need to make a steering / avoidance AI for simple bots, etc.

Fun little learning experience - if I flesh it out a bit more I might do a video on it and/or upload to github if anyone's interested.
 

Aztechnology

Community Resettler
Avenger
Oct 25, 2017
14,131
I've been playing around with CSS 3D Transforms tonight, figuring out how to put together a camera that can follow an object... and I also wrote my own Sprite class with animation states so I could use some spritesheets with this example. This is probably really easy with three.js or something similar, but this is just TypeScript / CSS Transforms / Simple HTML structure - I wanted to see what was doable with CSS...




At the moment WASD is just mapped to direct 2D movement forwards and backwards with turns left and right, there's no acceleration physics/inertia yet...

I was playing about with a split viewport and put together a track prototype too




I'm aware that the hill background isn't right / bugs out...

I've been using SignalR a bit at work (web sockets) - I think if I could find the time to pull some things together I might be able to make a fun little demo, maybe even allow a janky mulitplayer of sorts -- but at the moment I'm just messing about in my spare time.

I've got collision detection working with the bounds of a level, but I would need to implement stuff like - sprite billboarding (making other karts / obstacles always face the camera and use the correctly angled sprite), an underlying image map to let the update-routine know about things like road-surface/rough-terrain/non-drivable-areas/boost, I'd need to make a steering / avoidance AI for simple bots, etc.

Fun little learning experience - if I flesh it out a bit more I might do a video on it and/or upload to github if anyone's interested.

Really cool, thanks for sharing. I'd definitely check it out
 

plngsplsh

Member
Oct 28, 2017
1,142
I've been playing around with CSS 3D Transforms tonight, figuring out how to put together a camera that can follow an object... and I also wrote my own Sprite class with animation states so I could use some spritesheets with this example. This is probably really easy with three.js or something similar, but this is just TypeScript / CSS Transforms / Simple HTML structure - I wanted to see what was doable with CSS...




At the moment WASD is just mapped to direct 2D movement forwards and backwards with turns left and right, there's no acceleration physics/inertia yet...

I was playing about with a split viewport and put together a track prototype too




I'm aware that the hill background isn't right / bugs out...

I've been using SignalR a bit at work (web sockets) - I think if I could find the time to pull some things together I might be able to make a fun little demo, maybe even allow a janky mulitplayer of sorts -- but at the moment I'm just messing about in my spare time.

I've got collision detection working with the bounds of a level, but I would need to implement stuff like - sprite billboarding (making other karts / obstacles always face the camera and use the correctly angled sprite), an underlying image map to let the update-routine know about things like road-surface/rough-terrain/non-drivable-areas/boost, I'd need to make a steering / avoidance AI for simple bots, etc.

Fun little learning experience - if I flesh it out a bit more I might do a video on it and/or upload to github if anyone's interested.

that's pretty cool
 

Ninja_Hawk

Member
Oct 27, 2017
912
I'm building a project in react and bootstrap and i'm using a card component. My button element keeps appearing under the border of each card, any idea why or how I can keep the button within the borders of the card component. Basically whatever the last element is keeps appearing under the border.


Code:
<div className="card w-50" > {saved}

       {urlToImage && <img src={urlToImage} className="float-right ml-5"  className="card-img-top"/>}
       <div class="card-header">{title}</div>
        <div className="card-body">
          <h6 className="card-title">{author}</h6>
          
          <p class="card-text">{url}</p>
          <p class="card-text">{publishedAt}</p>
           <p class="card-text">{description}</p>
          
        
           <button
              className="btn btn-danger font-weight-bold text-uppercase float-right"
            
              onClick={handleSave}
              disabled={saved}
          >
            {saved ? "Saved!" : "Save"}
          </button>
    
        </div>
      
      </div>

CSS:

.card {

max-height: 250px;
margin-bottom: 1rem;
color: inherit;
border-radius: 0;
border: none;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}
.card-img-top {
width: 50px;
height: 50px;
object-fit: cover;
}
 

turbobrick

Member
Oct 25, 2017
13,058
Phoenix, AZ
I'm building a project in react and bootstrap and i'm using a card component. My button element keeps appearing under the border of each card, any idea why or how I can keep the button within the borders of the card component. Basically whatever the last element is keeps appearing under the border.


Code:
<div className="card w-50" > {saved}

       {urlToImage && <img src={urlToImage} className="float-right ml-5"  className="card-img-top"/>}
       <div class="card-header">{title}</div>
        <div className="card-body">
          <h6 className="card-title">{author}</h6>
        
          <p class="card-text">{url}</p>
          <p class="card-text">{publishedAt}</p>
           <p class="card-text">{description}</p>
        
      
           <button
              className="btn btn-danger font-weight-bold text-uppercase float-right"
          
              onClick={handleSave}
              disabled={saved}
          >
            {saved ? "Saved!" : "Save"}
          </button>
  
        </div>
    
      </div>

CSS:

.card {

max-height: 250px;
margin-bottom: 1rem;
color: inherit;
border-radius: 0;
border: none;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}
.card-img-top {
width: 50px;
height: 50px;
object-fit: cover;
}

If I understand this right, do you mean the button is under the border of the whole div? Like at the bottom its being covered up? I assume this is what you mean. If so can you space it up by adding a margin? Since you have a max height, is it running out of room?
 

Ninja_Hawk

Member
Oct 27, 2017
912
If I understand this right, do you mean the button is under the border of the whole div? Like at the bottom its being covered up? I assume this is what you mean. If so can you space it up by adding a margin? Since you have a max height, is it running out of room?
Not quite, but this lead me to a solution so thank you.
 
Oct 27, 2017
4,916
Is anyone here running a MERN stack app through Namecheap or other VPS Cpanel services?If any of you have experience with this, I'm wondering what setup environment to use to get this to work and what problems you had to solve. We previously had this running on a non-VPS shared hosting but we have to upgrade it for this tool we're building for a client (we're data nerds, not web devs).

Not sure if we need to learn how to implement htaccess or if this is one of those things that requires setting it all up to run on a virtual environment. Hopefully there's a quick and easy solution.
 

Midramble

Force of Habit
The Fallen
Oct 25, 2017
10,452
San Francisco
Well if you want some real activity, I've got a question. Is the react/redux/thunk/router ecosystem still a common suite of libraries for front end? I've dusted off a project and was reading through old code and considering if any of these pieces should be replaced. App involves api called elastic stack searches, a bit of e-commerce, and a bit of social components, so a whole lotta cards and other similar components.
 

FrakEarth

Member
Oct 25, 2017
3,271
Liverpool, UK
Well if you want some real activity, I've got a question. Is the react/redux/thunk/router ecosystem still a common suite of libraries for front end? I've dusted off a project and was reading through old code and considering if any of these pieces should be replaced. App involves api called elastic stack searches, a bit of e-commerce, and a bit of social components, so a whole lotta cards and other similar components.
I've only used it in one project and since thought about refactoring it to use context instead.

It seems most useful in large applications where maybe you want data to persist even when things unmount or regardless of where the user is in the app. It simplifies message/event messaging where you want data to flow back up the hierarchy but in my app it was total overkill. Glad I learned about it though!
 

grmlin

Member
Oct 25, 2017
10,276
Germany
Well if you want some real activity, I've got a question. Is the react/redux/thunk/router ecosystem still a common suite of libraries for front end? I've dusted off a project and was reading through old code and considering if any of these pieces should be replaced. App involves api called elastic stack searches, a bit of e-commerce, and a bit of social components, so a whole lotta cards and other similar components.
We got rid of Redux in our projects now. It's such a complex system and really hard to understand and maintain.

I would recommend to either use graphql, react-query or both instead.
I manage my local state with contexts, which works great. There are other libraries like Zustand, too, though

Also: everybody should try Vite, which is so much better than webpack and other build bundlers. Can't recommend it enough.
 

Midramble

Force of Habit
The Fallen
Oct 25, 2017
10,452
San Francisco
I've only used it in one project and since thought about refactoring it to use context instead.

It seems most useful in large applications where maybe you want data to persist even when things unmount or regardless of where the user is in the app. It simplifies message/event messaging where you want data to flow back up the hierarchy but in my app it was total overkill. Glad I learned about it though!

We got rid of Redux in our projects now. It's such a complex system and really hard to understand and maintain.

I would recommend to either use graphql, react-query or both instead.
I manage my local state with contexts, which works great. There are other libraries like Zustand, too, though

Also: everybody should try Vite, which is so much better than webpack and other build bundlers. Can't recommend it enough.


Yeah, I had seen some stuff about context out there and the two mentions here makes me really think I should learn that. As someone who was more backend oriented, dealing with state with such an unnecessarily complicated mechanism such as redux was quite painful. Does context help with actions as well to replace thunk?
 

turbobrick

Member
Oct 25, 2017
13,058
Phoenix, AZ
Having never used React in a professional setting, only on my own projects, I never really thought Redux was that bad to use. Maybe a bit overkill depending on how much you need to use it. Though I should point out I used Redux Toolkit which I found fairly straight forward.
 

FrakEarth

Member
Oct 25, 2017
3,271
Liverpool, UK
Yeah, I had seen some stuff about context out there and the two mentions here makes me really think I should learn that. As someone who was more backend oriented, dealing with state with such an unnecessarily complicated mechanism such as redux was quite painful. Does context help with actions as well to replace thunk?

The form of your context 'object' can be anything really, so it could for example contain functions or references to functions (perhaps that you have bound 'this' to at higher levels) - so you could certainly compose actions within your context. You can have multiple contexts in the tree / hierarchy too. A user context that's fed down from the top of the app for example, a page context that is only active in a certain context etc. Consuming them is different in class components to functional components, it's worth learning both.

I find context is great for avoiding prop drilling (passing props through layer upon layer of components) and it's enough for a huge number of use cases.

When your needs get a bit more complex, and you want to make it more of a finite state machine, or have the app be reactive to events, that's when you might want to look at other solutions but even then you can do a lot with just the framework and vanilla JS.

Having never used React in a professional setting, only on my own projects, I never really thought Redux was that bad to use. Maybe a bit overkill depending on how much you need to use it. Though I should point out I used Redux Toolkit which I found fairly straight forward.
I do actually like it and think it's quite clever - the idea of having a central store and being able to plug 'middleware' in to modify it is quite powerful. I did find it was good to scaffold your types, actions and reducers a certain way - organise them separately and logically in the project etc. I can imagine following some tutorials users might end up with ginormous files or code soup.. which is probably really confusing and off putting, not to mention bad for maintainability.

I try to actively avoid adding things that might not be necessary. Operate on a principle of least complexity. I don't add momentjs if I just need to add a week to a date or something. Likewise I wouldn't add redux if I just need a little bit of high level app state.
 

grmlin

Member
Oct 25, 2017
10,276
Germany
Does context help with actions as well to replace thunk?
The Context is a way to provide data/state to child components without passing props through a zillion component layers. It does not replace Redux. But I think, while the idea of redux with it's central store and app wide synced state is great, it's simply way too complex and complicated. Over engineered.

I would always use react-query for asynchronous operations. It's really wonderful, easy to read and understand. Now with queries most developers can understand the code, as it's very obvious and in your face.
 

SOLDIER

One Winged Slayer
Banned
Oct 26, 2017
11,339
I posted this in the Programming thread, but it seems this is a more appropriate place to ask:

I've recently been looking at some potential career paths, and have largely considered becoming a DevOps Cloud Engineer: going by postings, it's high in demand, high paying, and doesn't require a degree or certification to be considered for hiring.

What seems to be the key requirement is familiarity with a number of specific programs. I looked into this guide that lists a DevOps roadmap, and started going through Code Academy lessons on Go, which was one of the recommended languages. I wanted to learn AWS simultaneously but haven't found a similar beginner's guide for that yet. I feel having objective-based learning like with Code Academy would be the easiest way for me to learn this stuff, rather than reading or listening to any lectures.

I've also read that the best way to get a DevOps position is to get hired in the entry level for a job that builds you up to a DevOps position, as supposedly you learn a lot of the required programming while in the job itself.

So if any of that is true, then my requests come in three parts:

1. A list of entry level job titles/positions I could search for, as I'm currently unemployed and want to try and make my next job related to this career path.

2. A recommended list/order of the bare minimum skills and how much I should learn in order to get hired quickly. As I said, I'm going through Code Academy's lessons on Go, but am unsure how far I need to go until I've reached the "minimum" amount of knowledge that makes me eligible for hire. Ditto the other stuff that guides like the above have listed.

3. The best (and preferably free) resources I can use to learn these tools, especially AWS and other Cloud-based tools. I haven't looked too deep yet, but I'm going to need some guidance or objectives beyond "set up a VM and play around with it", because downloading the software is meaningless if I have no idea what to do with it.

I've put off and been so indecisive of what I want to do with my life career-wise for so long, so do forgive my impatience, but if I really can get in quickly into a decent job that moves me up to the big-paying DevOps role, I really want to know how quickly to get started and what I need to do so.
 

Midramble

Force of Habit
The Fallen
Oct 25, 2017
10,452
San Francisco
I'm getting desperate here.

Anyone here familiar with Blazor WASM view side apps? I'm at my wit's end with a cookie issue that I can't find the solution to anywhere online and stackexchange hasn't helped.

Also, since this is WASM, I'm not sure if this is a better fit for the main programming thread.

Evironment:

I have a asp.net core web API on localhost:7### and a view side Blazor WASM app serving pages from localhost:5###

The Issue:

I have one controller (Login) on the API that creates and appends a cookie to the response for later sending by the WASM view app. On the view app itself, when I run another action to get and verify the cookie (this is done on the controller side via a "validatecookie" controller) the cookie returns null.

If I call the GET controller directly in the browser everything functions correctly, so I assume the issue is with the different ports triggering CORS. That or it may be something about the WASM app being http while the API is https. To that end I've setup a CORS policy on the API to allow credentials from the view origin and I've tried a whole gambit of headers and origin flags on the view side but nothing seems to work.

Here is the Login controller that creates and appends the cookie
C#:
[HttpGet("/Login")]
        public String Get(String Email, String Pass)
        {
            String token = null;
            token = Auth.Login(Email, Pass);
            if (token != null)
            {
                String basicauth = Convert.ToBase64String(Encoding.ASCII.GetBytes(Email+":"+token));
                CookieOptions cookieOptions = new CookieOptions();
                Console.WriteLine("Cookie path is: " + cookieOptions.Path);
                Console.WriteLine("Cookie domain is: " + cookieOptions.Domain);
                Console.WriteLine("Cookie isEssential: " + cookieOptions.IsEssential);
                Console.WriteLine("Cookie Samesite: " + cookieOptions.SameSite);
                Console.WriteLine("Cookie secure: " + cookieOptions.Secure);
                Console.WriteLine("Cookie expires: " + cookieOptions.Expires);
                Console.WriteLine("Cookie httponly: " + cookieOptions.HttpOnly);
                Console.WriteLine("Cookie max age: " + cookieOptions.MaxAge);
                cookieOptions.IsEssential = true;
                cookieOptions.SameSite = SameSiteMode.Lax;
                cookieOptions.Secure = false;
                Response.Cookies.Append("bearer",basicauth,cookieOptions);
                Console.WriteLine("Cookie count after login: " + Request.Cookies.Count);
                return basicauth;
            }
            return "token was null";
        }

Here is the controller that is supposed to validate the cookie on the API side.

C#:
public class ValidateCookieToken : ControllerBase
    {

        [EnableCors("CookiePolicy")]
        [HttpGet("/ValidateCookie")]
        public String Get()
        {
            String bearertoken;
            Console.WriteLine("ValidateCookies Headers Keys: " + Request.Headers.Keys);
            foreach (var VARIABLE in Request.Headers.Keys)
            {
                Console.WriteLine("ValCookie Key: " + VARIABLE + " - Value: " + Request.Headers[VARIABLE]);
            }
            Console.WriteLine("ValidateCookies current cookie count: " + Request.Cookies.Count);
            Console.WriteLine("Validatecookies cookie keys: " + Request.Cookies.Keys);
            Console.WriteLine("ValCook headers cookie: " + Request.Headers.Cookie.ToString());
            Request.Cookies.TryGetValue("bearer", out bearertoken);
            String decodedbearer = Encoding.ASCII.GetString(Convert.FromBase64String(bearertoken));
            return decodedbearer;
        }
    }

Here is the action method on the view app calling the "validatecookie" controller
C#:
private async void CheckCookie()
    {
        HttpClient client = new HttpClient();
        HttpRequestMessage requestMessage = new HttpRequestMessage(HttpMethod.Get, "https://localhost:7139/ValidateCookie");
        //requestMessage.Options.Set(new HttpRequestOptionsKey<string>(),"true");
        //requestMessage.Options.Append(new KeyValuePair<string, object>("credentials","include"));
        requestMessage.Options.Set(new HttpRequestOptionsKey<string>("Access-Control-Request-Headers"),"Cookie");
        requestMessage.Options.Set(new HttpRequestOptionsKey<string>("Access-Control-Allow-Origin"),"http://localhost:5196");
        requestMessage.Options.Set(new HttpRequestOptionsKey<string>("Access-Control-Allow-Methods"),"GET");
        //requestMessage.Headers.Add("Access-Control-Allow-Credentials","true");
        //requestMessage.Headers.Add("withCredentials","true");
        CommunityObject[] subbedCommunities;
        List<CommunityObject> listSubbedCommunities = new List<CommunityObject>();
        HttpResponseMessage returnMessage = await client.SendAsync(requestMessage);
        var stream = returnMessage.Content.ReadAsStreamAsync();
        var contentstring = returnMessage.Content.ReadAsStringAsync();
        Console.WriteLine("Community CheckCookie return stream result: " + stream.Result);
        cookieresult = contentstring.Result;

    }

And here is my current CORS policy config

C#:
builder.Services.AddCors(options =>
        {
        options.AddPolicy("CookiePolicy",
        policy =>
        {
            policy.AllowCredentials().AllowAnyHeader().AllowAnyMethod().SetIsOriginAllowed(origin => new Uri(origin).Host == "localhost");
        });
        });
 

turbobrick

Member
Oct 25, 2017
13,058
Phoenix, AZ
I'm getting desperate here.

Anyone here familiar with Blazor WASM view side apps? I'm at my wit's end with a cookie issue that I can't find the solution to anywhere online and stackexchange hasn't helped.

Also, since this is WASM, I'm not sure if this is a better fit for the main programming thread.

Evironment:

I have a asp.net core web API on localhost:7### and a view side Blazor WASM app serving pages from localhost:5###

The Issue:

I have one controller (Login) on the API that creates and appends a cookie to the response for later sending by the WASM view app. On the view app itself, when I run another action to get and verify the cookie (this is done on the controller side via a "validatecookie" controller) the cookie returns null.

If I call the GET controller directly in the browser everything functions correctly, so I assume the issue is with the different ports triggering CORS. That or it may be something about the WASM app being http while the API is https. To that end I've setup a CORS policy on the API to allow credentials from the view origin and I've tried a whole gambit of headers and origin flags on the view side but nothing seems to work.

Here is the Login controller that creates and appends the cookie
C#:
[HttpGet("/Login")]
        public String Get(String Email, String Pass)
        {
            String token = null;
            token = Auth.Login(Email, Pass);
            if (token != null)
            {
                String basicauth = Convert.ToBase64String(Encoding.ASCII.GetBytes(Email+":"+token));
                CookieOptions cookieOptions = new CookieOptions();
                Console.WriteLine("Cookie path is: " + cookieOptions.Path);
                Console.WriteLine("Cookie domain is: " + cookieOptions.Domain);
                Console.WriteLine("Cookie isEssential: " + cookieOptions.IsEssential);
                Console.WriteLine("Cookie Samesite: " + cookieOptions.SameSite);
                Console.WriteLine("Cookie secure: " + cookieOptions.Secure);
                Console.WriteLine("Cookie expires: " + cookieOptions.Expires);
                Console.WriteLine("Cookie httponly: " + cookieOptions.HttpOnly);
                Console.WriteLine("Cookie max age: " + cookieOptions.MaxAge);
                cookieOptions.IsEssential = true;
                cookieOptions.SameSite = SameSiteMode.Lax;
                cookieOptions.Secure = false;
                Response.Cookies.Append("bearer",basicauth,cookieOptions);
                Console.WriteLine("Cookie count after login: " + Request.Cookies.Count);
                return basicauth;
            }
            return "token was null";
        }

Here is the controller that is supposed to validate the cookie on the API side.

C#:
public class ValidateCookieToken : ControllerBase
    {

        [EnableCors("CookiePolicy")]
        [HttpGet("/ValidateCookie")]
        public String Get()
        {
            String bearertoken;
            Console.WriteLine("ValidateCookies Headers Keys: " + Request.Headers.Keys);
            foreach (var VARIABLE in Request.Headers.Keys)
            {
                Console.WriteLine("ValCookie Key: " + VARIABLE + " - Value: " + Request.Headers[VARIABLE]);
            }
            Console.WriteLine("ValidateCookies current cookie count: " + Request.Cookies.Count);
            Console.WriteLine("Validatecookies cookie keys: " + Request.Cookies.Keys);
            Console.WriteLine("ValCook headers cookie: " + Request.Headers.Cookie.ToString());
            Request.Cookies.TryGetValue("bearer", out bearertoken);
            String decodedbearer = Encoding.ASCII.GetString(Convert.FromBase64String(bearertoken));
            return decodedbearer;
        }
    }

Here is the action method on the view app calling the "validatecookie" controller
C#:
private async void CheckCookie()
    {
        HttpClient client = new HttpClient();
        HttpRequestMessage requestMessage = new HttpRequestMessage(HttpMethod.Get, "https://localhost:7139/ValidateCookie");
        //requestMessage.Options.Set(new HttpRequestOptionsKey<string>(),"true");
        //requestMessage.Options.Append(new KeyValuePair<string, object>("credentials","include"));
        requestMessage.Options.Set(new HttpRequestOptionsKey<string>("Access-Control-Request-Headers"),"Cookie");
        requestMessage.Options.Set(new HttpRequestOptionsKey<string>("Access-Control-Allow-Origin"),"http://localhost:5196");
        requestMessage.Options.Set(new HttpRequestOptionsKey<string>("Access-Control-Allow-Methods"),"GET");
        //requestMessage.Headers.Add("Access-Control-Allow-Credentials","true");
        //requestMessage.Headers.Add("withCredentials","true");
        CommunityObject[] subbedCommunities;
        List<CommunityObject> listSubbedCommunities = new List<CommunityObject>();
        HttpResponseMessage returnMessage = await client.SendAsync(requestMessage);
        var stream = returnMessage.Content.ReadAsStreamAsync();
        var contentstring = returnMessage.Content.ReadAsStringAsync();
        Console.WriteLine("Community CheckCookie return stream result: " + stream.Result);
        cookieresult = contentstring.Result;

    }

And here is my current CORS policy config

C#:
builder.Services.AddCors(options =>
        {
        options.AddPolicy("CookiePolicy",
        policy =>
        {
            policy.AllowCredentials().AllowAnyHeader().AllowAnyMethod().SetIsOriginAllowed(origin => new Uri(origin).Host == "localhost");
        });
        });

I'm sure you already googled everything I did. But one thing I didn't see mentioned in your post I saw elsewhere is credentials on the HttpRequestMessage.

searching around I saw multiple examples that would have something like

requestMessage.SetBrowserRequestCredentials(BrowserRequestCredentials.Include);

Though disclaimer I haven't really done much with cookies in asp.net. I figure if it was CORS you'd be able to see something in the network tab.

I dunno, that's my attempt since you're desperate, lol.
 

Midramble

Force of Habit
The Fallen
Oct 25, 2017
10,452
San Francisco
I'm sure you already googled everything I did. But one thing I didn't see mentioned in your post I saw elsewhere is credentials on the HttpRequestMessage.

searching around I saw multiple examples that would have something like

requestMessage.SetBrowserRequestCredentials(BrowserRequestCredentials.Include);

Though disclaimer I haven't really done much with cookies in asp.net. I figure if it was CORS you'd be able to see something in the network tab.

I dunno, that's my attempt since you're desperate, lol.

Thanks! I actually ran into that solution on my search as well but ran into a different issue trying to implement it. It requires the Microsoft.AspNetCore.Components.WebAssembly v6.0.6 package and every time I've tried to install that I get a dependencies error saying it's not compatible with netcoreapp 6.0 but only support netframework 6.0.

To be honest I've struggled with understanding the dotnet library/package naming and versioning. I have the 6.0.301 SDK installed with 6.0.6 runtime and the project target is 6.0. That said I'm not exactly sure what it means by .net framework. From cursory looks I've seen the google answer to the difference between core and framework but not sure where the package for framework is or what that has to do with a aspentcore package (eventhough the nuget lists framework in the dependencies for it.)

I've struggled less with handling Maven/Jenkins dependencies than this hahahaha.


In parallel I'm also working on a "nuclear" option by building out my Azure Application Gateway and setting up the domain and certs just so I can get out of the need to deal with CORS altogether, as thats where the UAT and Prod environments will eventually sit anyways.
 

SuperEpicMan

Member
Oct 25, 2017
1,806
I am currently working as a developer in the UK and have been in the role for the last 7 months, but starting to get itchy feet (the job is really slow). I am really finding it impossible to get a sense of what salary I should be aiming for though. I have been doing development for the last 5 years, kinda going through HTML, CSS, Sass, JS, C#, ASP.NET, SQL, Vue.js, Angular, test-driven development, and maybe a bunch of other things I am forgetting. I have also done a bunch of React, though mostly in my spare time.

I am currently on £40K, but I am seeing a lot adverts for developers going anywhere between £35K and £75K. Not sure if I should just stay put, or if a much higher salary is realistic with my experience.
 

The Albatross

Member
Oct 25, 2017
38,956
I think a higher salary should be your expectations. List your experience as 5 years.

It's hard for me to gage salaries outside of the US, but for now, err on the side of higher salary. There's still basically 0% unemployment in tech/web software, in both the US & UK, and if you're gonna set a new salary floor for your career, it may as well be now.
 
Oct 27, 2017
3,583
I am currently working as a developer in the UK and have been in the role for the last 7 months, but starting to get itchy feet (the job is really slow). I am really finding it impossible to get a sense of what salary I should be aiming for though. I have been doing development for the last 5 years, kinda going through HTML, CSS, Sass, JS, C#, ASP.NET, SQL, Vue.js, Angular, test-driven development, and maybe a bunch of other things I am forgetting. I have also done a bunch of React, though mostly in my spare time.

I am currently on £40K, but I am seeing a lot adverts for developers going anywhere between £35K and £75K. Not sure if I should just stay put, or if a much higher salary is realistic with my experience.

Depends where in the country you are, but my gut is that with 5 years of experience, you should be aiming for more.

Still, even if you're not 100% sure, just apply for anything you fancy anyway. It costs nothing (aside from the time involved with updating your resume).
 

SuperEpicMan

Member
Oct 25, 2017
1,806
Depends where in the country you are, but my gut is that with 5 years of experience, you should be aiming for more.

Still, even if you're not 100% sure, just apply for anything you fancy anyway. It costs nothing (aside from the time involved with updating your resume).

Thanks for replying, I am in the north east. Might put some feelers out and see what comes back.
 

The Albatross

Member
Oct 25, 2017
38,956
This has been a dead thread for a while so I figured I might share the stack I'm developing a fair amount in these days.

Have been doing most of my component development using Lit the last year or so:

lit.dev

Lit

Simple. Fast. Web Components.

Main reason was a work push. We didn't want to be locked into an ecosystem because we have to develop components for any framework/language/platform, React, Vue, JavaScript, Rails, Go, etc, and wanted to try to do something that was as native as possible with web components, without going totally vanilla JS because of the learning curve, caveats, and friction with a purely JS based approach.

I was skeptical at first, I was an early React developer and comfortable in that ecosystem, but I've really taken to Lit, like how small and fast it is, and really like the lit-html template system which is straight native HTML templating system with features bolted on, not an abstraction like JSX. You don't get complaints about weird accessibility syntax or making simple mistakes with class vs. className, it's just native, normal HTML, with some directives bolted on top.
 

ohblahitsme

Member
Jan 20, 2018
46
Hi web dev era! I recently made a website for my cartoons and thought I post here to get some feedback on the stack.

Although lots of webcomics are hosted on Wordpress, etc., sebcomic sites can pretty much be static sites. I tried to figure out the cheapest way to do this: you can host static sites on github with up to 100GB/month bandwidth. All I had to do was pay for the domain name.

For publishing, I rolled my own templating script that spits out an html page for each comic and figures out how to link them together based on a text file where each line contains the name of the comic and an ID number.

It doesn't have any fancy stuff like commenting, but that's ok for me. It kind of reminds me of internet around the early 2000s, which is sort of the aesthetic I am going for. Part of the motivation here was to get away from Instagram and social media and just have a simple website hosting my cartoons. You can see the site here (hope this isn't against the rules!): https://www.springtimeforspiders.com

Thoughts on my barebones stack?
 

Dave.

Member
Oct 27, 2017
6,138
Hi web dev era! I recently made a website for my cartoons and thought I post here to get some feedback on the stack.

Although lots of webcomics are hosted on Wordpress, etc., sebcomic sites can pretty much be static sites. I tried to figure out the cheapest way to do this: you can host static sites on github with up to 100GB/month bandwidth. All I had to do was pay for the domain name.

For publishing, I rolled my own templating script that spits out an html page for each comic and figures out how to link them together based on a text file where each line contains the name of the comic and an ID number.

It doesn't have any fancy stuff like commenting, but that's ok for me. It kind of reminds me of internet around the early 2000s, which is sort of the aesthetic I am going for. Part of the motivation here was to get away from Instagram and social media and just have a simple website hosting my cartoons. You can see the site here (hope this isn't against the rules!): https://www.springtimeforspiders.com

Thoughts on my barebones stack?
It's nice! Since you're building these pages ahead of time with known elements, you could add width and height to the main <img> tag so it doesn't flicker a collapse/expand on each time you click "next" and get an uncached image load.
 

ohblahitsme

Member
Jan 20, 2018
46
It's nice! Since you're building these pages ahead of time with known elements, you could add width and height to the main <img> tag so it doesn't flicker a collapse/expand on each time you click "next" and get an uncached image load.
Thank you! That's a good tip, I didn't know about that!
 

grmlin

Member
Oct 25, 2017
10,276
Germany
The Albatross looks nice and light, but we don't have a use case for web components and are deep in react (and still love it all these years later).
Also don't want to mess around with class based components anymore. Just love my dumb functional code way too much to ever switch back to that
 

Arilian

Member
Oct 29, 2020
2,347
Thoughts on my barebones stack?
You can use tools like the W3C validator to find way of improving the code of your website:

The W3C Markup Validation Service

W3C's easy-to-use markup validation service, based on SGML and XML parsers.

It's a good idea to have an alt tag for each picture to succinctly describe what's happening on each comic to help blind and visually impaired persons to enjoy your website too. I know they may not your main target, but with good description, they can envoy a lot of visual medias (as an example, my uncle is blind and with good audio description, he can enjoy a movie like anyone else and can speak about that movie in great details).
 

SecondNature

Member
Oct 25, 2017
15,148
not sure im asking the right place but would it be possible to commission someone to design a logo for me, for a club? image would be 2d
 

The Albatross

Member
Oct 25, 2017
38,956
not sure im asking the right place but would it be possible to commission someone to design a logo for me, for a club? image would be 2d

I'd check out 99Designs. It's a freelance design farm, but I've referred clients there who needed low-cost design work and they got decent enough results. A visual designer friend of mine turned me onto them for clients who have low budgets, and the work is pretty decent usually.
 

ohblahitsme

Member
Jan 20, 2018
46
You can use tools like the W3C validator to find way of improving the code of your website:

The W3C Markup Validation Service

W3C's easy-to-use markup validation service, based on SGML and XML parsers.

It's a good idea to have an alt tag for each picture to succinctly describe what's happening on each comic to help blind and visually impaired persons to enjoy your website too. I know they may not your main target, but with good description, they can envoy a lot of visual medias (as an example, my uncle is blind and with good audio description, he can enjoy a movie like anyone else and can speak about that movie in great details).

That's a good point -- thank you! I can edit the code to add that in for each cartoon. And thanks for the link to the validator!
 

SuperEpicMan

Member
Oct 25, 2017
1,806
Its fairly quiet here but a lot has happened surrounding Chat GPT in the last few months, I wanted to see how people here within the development field feel towards it, and if its changed anyones long term plans.

For the longest time I felt pretty secure in my field, but the rate at which things like Chat GPT are advancing, has got me seriously considering how it could impact my career.
 

grmlin

Member
Oct 25, 2017
10,276
Germany
Its fairly quiet here but a lot has happened surrounding Chat GPT in the last few months, I wanted to see how people here within the development field feel towards it, and if its changed anyones long term plans.

For the longest time I felt pretty secure in my field, but the rate at which things like Chat GPT are advancing, has got me seriously considering how it could impact my career.
Not quite the same, but GitHub Copilot has a pretty huge impact on my work. And they are just getting started.

Hopefully I already retired when machines take over
 

The Albatross

Member
Oct 25, 2017
38,956
Its fairly quiet here but a lot has happened surrounding Chat GPT in the last few months, I wanted to see how people here within the development field feel towards it, and if its changed anyones long term plans.

For the longest time I felt pretty secure in my field, but the rate at which things like Chat GPT are advancing, has got me seriously considering how it could impact my career.

It's raised my level of anxiety around the future of my usefulness, but currently I'm still kinda in the "This is actually a helpful tool for development." ChatGPT, even the old one GPT3 or whatever, provides better debugging resources than Google does, by far. I was running into a simple bug with a fetch request in JavaScript last week, basically just getting some simple CORS errors and looking for a try catch that handled it more gracefully, and affter 10-15mins of debugging on MDN and web.dev, various google results which weren't helpful, I asked ChatGPT and it provided a way more accurate example of more sophisticated error handling with the fetch API than anything that Google provided.

I had to customize it for my use case, change a few things, but by and large, it "just worked," and it was super helpful.

Another area is that we use maven as a project tool, which whatever it has it's plusses and minuses, but one minus for me is the errors are usually super not helpful on what to do, and maven is so configuration dependent it's tough to find relevant results in google for bugs/errors. Entering my errors into ChatGPT is sooooo much more productive than doing so in Google, which never gets the context right.

But yeah, the anxiety of AI replacing my role at some point is pretty high.
 

SuperEpicMan

Member
Oct 25, 2017
1,806
Not quite the same, but GitHub Copilot has a pretty huge impact on my work. And they are just getting started.

Hopefully I already retired when machines take over

I have more than 30 years till I hit retirement age 🥲

It's raised my level of anxiety around the future of my usefulness, but currently I'm still kinda in the "This is actually a helpful tool for development." ChatGPT, even the old one GPT3 or whatever, provides better debugging resources than Google does, by far. I was running into a simple bug with a fetch request in JavaScript last week, basically just getting some simple CORS errors and looking for a try catch that handled it more gracefully, and affter 10-15mins of debugging on MDN and web.dev, various google results which weren't helpful, I asked ChatGPT and it provided a way more accurate example of more sophisticated error handling with the fetch API than anything that Google provided.

I had to customize it for my use case, change a few things, but by and large, it "just worked," and it was super helpful.

Another area is that we use maven as a project tool, which whatever it has it's plusses and minuses, but one minus for me is the errors are usually super not helpful on what to do, and maven is so configuration dependent it's tough to find relevant results in google for bugs/errors. Entering my errors into ChatGPT is sooooo much more productive than doing so in Google, which never gets the context right.

But yeah, the anxiety of AI replacing my role at some point is pretty high.

It's certainly helped me trouble shoot problems quicker than Google would have.