#python array
Explore tagged Tumblr posts
Text
python save me. save me python
#cannot get this fucking lab work to compile so im just gonna focus on my python assignment#because its easy as shit#(although tbf thats almost definitely just because i dont have to modularise or anything)#literally just basic printing and inputting user variables vs using data structures and opening and closing files and pointers and arrays a#afhhhhh#me.txt#maybe ill just take the l on this lab#i can take it. probably
9 notes
·
View notes
Text
Normally I just post about movies but I'm a software engineer by trade so I've got opinions on programming too.
Apparently it's a month of code or something because my dash is filled with people trying to learn Python. And that's great, because Python is a good language with a lot of support and job opportunities. I've just got some scattered thoughts that I thought I'd write down.
Python abstracts a number of useful concepts. It makes it easier to use, but it also means that if you don't understand the concepts then things might go wrong in ways you didn't expect. Memory management and pointer logic is so damn annoying, but you need to understand them. I learned these concepts by learning C++, hopefully there's an easier way these days.
Data structures and algorithms are the bread and butter of any real work (and they're pretty much all that come up in interviews) and they're language agnostic. If you don't know how to traverse a linked list, how to use recursion, what a hash map is for, etc. then you don't really know how to program. You'll pretty much never need to implement any of them from scratch, but you should know when to use them; think of them like building blocks in a Lego set.
Learning a new language is a hell of a lot easier after your first one. Going from Python to Java is mostly just syntax differences. Even "harder" languages like C++ mostly just mean more boilerplate while doing the same things. Learning a new spoken language in is hard, but learning a new programming language is generally closer to learning some new slang or a new accent. Lists in Python are called Vectors in C++, just like how french fries are called chips in London. If you know all the underlying concepts that are common to most programming languages then it's not a huge jump to a new one, at least if you're only doing all the most common stuff. (You will get tripped up by some of the minor differences though. Popping an item off of a stack in Python returns the element, but in Java it returns nothing. You have to read it with Top first. Definitely had a program fail due to that issue).
The above is not true for new paradigms. Python, C++ and Java are all iterative languages. You move to something functional like Haskell and you need a completely different way of thinking. Javascript (not in any way related to Java) has callbacks and I still don't quite have a good handle on them. Hardware languages like VHDL are all synchronous; every line of code in a program runs at the same time! That's a new way of thinking.
Python is stereotyped as a scripting language good only for glue programming or prototypes. It's excellent at those, but I've worked at a number of (successful) startups that all were Python on the backend. Python is robust enough and fast enough to be used for basically anything at this point, except maybe for embedded programming. If you do need the fastest speed possible then you can still drop in some raw C++ for the places you need it (one place I worked at had one very important piece of code in C++ because even milliseconds mattered there, but everything else was Python). The speed differences between Python and C++ are so much smaller these days that you only need them at the scale of the really big companies. It makes sense for Google to use C++ (and they use their own version of it to boot), but any company with less than 100 engineers is probably better off with Python in almost all cases. Honestly thought the best programming language is the one you like, and the one that you're good at.
Design patterns mostly don't matter. They really were only created to make up for language failures of C++; in the original design patterns book 17 of the 23 patterns were just core features of other contemporary languages like LISP. C++ was just really popular while also being kinda bad, so they were necessary. I don't think I've ever once thought about consciously using a design pattern since even before I graduated. Object oriented design is mostly in the same place. You'll use classes because it's a useful way to structure things but multiple inheritance and polymorphism and all the other terms you've learned really don't come into play too often and when they do you use the simplest possible form of them. Code should be simple and easy to understand so make it as simple as possible. As far as inheritance the most I'm willing to do is to have a class with abstract functions (i.e. classes where some functions are empty but are expected to be filled out by the child class) but even then there are usually good alternatives to this.
Related to the above: simple is best. Simple is elegant. If you solve a problem with 4000 lines of code using a bunch of esoteric data structures and language quirks, but someone else did it in 10 then I'll pick the 10. On the other hand a one liner function that requires a lot of unpacking, like a Python function with a bunch of nested lambdas, might be easier to read if you split it up a bit more. Time to read and understand the code is the most important metric, more important than runtime or memory use. You can optimize for the other two later if you have to, but simple has to prevail for the first pass otherwise it's going to be hard for other people to understand. In fact, it'll be hard for you to understand too when you come back to it 3 months later without any context.
Note that I've cut a few things for simplicity. For example: VHDL doesn't quite require every line to run at the same time, but it's still a major paradigm of the language that isn't present in most other languages.
Ok that was a lot to read. I guess I have more to say about programming than I thought. But the core ideas are: Python is pretty good, other languages don't need to be scary, learn your data structures and algorithms and above all keep your code simple and clean.
#programming#python#software engineering#java#java programming#c++#javascript#haskell#VHDL#hardware programming#embedded programming#month of code#design patterns#common lisp#google#data structures#algorithms#hash table#recursion#array#lists#vectors#vector#list#arrays#object oriented programming#functional programming#iterative programming#callbacks
20 notes
·
View notes
Text
optimization journey: glue 10000+ arrays together for each data channel -> reduce number of array glueing required by doing 32 sequences at once -> NO array glueing at all!
#tütensuppe#the previous problem i complained about happened bc you cant trick python into skipping for loop iterations#so when you do for i in range(100) and then i+=5 it wont eat it#what i got stuck on was the second flips. im calculating microseconds but the timestamps are not on the full second#so every 32 runs you have a second flip within the 500 data point run#but! you know what you can do!!#calculate the number of total datapoints. first timestamp+total*timestep gets you the final array value.#then do linspace over ALL those values. array%1000000. tada!! all the microseconds#including accurate time flips!#its not running yet though bc i mathed wrong somewhere#but once i fix that i bet its gonna be sooo fast
3 notes
·
View notes
Text
.
#ppl think coding is cool or whatever but its just#trying to convert a string to an array for like 12 hours#bc the string starts with a pound sign 😭#python i miss u 💔#proprietary ansi C is my enemy
0 notes
Text
tech mutuals/followers i need some help...
i almost finished c programming so...
#i have little experience with python because it was my first programming language i was taught in school#i self learned java but never finished it. i did upto arrays btw#no experience with c++ but I'm doing c so maybe it's appropriate to go for c++??#idk please vote guys 🙏
0 notes
Text
C language MCQ . . . . write your answer in the comment section https://bit.ly/48J8x0O You can check the answer at the above link at Q.no. 1
#c#cpp#programming#arrays#programminglanguage#pointers#java#python#computerscience#computerengineering#javatpoint
0 notes
Text
#Function and #array in #php
Read More: https://thetexvn.com/blogs/Function_and_Array_in_PHP
0 notes
Text
what do u do when u tell ur parent in no uncertain terms Thank You For The Offer But I Do Not Want A Tutor For This Course It Will Not Help And I Am Deeply Uncomfortable With It Do Not Get Me One
and then they go and book u with an online tutor. without asking. what the fuck.
#25 but being treated like im fucking 12#didnt even WANT help with courseworki went out there just looking for some goddamn emotional support#and i didnt even get it!!!!!!#theres 'problem solving instead of listening & supporting' and then theres THIS#i hate college#but rn i hate this family more#ANYWAYS#if any1 knows how 2 use python 2 'use file i/o on startup to open and read the dataset; initializing a few record objects with data parsed#from first few records in the csv file. the record objects should be stored in a simple data structure (array or list). use exception#handling in case the file is missing or not found'#i know how to open the file but idk how 2 'initialize a few record objects using data parsed etc. etc.'#like. i have a class so thats the record object. and ig i could have a list of instances of that class object#but idk how 2 like. combine the data from the csv file with instances of the class.#without having to individually list.append(()) 7000 rows bc eventually in this project u gotta use the whole dataset.
0 notes
Text
This is sort of an indirect addition to this ask maddy got about learning rust, I haven't actually gotten to learning rust yet but I do want to talk about an incident I recently had with python (I think with C the reasons why you'd rather not use it are fairly obvious) So recently tried to implement a basic matrix class in python, and since I wanted to do a whole thing where I did my own implementations of numerical optimization and more general linear algebra stuff, I tried to do it "properly" and make it "robust" and everything, but without installing any external libraries.
And to me, that obviously involved making sure that the matrix is formatted sensibly, i.e. that a matrix contains m rows of n numbers each. This seemed like a very obvious thing you should do in any serious piece of code, since if the contents of a matrix are accidentally formatted in a weird way, then you might get errors, or, significantly worse, python might just decide that it "can handle them" anyways and do some really unintuitive dumb stuff that's really hard to debug. (See this older post of mine for an example of how the pythonic willingness to work with bad inputs leads to really weird unintuitive behavior).
Turns out this is not something you can do directly in python without installing external type checking libraries! And I didn't want to just loop through all the contents and check their type individually during object creation, since that felt incredibly slow, stupid and inefficient. It didnt help that my algorithms theory exam was coming up soon, which meant I was thinking about asymptotic runtimes all day.
And so I was like "well surely at least it's easy to check for a matrix being a 2D array with consistent row sizes". However, at this point, with dawning horror, I came to a realization:
and at this moment I could just feel pretty much all of my remaining "python is easy to work with" attitude turning into dust and soaring away in the wind. If anyone here knows a way to enforce a given argument being a 2D array of numbers with consistent row sizes that doesn't involve O(n*m) overhead during object creation and that can be implemented in python using only internal modules (no external type checkers that need to be installed manually first) please tell me lol
50 notes
·
View notes
Text
The #1 thing keeping me from making more actual studyblr content is that all my actual studying is so unaesthetic. Yes I memorized the difference between python sets, lists, dictionaries, arrays, and tuples. No I cannot post it on my aesthetic blog, because the way I memorized it was by making little characters for each of them like they were ocs and then writing rhyming poems about them w/ a relationship chart (tuples and lists are good friends)
#studyblr#personal#university#programming#chaotic academia#catch me out here doing anything but memorizing the content in a hinged manner
22 notes
·
View notes
Text
Now I'm not sure how many quotes we have, but let's assume 5, and using the list of founding fathers aka signers-of-the-important-documents from wikipedia, which gives us around 119 founding fathers.
I did some research, and I could confirm the following:
I'll drop the ones I couldn't tell one way or another, but obviously these are predictably atrocious groupings. Now...
Again assuming we are grabbing 5 quotes at random from any founding father (now of course some founding fathers had more quotable literature and writings than others, but I'm doing this for kicks, not for peer review), what are the odds that all 5 are from slaveholders by pure random chance?
Well, the odds of at least 4 of the quoted people being slaveholders are around a full 80%--the yellow line--and the odds of all 5 being slaveholders are a hefty 40%, despite how generally unlikely it is to pick the same of a variant 5 times in a row out of a set of samples
making graphs is fun
I'm waiting for jury duty and they've got a slideshow going where they're displaying all these quotes from founding fathers about trial by jury and I'm starting to suspect they're doing ones from slave owners specifically.

Like, cool quote and all, but I'm not sure I want to listen to the thoughts on liberty from a guy who owned over a hundred slaves.
#nyansense speaks#science!#history#statistics#i know i didn't like get really rigorous with this or anything but consider I'm doing this for sillies. and I also have a lot of assignment#please DO improve on my analysis if you feel like it#if you don't wanna type out big fuckin arrays like i had to dm me for the python code jkdfdjs
771 notes
·
View notes
Note
wwx is sooo smart! in a modern setting, what subject do you think he would teach? what about in college?
seriously, i can wax poetic about wwx’s intelligence, ingenuity and smartness any day!! and ooooh, your question puts me in a bind because i cannot just name one subject. i think wei wuxian is good at too many things and the younger generations deserve to have his mentorship for an array of subjects. but i’m gonna try my best to just discuss one for this post!
see, i don’t want to mention fine arts because i think wwx would be a hobbyist about it and prefer to be one of those guys hopping around museums and galleries and curating a small but insightful review blog to engage with that side of the arts. an aspect of him that his students would probably find a bit later once they go stalking their professor’s social media profiles (which wwx would be VERY lowkey about) and find that, oh, the cool professor is so much cooler still.
also, because this got me thinking way too much, before we get to the subject, imagining wwx as a full time faculty member–i’ll go out on this fanfic fuelled limb and say he would totally be the teacher coordinator for a university play and/or the debate society! the latter especially, because if the second siege showed us nothing else, it made clear that wwx knows how to frame his arguments logically w/o getting too personal/emotional (not that some debates don’t need an emotional input!) and knows how to keep the audience hooked to his words. the same goes for the deft way in which he handled his defence at the nightless city. so, yeah.
okay, so the subject i think wwx would teach has to be....
physics!!!!!
like this is the one that pops in my mind first and foremost and it fits wwx so well and not just in the realm of engineering. not that wwx’s inventing streak won’t be profoundly useful there but when it comes teaching the subject, when i say “physics” i mean the pure science. that would be wei wuxian’s jam!! he would come up with elaborate setups to simply but elegantly explain and exhibit a complex physics law or phenomenon. he would assign practical-oriented projects to his students and allow for fun which is sorely lacking in intensive pure science classes! he would make time to go over some relevant historic trivia about some theory a guy in the 18th century came up with and he would TOTALLY gossip about the scientists of the past and the scandals so many of them were engaged in. and the most important part!! he would conceptualise different and unique experiments for his class to practice for that part of their grade! alot of the time we forget how important the practical ingenuity of physics professors need to be when it’s not applied physics because the emphasis on the theoretical classes overshadows it. but wei wuxian would plan the practical course himself, even discuss the experimental configurations with his students, and design a whole booklet with them! and ykw?? he’d teach them coding too! which is one aspect of our technological era that i think wwx would excel at because there is so much craftiness required for coding and since coding is so essential for simulations and analysis in physics, wwx could teach them...some python, lol. 😭😭 also, i want to add, wei wuxian would 100% be that college professor with a league of papers published and held in high regard so that for each course he teaches, his own work could be a relevant reference which his students would find SO cool and maybe even funny.
okay, i’m done feeding you my physics professor!wwx agenda but i also think him teaching an ethics class would be fun. and also P.E. no but imagine a sociology course with wei wuxian? or a music major? the possibilities are literally endless but you probably won’t catch wwx anywhere near a culinary school.
#ask#now why do i suddenly wanna write a modern au with profs wwx and lwj#coz professor wei wuxian would be SUCH A DELIGHT#and lan wangji is such an awesome patient fatherly teacher too#they’d be a power duo in their academia circles#wei wuxian appreciation#wei wuxian#mxtx mdzs#mdzs
44 notes
·
View notes
Text
CAFFEINE, CODE, AND COUCH CONFESSIONS



Warnings: coffee addiction
Tim Drake, the resident tech genius of Wayne Manor, had a mission: to teach you the intricacies of coding. Armed with a whiteboard, a stack of textbooks, and a steely determination, he embarked on this noble quest. Little did he know that unraveling the mysteries of Python and JavaScript would be the least challenging part.
Tim sat you down in the cozy corner of the Batcave, the glow of the Batcomputer casting shadows on his face. He explained loops, variables, and functions with the fervor of a preacher. But your brain? It was like a stubborn old laptop running Windows 95—slow, glitchy, and prone to crashing.
"Okay, so if you have a nested loop," Tim said, pointing at the whiteboard, "you'll need to—"
You interrupted. Again. "Wait, wait. What's a nested loop? Is it like a Russian doll situation?"
Tim sighed, rubbing his temples. "No, it's not—"
"But what if the Russian doll is an array?" you asked, eyes wide.
Tim's patience wavered. "It's not—"
"But what if the array contains Batman's utility belt gadgets?" you persisted.
He pinched the bridge of his nose. "That's not—"
Coding fatigue set in. Tim's eyes glazed over as you continued your relentless questioning. He needed a distraction—a break from the syntax and semicolons. So, he proposed a truce: "How about we take a snack break?"
You perked up. "Snacks? Now you're speaking my language."
Soon, the Batcave echoed with the rustling of chip bags and the clinking of coffee mugs. Tim brewed a fresh pot of coffee—the fifth one that day—and you raised an eyebrow.
"Tim, you're going to turn into a jittery metahuman," you warned.
He grinned, sipping from his mug. "Nah, I've built up a tolerance."
The couch beckoned, its cushions inviting. Tim abandoned the whiteboard, and you both sank into its plush embrace. Laptops forgotten, you fired up the gaming console. The Batcave's massive screen displayed the latest multiplayer shooter.
"Ready to kick some virtual butt?" you asked, controller in hand.
Tim hesitated. "Actually, can we watch movies instead?"
You raised an eyebrow. "Movies? Since when do you—"
"—binge-watch romantic comedies?" Tim finished, cheeks flushing. "I may or may not have a soft spot for cheesy love stories."
And so, you traded code for rom-coms, coffee for popcorn. Tim's head found its way to your lap, and you stroked his hair absentmindedly.
"Promise me," you said, "no more coffee. Your heart rate is rivaling the Bat-Signal."
He grumbled but complied. "Fine. But only because you're the best code-cracking partner."
As the credits rolled on the screen, Tim whispered, "Maybe I'll write an algorithm to predict our next movie choice."
You chuckled. "Or we could just flip a coin."
And there, in the dim glow of the Batcave, you realized that maybe—just maybe—love was the most complex code of all.
#yn#spotify#x reader#viralpost#batfam#x yn#tim drake#timothy drake#red robin#batboy#tim drake x reader#tim drake x y/n
138 notes
·
View notes
Text






Book 576
Pancha Tantra
Walton Ford
Taschen 2009
Walton Ford (b. 1960) is an American artist whose work mimics the style of naturalist illustrations, in particular those of the colonial era and often featuring extinct species. Highly symbolic and allegorical, offering clues, jokes, and references to relevant texts and other works, Ford’s paintings call out the horrors and hubris of colonialism, politics, natural history, industrialism, and humanity’s deleterious effect on the environment.
While not the first published collection of his work, Pancha Tantra is certainly the most impressive. Measuring 11.5” x 15”, 320 pages, and weighing around 8 lbs., the book offers a thrilling array of Ford’s work from the early 90s to the early aughts. While at first glance a Ford painting may appear to be a 19th century naturalist painting, there is something not quite right about it. In Diagnosis (1996), European starlings are practically being swallowed by Black-necked stork, whose namesake neck is bent back in an awkward and disturbing way. In Atma (1998), a reticulated python balances a caged lorikeet on its head. In Chingado (1998), a Brahmin bull is being suffocated by a jaguar, jaws clenched tight to the bull’s face and neck. The key to these works lies in the details: the notes scribbled in pencil along the margins, a brand on an animal’s hide, a piece of fruit from a specific part of the world is eaten by animal from another, a Latin inscription, a tiny creature being carelessly trampled underfoot by a much larger one.
Nature in Ford’s world is much more than simply “red in tooth and claw”, it is relentless and brutal, caused as much by need as by indifference and avarice, where species lost to consumption are not just cautionary tales, but premonitions.
#bookshelf#personal collection#personal library#books#library#bibliophile#book lover#illustrated book#booklr#natural history#art#pantra tantra#walton ford#taschen
16 notes
·
View notes
Text
What is the most awesome Microsoft product? Why?
The “most awesome” Microsoft product depends on your needs, but here are some top contenders and why they stand out:
Top Microsoft Products and Their Awesome Features
1. Microsoft Excel
Why? It’s the ultimate tool for data analysis, automation (with Power Query & VBA), and visualization (Power Pivot, PivotTables).
Game-changer feature: Excel’s Power Query and dynamic arrays revolutionized how users clean and analyze data.
2. Visual Studio Code (VS Code)
Why? A lightweight, free, and extensible code editor loved by developers.
Game-changer feature: Its extensions marketplace (e.g., GitHub Copilot, Docker, Python support) makes it indispensable for devs.
3. Windows Subsystem for Linux (WSL)
Why? Lets you run a full Linux kernel inside Windows—perfect for developers.
Game-changer feature: WSL 2 with GPU acceleration and Docker support bridges the gap between Windows and Linux.
4. Azure (Microsoft Cloud)
Why? A powerhouse for AI, cloud computing, and enterprise solutions.
Game-changer feature: Azure OpenAI Service (GPT-4 integration) and AI-driven analytics make it a leader in cloud tech.
5. Microsoft Power BI
Why? Dominates business intelligence with intuitive dashboards and AI insights.
Game-changer feature: Natural language Q&A lets users ask data questions in plain English.
Honorable Mentions:
GitHub (owned by Microsoft) – The #1 platform for developers.
Microsoft Teams – Revolutionized remote work with deep Office 365 integration.
Xbox Game Pass – Netflix-style gaming with cloud streaming.
Final Verdict?
If you’re a developer, VS Code or WSL is unbeatable. If you’re into data, Excel or Power BI wins. For cutting-edge cloud/AI, Azure is king.
What’s your favorite?
If you need any Microsoft products, such as Windows , Office , Visual Studio, or Server , you can go and get it from our online store keyingo.com
8 notes
·
View notes
Text
Tierlist part 4: Python
Python is an interesting case. On one hand i absolutely hate it. The dynamic type system is not fun to work with especially when you accidentally have created a reference to an array instead of cloning it. I have never gotten round to completely understanding how class work cause it just seems like a mess. On the other hand it's a great toy. There is just a bunch of syntax like for else and the most important list comprehension that makes it an ideal playground for the writing the most cursed code. It's a good entry to code golfing because of that. So that leaves the question of where to put it. So uhmmm, let me just find the knife and do a little dissecting. There. Perfect. A tier as a toy. D tier as a language to write actual projects in.
Part 3
#Possibly a bit mean towards python but i can't be kind if there is dynamic types. I am C-official after all#Seems its a good time to add conlangs to the poll#Somehow i haw voted the most popular option each time. That will probably change soon.#Im at work now and should get back to write php :(#c-official
16 notes
·
View notes