Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
M

Marc Clifton

@Marc Clifton
About
Posts
28.9k
Topics
2.5k
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Switchboard operators...
    M Marc Clifton

    Yeah, people are often change resistant until it becomes a matter of life or death for them or their children. And even then... :(

    Latest Articles:
    A Lightweight Thread Safe In-Memory Keyed Generic Cache Collection Service A Dynamic Where Implementation for Entity Framework

    The Lounge question career

  • Switchboard operators...
    M Marc Clifton

    What I see happening in my fuzzy crystal ball is that we're heading towards Basic Income or something similar. Depending on how that works out, we'll either see masses of people becoming addicted to both legal and illegal drugs, or a bizarre cultural revolution where people simply start doing what they really want (or can, with limited resources) do because at least they have a small room, food, and basic medical care. Or something in-between both of those extremes. Somewhere though, education, particularly higher education, also needs to become "free" because people in these service industries can't afford education. Heck, even middle-class people can't afford education.

    Latest Articles:
    A Lightweight Thread Safe In-Memory Keyed Generic Cache Collection Service A Dynamic Where Implementation for Entity Framework

    The Lounge question career

  • Switchboard operators...
    M Marc Clifton

    Technological advances always displace people's jobs and in theory creates new jobs, though not as many and often requiring significant retraining / new skills. I tend to be less concerned with AI per se and more concerned with the robotization of lots of things (which, yes, AI plays a part in of course) and the droves of people that will be replaced, a significant number being in service industries. We're not looking at / planning for the social shifts that will result.

    Latest Articles:
    A Lightweight Thread Safe In-Memory Keyed Generic Cache Collection Service A Dynamic Where Implementation for Entity Framework

    The Lounge question career

  • Where can we all meet up when CP disappears
    M Marc Clifton

    If CP disappears at some point, I'm am hoping that it will be after I've disappeared. ;) Though I agree, it would be nice to hear from the new leadership as to the future of CP.

    Latest Articles:
    A Lightweight Thread Safe In-Memory Keyed Generic Cache Collection Service A Dynamic Where Implementation for Entity Framework

    The Lounge workspace

  • If CodeProject Never Existed, Where Would You Have Gone?
    M Marc Clifton

    I've been a member for 22 years. First found CP while searching for something C or C++ related, while living in North Guilford CT, using a 64KB IDSN connection. Gads that was slow. Where would I have gone? For posting articles, nowhere at the time. Eventually I would have started posting articles on a blog or a website, both of which I eventually created, but I've pretty much posted all my articles here. As to finding a community like CP? I think what CP has provided over the years is irreplaceable. There is nothing that compares, at least that I've found. Same with finding valuable resources. My code over the years is liberally sprinkled with comments like "see Code Project article here:"

    Latest Articles:
    A Lightweight Thread Safe In-Memory Keyed Generic Cache Collection Service A Dynamic Where Implementation for Entity Framework

    The Lounge com question

  • Begun Backing Up My CP Articles
    M Marc Clifton

    Given I have 260 articles and 8 tips/tricks, that's quite a chore. Almost worth hiring someone.

    Latest Articles:
    A Lightweight Thread Safe In-Memory Keyed Generic Cache Collection Service A Dynamic Where Implementation for Entity Framework

    The Lounge html question

  • The world's main source of high-purity quartz needed for semiconductors could be disrupted
    M Marc Clifton

    Synthetic quartz can also be "grown."

    Latest Articles:
    A Lightweight Thread Safe In-Memory Keyed Generic Cache Collection Service A Dynamic Where Implementation for Entity Framework

    The Lounge

  • IT history
    M Marc Clifton

    Pascal, BASIC, Fortran, COBOL, and I would even go out on a limb and say assembly.

    Latest Articles:
    A Lightweight Thread Safe In-Memory Keyed Generic Cache Collection Service A Dynamic Where Implementation for Entity Framework

    The Lounge question

  • I love Tuples
    M Marc Clifton

    GKP1992 wrote:

    Create a nested tuple and now you don't know which element you are referring to when you say Item2

    Tuple "items" can be named, so: var name = GetMyName(); where:

    (string firstName, string lastName) GetMyName()
    {
    return ("Marc", "Clifton");
    }

    I can use name.firstName and name.lastName Most of the time. ;)

    Latest Articles:
    A Lightweight Thread Safe In-Memory Keyed Generic Cache Collection Service A Dynamic Where Implementation for Entity Framework

    The Lounge csharp

  • I love Tuples
    M Marc Clifton

    Yes, tuples are great, especially as a replacement for out string foo and I use them primarily for returning multiple things for rather low level methods when out or a C# class/struct is just overkill. The fact that the tuple parameters can be named was a huge advancement, rather than having to use Item1, Item2, etc. That said, I use them judiciously and always ask myself, if I'm using a tuple here, is that the right approach or am I compensating for a possibly bad "design." For example (this from code I have in a library):

        public (HttpStatusCode status, string content) Get(string url, Dictionary headers = null)
        {
            var client = RestClientFactory();
            var request = new RestRequest(url, Method.Get);
    
            headers?.ForEach(kvp => request.AddHeader(kvp.Key, kvp.Value));
            RestResponse response = client.Execute(request);
    
            return (response.StatusCode, response.Content);
        }
    

    Why am I parsing out the status code and content instead of just returning the response object? One answer is that returning response may probably require a using RestSharp and even a reference to the RestSharp package in the caller project. OK, maybe that's a defensible argument, maybe not. After using this library of mine (REST is just one small part of this library) I'm not that thrilled with my initial wrapper implementation. But because I started this "pattern", it continues, like:

        public (T item, HttpStatusCode status, string content) Get(string url, Dictionary headers = null) where T : new()
        {
            var client = RestClientFactory();
            var request = new RestRequest(url, Method.Get);
    
            headers?.ForEach(kvp => request.AddHeader(kvp.Key, kvp.Value));
            RestResponse response = client.Execute(request);
            T ret = TryDeserialize(response);
    
            return (ret, response.StatusCode, response.Content);
        }
    

    And this illustrates mashing together various potentially bad implementation/designs. The tuple now returns three things, and the TryDeserialize catches exceptions silently, returning a null for T item, and what if I want the actual deserialization exception? And now that I look at that code again after a couple years, what's with that AddHeader loop when there's a perfectly

    The Lounge csharp

  • You wanna talk about meta?
    M Marc Clifton

    From wikipedia: CPU @ 500 kHz Memory 2K (2048) 35-bit words (i.e., 83⁄4 kilobytes) (ultrasonic delay-line memory based on tanks of mercury) Good lord! And that was probably state of the art at the time.

    Latest Articles:
    A Lightweight Thread Safe In-Memory Keyed Generic Cache Collection Service A Dynamic Where Implementation for Entity Framework

    The Lounge linux testing beta-testing question lounge

  • Damnit, did I miss the leaving-do?
    M Marc Clifton

    @chris-maunder Code Project changed my life in major ways. Very few things, besides the birth of a child, have done that in my life. So thank you and the team for incarnating Code Project and my best wishes to your family and finding wellness and balance. I hope everything is OK.

    Latest Articles:
    A Lightweight Thread Safe In-Memory Keyed Generic Cache Collection Service A Dynamic Where Implementation for Entity Framework

    The Lounge announcement com collaboration json question

  • Oh, this should be popular!
    M Marc Clifton

    It's about time, IMHO.

    Latest Articles:
    A Lightweight Thread Safe In-Memory Keyed Generic Cache Collection Service A Dynamic Where Implementation for Entity Framework

    The Lounge lounge csharp com announcement

  • (brain dead) How do you call text files with data stored with fixed width/length ?
    M Marc Clifton

    Oh look, I'm using an archaic fixed length COBOL-style file format! How's that for the name? ;)

    Latest Articles:
    A Lightweight Thread Safe In-Memory Keyed Generic Cache Collection Service A Dynamic Where Implementation for Entity Framework

    The Lounge devops tutorial question

  • what is the fascination with Python ? ( CAUTION semi-programming rant )
    M Marc Clifton

    trønderen wrote:

    you could just type and run, no waiting for compilation.

    Yup. Type. Run. And if you by happenchance execute the new code you just typed, discover the syntax errors at runtime instead of compile-time! :laugh:

    Latest Articles:
    A Lightweight Thread Safe In-Memory Keyed Generic Cache Collection Service A Dynamic Where Implementation for Entity Framework

    The Lounge question python linux announcement

  • The Software Industry
    M Marc Clifton

    Vivi Chellappa wrote:

    What makes software different from common household goods such as TV, automobiles, etc?

    Nothing, the rest of those industries just hasn't caught up yet. If you read about about The Great Reset, or whatever it's called, one of the key components is that nobody owns anything -- they rent stuff. :omg: "You'll own nothing and you'll be happy" - World Economic Forum, 2016.[^]

    Latest Articles:
    A Lightweight Thread Safe In-Memory Keyed Generic Cache Collection Service A Dynamic Where Implementation for Entity Framework

    The Lounge sales java oracle question

  • Your Code Editor Themes
    M Marc Clifton

    I don't waste my time on theming. ;)

    Latest Articles:
    A Lightweight Thread Safe In-Memory Keyed Generic Cache Collection Service A Dynamic Where Implementation for Entity Framework

    The Lounge javascript question csharp html com

  • Scientists find ‘tunnel’ on the Moon
    M Marc Clifton

    The Formics are coming! (Sorry, just watched Ender's Game again -- the book is of course better, but it's always a pleasure to watch Harrison Ford.)

    Latest Articles:
    A Lightweight Thread Safe In-Memory Keyed Generic Cache Collection Service A Dynamic Where Implementation for Entity Framework

    The Insider News html

  • Devs say many of their hours are wasted, disagree with managers on how to fix the issue
    M Marc Clifton

    Quote:

    Another issue is interruptions causing lack of time for deep work, reported by 27 percent.

    I read that first as:

    Quote:

    Another issue is interruptions causing lack of time for sleeping at work, reported by 27 percent.

    Truly, I did read it that way first, was scanning the article rather too quickly. :laugh:

    Latest Articles:
    A Lightweight Thread Safe In-Memory Keyed Generic Cache Collection Service A Dynamic Where Implementation for Entity Framework

    The Insider News help com collaboration tools tutorial

  • A new spacesuit design can recycle astronauts’ urine into purified, drinkable water
    M Marc Clifton

    In the not-so-distant future, we may all be doing that, whether we're in orbit or down "in the well."

    Latest Articles:
    A Lightweight Thread Safe In-Memory Keyed Generic Cache Collection Service A Dynamic Where Implementation for Entity Framework

    The Insider News html com design
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups