Edit: yep - https://go.dev/ref/spec#Making_slices_maps_and_channels
1,405 karma · joined October 28, 2016
Edit: yep - https://go.dev/ref/spec#Making_slices_maps_and_channels
result := make([]unit64, 0, len(elements))
in the old func. I think that the way it is written, it will continually have to be expanded as the backing array exceeds its capacity (in the course of append() calls).And as others have pointed out, maybe use an empty struct (as opposed to a bool or empty interface) as the map value type. Also TIL about make(map[T]S, len) - didn’t know you could set len, or at least hadn’t seen it in practice, but it was suggested here and I think it would likely help as well.
Edited: I forgot to set len to 0.
Fair enough...
Something I have seen done before that I thought was good was that every so often a production database was synced, but during the sync process, things that could identify a customer were redacted or obfuscated. Then almost anyone who had need to work with production data would use the munged version.
- https://en.wikipedia.org/wiki/Foxconn#Controversies
- https://en.wikipedia.org/wiki/Hyundai_Motor_Manufacturing_Al...
etc.
<?php
if (! $isProd) {
showMixedFruit();
}
Also, the code should not be allowed to run on a prod instance, even if it is triggered there.But, I'm sure you've figured this all out by now.
>
> If you are employed at MariaDB, you absolutely need to be scheduling interviews with other companies.
In my own life, I have spent decades plagued by the feeling that I wasn’t doing enough, and I had many varied areas of focus and felt like I didn’t really progress on anything. That in itself (the feeling of lack of progress) was I think kind of misleading, as I did progress on some things (though I clearly regressed on some things as well).
I don’t really know how it happened but I have made some significant shifts in my life. I started to become physically active again, I stopped smoking cigarettes and some other unhealthy habits, I started really developing and digging into some of my active and creative passions like writing, playing a musical instrument, and renewing my focus on coding to an end and with purpose and quality in mind.
Somehow I started finding that I had much more energy and time available for everything. And as opportunities arose I began to seize them. It was a very exciting period for me. Eventually, my plate really became too full, and things began to suffer (mostly me) and I started to say no to things, and continue to keep my focus on what I really think is important. I feel that it has taught me about the interconnected nature of my life, and about how to value my time, how to slow down and appreciate something, how to deal with my emotions head on instead of taking years or decades to process events in my life (I am sure there have and will be many exceptions to what I have said), how to actively take stock of my current situation and change my plans as needed, how to deal with the fact that my expectations for things very rarely match up with reality, how to stop being an intellectual purist and idealist while still deeply valuing a good idea and pursuing my ideals. I look back at how much I have accomplished the last year and I can’t help thinking everything came from stopping trying to do everything and accomplishing nothing (or so it felt), and by embracing what really mattered to me when it was in front of me. I learned to float down the river, I guess. Lazily most of the time. But when I feel it is necessary, I can exert more power in changing my trajectory than ever I could before.
i have been pretty reluctant to take photographs in general. i do enjoy a nice photo for sure, and i have taken a few that i actually like too.
> [I]f you have a camera on you, that's good enough, and you have the basic understanding of photography, you can capture an event that would otherwise be lost to time.
i like this thought. and i will perhaps try to take more photos.
Unrelated, but despite not programming in C or C++ in several years, I have always enjoyed reading PVS Studio blog posts as I come across them. It is fun to think about static/dynamic analysis (I actually am not sure where the line is) and language design.
Some things bother me about this article and the facts that warranted it in the first place. I have very similar reservations with regard to the Bing chatbot launch (detailed below - just substitute Bing for Bard).
> Google has a lot riding on this launch. Microsoft partnered with OpenAI to make an aggressive play for Google’s top spot in search. Meanwhile, Google blundered straight out of the gate when it first tried to respond. In a teaser clip for Bard that the company put out in February, the chatbot was shown making a factual error. Google’s value fell by $100 billion overnight.
1. LaMDA is not a new project. They are clearly releasing a chatbot based on it to the public to compete with MS/OpenAI. But if the tech existed some time ago (and as a developer I realize that iteration and time and attention tends to improve quality), why didn't they release it before? I am guessing - baselessly - that they saw that the quality of the output was quite poor (often factually wrong, for instance). But now that a competitor is threatening their market share, quality metrics goes out the window - revenue is once again king.
2. Funny how the valuation of the company dropped so quickly. It is because as shareholders we rely so much on short term gain. There is no focus on follow-through or long-term consequences. I certainly don't believe that capitalism is inherently bad and I am a huge fan of competition. But I think the way we practice it leaves many practical things to be desired.
> “We’ll get user feedback, and we will ramp it up over time based on that feedback,” says Google’s vice president of research, Zoubin Ghahramani. “We are mindful of all the things that can go wrong with large language models.”
>
> But Margaret Mitchell, chief ethics scientist at AI startup Hugging Face and former co-lead of Google’s AI ethics team, is skeptical of this framing. Google has been working on LaMDA for years, she says, and she thinks pitching Bard as an experiment “is a PR trick that larger companies use to reach millions of customers while also removing themselves from accountability if anything goes wrong.”
3. This quote, and the mention in the article of the "Google It" button below the Bard chat, the three versions of Bard's response ("drafts", FTA), the quote by the Google product director that says "There’s the sense of authoritativeness when you only see one example”... I could not agree more with what Margaret Mitchell has to say (I have never heard of her before, to my knowledge). Isn't it very clear by now that users don't have the time or attention to acknowledge implications? We are busy and we don't have the energy. If we see it on a screen, we take it as fact, copy and paste it as needed, and proceed with the knowledge that we have gleaned from said "facts". I suspect that if anybody really knows how misinformation works and the effects it has on society, it's data analysts at Google search. But the almighty revenue stream dictates that they push this not-necessarily-factual-information-producing-tool anyway.
If I can find the time, I'm quite curious to read that article that just pre-dates Bing chat and Bard about the dangers of using LLMs in search engines.
But I must confess,
> Systemd also restarts the app daily to make sure it works properly long term
leaves me with a viscerally negative feeling. I feel like daemons should be able to run for years unless there is some kind of leak. Maybe I am wrong.
Also the "2019" section made me lol:
> I started working for wolfSSL, doing curl full-time. It just took 21 years to make curl my job.
Finally: thank you to Daniel Stenberg, Rafael Sagula, and the many, many contributors for making this tool.
> (That's life)
> And as funny as it may seem
> Some people get their kicks
> Stomping on a dream
> But I don't let it, let it get me down
> Cause this fine old world, it keeps spinnin' around
- That’s Life
By Dean Kay and Kelly Gordon. Most famously recorded by Frank Sinatra.
I don't know much about Lua or mruby but I understand they may fill such needs too.
Also fun to note that John Backus was at IBM. I have some vague memories of BNF. I imagine that AT&T Bell Labs and IBM and Xerox were amazing places to work at one time. I do hope that things are generally trending for the better, in that ideas can be exchanged digitally, and that things are de facto more inclusive today, but I bet it would have been a heady thing to have a lounge filled with people like at those offices and then go back to your own office and noodle away on ideas that had been discussed.
> Rexx (Restructured Extended Executor) is a programming language that can be interpreted or compiled. It was developed at IBM by Mike Cowlishaw.[2][3] It is a structured, high-level programming language designed for ease of learning and reading. Proprietary and open source Rexx interpreters exist for a wide range of computing platforms; compilers exist for IBM mainframe computers.[4]
>
> Rexx is a full language that can be used as a scripting, macro language, and application development language. It is often used for processing data and text and generating reports; these similarities with Perl mean that Rexx works well in Common Gateway Interface (CGI) programming and it is indeed used for this purpose. Rexx is the primary scripting language in some operating systems, e.g. OS/2, MVS, VM, AmigaOS, and is also used as an internal macro language in some other software, such as SPF/PC, KEDIT, THE and the ZOC terminal emulator. Additionally, the Rexx language can be used for scripting and macros in any program that uses Windows Scripting Host ActiveX scripting engines languages (e.g. VBScript and JScript) if one of the Rexx engines is installed.
The page goes on to discuss ARexx (the Amiga port) and Compound variables, which can be used as arrays (both of these things have been mentioned here by other commenters).
Something I've been wondering about lately is how much language developers get to code in their actual language. Perhaps if things get really really far along, the language interpreter/compiler/runtime/whatever becomes self-hosting. But I suspect many languages never actually get that far. I was just thinking about the fact that maybe most language developers today still code in C (I have no idea if this is actually true). Perhaps in the future they will code in Rust or Go.
He does briefly speak to part of this point:
> I don't think I'd change anything in them except to emphasise more that a programming language is a Human-Computer-Interface and the language designer should design for the users of the language, not just for himself or herself.
--
I personally have never used Rexx. But I remember many years ago I made an attempt to sign up for an OS/2 Warp beta and being shocked when I actually got picked. I recall installing it and the OS contained what was the first instance I had seen of some sort of voice control for computers. Even at the time my IBM PS/2 (a 386sx running at 20MHz) was at the low end of the requirements for OS/2 Warp and the system didn't perform very well at all. But I have a memory of speaking something like "Computer: Go to sleep!" and my brother laughing at me and repeating it from time-to-time after that, long after I'd uninstalled OS/2 and went back to Windows 3.11 or DOS or whatever I was running in those days.
I had a few notes:
1. It is really nice to have such thorough documentation. Even if a programmer doesn’t always have or make the time to read it.
2. I _think_ I remember reading an interview with Peter Norvig in Coders at Work where he talks about programmers never having the time to fully grok their API docs (it may well have been a more general statement about rushing to get stuff done).
Some time ago I personally learned a virtualization discovery API whereby one could make some calls and learn, through some sort of traversal, how a topology of VMs was laid out. My title at the time was Intermediate Software Developer. I remember I was pretty happy with my solution and shared during standup that it was working well but was kind of slow, and that there was another, more complicated and finicky type of traversal mentioned in the docs, and that my reading of the docs was that learning and coding this other method was necessary or helpful is some use cases but that for our situation it would not make a difference and would just add complexity. Well within a couple of weeks another team member - Junior Software Developer - read the same docs and tried out the more finicky version and wouldn’t you know, the discovery process suddenly became blazing fast.
I would say that for the most part I am a printf-style debugger. I remember reading some years ago (on HN, I believe) about time travel debugging in - I believe - C# and I was really impressed but I don’t code in C# so it soon left my mind.
I have a deep appreciation for mastering one’s toolset. I can’t think of the number of times that I learned something new about a tool (language, editor, shell, browser, whatever) that I use daily that changes my workflow - it has happened so many times. And as with all things code, sometimes new features are added.
I am going to try to make a point to re-read this article later and to visit each link and glean what I can.
I mostly code in Go. I wonder, does anybody know how much of this stuff might be supported there?
> Plankalkül (German pronunciation: [ˈplaːnkalkyːl]) is a programming language designed for engineering purposes by Konrad Zuse between 1942 and 1945. It was the first high-level programming language to be designed for a computer.
Apparently it influenced ALGOL 58 as well. Implementations were made:
> Plankalkül was more comprehensively published [vague] in 1972. The first compiler was implemented by Joachim Hohmann in his 1975 dissertation. Other independent implementations followed in 1998 and 2000 at the Free University of Berlin.
Here is something about primitive data types:
> The only primitive data type in the Plankalkül is a single bit or boolean (German: Ja-Nein-Werte – yes-no value in Zuses terminology). It is denoted by the identifier S 0 {\displaystyle S0} {\displaystyle S0}. All the further data types are composite, and build up from primitive by means of "arrays" and "records".
Cool.
Also this reminded me - nothing happens in a vacuum:
> In 1945, Zuse described Plankalkül in an unpublished book. The collapse of Nazi Germany, however, prevented him from submitting his manuscript.
I don’t know what the significance of that statement is and I won’t baselessly speculate, but it sure makes me curious. It also reminds me of some messages I remember seeing from Russian founders in the recent past.
But I’m thinking of:
1. How badly secured many real-world APIs are and how many API keys are out there to be scraped
2. Some APIs offer truly destructive or otherwise irreversible actions.
Suppose for one second there was a poorly secured API to control medication dosages. Or to deliver a lethal injection to a death row prison inmate. Or to detonate a building scheduled for demolition. Or, …
1. I found some "active" shit I legitimately enjoyed doing: playing music, writing, walking, iyengar yoga
2. I walk a lot
3. I do yoga intensely once a week
4. I keep a journal
5. I learned how to manage my emotions from a powerful book called "The Anger Management Workbook for Men" by Aaron Karmin, and embracing it changed my life and enriched it in ways I absolutely never could have predicted
6. I have found a couple of communities that I am a part of
None of this stuff happened overnight, but the shift into the right direction started occurring a lot more quickly than I expected, and the not feeling like complete shit all the time, the extremely poor and sometimes very destructive coping mechanisms, they are a work in progress, but I am so much closer to my ideals than I could have expected in such a short time.
If I had to pick one to recommend, it would easily be the Karmin book. Best investment I've ever made.