#Python coding efficiency
Explore tagged Tumblr posts
Text
Day-5: Mastering Python Loops
Python Boot Camp-2023: Day-5
Python Loop: A Powerful Tool for Iterative Tasks Python, one of the most popular programming languages, offers a wide range of features and functionalities. Among these, loops stand out as a powerful tool for performing repetitive tasks. In this article, we’ll explore Python loops, their types, usage, and best practices to optimize your code. 1. Introduction to Python Loops Loops are essential…

View On WordPress
#Iterative tasks in Python#List comprehensions in PythonPython loop best practices#Python coding efficiency#Python database interactions#Python for loop#Python loop examples#Python loop optimization#Python loop performance#Python loop syntax#Python loop tutorial#Python loops#Python nested loops#Python programming tips#Python while loop
0 notes
Text
i saw this post and decided that i had some time spare, i could give AI another go. (link to post https://www.tumblr.com/dibelonious/778852078032404480/now-that-ai-made-troubleshooting-ridiculously. dont harass the poor old sod obviously.)
i hear a lot of people irl at uni and some online say ai is great for coding, and so every couple months i try it out. sometimes with a very small project in a popular language (python or c, usually. though im forgiveful with c as everyone fucks up c.), sometimes with something simple (i.e. a couple lines tops with a naive approach if written idiomatically) but in a more unusual language with full documentation online. (like sed! yay!)
but every single time i come to the conclusion that even with being handheld chatgpt could not do what it was asked to do. even if someone tells it every issue in its outputs, itll remember for only one prompt. even if someone tells it the solution, itll find a new way to fuck it up.
below the cut is me trying to get chatgpt to make a working sed script that prints "meowwwwwwwwwwwwwwwww..." (long post warning)
(if anything reads weirdly, this was originally a reblog to the screenshotted post, then i decided to make it its own post. so that may be why.)
i cant remember the last time i ran into an issue that i couldnt fix in like ... 5 minutes. but knowing what chatgpt is like, any ask i give it will give me issues to troubleshoot. (yes this example is code, not linux proper. but its more of the same doing that.)
the other day i decided to write "meowwwwwwwwwwwwwwwwwwwwwwwwwwwww....." in many different languages, after seeing @brainfuck-official do it in BF. (link to post https://www.tumblr.com/brainfuck-official/773510105608192000) as is my blog, i asked it to do this in sed.
great! this script doesnt work! it doesnt even come *close* to working, giving me plenty to try out chatgpt's troubleshooting skills! it also just doesnt make much sense. why the shebang but not making it executable? and why are the flags different (ones -f, ones -nf). also a counter? why though? thats not what im asking for? (you can see tags for a brief explanation on how to add a counter)
after telling it the script doesnt work (and why, something someone troubleshooting likely wont know) it just adds in a P. a command that prints a damn newline. but it lies about it printing a newline.
(if you dont believe it prints a trailing newline and believe the AI instead, just try echo -n foo | sed -n 'P ; P')
anyways it alternated between no print statements and printing with newlines for the next ... 8 prompts, by which time i felt sorry for the poor bugger and told it to use e to print without a newline.
all the while it was trying to be more useful and add a count - making it print my string after n repeats instead of the infinite that i asked for. it was trying to subtract 1 with effectively s/[0-9]+/&-1/ which just appends the string "-1" to a number!
anyways, i tell it to use "the e command". there are three different versions of the e command in sed, and only one of them makes sense here. which did chatgpt use? none! it used the e regex modifier! which executes your pattern hold, then turns the output into the new pattern hold. and does not print anything.
ill just screenshot the last couple interactions minus only the useless exposition it adds to every response so you can see how stupid it is
ignoring sed's requirement for an input this is equivalent to the python
to be fair i never said there shouldnt be infinite meows, and this does have infinite Ws. but come the fuck on. this is clearly not whats being asked for.
#linux is best - yes. but learn to troubleshoot properly.#blindly copying code online without understanding it isnt troubleshooting.#regardless if that code came from stackoverflow or chatgpt.#anyways maybe it wouldve been better to write the equivalent in C with gotos and labels?#but at least everyone knows python#and i dont need to write c this way#also decided to see if it could find any info about me if i give it my name and county of origin#which is identifiable information but its outdated as ive changed my name (trans :3) and moved away.#anyways it thought i was from l*nd*n.#i told it where i was from (West Country. Very Much Not london.) and it thought i was a londoner. what in the hell.#yes if i said the name of most counties to an american online theyd probably think its in london.#but thats before they google the damn place! and this bot has access to the whole internet!#(for the yanks: it did the equivalent of calling an appalachian a californian)#(or at least i think thats close enough. im not really all that sure about what happens over the pond. and i like my ignorance here.)#wait the documentation tells you how to make a counter. at least twice.#IT COULD COPY CODE FROM THE INFO PAGES FOR THE COUNTER AND IT STILL GOT IT WRONG EVEN AFTER BEING TOLD WHY ITS WRONG#oh my god.#anyways in the docs they wanted to print the number. you can just hold n chars and remove one each loop#then break the loop when your hold is empty.#thats the easiest way ive found of looping n times (if you need the hold do this on a prepended line)#(not efficient but you can make it more efficient if you want. the docs explain how to! but its more effort and easy to fuck up soooooo...)#printing n ws though? just use e printf like it bloody demonstrates itself#no need to do inefficient shit in sed when someones written it in c for you.
0 notes
Link
Python Assignment Operators: Streamlining Variable Manipulation
The article delves into the concept of assignment operators in Python, shedding light on how they empower developers to efficiently assign values to variables. Beyond introducing the basic assignment operator (=), the article explores a range of compound assignment operators that combine arithmetic operations with assignments, resulting in more concise and readable code.
The article provides clear explanations of each compound assignment operator, along with illustrative examples for a comprehensive understanding. By showcasing how these operators work with numbers, strings, and lists, the article equips programmers with the knowledge to optimize their code while enhancing code readability.
In essence, this article serves as a valuable resource for both beginners and experienced Python programmers, offering insights into efficient variable manipulation and highlighting the benefits of adopting compound assignment operators.
0 notes
Text
I’m curious how binary cant work for admech since day 1. At first, I thought it’s just high speed alternation in frequencies of sounds to denote 0 and 1, just like how computer cable does with voltage. So I wrote a python script to convert natural language to binary code then to sound based on the idea (so that I can curse in binary in ttrpg). However, since the human auditory cortex can only distinguish sound about 20ms apart, the current commonly used binary coding method (Unicode) that requires 8 bits to encode for one letter (16 bits for one character in Mandarin) would make binary cant less efficient than natural language through the bare ear. As a result, binary cant users not only need vocal implants but also auditory implants to receive info (or perhaps cortex implants to decode). Based on these assumptions, binary cant would be able to happen in sound frequencies not perceivable by the original human cochlea so techpriests conversation can be extremely quiet. And more efficiently, just through data cables.
Or it could be the other way around, scientists might develop more efficient binary language without basing it on the symbol system of natural languages (I’m not that familiar with linguistics so I don’t know if this is possible or not).
However, the sound techpriests made in the game mechanicus doesn’t sound like my assumption. There are definitely more than 2 pitches used in the conversations (which makes it less binary...) and they seem to be faster than natural language. I still couldn’t figure out what’s happening here. Do the twisting pitches actually encode more than one bit? Is binary cant actually an analog signal encoding a digital signal? Or is the sound effect just mean to sound better for the game?
The binary curse program (turn the sound on!):
#warhammer 40k#adeptus mechanicus#binary cant#question#I should think about my BDNF & depression paper now but#each time I have a paper due I start to think about every irrelevant thing
2K notes
·
View notes
Text
Development Update - December 2024
Happy New Year, everyone! We're so excited to be able to start off 2025 with our biggest news yet: we have a planned closed beta launch window of Q1 2026 for Mythaura!
Read on for a recap of 2024, more information about our closed beta period, Ryu expressions, January astrology, and Ko-fi Winter Quarter reward concepts!
2024 Year in Review
Creative
This year, the creative team worked on adding new features, introducing imaginative designs, and refining lore/worldbuilding to enrich the overall experience.
New Beasts and Expressions: All 9 beast expression bases completed for both young and adult with finalized specials for Dragons, Unicorns, Griffins, Hippogriffs, and Ryu.
Mutations, Supers and Specials: Introduced the Celestial mutation as well as new Specials Banding & Merle, and the Super Prismatic.
New Artist: Welcomed Sourdeer to the creative team.
Collaboration and Sponsorship: Sponsored several new companions from our Ko-Fi sponsors—Amaru, Inkminks, Somnowl, Torchlight Python, Belligerent Capygora, and the Fruit-Footeded Gecko.
New Colors: Revealed two eye-catching colors, Canyon (a contest winner) and Porphyry (a surprise bonus), giving players even more variety for their Beasts.
Classes and Gear: Unveiled distinct classes, each with its own themed equipment and companions, to provide deeper roleplay and strategic depth.
Items and Worldbuilding: Created a range of new items—from soulshift coins to potions, rations, and over a dozen fishable species—enriching Mythaura’s economy and interactions.
Star Signs & Astrology: Continued to elaborate on the zodiac-like system, connecting each Beast’s fate to celestial alignments.
Questing & Story Outline: Laid the groundwork for the intro quest pipeline and overarching narrative, ensuring that players’ journey unfolds with purposeful progression.
Code
This year, the development team worked diligently on refining and expanding the codebase to support new features, enhance performance, and improve gameplay experiences. A total 429,000 lines of code changed across both the backend and frontend, reflecting:
New Features: Implementation of systems like skill trees, inventory management, community forums, elite enemies, npc & quest systems, and advanced customization options for Beasts.
Optimizations and Refactoring: Significant cleanup and streamlining of backend systems, such as game state management, passive effects, damage algorithms, and map data structures, ensuring better performance and maintainability.
Map Builder: a tool that allows us to build bespoke maps
Regular updates to ensure compatibility with modern tools and frameworks.
It’s worth noting that line changes alone don’t capture the complexity of programming work. For example:
A single line of efficient code can replace multiple lines of legacy logic.
Optimizing backend systems often involves removing redundant or outdated code without adding new functionality.
Things like added dependencies can add many lines of code without adding much bespoke functionality.

Mythaura Closed Beta

We are so beyond excited to share this information with you here first: Mythaura closed beta is targeted for Q1 2026!
On behalf of the whole team, thank you all so, so much for all of the support for Mythaura over the years. Whether you’ve been around since the Patreon days or joined us after Koa and Sark took over…it’s your support that has gotten this project to where it is. We are so grateful for the faith and trust placed in us, and the opportunity to create something we hope people will truly love and enjoy. This has truly been a collaborative effort with you and we are constantly humbled by all of the thoughtful insights, engaging discussions, and great ideas to come out of this amazing community of supporters.
So: thank you again, it’s been an emotional and amazing journey for the dev team and we’re delighted to join you on your journeys through Mythaura.
Miyazaki Full-Time
Hey everyone, Koa here!
We’re thrilled to share some news about Mythaura’s development! Starting in 2025, Miya will be officially dedicating herself full-time to Mythaura. Her focus will be on bringing even more depth and wonder to the world of Mythaura through content creation, worldbuilding, and building up the brand. It’s a huge step forward, and we’re so excited for the impact her passion and creativity will have on the project!
In addition, I’ve secured 4-day weeks and will be working full-time each Friday to dive deeper into development. This extra push is going to allow us to keep moving steadily forward on both the art and code fronts, and with Miya’s expanded role, the next year of development is looking really promising.
Thank you all for being here and supporting Mythaura every step of the way. We can’t wait to share more as things progress!
Closed Beta FAQ
In the interest of keeping all of the information about our Closed Beta in one place and update as needed, we have added as much information as possible to the FAQ page.
If you have any questions that you can think of, please feel free to reach out to us through our contact form or on Discord!

Winter Quarter (2025) Concepts


It’s the first day of Winter Quarter 2025, which means we’ve got new Quarterly Rewards for Sponsors to vote on on our Ko-fi page!
Which concepts would you like to see made into official site items? Sponsors of Bronze level or higher have a vote in deciding. Please check out the Companion post and the Glamour post on Ko-fi to cast your vote for the winning concepts!
Votes must be posted by January 29, 2025 at 11:59pm PDT in order to be considered.
All Fall 2024 Rewards are now listed in our Ko-fi Shop for individual purchase for all Sponsor levels at $5 USD flat rate per unit. As a reminder, please remember that no more than 3 units of any given item can be purchased. If you purchase more than 3 units of any given item, your entire purchase will be refunded and you will need to place your order again, this time with no more than 3 units of any given item.
Fall 2024 Glamour: Diaphonized Ryu
Fall 2024 Companion: Inhabited Skull
Fall 2024 Solid Gold Glamour: Hippogriff (Young)
NOTE: As covered in the FAQ, the Ko-fi shop will be closing at the end of the year. These will be the last Winter Quarter rewards for Mythaura!

New Super: Zebra

We've added our first new Super to the site since last year's Prismatic: Zebra, which has a chance to occur when parents have the Wildebeest and Banding Specials!
Zebra is now live in our Beast Creator--we're excited to see what you all create with it!

New Expressions: Ryu

The Water-element Ryu has had expressions completed for both the adult and young models. Expressions have been a huge, time-intensive project for the art team to undertake, but the result is always worth it!

Mythauran Astrology: January

The month of January is referred to as Hearth's Embrace, representing the fireplaces kept lit for the entirety of the coldest month of the year. This month is also associated with the constellation of the Glassblower and the carnelian stone.

Mythaura v0.35
Refactored "Beast Parties" into "User Parties," allowing non-beast entities like NPCs to be added to your party. NPCs added to your party will follow you in the overworld, cannot be made your leader, and will make their own decisions in combat.
Checkpoint floor functionality ironed out, allowing pre-built maps to appear at specific floor intervals.
The ability to set spawn and end coordinates in the map builder was added to allow staff to build checkpoint floors.
Various cleanups and refactors to improve performance and reduce the number of queries needed to run certain operations.
Added location events, which power interactable objects in the overworld, such as a lootable chest or a pickable bush.

Thank You!
Thanks for sticking through to the end of the post, we always look forward to sharing our month's work with all of you--thank you for taking the time to read. We'll see you around the Discord.
#mythaura#indie game#indie game dev#game dev#dev update#unicorn#dragon#griffin#peryton#ryu#basilisk#quetzal#hippogriff#kirin#petsite#pet site#virtual pet site#closed beta launch#flight rising#neopets
93 notes
·
View notes
Text
Rambling About C# Being Alright
I think C# is an alright language. This is one of the highest distinctions I can give to a language.
Warning: This post is verbose and rambly and probably only good at telling you why someone might like C# and not much else.
~~~
There's something I hate about every other language. Worst, there's things I hate about other languages that I know will never get better. Even worse, some of those things ALSO feel like unforced errors.
With C# there's a few things I dislike or that are missing. C#'s feature set does not obviously excel at anything, but it avoids making any huge misstep in things I care about. Nothing in C# makes me feel like the language designer has personally harmed me.
C# is a very tolerable language.
C# is multi-paradigm.
C# is the Full Middle Malcomist language.
C# will try to not hurt you.
A good way to describe C# is "what if Java sucked less". This, of course, already sounds unappealing to many, but that's alright. I'm not trying to gas it up too much here.
C# has sins, but let's try to put them into some context here and perhaps the reason why I'm posting will become more obvious:
C# didn't try to avoid generics and then implement them in a way that is very limiting (cough Go).
C# doesn't hamstring your ability to have statement lambdas because the language designer dislikes them and also because the language designer decided to have semantic whitespace making statement lambdas harder to deal with (cough Python).
C# doesn't require you to explicitly wrap value types into reference types so you can put value types into collections (cough Java).
C# doesn't ruin your ability to interact with memory efficiently because it forbids you from creating custom value types, ergo everything goes to the heap (cough cough Java, Minecraft).
C# doesn't have insane implicit type coercions that have become the subject of language design comedy (cough JavaScript).
C# doesn't keep privacy accessors as a suggestion and has the developers pinkie swear about it instead of actually enforcing it (cough cough Python).
Plainly put, a lot of the time I find C# to be alright by process of elimination. I'm not trying to shit on your favorite language. Everyone has different things they find tolerable. I have the Buddha nature so I wish for all things to find their tolerable language.
I do also think that C# is notable for being a mainstream language (aka not Haskell) that has a smaller amount of egregious mistakes, quirks and Faustian bargains.
The Typerrrrr
C# is statically typed, but the typing is largely effortless to navigate unlike something like Rust, and the GC gives a greater degree of safety than something like C++.
Of course, the typing being easy to work it also makes it less safe than Rust. But this is an appropriate trade-off for certain kinds of applications, especially considering that C# is memory safe by virtue of running on a VM. Don't come at me, I'm a Rust respecter!!
You know how some people talk about Python being amazing for prototyping? That's how I feel about C#. No matter how much time I would dedicate to Python, C# would still be a more productive language for me. The type system would genuinely make me faster for the vast majority of cases. Of course Python has gradual typing now, so any comparison gets more difficult when you consider that. But what I'm trying to say is that I never understood the idea that doing away entirely with static typing is good for fast iteration.
Also yes, C# can be used as a repl. Leave me alone with your repls. Also, while the debugger is active you can also evaluate arbitrary code within the current scope.
I think that going full dynamic typing is a mistake in almost every situation. The fact that C# doesn't do that already puts it above other languages for me. This stance on typing is controversial, but it's my opinion that is really shouldn't be. And the wind has constantly been blowing towards adding gradual typing to dynamic languages.
The modest typing capabilities C# coupled with OOP and inheritance lets you create pretty awful OOP slop. But that's whatever. At work we use inheritance in very few places where it results in neat code reuse, and then it's just mostly interfaces getting implemented.
C#'s typing and generic system is powerful enough to offer you a plethora of super-ergonomic collection transformation methods via the LINQ library. There's a lot of functional-style programming you can do with that. You know, map, filter, reduce, that stuff?
Even if you make a completely new collection type, if it implements IEnumerable<T> it will benefit from LINQ automatically. Every language these days has something like this, but it's so ridiculously easy to use in C#. Coupled with how C# lets you (1) easily define immutable data types, (2) explicitly control access to struct or class members, (3) do pattern matching, you can end up with code that flows really well.
A Friendly Kitchen Sink
Some people have described C#'s feature set as bloated. It is getting some syntactic diversity which makes it a bit harder to read someone else's code. But it doesn't make C# harder to learn, since it takes roughly the same amount of effort to get to a point where you can be effective in it.
Most of the more specific features can be effortlessly ignored. The ones that can't be effortlessly ignored tend to bring something genuinely useful to the language -- such as tuples and destructuring. Tuples have their own syntax, the syntax is pretty intuitive, but the first time you run into it, you will have to do a bit of learning.
C# has an immense amount of small features meant to make the language more ergonomic. They're too numerous to mention and they just keep getting added.
I'd like to draw attention to some features not because they're the most important but rather because it feels like they communicate the "personality" of C#. Not sure what level of detail was appropriate, so feel free to skim.
Stricter Null Handling. If you think not having to explicitly deal with null is the billion dollar mistake, then C# tries to fix a bit of the problem by allowing you to enable a strict context where you have to explicitly tell it that something can be null, otherwise it will assume that the possibility of a reference type being null is an error. It's a bit more complicated than that, but it definitely helps with safety around nullability.
Default Interface Implementation. A problem in C# which drives usage of inheritance is that with just interfaces there is no way to reuse code outside of passing function pointers. A lot of people don't get this and think that inheritance is just used because other people are stupid or something. If you have a couple of methods that would be implemented exactly the same for classes 1 through 99, but somewhat differently for classes 100 through 110, then without inheritance you're fucked. A much better way would be Rust's trait system, but for that to work you need really powerful generics, so it's too different of a path for C# to trod it. Instead what C# did was make it so that you can write an implementation for methods declared in an interface, as long as that implementation only uses members defined in the interface (this makes sense, why would it have access to anything else?). So now you can have a default implementation for the 1 through 99 case and save some of your sanity. Of course, it's not a panacea, if the implementation of the method requires access to the internal state of the 1 through 99 case, default interface implementation won't save you. But it can still make it easier via some techniques I won't get into. The important part is that default interface implementation allows code reuse and reduces reasons to use inheritance.
Performance Optimization. C# has a plethora of features regarding that. Most of which will never be encountered by the average programmer. Examples: (1) stackalloc - forcibly allocate reference types to the stack if you know they won't outlive the current scope. (2) Specialized APIs for avoiding memory allocations in happy paths. (3) Lazy initialization APIs. (4) APIs for dealing with memory more directly that allow high performance when interoping with C/C++ while still keeping a degree of safety.
Fine Control Over Async Runtime. C# lets you write your own... async builder and scheduler? It's a bit esoteric and hard to describe. But basically all the functionality of async/await that does magic under the hood? You can override that magic to do some very specific things that you'll rarely need. Unity3D takes advantage of this in order to allow async/await to work on WASM even though it is a single-threaded environment. It implements a cooperative scheduler so the program doesn't immediately freeze the moment you do await in a single-threaded environment. Most people don't know this capability exists and it doesn't affect them.
Tremendous Amount Of Synchronization Primitives and API. This ones does actually make multithreaded code harder to deal with, but basically C# erred a lot in favor of having many different ways to do multithreading because they wanted to suit different usecases. Most people just deal with idiomatic async/await code, but a very small minority of C# coders deal with locks, atomics, semaphores, mutex, monitors, interlocked, spin waiting etc. They knew they couldn't make this shit safe, so they tried to at least let you have ready-made options for your specific use case, even if it causes some balkanization.
Shortly Begging For Tagged Unions
What I miss from C# is more powerful generic bounds/constraints and tagged unions (or sum types or discriminated unions or type unions or any of the other 5 names this concept has).
The generic constraints you can use in C# are anemic and combined with the lack of tagged unions this is rather painful at times.
I remember seeing Microsoft devs saying they don't see enough of a usecase for tagged unions. I've at times wanted to strangle certain people. These two facts are related to one another.
My stance is that if you think your language doesn't need or benefit from tagged unions, either your language is very weird, or, more likely you're out of your goddamn mind. You are making me do really stupid things every time I need to represent a structure that can EITHER have a value of type A or a value of type B.
But I think C# will eventually get tagged unions. There's a proposal for it here. I would be overjoyed if it got implemented. It seems like it's been getting traction.
Also there was an entire section on unchecked exceptions that I removed because it wasn't interesting enough. Yes, C# could probably have checked exceptions and it didn't and it's a mistake. But ultimately it doesn't seem to have caused any make-or-break in a comparison with Java, which has them. They'd all be better off with returning an Error<T>. Short story is that the consequences of unchecked exceptions have been highly tolerable in practice.
Ecosystem State & FOSSness
C# is better than ever and the tooling ecosystem is better than ever. This is true of almost every language, but I think C# receives a rather high amount of improvements per version. Additionally the FOSS story is at its peak.
Roslyn, the bedrock of the toolchain, the compiler and analysis provider, is under MIT license. The fact that it does analysis as well is important, because this means you can use the wealth of Roslyn analyzers to do linting.
If your FOSS tooling lets you compile but you don't get any checking as you type, then your development experience is wildly substandard.
A lot of stupid crap with cross-platform compilation that used to be confusing or difficult is now rather easy to deal with. It's basically as easy as (1) use NET Core, (2) tell dotnet to build for Linux. These steps take no extra effort and the first step is the default way to write C# these days.
Dotnet is part of the SDK and contains functionality to create NET Core projects and to use other tools to build said projects. Dotnet is published under MIT, because the whole SDK and runtime are published under MIT.
Yes, the debugger situation is still bad -- there's no FOSS option for it, but this is more because nobody cares enough to go and solve it. Jetbrains proved anyone can do it if they have enough development time, since they wrote a debugger from scratch for their proprietary C# IDE Rider.
Where C# falls flat on its face is the "userspace" ecosystem. Plainly put, because C# is a Microsoft product, people with FOSS inclinations have steered clear of it to such a degree that the packages you have available are not even 10% of what packages a Python user has available, for example. People with FOSS inclinations are generally the people who write packages for your language!!
I guess if you really really hate leftpad, you might think this is a small bonus though.
Where-in I talk about Cross-Platform
The biggest thing the ecosystem has been lacking for me is a package, preferably FOSS, for developing cross-platform applications. Even if it's just cross-platform desktop applications.
Like yes, you can build C# to many platforms, no sweat. The same way you can build Rust to many platforms, some sweat. But if you can't show a good GUI on Linux, then it's not practically-speaking cross-platform for that purpose.
Microsoft has repeatedly done GUI stuff that, predictably, only works on Windows. And yes, Linux desktop is like 4%, but that 4% contains >50% of the people who create packages for your language's ecosystem, almost the exact point I made earlier. If a developer runs Linux and they can't have their app run on Linux, they are not going to touch your language with a ten foot pole for that purpose. I think this largely explains why C#'s ecosystem feels stunted.
The thing is, I'm not actually sure how bad or good the situation is, since most people just don't even try using C# for this usecase. There's a general... ecosystem malaise where few care to use the language for this, chiefly because of the tone that Microsoft set a decade ago. It's sad.
HOWEVER.
Avalonia, A New Hope?
Today we have Avalonia. Avalonia is an open-source framework that lets you build cross-platform applications in C#. It's MIT licensed. It will work on Windows, macOS, Linux, iOS, Android and also somehow in the browser. It seems to this by actually drawing pixels via SkiaSharp (or optionally Direct2D on Windows).
They make money by offering migration services from WPF app to Avalonia. Plus general support.
I can't say how good Avalonia is yet. I've researched a bit and it's not obviously bad, which is distinct from being good. But if it's actually good, this would be a holy grail for the ecosystem:
You could use a statically typed language that is productive for this type of software development to create cross-platform applications that have higher performance than the Electron slop. That's valuable!
This possibility warrants a much higher level of enthusiasm than I've seen, especially within the ecosystem itself. This is an ecosystem that was, for a while, entirely landlocked, only able to make Windows desktop applications.
I cannot overstate how important it is for a language's ecosystem to have a package like this and have it be good. Rust is still missing a good option. Gnome is unpleasant to use and buggy. Falling back to using Electron while writing Rust just seems like a bad joke. A lot of the Rust crates that are neither Electron nor Gnome tend to be really really undercooked.
And now I've actually talked myself into checking out Avalonia... I mean after writing all of that I feel like a charlatan for not having investigated it already.
72 notes
·
View notes
Text
In the near future one hacker may be able to unleash 20 zero-day attacks on different systems across the world all at once. Polymorphic malware could rampage across a codebase, using a bespoke generative AI system to rewrite itself as it learns and adapts. Armies of script kiddies could use purpose-built LLMs to unleash a torrent of malicious code at the push of a button.
Case in point: as of this writing, an AI system is sitting at the top of several leaderboards on HackerOne—an enterprise bug bounty system. The AI is XBOW, a system aimed at whitehat pentesters that “autonomously finds and exploits vulnerabilities in 75 percent of web benchmarks,” according to the company’s website.
AI-assisted hackers are a major fear in the cybersecurity industry, even if their potential hasn’t quite been realized yet. “I compare it to being on an emergency landing on an aircraft where it’s like ‘brace, brace, brace’ but we still have yet to impact anything,” Hayden Smith, the cofounder of security company Hunted Labs, tells WIRED. “We’re still waiting to have that mass event.”
Generative AI has made it easier for anyone to code. The LLMs improve every day, new models spit out more efficient code, and companies like Microsoft say they’re using AI agents to help write their codebase. Anyone can spit out a Python script using ChatGPT now, and vibe coding—asking an AI to write code for you, even if you don’t have much of an idea how to do it yourself—is popular; but there’s also vibe hacking.
“We’re going to see vibe hacking. And people without previous knowledge or deep knowledge will be able to tell AI what it wants to create and be able to go ahead and get that problem solved,” Katie Moussouris, the founder and CEO of Luta Security, tells WIRED.
Vibe hacking frontends have existed since 2023. Back then, a purpose-built LLM for generating malicious code called WormGPT spread on Discord groups, Telegram servers, and darknet forums. When security professionals and the media discovered it, its creators pulled the plug.
WormGPT faded away, but other services that billed themselves as blackhat LLMs, like FraudGPT, replaced it. But WormGPT’s successors had problems. As security firm Abnormal AI notes, many of these apps may have just been jailbroken versions of ChatGPT with some extra code to make them appear as if they were a stand-alone product.
Better then, if you’re a bad actor, to just go to the source. ChatGPT, Gemini, and Claude are easily jailbroken. Most LLMs have guard rails that prevent them from generating malicious code, but there are whole communities online dedicated to bypassing those guardrails. Anthropic even offers a bug bounty to people who discover new ones in Claude.
“It’s very important to us that we develop our models safely,” an OpenAI spokesperson tells WIRED. “We take steps to reduce the risk of malicious use, and we’re continually improving safeguards to make our models more robust against exploits like jailbreaks. For example, you can read our research and approach to jailbreaks in the GPT-4.5 system card, or in the OpenAI o3 and o4-mini system card.”
Google did not respond to a request for comment.
In 2023, security researchers at Trend Micro got ChatGPT to generate malicious code by prompting it into the role of a security researcher and pentester. ChatGPT would then happily generate PowerShell scripts based on databases of malicious code.
“You can use it to create malware,” Moussouris says. “The easiest way to get around those safeguards put in place by the makers of the AI models is to say that you’re competing in a capture-the-flag exercise, and it will happily generate malicious code for you.”
Unsophisticated actors like script kiddies are an age-old problem in the world of cybersecurity, and AI may well amplify their profile. “It lowers the barrier to entry to cybercrime,” Hayley Benedict, a Cyber Intelligence Analyst at RANE, tells WIRED.
But, she says, the real threat may come from established hacking groups who will use AI to further enhance their already fearsome abilities.
“It’s the hackers that already have the capabilities and already have these operations,” she says. “It’s being able to drastically scale up these cybercriminal operations, and they can create the malicious code a lot faster.”
Moussouris agrees. “The acceleration is what is going to make it extremely difficult to control,” she says.
Hunted Labs’ Smith also says that the real threat of AI-generated code is in the hands of someone who already knows the code in and out who uses it to scale up an attack. “When you’re working with someone who has deep experience and you combine that with, ‘Hey, I can do things a lot faster that otherwise would have taken me a couple days or three days, and now it takes me 30 minutes.’ That's a really interesting and dynamic part of the situation,” he says.
According to Smith, an experienced hacker could design a system that defeats multiple security protections and learns as it goes. The malicious bit of code would rewrite its malicious payload as it learns on the fly. “That would be completely insane and difficult to triage,” he says.
Smith imagines a world where 20 zero-day events all happen at the same time. “That makes it a little bit more scary,” he says.
Moussouris says that the tools to make that kind of attack a reality exist now. “They are good enough in the hands of a good enough operator,” she says, but AI is not quite good enough yet for an inexperienced hacker to operate hands-off.
“We’re not quite there in terms of AI being able to fully take over the function of a human in offensive security,” she says.
The primal fear that chatbot code sparks is that anyone will be able to do it, but the reality is that a sophisticated actor with deep knowledge of existing code is much more frightening. XBOW may be the closest thing to an autonomous “AI hacker” that exists in the wild, and it’s the creation of a team of more than 20 skilled people whose previous work experience includes GitHub, Microsoft, and a half a dozen assorted security companies.
It also points to another truth. “The best defense against a bad guy with AI is a good guy with AI,” Benedict says.
For Moussouris, the use of AI by both blackhats and whitehats is just the next evolution of a cybersecurity arms race she’s watched unfold over 30 years. “It went from: ‘I’m going to perform this hack manually or create my own custom exploit,’ to, ‘I’m going to create a tool that anyone can run and perform some of these checks automatically,’” she says.
“AI is just another tool in the toolbox, and those who do know how to steer it appropriately now are going to be the ones that make those vibey frontends that anyone could use.”
9 notes
·
View notes
Text
The Sims 4: New Game Patch (September 18th, 2024)
Your game should now read: PC: 1.109.185.1030 / Mac: 1.109.185.1230 / Console: 1.99.
Sul Sul Simmers!
This patch is a big one and brings many new updates and fixes into the game that span across different packs, including improvements to apartment walls, ceiling lighting, and a whole host of fixes for our recently released expansion pack, Lovestruck. These, along with so many more across both Base Game and Packs, can be found below.
Thank you for your continued reporting efforts at AnswersHQ. It really helps to let us know the issues you care most about. We hope these fixes keep improving your game and allow you to keep having more fun! More to come.
There’s a colorful update to Build/Buy items! 650 color variants have been added and there are new items such as archways, doors, and even ground covers to spruce up your terrain. Check out the vibrant colors and new items in the video. For more details, scroll to the end of the patch notes to see a list of all the Build/Buy items. We can’t wait to see how you mix and match!
youtube
Performance
Reducing Memory Usage:
Frequent Memory Updates – Increased the frequency of memory usage data updates to prevent out-of-memory crashes.
Improving Simulation Performance:
Streamlining Data Storage – We restructured how we store game data to reduce the overhead of using Python objects, making the game run faster and use less memory.
Efficient Buff Generation – Reworked how temporary data is generated and stored to fix previous issues and optimize memory usage.
Reducing Load Times:
Optimizing Render Target Allocation – Stopped unnecessary allocation of large color targets during certain rendering processes, now saving valuable memory especially in high-resolution settings.
DirectX 11 (DX11) Updates
We’re pleased to announce improvements to the DirectX 11 executable for PC users. While these updates are focused on Windows PC’s, Xbox Simmers will also see benefits from these changes as the Xbox runs a console-based variant of DirectX 11. Here’s what to expect:
NVIDIA and AMD
NVIDIA and AMD Graphics Cards – Players using NVIDIA and AMD GPUs will now automatically default to the DX11 executable. Players on other GPUs like Intel, will continue to enjoy The Sims 4 on DX9 until a later update.
DirectX 11 Enhancements – Faster Graphics Processing – Implemented changes to how graphics data is updated, reducing delays between the CPU and GPU for smoother gameplay.
Performance Boost with Constant Buffers (cbuffers) – This enhances performance by reducing overhead and managing memory more efficiently. Users with mid to high-end GPUs should notice improved performance!
New DirectX 9 Option in Graphics Setting – By default, Simmers on NVIDIA and AMD GPUs will launch The Sims 4 using DX11. If you prefer, you can switch to DX9 via Game Options > Graphics and enable the DirectX 9 toggle before re-launching The Sims 4 to play using DirectX 9.
Intel
Ongoing Intel Development – We are continuing development on bringing DirectX 11 to Intel GPU based PC’s but it needs a little longer before we can bring it to Simmers as the default option. For now Intel based Simmers will continue to use DirectX 9 when running The Sims 4.
DirectX 11 Opt-In – DirectX 11 is available for those Simmers who want to try it, including those using an Intel GPU, you may experience visual issues with mods. We recommend disabling all mods while using the -dx11 command line argument.
For detailed information about DirectX 11 and instructions on how to enter launch arguments for both the EA App and Steam, please visit here. If you encounter any issues with DirectX, you can find assistance here.
The Gallery
Pack filters now properly work for Home Chef Hustle in The Gallery and library. No more hiding.
Base Game
[AHQ] Outdoor lighting will no longer affect inside the room through ceilings. Let there be (proper) light.
[AHQ and AHQ] When attempting to save, “Error Code: 0“ no longer occurs related to Gigs or Neighborhood Stories.
[AHQ] Addressed an additional issue where the game would fail to load and display Error Code 123 when traveling between lots.
[AHQ] Clay and Future Cubes will no longer get left on lots during events. Pick up your trash and leave nothing behind.
[AHQ] Frogs, mice and fishes in tanks are now visible when placed in laptop mode. Welcome back, friends!
[AHQ] Sims will put their tablets and homework back into their inventory instead of placing them in the world as long as they are standing or sitting. Again, stop littering, Sims!
[AHQ] The call is not coming from inside the house–you'll stop getting invitational phone calls from your own Household Members.
[AHQ] “Complete a Daily Work Task” Want now completes properly after finishing a daily work task. Work work work.
[AHQ] Children now have the option to quit their “After School Activity“. Although quitters never prosper.
[AHQ] Thought bubbles of Sims will no longer appear through walls and floors. Keep your thoughts to yourself.
[AHQ] Family fortune - “Heal Negative Sentiments” task will now properly complete.
[AHQ] Sims will return from work or school and switch into the same Everyday Outfit they had on instead of defaulting to the first Everyday Outfit in the Create a Sim list. You will wear what I tell you to wear, Sim!
[AHQ] Certain cabinet/shelf combinations over kitchen sinks will no longer prevent Sim from washing in the sink. No excuses for not cleaning up after yourself.
[AHQ] Outdoor shadows now move smoothly without jumping on the screen on ultra graphics settings and at different Live Mode speeds.
[AHQ] Camera jittering is no longer observed in Build Buy mode after using Terrain Tools.
[AHQ] When recent neighborhood stories mention a Sim that died in another neighborhood, switching to the respective Sim household will now have an urn present. RIP.
[AHQ] Upgrading washer/dryer now completes Nerd Brain Aspiration.
[AHQ] Sims will now hold the acarajé dish the right way while eating. It’s delicious however you eat it, though.
[AHQ] Autonomous check infant no longer causes new random cold weather outfit to be generated for infant. They’re not cold.
Infant no longer stretches when crawling in deep snow. Although we question why you’re letting your infant crawl in the snow.
[AHQ] Teen Sim is able to take vacation days while working in the lifeguard career. It’s only fair.
[AHQ] Event goals remain visible even after editing from the Calendar.
Siblings can no longer be set as engaged in Create a Sim.
[AHQ] The Teen Goal Oriented Aspiration now gets completed properly after getting promoted at work.
Investigating missing Doodlepip splines. Reticulation progressing.
[AHQ] “Become friends with“ Want no longer appears for Sims with relationship equal or above friends. We’re already friends.
[AHQ] World icons on the world selection screen no longer move when middle-clicked.
[AHQ] Locked seed packets are unlocked in BB when using the gardening skill cheat “stats.set_skill_level Major_Gardening 10”. Gimme my seeds!
[AHQ] Female Sims' stomachs will no longer become invisible when paired with Masculine cargo pants in certain color swatches.
“Likes/Dislikes“ Sim preferences are now available for Sims created via Create a Sim Stories.
Sim animation will no longer pop when sitting on a stool and asking another Sim an inappropriate question.
[AHQ] Sim thumbnails are no longer low resolution on the Resume button.
[AHQ] Re-fixed issue where Skill List gets out of order, specifically when switching between Sims.
[AHQ] ‘ymTop_TshirtRolled_Yellow' top no longer clips with bottoms in Create a Sim.
[AHQ] Event Goals created through the Calendar properly show up during the Event, even if you edit the Event.
You can view the rest game patch notes on the Official site
26 notes
·
View notes
Text
How to back up your Tumblr blog
Not sure if all of you heard the news, but Wordpress laid off 16% of its staff, which happened to include senior tumblr staff like cyle. According to 3liza, the amount of staff running tumblr is about 25.
Welp. Will Tumblr finally die? I don't know. It's pretty likely, since this site costs millions to run and to host all this content, but I'll stay till the end. But I backed up my blog, with the help of a post that can't be reblogged rn.
you can reblog this one though.
Quoth butchlinkle: "In your blog settings you have the ability to initiate a blog export, and this will generate a backup for your blog.
Fair warning though, if you’ve been on the platform for a long time this archive is likely to be quite hefty in file size. This blog I have had for 5 years with 22k posts, and the export from tumblr came to be 48GB. My previous blog I made in 2011 and has 95k posts, so needless to say I did not use tumblr’s built in export to back that one up.
If you want more control over exactly what you back up from your blog, I recommend that you use tumblr-utils instead. It allows you to backup specific tags, post types, and to ignore posts that you did not create (reblogs where you’ve added a comment count unfortunately do not count unless you use the older version of the script made with python 2.7).
To use it:
download and install python
create an application on tumblr to get an api key
create a folder where you would like to save your backups and right click to open it in the terminal/command prompt, or type cmd.exe in the address bar from inside that folder
Backing up just my original posts from this blog with this command came to 632MB rather than 48GB, and also gave me the option to save my posts in JSON format which will be useful for converting my posts to a new format for self hosting.
On that note I’m currently looking into figuring out a simple (and ideally free) way of self hosting a static site blog that utilises activitypub, and also converting my old posts to re-host on said blog.
This post series by maho.dev on implementing activitypub with any static site is my primary source of guidance atm if you also want to try figure that out yourself, as well as having an explanation for why you’d even want to do this if you don’t already know
but if tumblr goes down before I get things sorted and write up a post about it then i’ll be reporting back on it via my bsky, mastodon, and toyhouse accounts
if you dont have an account on any of these I’ll also be sharing an update via my personal site’s RSS feed, link of which includes an explanation of what RSS is and some feed readers you can use, I highly recommend checking it out as getting a feed reader is going to be the best way you can stay connected with people if they scatter across the internet!
tldr: download tumblr-utils to backup your blog more efficiently, introduce yourself to RSS and get a feed reader to stay connected with people, consider saving mine so you can find out how to self host your blog later if tumblr goes down."
here's a guide from the notes: https://docs.google.com/document/u/0/d/1yBWlk-yEgpSoEh3c9oLhz_kbLtUGqbqzOpCtJsvQgjI/mobilebasic?pli=1#h.u9vj7pezwpcy
Back up those blogs. This was way faster than trying to use Webarchive, and webarchive seems to be only good for saving text, audio, and video, because it saved none of the images. And remember: I did not write this guide, and I do not know a thing about coding or fixing bugs.
8 notes
·
View notes
Note
Hya! Do any of the ppl in charge of coding have any recommendations for people who wanna learn? Looking to make my own game but not sure where to start 😅😅 ty!!
I don't work on Clangen as a coding dev, but I am working to become a programmer as a career, so maybe some of my advice might be helpful?
One thing is, What programming language are you working in? Games use a variety of programming languages depending on what they need. Clangen itself is built on Pygame, which runs on the programming language Python. Python's a more "beginner-friendly" language, due to it being written in more regular English. Lots of game engines use stuff like C# or C++ for their memory efficiency though. Choose what you need!
Either way, you'll need to learn the basics of programming before you start going nuts. I'd look up tutorials online for learning that, and make a bunch of small bad programs. You've got to practice it to do it! Also, you're going to break stuff. Don't be afraid of it. Whenever you're doing anything different, stuff is going to be slightly broken at first. You've just got to take another look and the answer might be way more obvious than you think!
✦ Chibi ✦
#clangen#ask response#warrior cats#clan generator#ask#clan gen#warriors#warrior cats generator#it's 3am. the chibi hour
71 notes
·
View notes
Text
Python for Beginners: Launch Your Tech Career with Coding Skills
Are you ready to launch your tech career but don’t know where to start? Learning Python is one of the best ways to break into the world of technology—even if you have zero coding experience.
In this guide, we’ll explore how Python for beginners can be your gateway to a rewarding career in software development, data science, automation, and more.
Why Python Is the Perfect Language for Beginners
Python has become the go-to programming language for beginners and professionals alike—and for good reason:
Simple syntax: Python reads like plain English, making it easy to learn.
High demand: Industries spanning the spectrum are actively seeking Python developers to fuel their technological advancements.
Versatile applications: Python's versatility shines as it powers everything from crafting websites to driving artificial intelligence and dissecting data.
Whether you want to become a software developer, data analyst, or AI engineer, Python lays the foundation.
What Can You Do With Python?
Python is not just a beginner language—it’s a career-building tool. Here are just a few career paths where Python is essential:
Web Development: Frameworks like Django and Flask make it easy to build powerful web applications. You can even enroll in a Python Course in Kochi to gain hands-on experience with real-world web projects.
Data Science & Analytics: For professionals tackling data analysis and visualization, the Python ecosystem, featuring powerhouses like Pandas, NumPy, and Matplotlib, sets the benchmark.
Machine Learning & AI: Spearheading advancements in artificial intelligence development, Python boasts powerful tools such as TensorFlow and scikit-learn.
Automation & Scripting: Simple yet effective Python scripts offer a pathway to amplified efficiency by automating routine workflows.
Cybersecurity & Networking: The application of Python is expanding into crucial domains such as ethical hacking, penetration testing, and the automation of network processes.
How to Get Started with Python
Starting your Python journey doesn't require a computer science degree. Success hinges on a focused commitment combined with a thoughtfully structured educational approach.
Step 1: Install Python
Download and install Python from python.org. It's free and available for all platforms.
Step 2: Choose an IDE
Use beginner-friendly tools like Thonny, PyCharm, or VS Code to write your code.
Step 3: Learn the Basics
Focus on:
Variables and data types
Conditional statements
Loops
Functions
Lists and dictionaries
If you prefer guided learning, a reputable Python Institute in Kochi can offer structured programs and mentorship to help you grasp core concepts efficiently.
Step 4: Build Projects
Learning by doing is key. Start small:
Build a calculator
Automate file organization
Create a to-do list app
As your skills grow, you can tackle more complex projects like data dashboards or web apps.
How Python Skills Can Boost Your Career
Adding Python to your resume instantly opens up new opportunities. Here's how it helps:
Higher employability: Python is one of the top 3 most in-demand programming languages.
Better salaries: Python developers earn competitive salaries across the globe.
Remote job opportunities: Many Python-related jobs are available remotely, offering flexibility.
Even if you're not aiming to be a full-time developer, Python skills can enhance careers in marketing, finance, research, and product management.
If you're serious about starting a career in tech, learning Python is the smartest first step you can take. It’s beginner-friendly, powerful, and widely used across industries.
Whether you're a student, job switcher, or just curious about programming, Python for beginners can unlock countless career opportunities. Invest time in learning today—and start building the future you want in tech.
Globally recognized as a premier educational hub, DataMites Institute delivers in-depth training programs across the pivotal fields of data science, artificial intelligence, and machine learning. They provide expert-led courses designed for both beginners and professionals aiming to boost their careers.
Python Modules Explained - Different Types and Functions - Python Tutorial
youtube
#python course#python training#python#learnpython#pythoncourseinindia#pythoncourseinkochi#pythoninstitute#python for data science#Youtube
3 notes
·
View notes
Text
shitGPT
for uni im going to be coding with a chatGPT user, so i decided to see how good it is at coding (sure ive heard it can code, but theres a massive difference between being able to code and being able to code well).
i will complain about a specific project i asked it to make and improve on under the cut, but i will copy my conclusion from the bottom of the post and paste it up here.
-
conclusion: it (mostly) writes code that works, but isnt great. but this is actually a pretty big problem imo. as more and more people are using this to learn how to code, or getting examples of functions, theyre going to be learning from pretty bad code. and then theres what im going to be experiencing, coding with someone who uses this tool. theres going to be easily improvable code that the quote unquote writer wont fully understand going into a codebase with my name of it - a codebase which we will need present for our degree. even though the code is not the main part of this project (well, the quality of the code at least. you need it to be able to run and thats about it) its still a shitty feeling having my name attached to code of this quality.
and also it is possible to get it to write good (readable, idiomatic, efficient enough) code, but only if you can write this code yourself (and are willing to spend more time arguing with the AI than you would writing the code.) most of the things i pointed out to the AI was stuff that someone using this as a learning resource wont know about. if it never gives you static methods, class methods, ABCs, coroutines, type hints, multi-file programs, etc without you explicitly asking for them then its use is limited at best. and people who think that its a tool that can take all the info they need, and give it back to them in a concise, readable way (which is a surprising lot of people) will be missing out without even knowing about it.
i got it to write tic-tac-toe (the standard babee) in python (the lang i have to use for uni ;-; (held at gunpoint here)). my specific prompt was "write me a python program for tictactoe that is written in an object oriented way and allows for future expansion via multiple files"
it separated it into three files below (which i think would run, but i never actually ran any of this code. just reading and judging)
why does board use display instead of __str__ and __repr__?
why is the board stored as 1d instead of 2d? thats just confusing
why does it never early return aside from check_winner? (not a big issue here but kept on choosing to never early return when i asked it to add more methods)
why is there no handling of non-number user inputs?
why are non-int inputs truncated instead of telling the user that they should input ints only?
why is display implemented like that?
why are so many lines so bloody long (wide)?
why is there a redundant self.check_winner() after the while loop in TicTaacToe.play()? and if it wasnt redundant then you could finish the game without there being anything printed telling you that the game is finished?
why is the only comment useless? (this comment wouldnt be useless if it was a doc comment tho, but it aint a doc comment. speaking of, why is there no doc comments?)
these are the more immediate things i saw, but there are other things that are bad here.
whenever i write * this is where it updated the api without changing any usage of the api.
so i ask it to change board.display into __str__ and __repr__, it changes it to __str__*, it does not add a __repr__. asking it to add a __repr__ 1) removes the __str__ and 2) gives me this (the other methods are unchanged)
what. the. fuck. this would imply that board takes in an argument for the boardstate, but it clearly doesnt. after 4 more asks it finally has both __str__ and __repr__, without fixing the fact its implying board takes an optional arg, so i get it to add this arg. anything that needs to print the board still calls display btw.
the reasoning it gave for using display over the repr and str magics was this
While using __str__ and __repr__ is a more idiomatic approach in Python, choosing to have a separate display method can still be a valid choice, especially if the display logic is more complex or if you want to keep the __str__ method for a more concise or formal representation of the object.
which, erm what? why would __str__ be for a concise or formal repr when thats what __repr__ is for? who cares about how complex the logic is. youre calling this every time you print, so move the logic into __str__. it makes no difference for the performance of the program (if you had a very expensive func that prints smth, and you dont want it to run every time you try to print the obj then its understandable to implement that alongside str and repr)
it also said the difference between __str__ and __repr__ every damn time, which if youre asking it to implement these magics then surely you already know the difference?
but okay, one issue down and that took what? 5-10 minutes? and it wouldve taken 1 minute tops to do it yourself?
okay next implementing a tic-tac-toe board as a 1d array is fine, but kinda weird when 2d arrays exist. this one is just personal preference though so i got it to change it to a 2d list*. it changed the init method to this
tumblr wont let me add alt text to this image so:
[begin ID: Python code that generates a 2D array using nested list comprehensions. end ID]
which works, but just use [[" "] * 3 for _ in range(3)]. the only advantage listcomps have here over multiplying is that they create new lists, instead of copying the pointers. but if you update a cell it will change that pointer. you only need listcomps for the outermost level.
again, this is mainly personal preference, nothing major. but it does show that chatgpt gives u sloppy code
(also if you notice it got rid of the board argument lol)
now i had to explicitly get it to change is_full and make_move. methods in the same damn class that would be changed by changing to a 2d array. this sorta shit should be done automatically lol
it changed make_move by taking row and col args, which is a shitty decision coz it asks for a pos 1-9, so anything that calls make_move would have to change this to a row and col. so i got it to make a func thatll do this for the board class
what i was hoping for: a static method that is called inside make_move
what i got: a standalone function that is not inside any class that isnt early exited
the fuck is this supposed to do if its never called?
so i had to tell it to put it in the class as a static method, and get it to call it. i had to tell it to call this function holy hell
like what is this?
i cant believe it wrote this method without ever calling it!
and - AND - theres this code here that WILL run when this file is imported
which, errrr, this files entire point is being imported innit. if youre going to have example usage check if __name__ = "__main__" and dont store vars as globals
now i finally asked it to update the other classes not that the api has changed (hoping it would change the implementation of make_move to use the static method.) (it didnt.)
Player.make_move is now defined recursively in a way that doesnt work. yippe! why not propagate the error ill never know.
also why is there so much shit in the try block? its not clear which part needs to be error checked and it also makes the prints go offscreen.
after getting it to fix the static method not being called, and the try block being overcrowded (not getting it to propagate the error yet) i got it to add type hints (if u coding python, add type hints. please. itll make me happy)
now for the next 5 asks it changed 0 code. nothing at all. regardless of what i asked it to do. fucks sake.
also look at this type hint
what
the
hell
is
this
?
why is it Optional[str]???????? the hell??? at no point is it anything but a char. either write it as Optional[list[list[char]]] or Optional[list[list]], either works fine. just - dont bloody do this
also does anything look wrong with this type hint?
a bloody optional when its not optional
so i got it to remove this optional. it sure as hell got rid of optional
it sure as hell got rid of optional
now i was just trying to make board.py more readable. its been maybe half an hour at this point? i just want to move on.
it did not want to write PEP 8 code, but oh well. fuck it we ball, its not like it again decided to stop changing any code
(i lied)
but anyway one file down two to go, they were more of the same so i eventually gave up (i wont say each and every issue i had with the code. you get the gist. yes a lot of it didnt work)
conclusion: as you probably saw, it (mostly) writes code that works, but isnt great. but this is actually a pretty big problem imo. as more and more people are using this to learn how to code, or getting examples of functions, theyre going to be learning from pretty bad code. and then theres what im going to be experiencing, coding with someone who uses this tool. theres going to be easily improvable code that the quote unquote writer wont fully understand going into a codebase with my name of it - a codebase which we will need present for our degree. even though the code is not the main part of this project (well, the quality of the code at least. you need it to be able to run and thats about it) its still a shitty feeling having my name attached to code of this quality.
and also it is possible to get it to write good (readable, idiomatic, efficient enough) code, but only if you can write this code yourself (and are willing to spend more time arguing with the AI than you would writing the code.) most of the things i pointed out to the AI was stuff that someone using this as a learning resource wont know about. if it never gives you static methods, class methods, ABCs, coroutines, type hints, multi-file programs, etc without you explicitly asking for them then its use is limited at best. and people who think that its a tool that can take all the info they need, and give it back to them in a concise, readable way (which is a surprising lot of people) will be missing out without even knowing about it.
#i speak i ramble#effortpost#long post#progblr#codeblr#python#chatgpt#tried to add IDs in as many alts as possible. some didnt let me and also its hard to decide what to put in the IDs for code.#like sometimes you need implementation details but others just the broad overview is good enough yknow?#and i also tried to write in a way where you dont need the IDs to follow along. (but with something like this it is hard yknow?)#id in alt#aside from that one where i got cockblocked#codeblocked?#codeblocked.
40 notes
·
View notes
Note
hi aashi! as a fellow indian and comp sci student i am Obligated to ask you what your favourite indian sweet is & if u prefer python over c (im so specific i know 😭)
hiii bb!! my favorite indian sweet right now is definitely HALWAAA. rn, i love to heat up some good fuckin gajar halwa and eat it up, but i recently discovered sohan halwa and my life has been changed. however, my stomach is rumbling at the thought of sum gajar halwa rn welp
ok and im going to be so fr with you right now, im double majoring in math and computer science so i dabble in a lot more theoretical cs / ML than i do in programming. thus, i haven't really coded in c but i know FOR SUREEE that python is better bro fuck c multi lines for smth i could do IN ONE LINE IS ABSURD like if u prefer c over python then ur a masochist or just an old fucking person
people who prefer c are NOT VALID idgaf. like one time i was working on making a package (it was for quantum computing) and my team member proposed to make it in C to make it "more efficient." i got so close to cursing him out im so srs i was BLOWING UP the group chat to fight him
9 notes
·
View notes
Link
Python Assignment Operators: Streamlining Variable Manipulation
The article delves into the concept of assignment operators in Python, shedding light on how they empower developers to efficiently assign values to variables. Beyond introducing the basic assignment operator (=), the article explores a range of compound assignment operators that combine arithmetic operations with assignments, resulting in more concise and readable code.
The article provides clear explanations of each compound assignment operator, along with illustrative examples for a comprehensive understanding. By showcasing how these operators work with numbers, strings, and lists, the article equips programmers with the knowledge to optimize their code while enhancing code readability.
In essence, this article serves as a valuable resource for both beginners and experienced Python programmers, offering insights into efficient variable manipulation and highlighting the benefits of adopting compound assignment operators.
0 notes
Text
Python Bitwise Operators
Bitwise operators in Python work directly with binary numbers (0s and 1s), which are how computers understand data. They are useful when you want to perform fast and efficient calculations, especially in programming tasks like encryption, compression, or low-level data handling. Instead of dealing with full numbers, these operators compare individual bits of those numbers. Learning them can help you write better-performing code.
Important Bitwise Operators in Python
AND (&) – Compares bits of two numbers and gives 1 only if both bits are 1. Otherwise, it gives 0.
OR (|) – Returns 1 if at least one of the compared bits is 1. It gives 0 only if both bits are 0.
XOR (^) – Gives 1 when the two bits are different. If they are the same, the result is 0.
NOT (~) – Flips every bit in a number. 0 becomes 1, and 1 becomes 0, effectively turning the number negative.
Left Shift (<<) – Moves bits to the left, which is like multiplying the number by 2 for every shift.
Right Shift (>>) – Moves bits to the right, which works like dividing the number by 2 for every shift.
For more detailed information, you can visit the original article: Python Bitwise Operators | PrepInsta.
#software#courses#coding#python#python course#online courses#prepinsta#jobsearch#jobs#online jobs#working
3 notes
·
View notes
Text
Interesting Papers for Week 42, 2024
Fear learning induces synaptic potentiation between engram neurons in the rat lateral amygdala. Abatis, M., Perin, R., Niu, R., van den Burg, E., Hegoburu, C., Kim, R., … Stoop, R. (2024). Nature Neuroscience, 27(7), 1309–1317.
Jointly efficient encoding and decoding in neural populations. Blanco Malerba, S., Micheli, A., Woodford, M., & Azeredo da Silveira, R. (2024). PLOS Computational Biology, 20(7), e1012240.
Flexible multitask computation in recurrent networks utilizes shared dynamical motifs. Driscoll, L. N., Shenoy, K., & Sussillo, D. (2024). Nature Neuroscience, 27(7), 1349–1363.
Kinetic features dictate sensorimotor alignment in the superior colliculus. González-Rueda, A., Jensen, K., Noormandipour, M., de Malmazet, D., Wilson, J., Ciabatti, E., … Tripodi, M. (2024). Nature, 631(8020), 378–385.
A recurrent network model of planning explains hippocampal replay and human behavior. Jensen, K. T., Hennequin, G., & Mattar, M. G. (2024). Nature Neuroscience, 27(7), 1340–1348.
Adaptive coding of reward in schizophrenia, its change over time and relationship to apathy. Kaliuzhna, M., Carruzzo, F., Kuenzi, N., Tobler, P. N., Kirschner, M., Geffen, T., … Kaiser, S. (2024). Brain, 147(7), 2459–2470.
Human navigation strategies and their errors result from dynamic interactions of spatial uncertainties. Kessler, F., Frankenstein, J., & Rothkopf, C. A. (2024). Nature Communications, 15, 5677.
Local field potential sharp waves with diversified impact on cortical neuronal encoding of haptic input. Kristensen, S. S., & Jörntell, H. (2024). Scientific Reports, 14, 15243.
Factorized visual representations in the primate visual system and deep neural networks. Lindsey, J. W., & Issa, E. B. (2024). eLife, 13, e91685.3.
A mathematical theory of relational generalization in transitive inference. Lippl, S., Kay, K., Jensen, G., Ferrera, V. P., & Abbott, L. F. (2024). Proceedings of the National Academy of Sciences, 121(28), e2314511121.
Precise tactile localization on the human fingernail. Longo, M. R. (2024). Proceedings of the Royal Society B: Biological Sciences, 291(2026).
Trying Harder: How Cognitive Effort Sculpts Neural Representations during Working Memory. Master, S. L., Li, S., & Curtis, C. E. (2024). Journal of Neuroscience, 44(28), e0060242024.
Context-invariant beliefs are supported by dynamic reconfiguration of single unit functional connectivity in prefrontal cortex of male macaques. Noel, J.-P., Balzani, E., Savin, C., & Angelaki, D. E. (2024). Nature Communications, 15, 5738.
Reward prediction error neurons implement an efficient code for reward. Schütt, H. H., Kim, D., & Ma, W. J. (2024). Nature Neuroscience, 27(7), 1333–1339.
Joint modeling of choices and reaction times based on Bayesian contextual behavioral control. Schwöbel, S., Marković, D., Smolka, M. N., & Kiebel, S. (2024). PLOS Computational Biology, 20(7), e1012228.
Selective recruitment of the cerebellum evidenced by task-dependent gating of inputs. Shahshahani, L., King, M., Nettekoven, C., Ivry, R. B., & Diedrichsen, J. (2024). eLife, 13, e96386.3.
A simple optical flow model explains why certain object viewpoints are special. Stewart, E. E. M., Fleming, R. W., & Schütz, A. C. (2024). Proceedings of the Royal Society B: Biological Sciences, 291(2026).
Stimulus type shapes the topology of cellular functional networks in mouse visual cortex. Tang, D., Zylberberg, J., Jia, X., & Choi, H. (2024). Nature Communications, 15, 5753.
Control over self and others’ face: exploitation and exploration. Wen, W., Mei, J., Aktas, H., Chang, A. Y.-C., Suzuishi, Y., & Kasahara, S. (2024). Scientific Reports, 14, 15473.
BCI Toolbox: An open-source python package for the Bayesian causal inference model. Zhu, H., Beierholm, U., & Shams, L. (2024). PLOS Computational Biology, 20(7), e1011791.
#neuroscience#science#research#brain science#scientific publications#cognitive science#neurobiology#cognition#psychophysics#neurons#neural computation#neural networks#computational neuroscience
8 notes
·
View notes