#mean python: a=input()
Explore tagged Tumblr posts
Text
Man this day sucked balls
#i had to get up at 5:45am#that was the first worst sign#it was well until i went home for my zoom lesson#since i was like the main coordinator for one big event which had multiple small events#my boss called me and was like hey where is the portable ultrasound for the event#and she found it but the charger was missing#so i asked people responsible for the smaller events who used that ultrasound if they know anything and they were like nope#and one even managed to throw shade on me bc it has been like 2 weeks since the event#after my zoom lesson i cried abt that stupid charger#but i was like hold up i have 20 minutes only to cry bc i have my next lesson in person and i have to go#and then i went and i managed to forget abt that stupid lost charger#and i was like yay i will learn python#and then i did learn the basics and then it started to get complicated and i was lost and then our task was like#hell#and then i tried to make something at least of my task. to like define functions and stuff#and it wasnt possible#and then our teacher kind of wrote the script for the 1st part of the assignment#and i was like okay#and i tried it and the int thing didnt work it was like no you cant put it there where your teacher put it#and i was like fuck then#i just learned how to write a if else and now i have to make two different triangle area scripts baded on input and so that it would work#for non existing triangles#and like what does it mean a triangle with 4 3 and 9 as edge lengths#what do you want from me? an error output? triangle does not exist? what?#either way im fucked#i have to wake up just as early tomorrow#and i have to do a lecture for schoolkids on saturday and my ppt is not finished#and its not like ill have time tomorrow bc i work from 7am to 9pm bc im maybe a masochist#which means even less sleep#i think i have so much going on i want to just. scream.
0 notes
Text
back to basics


mostly free resources to help you learn the basics that i've gathered for myself so far that i think are cool
everyday
gcfglobal - about the internet, online safety and for kids, life skills like applying for jobs, career planning, resume writing, online learning, today's skills like 3d printing, photoshop, smartphone basics, microsoft office apps, and mac friendly. they have core skills like reading, math, science, language learning - some topics are sparse so hopefully they keep adding things on. great site to start off on learning.
handsonbanking - learn about finances. after highschool, credit, banking, investing, money management, debt, goal setting, loans, cars, small businesses, military, insurance, retirement, etc.
bbc - learning for all ages. primary to adult. arts, history, science, math, reading, english, french, all the way to functional and vocational skills for adults as well, great site!
education.ket - workplace essential skills
general education
mathsgenie - GCSE revision, grade 1-9, math stages 1-14, provides more resources! completely free.
khan academy - pre-k to college, life skills, test prep (sats, mcat, etc), get ready courses, AP, partner courses like NASA, etc. so much more!
aleks - k-12 + higher ed learning program. adapts to each student.
biology4kids - learn biology
cosmos4kids - learn astronomy basics
chem4kids - learn chemistry
physics4kids - learn physics
numbernut - math basics (arithmetic, fractions and decimals, roots and exponents, prealgebra)
education.ket - primary to adult. includes highschool equivalent test prep, the core skills. they have a free resource library and they sell workbooks. they have one on work-life essentials (high demand career sectors + soft skills)
youtube channels
the organic chemistry tutor
khanacademy
crashcourse
tabletclassmath
2minmaths
kevinmathscience
professor leonard
greenemath
mathantics
3blue1brown
literacy
readworks - reading comprehension, build background knowledge, grow your vocabulary, strengthen strategic reading
chompchomp - grammar knowledge
tutors
not the "free resource" part of this post but sometimes we forget we can be tutored especially as an adult. just because we don't have formal education does not mean we can't get 1:1 teaching! please do you research and don't be afraid to try out different tutors. and remember you're not dumb just because someone's teaching style doesn't match up with your learning style.
cambridge coaching - medical school, mba and business, law school, graduate, college academics, high school and college process, middle school and high school admissions
preply - language tutoring. affordable!
revolutionprep - math, science, english, history, computer science (ap, html/css, java, python c++), foreign languages (german, korean, french, italian, spanish, japanese, chinese, esl)
varsity tutors - k-5 subjects, ap, test prep, languages, math, science & engineering, coding, homeschool, college essays, essay editing, etc
chegg - biology, business, engineering/computer science, math, homework help, textbook support, rent and buying books
learn to be - k-12 subjects
for languages
lingq - app. created by steve kaufmann, a polygot (fluent in 20+ languages) an amazing language learning platform that compiles content in 20+ languages like podcasts, graded readers, story times, vlogs, radio, books, the feature to put in your own books! immersion, comprehensible input.
flexiclasses - option to study abroad, resources to learn, mandarin, cantonese, japanese, vietnamese, korean, italian, russian, taiwanese hokkien, shanghainese.
fluentin3months - bootcamp, consultation available, languages: spanish, french, korean, german, chinese, japanese, russian, italian.
fluenz - spanish immersion both online and in person - intensive.
pimsleur - not tutoring** online learning using apps and their method. up to 50 languages, free trial available.
incase time has passed since i last posted this, check on the original post (not the reblogs) to see if i updated link or added new resources. i think i want to add laguage resources at some point too but until then, happy learning!!
#study#education resources#resources#learning#language learning#math#english languages#languages#japanese#mandarin#arabic#italian#computer science#wed design#coding#codeblr#fluency#online learning#learn#digital learning#education#studyinspo#study resources#educate yourselves#self improvement#mathematics#mathblr#resource
757 notes
·
View notes
Text
Feeling inspired by a post I saw a few months ago, I programmed a simple game of tic-tac-toe in python, in a single expression. Like regular functional programming, this means I can't mutate variables. But more than functional programming, this also means I can't
Declare variables at all
Declare functions
Use most loops and branch structures
The resulting program is 1730 characters long after removing all the non-strictly necessary whitespace and contains "lambda" 9 times.
The players are asked where they want to play using a number for each cell, in the configuration of a standard numpad. The program checks for invalid input too.
Source code under the cut
(lambda grid,toggle,players,cells_filled,print_grid,check_victory,ask_xy,validate_input,the_game:(lambda victor:print('=====\n'+('Draw.'if victor is None else f"{victor} wins!")))(the_game(grid,players,cells_filled,toggle,print_grid,check_victory,ask_xy,validate_input,the_game)))([[7,8,9],[4,5,6],[1,2,3]],True,['X','O'],0,lambda grid:print('\n'+'\n'.join(' '.join(map(str,ligne))for ligne in grid)),lambda grid,players:([player for player in players if any(set(grid[i][col]for i in[0,1,2])=={player}for col in[0,1,2])or any(set(grid[row])=={player}for row in[0,1,2])or set(grid[i][i]for i in[0,1,2])=={player}or set(grid[i][2-i]for i in[0,1,2])=={player}]+[None])[0],lambda players,toggle,grid,ask_xy,validate_input:validate_input(input(f"{players[toggle]}, place your symbol: "),grid,players,toggle,ask_xy,validate_input),lambda selection,grid,players,toggle,ask_xy,validate_input:(lambda selection,grid,players,toggle,ask_xy,validate_input:(selection%3,2-selection//3)if grid[2-selection//3][selection%3]not in players else ask_xy(players,toggle,grid,ask_xy,validate_input))(int(selection)-1,grid,players,toggle,ask_xy,validate_input)if len(selection)==1 and'0'<selection<='9'else ask_xy(players,toggle,grid,ask_xy,validate_input),lambda grid,players,cells_filled,toggle,print_grid,check_victory,ask_xy,validate_input,the_game:(print_grid(grid),the_game((lambda players,toggle,xy,grid:[[players[not toggle]if(j,i)==xy else grid[i][j]for j in[0,1,2]]for i in[0,1,2]])(players,toggle,ask_xy(players,not toggle,grid,ask_xy,validate_input),grid),players,cells_filled+1,not toggle,print_grid,check_victory,ask_xy,validate_input,the_game)if check_victory(grid,players)is None and cells_filled<9 else check_victory(grid,players))[1])
If you can't read any of this, don't worry, I can't either.
You can find the original code and a slightly more readable version on my gitlab: https://gitlab.com/Rijaja/gaae/-/tree/main/tttaae (but careful, the game is in French)
96 notes
·
View notes
Text
op you speak to my soul
bitch java is so fucking annoying why does the S in String need to be capitalized but the i in int has to be in lowercase??? why do you need to import a whole ass module just to take an input from the user??? why are all the commands so fucking long and hard to remember??? JUST DIE
#i can never frickin remember what the heck to do in my java code#the S in String still pisses me off#and exactly why do i need to import a whole module#mean python: a=input()#now that's what i call short and sweet ^^#im forever going go have a love hate relationship with java#java#codeblr#coding#computer science#java code#java developer#programming languages#programming#code#comp sci#app dev
137 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
Part 2 of a Computer Science student's analysis of the FNAF: SB intro
Full with tech lingo, abundant personal interpretations, and translations so that my tech illiterate fellas may undertand whatever the fuck im yapping about!
This post is written under the context that you've read my last analysis. I highly recommend you first check out these two posts before continuing with this one if you haven't already: > First post + Continuation ( IMPORTANT!! ) > An addition to the first post
Once you've read through those two (three?) posts, come back here! You're back? You've read them? Awesome! Let's begin then. =)
Reminder! This analysis has been done based off of my own understanding of the subject of both computing and programming - which I am currently studying. I would also like to yet again shout out this reddit post, that also gives a great perspective. Definitely check it out if you're interested later!
Also I have not re-read this, you may find typos - don't hold it against me, they will be fixed, someday =(
Now then, fellas, this is where shit gets wild.
Last post, I talked about the command box we can see at the top right corner of the intro - what each command did and how it basically corresponded to what happens to freddy in the events of the intro.
However, you might recall I mentioned a second command box, the one found at the left side of the screen. This command box is by far the most important piece of information we have throughout the entire duration of the intro. Mostly, because it changes 3 times.
It changes a total of 3 times in the time it takes for the right command box to finish.
Each time it changes, it displays new lines of code. And every single line of code it displays, tells us a lot about what is happening to Freddy.
This is the first block of code that we get:
system32> Get-568_win heat_869%yTnu_bl8 lvl_b> 228.wst serial.dot_btb rec.556> dtd /
You might inmediately realize that the first line of code from this command box matches exactly the one from the first analysis. Here are both of them as comparison.
Hopefully, you've already made the connection. This command box is the one possibly being run by the Glitchtrap/Vanny Virus. Whatever lines of code appear on the command box to the left, are the ones being executed by the Virus - and they affect Freddy in real time. However, the command box on the right ir Freddy's, so to speak.
Both CLI (command line interfaces) are being run at the same time - yet independently of one another. Keep this in mind.
I don't want to go too in depth with this first block of code. All you need to know is that it moves around some directories and runs something called 'dtd', wich could be a command or a program.
The next two blocks of code, however? Ohhh damn... This is it, fellas. This is what I've been waiting for.
Now, I want you to know that this doesn't quite resemble any 'real' code, at least not at first glance. I do believe that it is a very 'condensed' form of the Python programming language, since the syntaxing of the commands shown here somewhat resemble how a string written in Python would look like.
So, I have taken the time to try to decipher what each line means, and what they do. And well, let's just say it explains why Freddy wasn't affected by the Virus in the first place.
def rule(x) return warning78 init; self_overdrive abort(3)RTLKt abort(5)XGE END
This is the second block of code that we're shown, so lets break it down.
def rule(x) return warning78 init;
This string would define "rule" as a function, specifying "x" as the parameter. Basically, this line specifies that if the command rule is inputted, it should return whatever value (or argument) x has taken.
Normally, define is followed by a return function, which is why I've shown them together, as well as the init; command.
The command return followed by "warning78", makes it so whenever we call upon the function rule, it shows us whatever warning78 may be - and judging as to what happens in the intro, it could be any of the multiple warnings that appear in Freddy's GUI. Or it could also easily be the big "WARNING!" message that can be seen the entire time near the top of the screen.
Lastly, the init; command isn't exactly a standardized python command - but it is a common abreviation of the initialization command, where in the field of programming, it means "the assignment of an initial value for a data object or variable". Basically, it's when you assign the initial values and variables to a program so it can start.
All in all, these three lines create a command that, when called upon, gives out the warning78.
self_overdrive
Again, not really a python function, but important nontheless. This command doesn't have a specific meaning, but we can try to understand what it does.
The term overdrive doesn't really exist in the field of computing/programming. However, it is asociated with overclocking - "the practice of increasing the clock rate of a computer to exceed that certified by the manufacturer" - Overdrive is also a term in the field of music, also known as distorsion, which is when you force an amplifier to output past its limits.
Both of these definitions go around the same concept, pushing a computer to its limits so that it works better, or faster - even while it possibly damages the computer.
We can then assume that the function self_overdrive is making Freddy's system run pasts its usual limits. Which is why I believe Freddy's integrity level plumits during the intro.
abort(3)RTLKt abort(5)XGE END
Lastly, we have these three lines.
The abort function isn't a real python function - but I believe you can asume what it does. Both lines are attempting to kill something - a program, a process, another function... However, I am not sure wether these two are really functions, since they could very easily be error handling messages. Essencially, warning messages that the system returns when something crashes, for example.
The last line, END, specifies the end of this string of code.
Which leads us to the third and last block of code. The one which in my professional opinion, is the one that reveals to us why Freddy's cool with us during Security Breach! =]
report.NULL gridlock [ax674] init_task>void alloc [overload] SW.failure return /
THIS IS WHAT WE'VE BEEN WAITING FOR, FRIENDS. THIS IS IT. This is the part where I had the most fun with this analysis...
report.NULL
Now, usually report, in the field of programming and software, it means to record or log something. For example an error log, or crash log. However, it being followed by NULL could also mean that this is an error handling message of sorts.
In computing, Null is, well, zero. It's nothing. It's the absence of value, when something that should be there, isn't.
From this, we could gather that this is a warning message that attempted to report something, yet failed to find anything to report back. No value at all.
...or, we could take this line literally. Taking into consideration that this code is being executed by the virus - this line of code could be taken as an attempt by the virus to stop Freddy's system from freaking out.
Remember that this entire code is being executed as Freddy's actively getting a big flashing WARNING! message. So, this line of code could be an effort to silence it, returning a null value to a warning message.
Both scenarios are plausible, so stick with the one you think fits best!
gridlock [ax674]
This one... man... this line was wild. It's where everything clicked for me. You will want to ignore the characters [ax674], what we truly care about is the first word: gridlock.
You see, a gridlock isn't really a term used in computing at all. It is a term refering to a "severe congestion of traffic, where continuous queues of vehicles block an entire intersection". HOWEVER, gridlock is also known as another term for deadlock.
A deadlock is what's known as a stalemate. A situation where two opposing parties come to a point where no progress can be made. In programming, it means basically the same thing.
A situation where two processes can't proceed, since both of them are waiting for the other to release a resource. Now, imagine this scenario. We have two processes, A and B, and two resources, R1 and R2.
Process A is currently using resource R1.
Process B is currently using resource R2.
Process A requests resource R2, but is blocked because it's held by Process B.
Process B requests resource R1, but is blocked because it's held by Process A.
Now... imagine this situation, but with Freddy, and the virus.
What we most likely have here, the line gridlock [ax674], is an error handling message, warning that a deadlock is ocurring. The string of characters beside it has no meaning, and could easily be but an error handling code of sorts.
init_task>void
I've explained before that init is the abreviation of initialization. So, we can gather that this is a command that is attempting to initialize a task. Now then, in the context of the previous line, this one could mean one of two things:
The virus is attempting to initialize a task (a set of instructions) called void.
The virus is attempting to initialize a task, however, due to the deadlock, it returns this line as an error message, indicating a void return. In programming, when a function returns the word void, it usually means that the function was not able to return a value. It is similar to Null, yet not the same.
Either of these could be a posibility, so I will leave it to your personal interpretation.
And here it when it all goes to hell...
alloc [overload] SW.failure return
Alloc is not a real function, but it can be considered an abreviation of the word allocation. In computing, the allocation is the assignment of memory and resources to the various processes the system may have.
Proper memory and resource allocation is very important in a computer. As you may know, a computer as a limited amount of RAM it can work with, and the same goes for it's processing power. But, for example, what happens when you try to allocate resources that aren't available?
Well, a lot of things may happen. Mainly, the program could hang, the process could freeze - or the entire system could crash!
Remember earlier, we saw that it was likely that Freddy and the virus were in a deadlock. Yet, the Virus tried to allocate more resources to itself... Which overloaded the system, and likely resulted in the next line.
SW.failure has no real meaning - but I've interpreted the first two characters [SW] as software. This would make this line an error message warning about a software failure.
So... What does this all mean? How does it all tie together? Why didn't Freddy get infected by the Virus? Because it got too greedy. It tried to allocate too many resources/memory, overloaded the system and crashed both itself and Freddy.
Why only Freddy, though? Why didn't this happen to the other animatronics? That... I'm not sure. I believe this is more of a lore question rather than computer question.
In my opinion, I don't think this was a case of 'Freddy knew that he was getting infected by a virus, and fought back'. I'm leaning more to the posibility of it being a 'wrong place wrong time' type of situation... or maybe 'right place right time'? In general, a lot of factors and a lot of different things happened that lead to this specific scenario happening.
Anyways, this is it! This has been my analysis - or nerdy infodumping, if you please.
I do hope that I was able to teach you something today, and that this whole analysis helps you understand the animatronics a bit better - and helps you with future fanfics, comics, AUs, artworks... whatever!
One last reminder - if you have any more questions about this stuff, my ask box is open! I love talking about this stuff!!
Oh, and, coming soon...
DJMM's Bouncer Mode ! A theory by a computer science student as to why it's still present, and why it makes him so aggressive.
#oh god is this post too long?#i hope this doesn't crash anyones phone im so sorry#anyways yea. DJMM bouncer mode explained coming soon#not me being a computer nerd AGAIN?#fnaf#fnaf sb#fnaf security breach#five nights at freddy's#security breach#snailsnarks#fnaf djmm#fnaf dj music man
96 notes
·
View notes
Text
These are 50 triangles "learning" themselves to mimic this image of a hot dog.
If you clicked "Read more", then I assume you'd be interested to hear more about this. I'll try my best, sorry if it ends up a bit rambly. Here is how I did that.
Points in multiple dimensions and function optimization
This section roughly describes some stuff you need to know before all the other stuff.
Multiple dimensions - Wikipedia roughly defines dimensionality as "The minimum number of coordinates needed to specify any point within it", meaning that for a 2-dimensional space, you need 2 numbers to specify the coordinates (x and y), but in a 3-dimensional space you need 3 numbers (x, y, and z). There are an infinite amount of dimensions (yes, even one million dimensional space exists)
Function optimization - Optimization functions try and optimize the inputs of a function to get a given output (usually the minimum, maximum, or some specific value).
How to train your triangles
Representing triangles as points - First, we need to convert our triangles to points. Here are the values that I use. (every value is normalized between 0 and 1) • 4 values for color (r, g, b, a) • 6 values for the position of each point on the triangle (x, y pair multiplied by 3 vertices) Each triangle needs 10 values, so for 10 triangles we'd need 100 values, so any image containing 10 triangles can be represented as a point in 100-dimensional space
Preparing for the optimization function - Now that we can create images using points in space, we need to tell the optimization function what to optimize. In this case - minimize the difference between 2 images (the source and the triangles). I'll be using RMSE
Training - We finally have all the things to start training. Optimization functions are a very interesting and hard field of CS (its most prominent use is in neural networks), so instead of writing my own, I'll use something from people who actually know what they're doing. I'm writing all of this code in Python, using ZOOpt. The function that ZOOpt is trying to optimize goes like so: • Generate an image from triangles using the input • Compare that image to the image we're trying to get • Return the difference
That's it! We restrict how long it takes by setting a limit on how many times can the optimizer call the function and run.
Thanks for reading. Sorry if it's a bit bad, writing isn't my forte. This was inspired by this.
You can find my (bad) code here:
https://gist.github.com/NikiTricky2/6f6e8c7c28bd5393c1c605879e2de5ff
Here is one more image for you getting so far
123 notes
·
View notes
Text
This might be really cringe but fuck it I need to get it off my chest (also this is really long and rather nerdy so. brace yourselves)
So I'm taking linear algebra and differential equations right now. If that means nothing to you, it's the next class in the sequence after Calculus 3, and is the highest level of math offered at the community college level (at least where I'm at).
The professor gave us a spreadsheet to use for Euler's Method and Modified Euler's method, which are basically very tedious methods of approximating the value of a differential equation at a certain input. Before he gave this to us, I had already written Python scripts to do the same thing, cause that was the only way I could understand them (like not even exaggerating, they made 0 sense to me until I converted them into code lmao).
So on the first quiz I decided to use the provided spreadsheet to find the values for a particular problem, and then I also ran my Python scripts to see if I got the same result... and for the Modified Euler's method, I didn't. I then found some online calculators, and they also got the same value that my Python script got. The spreadsheet used a slightly different method, and so got a slightly different result.
I decided to implement the method I used in the Python script as another tab of the spreadsheet, then I messaged the professor asking why these values were different, and included my version of the spreadsheet.
He confirmed that both methods are valid versions so we could use either one (and even sent out a class wide announcement saying so). I was like yay I didn't make a mistake :) and then moved on
...until I watched the video he posted going over all the questions on the quiz. When he got to this particular problem, he briefly showed the spreadsheet on the screen. But it was MY version of the spreadsheet!!!! Like I named the tab I added "Brianna's Modified Euler's" and that tab was there!!!!!
And like, sure. He probably just used it because he already had it open or something. I know it wasn't about me. But seeing him use MY version of the spreadsheet made my heart flutter and it was enough to make me write this stupid post
Seriously why does this make me so happy???? I'm afraid there might be something wrong with me (which, well. isn't new lmao)
4 notes
·
View notes
Text



this week on megumi.fm ▸ coding and coffeeshops
📋 Tasks
💻 Internship ↳ lab meet!!! got to learn about the other projects in the lab ↳ got work from home approved!! ↳ optimize protein seq code // account for missing residues ✅ ↳ add on a binding site identifier function for code using 4.5A distance threshold ✅ ↳ optimize binding site code // reducing time complexity for large PDB file inputs ✅ ↳ download and extract alphafold human protein repository and analyze pdb file formats ↳ set up progress tracker and upload code on colab ✅ 🎓 Uni ↳ Final Project: update images quality according to changes mentioned ✅ ↳ renew uni email for extra credit classes ✅ ↳ extra credit classes started this week! 🩺Radiomics Projects ↳ call with teammates to discuss next steps ✅ 📧 Application-related ↳ finished masters application form for 1/1 Uni (waiting on my referee reports) ✅ ↳ finalize referee report from my profs ✅
📅 Daily-s
🛌 consistent sleep [7/7] 💧 good water intake [5/7] 👟 exercise [5/7]
Fun Stuff this week
🍻 met up with my bestie @muakrrr <3 it was a stressful tuesday so meeting him for lunch was super comforting! he bought this cute purple drink and I got myself some ginger ale and the waiter served us the wrong drinks (gender and expectations something something) and it was amusing to watch them get confused when we corrected them 🎂 mom's b'day this week!! went out for dinner with her!! 🛒 went shopping with relatives who I haven't seen in years. bought myself a book! (rip my bookshelf) ☕ went out for coffee and dinner with my girlies (the same besties who I exchanged mugs with). we're trying to spend as much time together as possible before we leave to different countries for our masters 🎮 continuing the beginner's guide 📺 ongoing: Marry my Husband, Cherry Magic Th, Last Twilight 📺 binged: KinnPorsche The Series
📻 This week's soundtrack
Love Wins All by IU (been crying over this music video for days now. it's beautiful) KinnPorsche theme by Slot Machine: Kinn's theme [aka Phiang Waichai; TH] | Porche's theme [aka Free Fall; Eng] (first of all this is one of the catchiest theme songs to exist second only to SPECIALZ aka the JJK s2 op i'm also particularly losing my mind over how the two themes are love letters to the main characters from each other... the narrative parallels of it all are driving me insane sldkhlaksjkshs) Dum Dum by Jeff Satur + the Live Unchained version where his vocals are heavenly (maybe im so drawn to this song because the chorus is similar to the melodic motifs of the KPTS themes/soundtrack, either way, the show introduced me to him and god. I've been voraciously consuming his discography.) Ghost by Jeff Satur (on repeat all week. thoroughly obsessed with this song- the lyricism, his voice, the storyline in the MV, his acting, everything. wow. truly.)
---
[Jan 22 to 28 ; week 4/52 || I. love. my. internship. like. I have been having the most fun time problem solving and troubleshooting. it's also super satisfying to see the outcome of my code. it's been a while since I used python (I've been coding on C) so I forget that python has a lot of inbuilt functions that would do the same tasks I inadvertently entrust my nested loops with, and finding out about them is always so joyous (although it means I have to scrap off several chunks of code). i am a bit annoyed though, because the other intern isn't really doing any work that we're entrusted with so I'm having to carry the team and it's taking me too much time. but oh well. I've suggested we split tasks from next week, hopefully that'll make things better.
I've also been procrastinating a lot when it comes to my masters applications and it really hit me this week when I had to run to uni several times to get things approved and completed. Now that I'll get to work from home I need to set up a proper schedule to get application work completed wayy in advance. also need to resume my GRE prep from next week.]
#52wktracker#studyblr#study blog#studyspo#stemblr#stem student#study goals#student life#college student#studying#stem studyblr#adhd studyblr#adhd student#study motivation#100 days of productivity#study inspo#study inspiration#gradblr#uniblr#studyinspo#sciblr#study aesthetic#study blr#study motivator#100 days of self discipline#100 days of studying#stem academia#bio student#100 dop#100dop
27 notes
·
View notes
Text
I think a lot sometimes about the pushback against the concept of talent within arts and I mean yeah on some level I get it, but also the suggestion that anyone can learn to draw is, to me, like saying anyone can learn to program.
like yes, sure, at the end of the day just about anyone can likely find some way of forming vague scribbles using their tool or input peripheral of choice, but that's basically like saying just about anyone can find ways of writing semicolons and the words if, then, else on some kind of digital computer - the difficulty was never in achieving the most basic and abstracted interpretation of the act, but in an understanding of how your actions translate into the kind of end result that you want.
in programming, the most basic starter program that nearly every extremely basic example or tutorial will start with is called Hello World, which is simply a program that prints or otherwise displays the text Hello World to the user.
#include <iostream>
in python, this can be done with a single line of code, like so:
print("Hello World!")
while in C++, that same program will take a bit more work:
#include <iostream>
int main()
{
std::cout << "Hello World!\n";
return 0;
}
Now if you have the ability to copy that text into a file then congratulations, you have the ability to write a program! But, obviously, to really do any actual programming, you kind of need to know what any of the above actually means and what it makes the computer actually do.
This by the way is why the "Learn to Code" kind of initiatives tend not to work out very well, because while technically anyone can write code, actually understanding how to code is a much more complicated affair that can't necessarily be directly taught - it's something that has to be understood.
What is needed, basically, is a system - a kind of mental library of symbols and concepts that you can rearrange and reassemble in various ways to reach a particular solution; a point where you can break down a larger problem into a bunch of much smaller, more individualised problems that are easier to solve one by one.
This is basically how expertise works - whether consciously or (much more often!) not, you form models and systems in your head to let you simplify and, to an extent, automate otherwise complex tasks. If you've ever looked at something and just felt this feeling of "aha, I see how this works", then you should technically already know what I'm talking about.
And look, this is not an argument against practice - expertise takes work, it takes training and experience and gradually discovering ways in which things start making sense to you, even those things that you might have an intuitive knack for. However, what I do think is that telling people who say they can't draw to "just draw anyway" is a lot like, and just as dismissive as, "Learn to Code" because, just like how saying "I don't know how to code" generally is not meant to be understood as "I am physically unable to write words into a text document", saying "I can't draw" typically does not mean being physically unable to form lines or shapes on paper or in a digital image or whatever. Rather, it's a statement about being unable to break down the problem of how to reach a desired end result into smaller, manageable steps that you are able to grasp. And, much like with programming, not everyone will have an eye, or a mind, for it: just like some people struggle with spelling or mathematics or, indeed, code, some people also struggle with colour or perspective or object shape or lighting and shading. And, by contrast, for some people these things also come much more easily and naturally than others.
Not everyone can do everything - at least not to such an extent that it would let them do something they would want to do. Practice can help, certainly, but it's not necessarily guaranteed to bridge the gap either. I mean, I personally find it baffling how many people seem to struggle with what I consider basic computer literacy, but that's a lot to do with the fact that I just happen to find much of it pretty simple and straightforward where a lot of people don't. Not everyone has a base aptitude to build on for every field or skill, and that's both fine and normal. And I mean - something as simple as the ability to put in the effort to practice and learn a particular skill or expertise is in itself a skill, and one that can be very selective about what contexts it's willing to apply to.
9 notes
·
View notes
Text
Reawakened; Into the Abyss – Domestic prelude
From my CW final assignment. Every other character belongs to me. This story is 5 pages long in it’s entirety. I feel the need to specify that the 4 characters at the end are Sanrio OC’s and the first 3 are Elemental Alicorns.
🌫️💭🕸️📻🪦🍽️🌑🕳️❔👁️🗨️🕒
Thalassorion laid in a paradise–like island, watching the waves caress the beach. Verdanox and Luxvian suddenly ran over, looking up at their mentor. Thalassorion looked down, “What is it?” “Someone’s at the pizzeria. Appreciate they’re trying to open the pizzeria again.” Verdanox said, “We can’t let them get back in, right?” Luxvian added, standing behind Verdanox. Thalassorion sighed and stood up, walking off with the two running after him like they always did when he had to do something they considered interesting enough to witness for themselves.
Lottie helped Yukio, Taffy, and Winnie off the table in the storage room. Outside the room, near the door, sat Fredbear and Spring Bonnie or Tex, who were busy with a Lego set. “Lego’s really improved.” Fredbear noted, looking at the instructions and trying to find the correct set of pieces being pictured. “We’ve been hidden away for the past 37 years, I think about of things other than Lego have changed.” Tex replied. “My point still stands. These pieces are much more..complicated and intricate. They really improved these models and builds. It’s good but also a bad thing. I mean, this set looks like it’s defying gravity!” “Maybe because these are made for kids and kids din’t exactly know about weight distribution? But I think even kids would be able to realize that these parts aren’t properly supported.” Tex sighed as he waited for his friend to finish.
Nearby, standing outside their large music boxes in a corner, floated Jinx and Marionette. “It’s a bit difficult using pronouns other than the basic trio.” Jinx said. Marionette nodded, “What pronouns do you use?” “Oh, I use he/xi/spir/lumi/pup/jin/clow. What about you?” “He/it/ae/xe/ver/spool/string. I don’t know anybody other than you who uses neopronouns.” “Well, Yukio, Taffy, and Winnie use neopronouns.” Jinx replied as the two now sat in their boxes.
“Oh, really? What neopronouns?” Marionette asked. “From what I remember, Yukio uses he/it/fae/spra/fro/glace/antler/chill/fluff/snow/frost/burr. Taffy uses he/coco/rain/choco/puddle/drip/mochi/raindrop/candy/quack/syrup/melt. Winnie uses she/boo/bubbly/ghost/soapy/lather/phantom/whisp/squeak/froth/fizz/mist/scrub.” Jinx responded. “Do you have this memorized or something?” The other puppet asked.
Jinx disappeared into his box and after some comical sounds came out of the box, he reappeared. He held a Sanrio themed notebook and opened it, flipping through a few pages before showing Marionette a page. “Fredbear uses he/teddy/snugg/cuddly/fuzzy/stuffie/hug/pillow/bearie/fur/paw and Tex uses he/ver/spring/bun/tink, if that’s important to you.” “And Freddy and Bonnie?” “Cutest couple in the company–Anyways, Gabriel uses he/it/xe/fae/bea/sparkle/paw/fluff/bun/pup/hug/ze/ae/confetti/sticker/silly/fun/laugh and Jeremy uses he/ey/vey/byte/data/it/input/output/ram/static/type/java/python/01/exe/bass/chord. And can I also tell you Plushtrap and Carl’s pronouns?” “I know I can’t stop you so..”
“Thanks. Plushtrap uses he/trap/puff/chomp and Carl uses he/cake/sweet/sugar/cherry/flesh/rot/candle.” Jinx responded. “I’ve still got a lot more people to write down. I intend to go for Mangle and Endo next. Also, uh, what were your pronouns again?” He added as he clicked his Sanrio pen. “He/it/ae/xe/ver/spool/string. Also they/them but, like, plural. I just like being referred to as more than one, I dunno.” “Probably Lefty.” “Yeah, I’ll have to get that checked.” Marionette sighed as he pulled out his phone. “I’m scheduling an appointment.”
Plushtrap and Carl sat in a small room, drawing. Plushtrap lifted his drawing. “Look, this is you. You fucking suck, loser.” Carl looked up, showing his own drawing. “Yeah, I drew you too. You’re a dumbass. How accurate.” “The fuck does ‘accurate’ mean?” “Oh my god, you’re actually stupid.” Carl sighed.
Carl looked down and pointed at the sketchpad the other small animatronic had done. “What’s in there?” “Uh, nothing.” Carl raised a brow and suddenly snatched it, running off. Plushtrap yelled and sprinted after him, running past a room where Freddy and Bonnie were inside. Freddy was busy doing a Lego set on a nearby table, struggling to understand how to properly put together a particularly intricate Lego building. “Is is that hard?” Bonnie asked. “Yes. Very.” Freddy sighed in defeat as his close friend walked over “Maybe because you’re not on the right page?” The purple bunny robot muttered as he flipped pages back to the proper page. “Oh!” Freddy said, looking closely at the instructions. “Okay, yeah. Your eyesight got better as an animatronic and mine’s got worse–That’s actually probably karma for me making fun of you being blind, huh? Guess I better start praying to some God above for forgiveness. You think God will forgive it makr me more blind?” “Your eyesight can’t get any worse and the same goes for your memory. You always lose things.” “Like what?” “Your hat.” “It just–” “It is LITERALLY on your head.” “Okay, yeah, well..” Freddy sighed and looked back down to the Lego set.
“Shut up, I’m helping you build your Lego city since Fritz is too busy buying more sets and you know he only helps with it involves vehicles.” Freddy said as he finished making one of the supermarket’s walls. “My god, that’s complicated.” He muttered. “Why are you putting the wall on? Wait until you’ve done the inside then put the walls on, that’s common sense. You’re just making it more difficult.” Bonnie sighed.
“You know I’m not smart.” Freddy responded. “Don’t be surprised when I’m dumb or overcomplicate things. That’s, like, my special talent.” “You’re special talent is entertainment, being an idiot is your second.” The animatronic bunny corrected. “Yeah. Was almost my first, unfortunately.”
Out of the room and a few hallways down, Yukio, Taffy, and Winnie were in another room, looking around the dim space. They looked at a screen and walked up to it winnie floated off and looked at a model that was standing, resembling The Singularity from Dead By Daylight; an organic yet inorganic being. She floated around it, her hands in front of her chest but covered by the white sleeves of her oversized dress. She inspected it curiously while Yukio and Taffy stood at the computer. Taffy inspected the screen curiously while Yukio tapped buttons and accidentally turned it on. As the computer turned on, Taffy found a book and dusted it off before opening it. A paper fell out and he grabbed it before coming out from behind the computer.
He walked to Yukio’s side, reading the paper. “What’s that?” Yukio asked curiously, standing on his tippy–toes to try and see what was in the book or on the paper. “‘Questions to ask Vega’ but the e is a 3 and the a is a 4. That’s weird.” Taffy replied.
The computer finished setting up showing a digital version of the model that Winnie was still busy inspecting in the back corner of the room. Winnie looked over. Taffy looked at the paper, “I guess this is Vega. We’re supposed to ask him these questions.” Taffy handed the paper to Yukio who anxiously took it.
“Um, what’s your name?”
“My n4m3 15 V3g4.”
“Okay, what’s your..gender and pronouns?” Yukio said.
“M4ch1n3g3nd3r, v01dg3nd3r, c1rcu1tg3nd3r, 5t4rc0r3g3nd3r, 43th3rg3nd3r, 4nd h3/1t/x3/v3/43/3y.”
“Okay..” Yukio drew out the word. “Uh, any other labels?”
“Cyb0rg, 5ynth, t3chn01d, m3ch4n01d, fl35hb0t, 41–b31ng, 3nt1ty, 4nd 4ut15t1c, 4DHD, 53n50ry pr0c3551ng d150rd3r, 5ch1z04ff3ct1v3, 4nd hyp3rthym3514 th4t c4n b3 tr1gg3r3d by 5yn35th3514.”
“I don’t know what any of that means.” Yukio frowned up at the screen.
“[OBSTACLE DETECTED], [SEARCHING FOR SOURCE OF OBSTACLE..]”
Yukio stared up at the computer silently as Taffy stood beside him. Winnie floated over to the two boys, also watching the screen as it loaded. A multitude of screens appearing before it picked a clip of Yukio standing before it and saying he didn’t understand what was shown before him and analyzing the clip.
“[OBSTACLE FOUND], [OBSTACLE; FAWN BOY DOES NOT UNDERSTAND WHAY IS BEING TOLD]. [SEARCHING FOR SOLUTION..]”
“[SOLUTION FOUND; TRANSLATION FROM LEETSPEAK TO BASIC ENGLISH], [LOADING; LEETSPEAK TO BASIC ENGLISH TRANSLATION..]”
“My name is Vega. Machinegender, voidgender, circuitgender, starcoregender, aethergender, he/it/xe/ve/ae/ey. Cyborg, synth, technoid, mechanoid, fleshbot, AI–being, entity, and autistic, ADHD, sensory processing disorder, schizoaffective, and hyperthymesia that can be triggered by synesthesia.”
Yukio looked down, “I can’t write this down, I don’t know how to spell like that.” He said sadly before looking to Taffy and Winnie for comfortm
“[OBSTACLE DETECTED; FAWN BOY CANNOT WRITE PROPERLY DUE TO LACK OF HIGHER EDUCATION]. [SOLUTION; PRINT RESPONSES].”
Suddenly, the machine started making churning noises and soon, a paper came out with the questions and Vega’s answers below. Winnie floated over to Yukio, looking, at the original paper that was aged and ripped at the edges from its age. She took the paper and flipped it over. “Oh, there’s another question.” She said, making Yukio and Taffy look over curiously. “‘Design a Whimsy Wonderland animatronic’. What’s ‘Whimsy Wonderland’?” She asked, tilting her head. The computer immediately took the orders.
“Name; Niji Sparkle.
Gender and pronouns; cynosgender, glittergender, sodagender, sparklegender, fizzyfluid, Backroomic, neonradientgender, neongenderflux, shinjugender, sodaglowgender, and he/spark/fizz/neon/kiro/bubble.
Alterhuman labels; bubblekin, sodaheart, glitchkin, and keroid.
Neurodivergent labels; cerebriot, dreamshifted, sparkletouched, echoedmind, popkinesis.”
The computer progressively made an image of a Pitbull puppy before throwing the model out. The model, Niji Sparkle, stood up. He waved happily at the shocked trio. “Hi, I’m Niji Sparkle! I’m a Pitbull.” Niji said. A hand suddenly came out of the machine, took the response paper it’d made, and put the model of Niji Sparkle and his information on the back before putting it back in Yukio’s hands then disappearing inside the machine again.
“What do we do with him?” Taffy asked. Yukio shrugged, “Um, bring him to Lottie?” Yukio replied. The boys walked off to go to Lottie as Winnie grabbed Niji and carried him out of the room, following the two.
🌫️💭🕸️📻🪦🍽️🌑🕳️❔👁️🗨️🕒
Um, yeah, that’s the end of the story. Total word count (story); 1,704.
2 notes
·
View notes
Text

The Comprehensive Guide to Web Development, Data Management, and More
Introduction
Everything today is technology driven in this digital world. There's a lot happening behind the scenes when you use your favorite apps, go to websites, and do other things with all of those zeroes and ones — or binary data. In this blog, I will be explaining what all these terminologies really means and other basics of web development, data management etc. We will be discussing them in the simplest way so that this becomes easy to understand for beginners or people who are even remotely interested about technology. JOIN US
What is Web Development?
Web development refers to the work and process of developing a website or web application that can run in a web browser. From laying out individual web page designs before we ever start coding, to how the layout will be implemented through HTML/CSS. There are two major fields of web development — front-end and back-end.
Front-End Development
Front-end development, also known as client-side development, is the part of web development that deals with what users see and interact with on their screens. It involves using languages like HTML, CSS, and JavaScript to create the visual elements of a website, such as buttons, forms, and images. JOIN US
HTML (HyperText Markup Language):
HTML is the foundation of all website, it helps one to organize their content on web platform. It provides the default style to basic elements such as headings, paragraphs and links.
CSS (Cascading Style Sheets):
styles and formats HTML elements. It makes an attractive and user-friendly look of webpage as it controls the colors, fonts, layout.
JavaScript :
A language for adding interactivity to a website Users interact with items, like clicking a button to send in a form or viewing images within the slideshow. JOIN US
Back-End Development
The difference while front-end development is all about what the user sees, back end involves everything that happens behind. The back-end consists of a server, database and application logic that runs on the web.
Server:
A server is a computer that holds website files and provides them to the user browser when they request it. Server-Side: These are populated by back-end developers who build and maintain servers using languages like Python, PHP or Ruby.
Database:
The place where a website keeps its data, from user details to content and settings The database is maintained with services like MySQL, PostgreSQL, or MongoDB. JOIN US
Application Logic —
the code that links front-end and back-end It takes user input, gets data from the database and returns right informations to front-end area.

Why Proper Data Management is Absolutely Critical
Data management — Besides web development this is the most important a part of our Digital World. What Is Data Management? It includes practices, policies and procedures that are used to collect store secure data in controlled way.
Data Storage –
data after being collected needs to be stored securely such data can be stored in relational databases or cloud storage solutions. The most important aspect here is that the data should never be accessed by an unauthorized source or breached. JOIN US
Data processing:
Right from storing the data, with Big Data you further move on to process it in order to make sense out of hordes of raw information. This includes cleansing the data (removing errors or redundancies), finding patterns among it, and producing ideas that could be useful for decision-making.
Data Security:
Another important part of data management is the security of it. It refers to defending data against unauthorized access, breaches or other potential vulnerabilities. You can do this with some basic security methods, mostly encryption and access controls as well as regular auditing of your systems.
Other Critical Tech Landmarks
There are a lot of disciplines in the tech world that go beyond web development and data management. Here are a few of them:
Cloud Computing
Leading by example, AWS had established cloud computing as the on-demand delivery of IT resources and applications via web services/Internet over a decade considering all layers to make it easy from servers up to top most layer. This will enable organizations to consume technology resources in the form of pay-as-you-go model without having to purchase, own and feed that infrastructure. JOIN US
Cloud Computing Advantages:
Main advantages are cost savings, scalability, flexibility and disaster recovery. Resources can be scaled based on usage, which means companies only pay for what they are using and have the data backed up in case of an emergency.
Examples of Cloud Services:
Few popular cloud services are Amazon Web Services (AWS), Microsoft Azure, and Google Cloud. These provide a plethora of services that helps to Develop and Manage App, Store Data etc.
Cybersecurity
As the world continues to rely more heavily on digital technologies, cybersecurity has never been a bigger issue. Protecting computer systems, networks and data from cyber attacks is called Cyber security.
Phishing attacks, Malware, Ransomware and Data breaches:
This is common cybersecurity threats. These threats can bear substantial ramifications, from financial damages to reputation harm for any corporation.
Cybersecurity Best Practices:
In order to safeguard against cybersecurity threats, it is necessary to follow best-practices including using strong passwords and two-factor authorization, updating software as required, training employees on security risks.
Artificial Intelligence and Machine Learning
Artificial Intelligence (AI) and Machine Learning (ML) represent the fastest-growing fields of creating systems that learn from data, identifying patterns in them. These are applied to several use-cases like self driving cars, personalization in Netflix.
AI vs ML —
AI is the broader concept of machines being able to carry out tasks in a way we would consider “smart”. Machine learning is a type of Artificial Intelligence (AI) that provides computers with the ability to learn without being explicitly programmed. JOIN US
Applications of Artificial Intelligence and Machine Learning: some common applications include Image recognition, Speech to text, Natural language processing, Predictive analytics Robotics.
Web Development meets Data Management etc.
We need so many things like web development, data management and cloud computing plus cybersecurity etc.. but some of them are most important aspects i.e. AI/ML yet more fascinating is where these fields converge or play off each other.
Web Development and Data Management
Web Development and Data Management goes hand in hand. The large number of websites and web-based applications in the world generate enormous amounts of data — from user interactions, to transaction records. Being able to manage this data is key in providing a fantastic user experience and enabling you to make decisions based on the right kind of information.
E.g. E-commerce Website, products data need to be saved on server also customers data should save in a database loosely coupled with orders and payments. This data is necessary for customization of the shopping experience as well as inventory management and fraud prevention.
Cloud Computing and Web Development
The development of the web has been revolutionized by cloud computing which gives developers a way to allocate, deploy and scale applications more or less without service friction. Developers now can host applications and data in cloud services instead of investing for physical servers.
E.g. A start-up company can use cloud services to roll out the web application globally in order for all users worldwide could browse it without waiting due unavailability of geolocation prohibited access.
The Future of Cybersecurity and Data Management
Which makes Cybersecurity a very important part of the Data management. The more data collected and stored by an organization, the greater a target it becomes for cyber threats. It is important to secure this data using robust cybersecurity measures, so that sensitive information remains intact and customer trust does not weaken. JOIN US
Ex: A healthcare provider would have to protect patient data in order to be compliant with regulations such as HIPAA (Health Insurance Portability and Accountability Act) that is also responsible for ensuring a degree of confidentiality between a provider and their patients.
Conclusion
Well, in a nutshell web-developer or Data manager etc are some of the integral parts for digital world.
As a Business Owner, Tech Enthusiast or even if you are just planning to make your Career in tech — it is important that you understand these. With the progress of technology never slowing down, these intersections are perhaps only going to come together more strongly and develop into cornerstones that define how we live in a digital world tomorrow.
With the fundamental knowledge of web development, data management, automation and ML you will manage to catch up with digital movements. Whether you have a site to build, ideas data to manage or simply interested in what’s hot these days, skills and knowledge around the above will stand good for changing tech world. JOIN US
#Technology#Web Development#Front-End Development#Back-End Development#HTML#CSS#JavaScript#Data Management#Data Security#Cloud Computing#AWS (Amazon Web Services)#Cybersecurity#Artificial Intelligence (AI)#Machine Learning (ML)#Digital World#Tech Trends#IT Basics#Beginners Guide#Web Development Basics#Tech Enthusiast#Tech Career#america
4 notes
·
View notes
Text
Learning About Different Types of Functions in R Programming
Summary: Learn about the different types of functions in R programming, including built-in, user-defined, anonymous, recursive, S3, S4 methods, and higher-order functions. Understand their roles and best practices for efficient coding.
Introduction
Functions in R programming are fundamental building blocks that streamline code and enhance efficiency. They allow you to encapsulate code into reusable chunks, making your scripts more organised and manageable.
Understanding the various types of functions in R programming is crucial for leveraging their full potential, whether you're using built-in, user-defined, or advanced methods like recursive or higher-order functions.
This article aims to provide a comprehensive overview of these different types, their uses, and best practices for implementing them effectively. By the end, you'll have a solid grasp of how to utilise these functions to optimise your R programming projects.
What is a Function in R?
In R programming, a function is a reusable block of code designed to perform a specific task. Functions help organise and modularise code, making it more efficient and easier to manage.
By encapsulating a sequence of operations into a function, you can avoid redundancy, improve readability, and facilitate code maintenance. Functions take inputs, process them, and return outputs, allowing for complex operations to be performed with a simple call.
Basic Structure of a Function in R
The basic structure of a function in R includes several key components:
Function Name: A unique identifier for the function.
Parameters: Variables listed in the function definition that act as placeholders for the values (arguments) the function will receive.
Body: The block of code that executes when the function is called. It contains the operations and logic to process the inputs.
Return Statement: Specifies the output value of the function. If omitted, R returns the result of the last evaluated expression by default.
Here's the general syntax for defining a function in R:
Syntax and Example of a Simple Function
Consider a simple function that calculates the square of a number. This function takes one argument, processes it, and returns the squared value.
In this example:
square_number is the function name.
x is the parameter, representing the input value.
The body of the function calculates x^2 and stores it in the variable result.
The return(result) statement provides the output of the function.
You can call this function with an argument, like so:
This function is a simple yet effective example of how you can leverage functions in R to perform specific tasks efficiently.
Must Read: R Programming vs. Python: A Comparison for Data Science.
Types of Functions in R
In R programming, functions are essential building blocks that allow users to perform operations efficiently and effectively. Understanding the various types of functions available in R helps in leveraging the full power of the language.
This section explores different types of functions in R, including built-in functions, user-defined functions, anonymous functions, recursive functions, S3 and S4 methods, and higher-order functions.
Built-in Functions
R provides a rich set of built-in functions that cater to a wide range of tasks. These functions are pre-defined and come with R, eliminating the need for users to write code for common operations.
Examples include mathematical functions like mean(), median(), and sum(), which perform statistical calculations. For instance, mean(x) calculates the average of numeric values in vector x, while sum(x) returns the total sum of the elements in x.
These functions are highly optimised and offer a quick way to perform standard operations. Users can rely on built-in functions for tasks such as data manipulation, statistical analysis, and basic operations without having to reinvent the wheel. The extensive library of built-in functions streamlines coding and enhances productivity.
User-Defined Functions
User-defined functions are custom functions created by users to address specific needs that built-in functions may not cover. Creating user-defined functions allows for flexibility and reusability in code. To define a function, use the function() keyword. The syntax for creating a user-defined function is as follows:
In this example, my_function takes two arguments, arg1 and arg2, adds them, and returns the result. User-defined functions are particularly useful for encapsulating repetitive tasks or complex operations that require custom logic. They help in making code modular, easier to maintain, and more readable.
Anonymous Functions
Anonymous functions, also known as lambda functions, are functions without a name. They are often used for short, throwaway tasks where defining a full function might be unnecessary. In R, anonymous functions are created using the function() keyword without assigning them to a variable. Here is an example:
In this example, sapply() applies the anonymous function function(x) x^2 to each element in the vector 1:5. The result is a vector containing the squares of the numbers from 1 to 5.
Anonymous functions are useful for concise operations and can be utilised in functions like apply(), lapply(), and sapply() where temporary, one-off computations are needed.
Recursive Functions
Recursive functions are functions that call themselves in order to solve a problem. They are particularly useful for tasks that can be divided into smaller, similar sub-tasks. For example, calculating the factorial of a number can be accomplished using recursion. The following code demonstrates a recursive function for computing factorial:
Here, the factorial() function calls itself with n - 1 until it reaches the base case where n equals 1. Recursive functions can simplify complex problems but may also lead to performance issues if not implemented carefully. They require a clear base case to prevent infinite recursion and potential stack overflow errors.
S3 and S4 Methods
R supports object-oriented programming through the S3 and S4 systems, each offering different approaches to object-oriented design.
S3 Methods: S3 is a more informal and flexible system. Functions in S3 are used to define methods for different classes of objects. For instance:
In this example, print.my_class is a method that prints a custom message for objects of class my_class. S3 methods provide a simple way to extend functionality for different object types.
S4 Methods: S4 is a more formal and rigorous system with strict class definitions and method dispatch. It allows for detailed control over method behaviors. For example:
Here, setClass() defines a class with a numeric slot, and setMethod() defines a method for displaying objects of this class. S4 methods offer enhanced functionality and robustness, making them suitable for complex applications requiring precise object-oriented programming.
Higher-Order Functions
Higher-order functions are functions that take other functions as arguments or return functions as results. These functions enable functional programming techniques and can lead to concise and expressive code. Examples include apply(), lapply(), and sapply().
apply(): Used to apply a function to the rows or columns of a matrix.
lapply(): Applies a function to each element of a list and returns a list.
sapply(): Similar to lapply(), but returns a simplified result.
Higher-order functions enhance code readability and efficiency by abstracting repetitive tasks and leveraging functional programming paradigms.
Best Practices for Writing Functions in R
Writing efficient and readable functions in R is crucial for maintaining clean and effective code. By following best practices, you can ensure that your functions are not only functional but also easy to understand and maintain. Here are some key tips and common pitfalls to avoid.
Tips for Writing Efficient and Readable Functions
Keep Functions Focused: Design functions to perform a single task or operation. This makes your code more modular and easier to test. For example, instead of creating a function that processes data and generates a report, split it into separate functions for processing and reporting.
Use Descriptive Names: Choose function names that clearly indicate their purpose. For instance, use calculate_mean() rather than calc() to convey the function’s role more explicitly.
Avoid Hardcoding Values: Use parameters instead of hardcoded values within functions. This makes your functions more flexible and reusable. For example, instead of using a fixed threshold value within a function, pass it as a parameter.
Common Mistakes to Avoid
Overcomplicating Functions: Avoid writing overly complex functions. If a function becomes too long or convoluted, break it down into smaller, more manageable pieces. Complex functions can be harder to debug and understand.
Neglecting Error Handling: Failing to include error handling can lead to unexpected issues during function execution. Implement checks to handle invalid inputs or edge cases gracefully.
Ignoring Code Consistency: Consistency in coding style helps maintain readability. Follow a consistent format for indentation, naming conventions, and comment style.
Best Practices for Function Documentation
Document Function Purpose: Clearly describe what each function does, its parameters, and its return values. Use comments and documentation strings to provide context and usage examples.
Specify Parameter Types: Indicate the expected data types for each parameter. This helps users understand how to call the function correctly and prevents type-related errors.
Update Documentation Regularly: Keep function documentation up-to-date with any changes made to the function’s logic or parameters. Accurate documentation enhances the usability of your code.
By adhering to these practices, you’ll improve the quality and usability of your R functions, making your codebase more reliable and easier to maintain.
Read Blogs:
Pattern Programming in Python: A Beginner’s Guide.
Understanding the Functional Programming Paradigm.
Frequently Asked Questions
What are the main types of functions in R programming?
In R programming, the main types of functions include built-in functions, user-defined functions, anonymous functions, recursive functions, S3 methods, S4 methods, and higher-order functions. Each serves a specific purpose, from performing basic tasks to handling complex operations.
How do user-defined functions differ from built-in functions in R?
User-defined functions are custom functions created by users to address specific needs, whereas built-in functions come pre-defined with R and handle common tasks. User-defined functions offer flexibility, while built-in functions provide efficiency and convenience for standard operations.
What is a recursive function in R programming?
A recursive function in R calls itself to solve a problem by breaking it down into smaller, similar sub-tasks. It's useful for problems like calculating factorials but requires careful implementation to avoid infinite recursion and performance issues.
Conclusion
Understanding the types of functions in R programming is crucial for optimising your code. From built-in functions that simplify tasks to user-defined functions that offer customisation, each type plays a unique role.
Mastering recursive, anonymous, and higher-order functions further enhances your programming capabilities. Implementing best practices ensures efficient and maintainable code, leveraging R’s full potential for data analysis and complex problem-solving.
#Different Types of Functions in R Programming#Types of Functions in R Programming#r programming#data science
3 notes
·
View notes
Text
Make-a-fish
There is a very cute site out there: http://makea.fish
It was written by @weepingwitch
If it is 11:11 AM or PM according to your machine's clock, you can visit this page and get a cute procedurally-generated fish image. Like this:
At other times, you will get a message like this:
This is charming enough that I have a friend who has a discord channel devoted entirely to people's captures of fish at 11:11. But it's also a fun code-deobfuscation puzzle. Solution below the cut--I checked, and it's ok for me to share the solution I came up with :)
If you show source for the makea.fish website:
Basically:
an image, set by default to have a pointer to a source that doesn't really exist
a script, that is one big long line of javascript.
The javascript is where we are going. Start by loading it into an editor and prettifying it up. It's like taking home a scrungly cat and giving it a wash. or something idk.
Believe it or not this is better. Also, maybe there are some low-hanging fruits already we can pick?
Like this:
Each of the strings in this array is composed of escaped characters. Escaped hex characters are useful if you need to put characters in your string that are not available on the keyboard or might be interpreted as part of the code, but here I think they're just being used to hide the actual contents of the string.
I used python to deobfuscate these since the escape sequences should be understood by python as well. And lo--not only are they all symbols that can be rendered (no backspaces or anything!) but they also look like base64 encoded strings (the =, == terminators are a giveaway).
What happens if we run these through a base64 decoder?
We see that the array actually contains base64-encoded strings. Perhaps a portion of this code is converting these strings back, so that they can be used normally?
At any rate I am going to rename the variable that this array is assigned to to "lookupTable" because that's what I think of it as.
We are making an anonymous function and immediately calling it with two arguments: lookupTable and 0xd8. 0xd8 is 216 in decimal. By renaming the variables, we get:
Confession time, I am not a person who writes lots of javascript. But it occurs to me that this looks an awful lot like we're being weird about calling functions. Instead of traditional syntax like "arrayInput.push(arrayInput.shift())" we're doing this thing that looks like dictionary access.
Which means that, according to the docs on what those two array functions are doing, we are removing the first element of the array and then putting it on the end. Over and over again. Now I could try to reason about exactly what the final state of the array is after being executed on these arguments but I don't really want to. A computer should do this for me instead. So I in fact loaded the original array definition and this function call into a JS interpreter and got:
['Z2V0SG91cnM=', 'd3JpdGVsbg==', 'PEJSPjExOjExIG1ha2UgYSBmaXNo', 'PEJSPmNvbWUgYmFjayBhdCAxMToxMQ==', 'Z2V0TWlsbGlzZWNvbmRz', 'Z2V0U2Vjb25kcw==', 'Z2V0RWxlbWVudEJ5SWQ=', 'c3Jj', 'JnQ9', 'JmY9']
This is our array state at this time. By the way, this comes out to
['getHours', 'writeln', '11:11 make a fish', 'come back at 11:11', 'getMilliseconds', 'getSeconds', 'getElementById', 'src', '&t=', '&f=']
(there are some BR tags in there but the Tumblr editor keeps eating them and I'm too lazy to fix that).
What's next? Apparently we are defining another function with the name "_0x2f72". It is called very often and with arguments that look like small numbers. It is the only place our lookupTable is directly referenced, after the last little shuffler function. So my guess is deobfuscator for the elements of the array.
It takes two arguments, one of them unused. Based on my hunch I rename the function arguments to tableIndex and unused.
One of the first things we do seems to be using the awesome power of javascript type coercion to get the input as an integer:
tableIndex=tableIndex-0x0;
Normal and ranged.
The next thing that is done seems to be assigning the return value, which may be reassigned later:
var retVal=lookupTable[tableIndex];
The next line is
if(deobfuscatorFn['MQrSgy']===undefined) {...
Again, I'm not exactly a javascript person. My guess is that "everything is an object" and therefore this value is undefined until otherwise set.
indeed, much further down we assign this key to some value:
deobfuscatorFn['MQrSgy']=!![];
I don't know enough javascript to know what !![] is. But I don't need to. I'll as a js interpreter and it tells me that this evaluates to "true". Based on this I interpret this as "run this next segment only the first time we call deobfuscatorFn, otherwise shortcircuit past". I rewrite the code accordingly.
The next block is another anonymous function executed with no arguments.
Within the try catch block we seem to be creating a function and then immediately calling it to assign a value to our local variable. The value of the object in our local variable seems to be the entire js environment? not sure? Look at it:
My guess is that this was sketchy and that's why we assign "window" in the catch block. Either way I think we can safely rename _0x2611d5 to something like "windowVar".
We then define a variable to hold what I think is all the characters used for b64 encoding. May as well relabel that too.
Next we check if 'atob' is assigned. If it isn't we assign this new function to it, one which looks like it's probably the heart of our base64 algorithm.
I admit I got lost in the weeds on this one, but I could tell that this was a function that was just doing string/array manipulation, so I felt comfortable just assigning "atob" to this function and testing it:
vindication! I guess. I think I should probably feel like a cheater, if I believed in that concept.
we next assign deobfuscatorFn['iagmNZ'] to some new unary function:
It's a function that takes an input and immediately applies our atob function to it. Then it...what...
tbh I think this just encodes things using URI component and then immediately decodes them. Moving on...
deobfuscatorFn['OKIIPg']={};
I think we're setting up an empty dictionary, and when I look at how it's used later, I think it's memoizing
Yup, basically just caching values. Cool!
We now have a defined deobfuscatorFn. I think we can tackle the remaining code fairly quickly.
First thing we do is get a Date object. This is where the time comes from when deciding whether to get the fish image.
Actually, let's apply deobfuscatorFn whenever possible. It will actually increase the readability quite a bit. Remember that this just does base64 decoding on our newly-shuffled array:
relabeling variables:
In other words, if the hours is greater than 12 (like it is in a 24 hour clock!) then subtract 12 to move it to AM/PM system.
Then, set "out" to be x hours minutes concatenated. Like right now, it's 16:36 where I am, so hours would get set to 4 and we would make x436x be the output.
Next, if the hours and minutes are both 11 (make a fish), we will overwrite this value to x6362x and print the makeafish message. Otherwise we print a request to comeback later. Finally, we lookup the fish image and we tell it to fetch this from "makea.fish/fishimg.php?s={millis}&t={out}&f={seconds}"
(there's a typo in the pictures I have above. It really is f=seconds).
Thus, by visiting makea.fish/fishimg.php?s=420&t=x6362x&f=69
we can get a fish. It appears to be random each time (I confirmed with weepingwitch and this is indeed truly random. and the seconds and millis don't do anything).
Now you can make fish whenever you want :)
51 notes
·
View notes
Text
(hypnotizing you voice) this is the most complicated and inachievable coding you ever did see. i am a world-class expert on coding. you believe me... oooo🌀🌀

[image desc: very simple lines of python code. it takes user input for a name and prints out, "Hello, (name)!". the programmer of the script commented between the lines; two to designate what the code means and one to just say, "I'm making a comment!" // end id]
4 notes
·
View notes
Text
Trying to calculate capital gains on crypto, mostly out of curiosity. (I recently sold some, but not enough to need to report.)
I would have hoped it would be mostly easy. I've been tracking my assets with ledger. So for approximately every fraction of a bitcoin I own, I can see
This is the day I bought it
This is how much I paid
And this is the fees I paid
E.g. "bought 0.00724641 BTC on 2018-05-07, I paid £51.99 of which £1.99 is fees".
There are some exceptions: I have some that I got from mining or from the bitcoin faucet way back when, stored in a wallet on my computer that I couldn't figure out how to access again; I got someone else to do it for me in exchange for about half of what was in there. In my ledger this is just recorded as a 0.03 BTC input that I got given for free. And there's an in-progress bet that involved someone sending me $100 of BTC.
(Other coins are more complicated: I once bought BCH, converted it to BNB, converted that to SOL, moved the SOL to a different place, staked the SOL, moved it back, staked it again and eventually sold, and there's fees involved in lots of these steps.)
But ignoring this I'd hope it would be simple enough? But not really.
I think partly this is because calculating capital gains isn't an objective one-right-answer calculation. If I buy 1 BTC, then buy 3 BTC, then sell 2 BTC, then sell 2 BTC, it matters which order I sell them in.
Okay, but I think FIFO is pretty standard? But I don't think there's a way to specify that I'm doing that or any other approach that could be automated. I just need to manually say "okay, the BTC that I sold here are the same BTC that I bought here", and the way to do that is to specify the date and unit price when I bought them.
Which, I get having this written out explicitly in the file, that seems reasonable, but I'd hope for some way to auto-generate the posting, and I don't see one.
...also I've been letting the unit price be implicit, instead specifying the lot price. Which means the unit price has 16 decimal digits, which aren't written in the file, and which I need to copy exactly when I'm selling or the lots won't quite match up. (Which is mostly fine, but when I want to print lots explicitly it means it doesn't show as "I bought BTC valued at X and then sold them" but as "I bought BTC valued at X and on the same day went into debt for the same quantity of unrelated BTC valued at X±ε".) And sometimes exact isn't enough due to rounding errors.
So I'm converting lot prices to unit prices, which there ought to be a way to do that automatically too but afaict there isn't. (Unless I want to do some python scripting, which might be fun I guess but also might be super frustrating depending how good the API is.)
I've looked idly at hledger as well but from what I can tell it's no better at this. I don't think I've looked closely enough at beancount to know, that might be worth looking into. But I have over 7 years of financial data in ledger and it would probably be annoying to convert it all - just crypto would be fine I guess, but then I'm using two different CLI accounting tools.
5 notes
·
View notes