Tumgik
#python sets tutorial
Text
Functions in Python
Functions in Python A function in Python is a block of code that performs a specific task and returns a result. Functions help break down a program into smaller, more manageable pieces and make the code easier to read, test, and maintain. Functions define using the def keyword, followed by the name of the function, a set of parentheses, and a colon. The code within the function indent under the…
Tumblr media
View On WordPress
2 notes · View notes
awingedllama · 1 year
Text
so i've got stuck on something simple and it's driving me insane
i'm creating a calendar to slot to the sides of the fridge in my kitchen set. and i really wanted it to be useful, not just random clutter, so i decided i was going to make it functional and have it bring up the real in-game calendar. cute lil idea, should be easy, yeah?
Tumblr media
my god it is not easy
i can bring up the notebook and phone ui... every icon but the one i want. i have no idea what the command to bring up the calendar could be, and i've tried SO many
i was so determined to get it working i even ventured into python for the first time to look through the game files. for hours on end i've searched 'calendar' and 'event' and 'ui' and 'holiday' and 'dialog' and everything else i could think of, but none of the commands i try do anything
like who was i even kidding installing PyCharm 😭 over here breaking out in a sweat watching 'absolute beginner!! a baby could code this!!!' tutorials
anyway, i never get any responses posting in the Sims 4 Studio forum, but if any modders see this post 1) i apologize for being a novice on main and 2) i would be eternally grateful for your help, or even just a nudge in the right direction. the file is here and right now the interaction opens the phone
it grinds my gears to give up on an idea, but i've wasted an embarrassing amount of time messing with this. so for now, defeated, i'm going back to my microwave 😔
208 notes · View notes
beatrice-otter · 1 year
Text
Alternatives to AO3
With the recent revelations about the OTW's internal dysfunction (and the effect that has on AO3's functioning and abuse of volunteers), a lot of people are all of a sudden looking for alternatives in a way they haven't for years. I think AO3 is here to stay, and I think they will (eventually) manage to get their shit together, (and I also think that a little failure might actually be good for them in the long run) but I also firmly believe that fandom should be less centralized than it currently is. I think it's unhealthy to rely on One Major Archive. I think there should be lots of alternatives, and I think people should post their fanfiction in multiple spaces. I lived through the era when entire archives could vanish overnight. Backups are a very good thing. (AO3 won't vanish overnight; the nonprofit structure means that most of the things that nerfed the older archives can't happen to AO3. It would take a long, slow decline for AO3 to die, with plenty of warning.) Anyway! Here are some other things to consider. OTW-style archives There are actually TWO other archives using the same software as AO3! It is open source. Now, it is deeply unfriendly to use, and has a lot of things that are hard-coded that shouldn't be, so it takes a bit of work to make it work. But two people have gotten it up and running: Squidgeworld. Squidgeworld is a multifandom archive that is the current iteration of an archive that started in 1994. Squidge has been around for a long time, and they just recently converted into a nonprofit to ensure that even if the original founder steps away or dies or whatever, the archive will continue on. Pretty much anything you can post to AO3, you can post to Squidgeworld. Ad Astra. Ad Astra is a Star Trek archive that's been around since 2009, and was formed from even earlier Star Trek fan spaces. It only accepts Star Trek fanfic. Crossovers are fine, RPF is fine (consider time travel fic) as long as the person has been dead for at least 50 years. Personal fanfiction websites Do you want to have a place where you completely control how your fanfiction is presented? It's actually pretty simple to create your own website!
Tumblr media
melannen has a tutorial. And there are people creating old-style fanfiction webrings to link peoples' personal fic pages together. If you want something slightly fancier,
Tumblr media
tobli has put together a set of Python scripts to function as a static site generator.
Tumblr media
comments Comment? https://ift.tt/aKzAuNZ
210 notes · View notes
angellic-critique · 9 months
Note
Honestly my biggest fear is to end up writing my characters the same way vivzie does, I feel like she doesn't even try on certain characters(female characters and literally any other that isn't her "uwu baby boi must be protected at all costs" characters like stolas, angel dust). Like imagine completely missing the point of your own character/srs
to everyone pre-release worries and anxieties just as much as I have-- Please take this time to read or explore different interests of books or authors of subjects and genres you like ! In the era of internet where the golden age of information is rusting into brainrot, the less time online anymore the better. I've been taking javascript/python tutorials for myself attempting to make a dating simulator for literal years at this point and its bounced around to the point of where I branched off to develop my own murder mystery 2-d sidescroller !
I wish for this to be a farewell letter to the crushed hopes and dreams I had for the original hazbin pilot and crew has moved on to other things whereas viv attempted to spitefully keep a story she clearly doesn't have any passion over- it is very evident over her lack of care for her own characters purely for the monetary gains of attempting and sadly wriggling her way into industry the way she did is so abhorrent to the world of genuine art and animation I grew up with.
Has Vivzie ever read a Felix the Cat comic strip or Dilbert even Hägar The Horrible? Does she even know about the history and strive of depth that animation has been at for hundreds of years? Does she even like comics, clearly not if she doesn't even have the patience to write her own and horribly rush whichever story she's interested in that day. I've never seen a careless writer be this selfishly unashamed to write literal garbage and surface level 'intrigue' of design and then falling flat face first at EVERY step. Hope she becomes as unbearable of a director as John K. is because honestly even though I'm cringing making that comparison, it's pretty fair in my book considering the outright ABUSE she has always trying to talk or hoard artists into her 'pet project' I recommend above anything else to watch Dan Stamanolous' 'Moral Orel' if you want an actually funny dark comedy or Christy Karacas' fast paced dark horror comic-come-to-life Superjail! for good animattion that doesn't belittle its audience... *[Trigger Warnings for Adult Swim-esque outdated 2007 humor and light transphobia, read for your own triggers if you dont want to though, please!]
The fact that Stollitz is written so flimsily like a wattpad fanficiton of tropes rolled into one is astounding to me, I used to like the dynamic pre-season 2 as I've mentioned on here and @tired-hellowl so I really don't want to get a headache going into how I USED to like it-Realizing the problematic consent issues all of STOLASS is, I physically cannot watch another Helluva or Hazbin promo anymore without rolling my eyes into the back of my head.
To the anons and people who used to also enjoy vivs work, there are other artists and there are other stories to tell. If you wish to be inspired from Dante's Inferno/Hell or WESTERN CHRISTIAN BASED RELIGION keep in mind what source material you're doing because I don't even think vivzie has picked up the bible once in her life.... And I say this as a drifter in the world who believes in reincarnation I don't really vibe with the athiest stereotypes however, I don't believe in most religion but more power to people that do get hope and love from their teachings and cultures.
She entirely missed the mark for several years, nearly a decade. Viv has had time and time again chance and opportunity to give a chance of storytelling with demons and what does she do? Adult Cartoon that has the demons scream 'FUCK SHIT DAMNIT DAMNIT LOOK IM SO HORNY AND SILLY AND WACKY WOAHH THE SCREEN IS CONSTANTLY MOVING YOU CAN NEVER HAVE A SECOND TO BREATH IN ANY AMOUNT OF WORLBUILDING OR SETTING BECAUSE FUCK. YOU.'--
I have said this time and time again- there is no substance or worth about Helluva Bosses or Hazbins writing, even without the show not being released because Amazon seems ashamed about it, I know it'll be a shitshow.
Honestly at this point I agree with the redesign community, take any character you used to like and rewrite them until it's unrecognizable from the original source material, let those fuckers in space fight alien pirates or hell take them out of the heaven and hell trope and just flip it on it's head entirely out of earth or wherever you want to set your story! I'm personally redesigning angel to be a slight aid to my addiction help via rewriting him into my murder mystery heheh while keeping the sexual abuse and recovery in mind because woah that shit happened to me too man !!!
I wish the best to any future writers, animators, programmers, lovers of animation or art, you can do what you put your mind and hands to! Spread more positivity and love then hate in this world please guys, this'll be the last time I pop in I promise I'm trying to get a better job and hopefully get accepted in a community college that i've been on the fence over trying to do more online coding ! The sky is the limit!<3
48 notes · View notes
voxceleste · 1 year
Text
in case anyone else is taking the opportunity to back up their own or other people's fic hosted on ao3, the ao3 downloader bookmarklet makes it much quicker to quickly download all of the works on a given page in any of the formats ao3 offers for export. like so:
Tumblr media
it works on a given author's works directory or a bookmarks listing page.
if you're comfortable using python, this ao3 downloader script might give you more advanced functionality, but that is way more effort than i'm willing to put in to setting something up that exists so i have to put less effort into something... but if you have a large catalogue of works or bookmarks it might be worth the effort.
edit: there's also a quick and dirty tutorial to making a simple neocities site as a personal fic archive using html files -- you can find that here. even if you plan to keep hosting work on ao3, backups are always good!
122 notes · View notes
lovelylittlelevity · 7 months
Note
Hello! I'm a bit curious on what game engine you all use to make the game itself? Are there any small tutorials you can give? Do's and don't? What was the hardest challenge when making the game and any tips for beginners who want to learn? I really like the game and I feel a bit inspired after playing it.
We used an engine called "Renpy"!
Renpy Download
You can click here if you want to download it! There are small tutorials on how to use Renpy on YouTube but I personally use this for beginners.
Zeil Learnings 10 minute tutorial
Visual Studio Code
This is the app I'm using on my computer! If I'm not mistaken, Renpy uses python.
Just some of my tips:
• Save regularly. I had a time where half of my coding went missing because I didn't save and it took me hours.
• Double checking your codes.
• Its best to have a tab open so you can check through Google, Renpy Forums and/or tutorials on YouTube.
• Careful if you wanna spend hours on coding. It could lead to headaches.
• ALWAYS keep a spare file. If you wanna mess with some of the settings of the game, best to keep one spare in case the one you messed with broke down.
• Keep basic codes written in a note. In case you're like me who has bad memories, always write them down.
• Plenty of rest. Don't be like me-
My hardest challenge on doing the coding is honestly when I can't find that one specific code that was wrong- Had to check through 300+ lines of codes, and when I was done checking that code, I moved onto the next file. Coding GUI is hard too.
And yes, The Y/N's have different sheets for their codes.
- Puppit
22 notes · View notes
studentbyday · 1 year
Text
Tumblr media
day 59 // 100dop && day 36 // 100doc
studying feels much less stressful with a study buddy (and study with me videos...i'm trying to get into the habit of actually pomodoro-ing so maaaybe i can survive the 10 hours of studying every day come Fall?? 😅 well, even if i can't, i do need to improve my ability to discipline myself into focusing XD) 🧸
went to tutorial and was confused af, luckily 1 group member knew what to do...and we asked the TA a lot of questions so we probably have the right answers...but i still need to go over the material again to be sure i understand it
finished addition reaction notes
finally finished credit.py - i am sooo not used to writing in python, e.g. for i in list iterates through the actual list elements, but for i in range(len(list)) goes through the actual indices of the list elements and little things like that which i just have to get used to but i do love how much easier it is to debug in python...
wrote some code for readability.py, but it's basically copying readability.c so i'm not really thinking at this point, i literally have the 2 versions set up side by side 😂
55 notes · View notes
izicodes · 1 year
Note
Hiya!! I am taking a coding course at a University. While it's excellent for learning how to use a lot of complicated concepts in programming, we don't really get to do any projects or create anything yet. I was wondering how to get into that. Are there any resources you might recommend?
Hiya!! 💞
Goodie, you want to build your own projects! That's so good, I love project building! Now, it depends what you're coding (the languages + specific area) e.g. are you learning HTML/CSS/JavaScript (Website building) or is it like Python/Java/C# idk but you get what I'm asking for here, the projects you want to learn and build depends on what you're learning in the first place! But I will give some general advice!
Tumblr media
🎥 YouTube
I love YouTube so much, there are thousands of videos on that site for any programming language to building pretty much anything! What I did when I started off was the simple search of "[The coding language] beginner project" and then I get to see what I can build. Now if you get stuck on a snippet of code, Google it and there are sites that will explain it for you. Now, don't fall for tutorial hell where you're watching tutorial after tutorial videos but watching them will give you a good foundation!
🔍 Google
Similar to what I said for the YouTube way, you can Google the same question and it will give you a bunch of project ideas, how to even do them and all you can do also is add more on top, what I mean is don't just watch or read about a project idea, see how you can twist it your own style e.g. recently I watched a React.js tutorial on how to make a to-do app! My twist was I styled it different by adding a frog theme. So the tutorial was my foundation and I just added on top of that to further exercise my skills!
🌐 GitHub
Have a hub for all your projects! After creating your projects, you don't just want it sitting on your computer, you can put it online! I use GitHub - it's a place where you can store all your projects, have a save history so you can go back on old code, even share the static webpages you make (using HTML/CSS/JavaScript) with other people online! The Site | How to use GitHub | Check out my GitHub for reference
📚 Online Courses
Many online platforms offer project-based courses. Websites like Udemy, Coursera, Codecademy and FreeCodeCamp can guide you through creating practical projects step by step. I use Udemy for learning and there are courses that are like "Build 9 web development projects blah blah blah" they're actually really good! BUT you do have to pay for them but if you can't find a good project on YouTube to follow or you can visualise or understand the articles online on how to build one, I suggest getting a course because someone teaches you how to make the project. Udemy is fairly cheap during their sales, going down from £59.99 to £10.99!
🤗 Collaboration
Reach out to classmates to build together, someone is bound to have an idea for something! Collaborative projects not only expand your skill set but also let you learn from others. Great skill to have! You can even collab on GitHub projects - which I am doing right now with people I've met through Tumblr (checkout our project)!
Remember, Rome wasn't built in a day! Start with small projects, gradually challenging yourself with larger ones. The journey of creating is just as exciting as the finished project itself. Happy coding! 😎🙌🏾💻💗
Tumblr media
42 notes · View notes
egelantier · 11 months
Text
rimworld, the addiction
i promised a post about rimworld somewhere an entirety away, and even if i did, by now i was playing it exclusively, a bit every day, for something like half a year, so i think it deserves some kind of an entry in my journal either way.
Tumblr media
preface: usually when i describe games here, i put in some kind of a note how this or that game is very casual user friendly (because i am a casual user), and you can play it if you never played stuff, and so on. rimworld is not quite that game. it’s very much a gamer’s game, in a sense that its UI looks like an unholy cross of “hello, world!” programming and an excel spreadsheet, it’s incredibly counterintuitive, it takes from ten to twenty minutes to load on the average (and the loading screen looks like it crashed meantime), and it wants you to suffer. if you play any amount of time, you’re going to inevitably end up with hundred to two hundred mods, and to make the game move with all those mods you’ll have to follow the easily-accessible tutorials with advice like “install this handy Python program” and “Select "BC7 Texconv compressor" on the middle bottom.” and the complexity of the game’s inner system makes its own tutorial - well - it will tell you that you colony needs a freezer for food to outlive the winter, but you will have to intuit by yourself that to make this freezer you’ll have to build a double-walled room of just the right side, put in two air conditioner users set one degree celsius apart from each other to minimize the power load, don’t forget to build double-door airlocks to account for the temperature spikes when the door opens and adjust it by the variety in your biome’s climate. and don’t even get me started on killboxes! this is to say, you’re going to be watching youtube and reading guides. a lot.
(OKAY it’s not THAT bad and you mostly need to be able to know where the mod folder is and how to follow detailed instructions. but by the standards by today’s, increasingly mobile and under-the-hood gaming, it’s practically NASA. even minecraft is more user-friendly in comparison.)
and yet like i said: hordes of rabid fans, literally months of addictive playing, thousands of mods, active scene. why? and what the hell is it? let’s see.
rimworld as a setting is a procedurally generated world in a galaxy far, far away (that takes its setting inspiration from firefly, star wars, a bit of dune, and a general space opera vibe), with diverse climate biomes (from ice sheets to arid deserts, from temperate forests to tropical swamps), inhabited by a variety of friendly and unfriendly flora and fauna and a multitude of friendly and very unfriendly tribes, factions, empire remnants and such. they send each other (and you) raids and trade caravans, and overall just try to survive.
“you" is an unspecified entity (some speculate that you might be an orbital AI, but it doesn’t quite matter) in charge of a group of your “pawns,“ aka colonists - little blobby humanoid representations of either baseline or gene-modified humans that, in a variety of scenarios, find themselves on the unhospitable surface of rimworld either literally butt-naked or with a scant handful of resources, and have to survive and build their way up from a hovel and a campfire to the ultratech spacefaring colony. pawns have their own backstories, traits, needs and health condition; they form relationships, meet their relatives, get together, make up, break up, marry, divorce, make children, mourn their lost people, keep pets, suffer from mental breaks and so on. you can give them direct orders in some occasions, like the battle, but for most of the time you’re going to give them priorities based on their skillset, and watch them do their things on their own, which is alternately fun, touching and infuriating.
your colony’s experience in rimworld is governed by one of the (canonically) three “storytellers,” aka AIs, who’re in charge of sending you various events - enemy raids, wanderers joining in, solar eclipses, manhunting packs of rabid enemies, crop blights, weather anomalies and so on. each storyteller has several levels of intensity, from ‘peaceful’ (it’ll keep weather events and random angry animal attacks, but cut out everything related to hostile pawns, like raiders) to ‘death is inevitable,’ and also has their own style: phoebe just wants you to have a good time, cassandra provides a linear progression of difficulty and alternates ‘bad’ and ‘good’ challenges, and randy just doesn’t give a fuck and WILL get your colony attacked by mechanoids, manhunting yorkshire terriers and pig-human raiders on the same day your favorite melee fighter died and all the electricity cut out, just for the hell of it.
the intended (loosely) gameplay is to randomise your colonists, pick up a storyteller on a medium difficulty, set the game to ‘only save on exit, permadeath’ setting and let your colony tell its own history by surviving as much as it can, mourning its losses and celebrating its wins, and eventually succumbing to the entrophy (or, less likely, achieving one of the win conditions - building a spaceship and getting off the planet, decoding an ancienty mystery to join up with a techmegabrain, hitching a ride with the imperial ship after gladhanding the emperor and his escort in style for a set amount of days, etc.). but the beauty of rimworld is that between the granular difficulty settings and mods you’re able - and welcome - to finetune your experience to the exact specific level of challenge and/or chill you want. don’t care for the fighting at all and just want to build your colony and select the right shade of the carpets? put it on peaceful. don’t mind raiders but fuck those guys who airpod in the middle of your base or breach your walls? the turtle mod is your friend. raiders are fine, but you want to dig your way into the mountain without being afraid of giant insect infestations? turn those assholes off. want to min-max your experience and fight literal horders of enemies every ten minutes? either max out the difficulty or install one of the thousand of mods like combat extended or whatever, that add difficulties and mechanics.
and meanwhile the game - that looks deceptively simple on the outside, build this, harvest this - is stuffed with overcomplicated intersection of various systems creating weird outcomes. it’s a bit minecraft and a bit dwarf fortress and a bit sims and emergent gateways all the way. your little pawns follow the tenets of their ideoligions, get upset over seeing corpses or eating mushrooms, go into berserk rages after eating without a table one too many times, make friends, celebrate the defeat of their rivals and get attached to random squirrels. they can interact with other inhabitants of rimworlds by trading and diplomacy, or indulge in raiding, piracy, enslavement, ritualized murder, forced conversions, cannibalism or non-consensual organ and gene harvesting. a starved pawn on a frozen ice will eat somebody’s body and feel bad about it… unless they come from a society of cannibals, in which case it would be fine and dandy, but they might be upset about eating their human meat in an untidy room, you know? some precepts require the colonists to worship blindness; some of them make people hate the sight of the sun, and some require worshipping every tree and never kill an animal. it’s all, to put it simply, complicated.
and then, of course, mods. the game is created to be as mod-friendly as possible, and so there are literal thousands of them, and they reflect the multifaceted insanity of the world in the most hilarious ways. the most-downloaded mod overall is called wall lights and allows you, well, to put lamps on the wall. the other popular one is called “war crimes,” and you can probably infer its purpose from the title. there are mods that prettify, fully change or customise the chunky UI; mods that clean up or straight up rewrite the graphics; mods that make your little blobby guys look anime and sexy (it’s hilarious); mods that turn rimworld into warhammer 40k, or star wars, or mass effect, or lord of the rim, or a lovecraftian nightmare, or some combination thereof. my favorite of the moment is the collection centered around medieval overhaul, a clever and beautiful bundle that turns the gritty space opera into the fully realized medieval town builder - with smithies and bakeries and castle walls and knight plumages. it takes some time to cobble together a collection that works (and then make sure it all hangs together, and learn to use rimsql, and figure out what the hell defs are and why your log is giving you errors, and change the order of mods a thousand times, and make sure you did not accidentally turn your squirrels into unstoppable death machines while trying to add some prettier capes to your tailor bill), but on practice it means that pretty much every person playing will have their own unique copy of the game, vastly different from what somebody next to them is playing.
like i said above, the intended gameplay is the triumph and misery of playing through as is; but i’m having one of the shittiest years of my entire life, and so almost every day i would load it up and watch the progress of my little medieval towns from one lost person in the wood trying to figure out how to spin flax into thread into little blooming towns, with nothing to distract me. there’s something of bird-watching or flower-pressing to this experience: you set up the conditions and you set up your priorities (or install ‘free will’ and then tear your hair out over your pawns avoiding research and cleaning their floor while winter is looming ahead and they need to figure out how to make parkas) and then you watch how it all unfolds, and you can sprinkle in a bit of a challenge, or you can just watch them grow and mix up and change and misbehave and be silly and transform, and transform, and transform. it more or less saved my sanity. it’s a very specific kind of experience - i built a monastery with a winery and an apothecary’s dark corner in one map, and a small mountain hideaway for a runaway princess in another, and a rough-and-tumble tundra city in third, and so on - and i saw people building unstoppable war machines instead, or trying to survive specific unfair scenarios, or roleplaying, or multiplayering, or minmaxing with spreadsheets and calculators, or all of the above - and god, is it good. is it so goddamn good.
so! whether you want to play it or have ran away screaming by this time, i hope you enjoyed this silly writeup. and if you do want to start playing, don’t hesitate to ask me stuff! or like share my list of mods and so on.
25 notes · View notes
Text
im getting windows 95 running ina vm on my pc and im writing my process here so i dont forget
installed oracle vm + got windows 95 iso files downloaded and stuck in (floppy disk boot // disk os thing)
enable virtualisation in my bios (risky bc my pc crashes a load when i do that for some reason)
ima boot in safe mode bc idk what these options do
okay it looks like safe mode is the command prompt??? how do i quit this (powered off rhe machine)
lets try just boot option 1
okay still no gui lemme check the guide i was using
run "fdisk" to get large disk support?
oh fdisk is format disk
use primary dos partition w max size
reboot machine and use NEC thing
"format C:"
navigate to c drive ("C:")
"mkdir WIN95" to start copying files over
get annoyed that oracle is blocking alt+tab
head into WIN95
"copy D:\WIN95"
watch shit tons of files (217 copy over super quick)
eject the disk
start setup by typing "setup"
okay so ima stop following rhe tutorial here
installing in C etc (default options)
using advanced bc im nerdy like that
okay we r going back to the tutorial to see what vertificate key thing we should use
12095-OEM-0004226-12233
popping in user info (name: Jen)
we'll go w recommended hardware auto detect bs
i didn't set up network or sound/midi so i assume its not there? (just checked the tutorial I can check em)
realise u didnt take any screenshots so are going to have to run through this again later to get em
wait for setup
wonder if u could run python w flask or node w express or smthn on it
use every component bc i can
i dont understand network configuration so im skipping it right now
BRITISH KEYBOARD 🇬🇧🇬🇧🇬🇧
sure startup disk sesms fine
Insert Disk (what) (tutorial time) (what do)
tutorial didn't get this (wuhoh.png) (let's just click ojay and see what happens
it was fine!!
god win 95 is cool
okay pc should restart
i should gave ejected that floppy disk huh
wuhoh2.png
remove floppy diskabdn reviot
reboot aagin bc error?
okay kets try safe mode
yeah no it goofed lets start it again from rhe fresh install hopefully
i dont want to make another device so im sticking rhe shit in again and hopping
no
didnt work
fuck
Windows 95 two Electric Booglaoo
IT FUCKED W THE ISOS I THINK
Re-extracted the files time to try again
booting up #3 lets get screenshots
end of part one (ill rb w my next progress update (w screenshots this time)
5 notes · View notes
esoxy · 1 year
Text
So let's get into the nitty-gritty technical details behind my latest project, the National Blue Trail round-trip search application available here:
This project has been fun with me learning a lot about plenty of technologies, including QGis, PostGIS, pgRouting, GTFS files, OpenLayers, OpenTripPlanner and Vita.
So let's start!
In most of my previous GIS projects I have always used custom made tools written in ruby or Javascript and never really tried any of the "proper" GIS tools, so it was a good opportunity for me to learn a bit of QGIS. I hoped I could do most of the work there, but soon realized it's not fully up to the job, so I had to extend the bits to other tools at the end. For most purposes I used QGis to import data from various sources, and export the results to PostGIS, then do the calculations in PostGIS, re-import the results from there and save them into GeoJSON. For this workflow QGIS was pretty okay to use. I also managed to use it for some minor editing as well.
I did really hope I could avoid PostGIS, and do all of the calculation inside QGIS, but its routing engine is both slow, and simply not designed for multiple uses. For example after importing the map of Hungary and trying to find a single route between two points it took around 10-15 minutes just to build the routing map, then a couple seconds to calculate the actual route. There is no way to save the routing map (at least I didn't find any that did not involve coding in Python), so if you want to calculate the routes again you had to wait the 10-15 minute of tree building once more. Since I had to calculate around 20.000 of routes at least, I quickly realized this will simply never work out.
I did find the QNEAT3 plugin which did allow one to do a N-M search of routes between two set of points, but it was both too slow and very disk space intense. It also calculated many more routes than needed, as you couldn't add a filter. In the end it took 23 hours for it to calculate the routes AND it created a temporary file of more than 300Gb in the process. After realizing I made a mistake in the input files I quickly realized I won't wait this time again and started looking at PostGIS + pgRouting instead.
Before we move over to them two very important lessons I learned in QGIS:
There is no auto-save. If you forget to save and then 2 hours later QGIS crashes for no reason then you have to restart your work
Any layer that is in editing mode is not getting saved when you press the save button. So even if you don't forget to save by pressing CTRL/CMD+S every 5 seconds like every sane person who used Adobe products ever in their lifetimes does, you will still lose your work two hours later when QGIS finally crashes if you did not exit the editing mode for all of the layers
----
So let's move on to PostGIS.
It's been a while since I last used PostGIS - it was around 11 years ago for a web based object tracking project - but it was fairly easy to get it going. Importing data from QGIS (more specifically pushing data from QGIS to PostGIS) was pretty convenient, so I could fill up the tables with the relevant points and lines quite easily. The only hard part was getting pgRouting working, mostly because there aren't any good tutorials on how to import OpenStreetMap data into it. I did find a blog post that used a freeware (not open source) tool to do this, and another project that seems dead (last update was 2 years ago) but at least it was open source, and actually worked well. You can find the scripts I used on the GitHub page's README.
Using pgRouting was okay - documentation is a bit hard to read as it's more of a specification, but I did find the relevant examples useful. It also supports both A* search (which is much quicker than plain Dijsktra on a 2D map) and searching between N*M points with a filter applied, so I hoped it will be quicker than QGIS, but I never expected how quick it was - it only took 5 seconds to calculate the same results it took QGIS 23 hours and 300GB of disk space! Next time I have a GIS project I'm fairly certain I will not shy away from using PostGIS for calculations.
There were a couple of hard parts though, most notably:
ST_Collect will nicely merge multiple lines into one single large line, but the direction of that line looked a bit random, so I had to add some extra code to fix it later.
ST_Split was similarly quite okay to use (although it took me a while to realize I needed to use ST_Snap with proper settings for it to work), but yet again the ordering of the segments were off a slight bit, but I was too lazy to fix it with code - I just updated the wrong values by hand.
----
The next project I had never used in the past was OpenTripPlanner. I did have a public transport project a couple years ago but back then tools like this and the required public databases were very hard to come by, so I opted into using Google's APIs (with a hard limit to make sure this will never be more expensive than the free tier Google gives you each month), but I have again been blown away how good tooling has become since then. GTFS files are readily available for a lot of sources (although not all - MAV, the Hungarian Railways has it for example behind a registration paywall, and although English bus companies are required to publish this by law - and do it nicely, Scottish ones don't always do it, and even if they do finding them is not always easy. Looks to be something I should push within my party of choice as my foray into politics)
There are a couple of caveats with OpenTripPlanner, the main one being it does require a lot of RAM. Getting the Hungarian map, and the timetables from both Volánbusz (the state operated coach company) and BKK (the public transport company of Budapest) required around 13GB of RAM - and by default docker was only given 8, so it did crash at first with me not realizing why.
The interface of OpenTripPlanner is also a bit too simple, and it was fairly hard for me to stop it from giving me trips that only involve walking - I deliberately wanted it to only search between bus stops involving actual bus travel as the walking part I had already done using PostGIS. I did however check if I could have used OpenTripPlanner for that part as well, and while it did work somewhat it didn't really give optimal results for my use case, so I was relieved the time I spend in QGIS - PostGIS was not in vain.
The API of OpenTripPlanner was pretty neat though, it did mimic Google's route searching API as much as possible which I used in the past so parsing the results was quite easy.
----
Once we had all of the data ready, the final bit was converting it to something I can use in JavaScript. For this I used my trusted scripting language I use for such occasion for almost 20 years now: ruby. The only interesting part here was the use of Encoded Polylines (which is Google's standard of sending LineString information over inside JSON files), but yet again I did find enough tools to handle this pretty obscure format.
----
Final part was the display. While I usually used Leaflet in the past I really wanted to try OpenLayers, I had another project I had not yet finished where Leaflet was simply too slow for the data, and I had a very quick look at OpenLayers and saw it could display it with an acceptable performance, so I believed it might be a good opportunity for me to learn it. It was pretty okay, although I do believe transparent layers seem to be pretty slow under it without WebGL rendering, and I could not get WebGL working as it is still only available as a preview with no documentation (and the interface has changed completely in the last 2 months since I last looked at it). In any case OpenLayers was still a good choice - it had built in support for Encoded Polylines, GPX Export, Feature selection by hovering, and a nice styling API. It also required me to use Vita for building the application, which was a nice addition to my pretty lacking knowledge of JavaScript frameworks.
----
All in all this was a fun project, I definitely learned a lot I can use in the future. Seeing how well OpenTripPlanner is, and not just for public transport but also walking and cycling, did give me a couple new ideas I could not envision in the past because I could only do it with Google's Routing API which would have been prohibitively expensive. Now I just need to start lobbying for the Bus Services Act 2017 or something similar to be implemented in Scotland as well
21 notes · View notes
skaruresonic · 4 months
Text
Tumblr media
RenPy: Defining Characters
One of the first things RenPy does upon initialization (the boot-up period before the start label executes the game) is read your custom-made character strings to determine what character dialogue will look like.
Although defining usually takes place under the init block, I've chosen to make a separate pre-start label for organization purposes. Really, any time is fine as long as you make sure the pre-start label runs before the game actually executes, or else you're going to encounter errors.
Let's take a look at the code piece by piece.
$ a = Person(Character("Arthur", who_color="#F4DFB8", who_outlines=[( 3, "#2B0800", 0, 2 )], what_outlines=[( 3, "#2B0800", 0, 2 )], what_color="#F4DFB8", who_font="riseofkingdom.ttf", what_font="junicode.ttf", ctc="ctc", ctc_position="fixed", what_prefix='"', what_suffix='"'), "Arthur", "images/arthurtemp1.png") $ is a common symbol used by both Python and RenPy to define custom-made variables. Here in the pre-start label section of our script, we're using it to define our characters.
For the sake of propriety, it's probably better to define characters using define, but for ease of use, I've chosen $ instead.
It would be tiresome to have to write "Arthur" every time I wanted to call him in the script. Luckily, by assigning these parameters before initialization, RenPy will read "a" as Arthur.
Most scripts will suffice with assigning a Character object class to your character. If you open the script for The Tutorial, you'll find a basic string that looks like this: $ e = Character("Eileen") As you can see in my batch of code, however, I've done something different by nestling the Character object class within a Person object class. The reason why will become apparent in future posts.
For now, let's focus on the fundamentals.
---
Tumblr media
who_color tells RenPy the color of the character's name, determined by a hexadecimal code (either three, four, or six digits). Its sister parameter what_color tells RenPy the color of a character's dialogue text.
If no values are given for these parameters, RenPy will look at your project's GUI file to determine them.
---
Tumblr media Tumblr media
who_font tells RenPy the kind of font you want to use for your character's name, and likewise, what_font determines the font you want to use for your character's dialogue.
Note that these fonts do not have to match. They can be whatever font you wish.
The size of character names and dialogue text can be customized in the GUI file of your project:
Tumblr media Tumblr media
---
Tumblr media
who_outlines=[( 3, "#2B0800", 0, 2 )], what_outlines=[( 3, "#2B0800", 0, 2 )]
who_outlines and what_outlines add outlines or drop shadows to your text (character name and character dialogue, respectively). This string is expressed as a tuple, or four values enclosed by parentheses.
The first value expresses the width of the shadow in pixels. The second value is a hexadecimal value for your chosen color. The third value offsets the shadow along the X-axis (pixels to the right or left of the text). Because it's set to 0, my drop shadows do not appear to the right or the left of the text. The fourth value offsets the shadow along the Y-axis (pixels beneath/above the text). In this case, shadows appear 2 pixels beneath the text.
My outlines are a bit hard to see because they're only 3 pixels wide and 2 pixels offset.
---
Font files RenPy recognizes TrueType font files. You can download TTF fonts for free online - just be sure to unzip them and put them in your game folder.
If you intend to monetize your project, you absolutely need to make certain your fonts are royalty-free or, ideally, public domain. Most font families come with licenses telling you whether they are free use.
To be on the safe side, I would put the following code before the start label in your script, just so RenPy knows which files to look for:
init:
define config.preload_fonts = ["fontname1.ttf", "fontname2.ttf", "fontname3.ttf"]
---
Tumblr media
ctc stands for "click to continue." It's a small icon commonly seen in visual novels, usually in one corner of the text box, that indicates the player has reached the end of a line. It's called "click to continue" because the program waits for the reader to interact to continue. To make a custom ctc icon, make a small drawing in an art program and save the image to your GUI folder. As seen above, I'm using a tiny moon as the ctc in my current project. ctc_position="fixed" means the ctc icon will stay rooted in whatever place you specify in the code. Like with most everything else in RenPy, you can apply transforms to the ctc if you so wish. Fun fact: because the ctc is determined on a character-by-character basis in initialization, you can give different characters custom ctcs!
---
Tumblr media
what_prefix="" and what_suffix="" add scare quotes to the beginning and end of a character's dialogue.
One thing you'll notice as you work with RenPy is that "the computer is stupid." That is to say, the program will not execute code you don't explicitly spell out. Things which seem intuitive and a given to us are not interpreted by the program unless you write them into the code.
That is why, in this case, you need to specify both prefix and suffix, otherwise RenPy may begin lines of dialogue with " but not end with ", or vice-versa.
Note that unless you apply these parameters to the narrator character, ADV and NVL narration will not have them.
---
** Note: the next two tags following these ones are extraneous and therefore ignored.
6 notes · View notes
thethinkingaurora · 5 months
Note
Yo. How do you code? (I only know the basics to HTML and CSS :/)
Idk which specific question you’re asking, like like how do I code as in what tools do I use, or what do I do and what is my process, or how did I learn to code, or can you teach me to code
And because I don’t know I’ll answer all of them :3
1. What tools do I use?
I use a few things to code, VS Code for actually writing the code, GitHub for storing projects and collaboration, Google and StackOverflow and depending on the project various other apps
2. How do I do it and my workflow process
Uh I have like no idea, I kinda just learn how certain things work via Google and then I slot them together, But the workflow process, I know exactly how to do that, ok so get a white board or a notepad or something, write what you want your program to do, and then break it down into steps and then break it down again and again, so for example,
For my current project, (The Incorrect Quote Generator), I need to take inputs, from a list of quotes choose one that fits the parameters, replace names in the quote with the inputted ones and then print the whole thing
Breaking down the first bit I need the inputs, what inputs do I need? I need the amount of characters and the names of the characters, ok done, second bit, take the quotes, sort them based off of character amount, using the amount of characters from the previous step, pick a set of quotes that match, replace the names, last bit, take the quote with it replaced and done
Breaking down again, first bit, done already, second bit, do we want something like autocapitalisation to make it nicer , yeah sure, what about capitalising the entire name if it fits the circumstance, makes it smoother, done, last bit done
Ok what about formatting, do we want all of this on one line or do we want separate lines for each person speaking, yeah we want separate lines, ok use an “&” symbol to represent a space and when the piece of code that assembles the end string encounters it, print the string and reset continuing from where we are to make a new line
That’s the design process for that
But first you make a prototype of it, to see if it works, like I didn’t have the autocaps or anything at first, I only added that when one of the submissions needed it
Anyways-
3. How did I learn to code
Through a number of ways, first I had gone to this computer club thing when I was like 8 or something and I found Scratch and learned about that, then when I was about 10 I was curious about html and websites, so I ended up making websites for classmates, then lockdown hit and I had nothing to do, I wanted to make a game, so what did I do? I jumped headfirst into Unity and struggled to get absolutely anything done (DON’T DO THIS), at some point I ended up joining this thing called Coderdojo which is like a coding class which worked really well (I actually still go there every Saturday although I’m at more advanced stuff now) and I learned about python and then kept learning more, then I made my own projects and learned more on my own from that
If you are looking to learn on your own, I’d recommend W3Schools, they have tons of courses, are entirely free and very in depth
But first I’d recommend you check out Scratch, it’s great for learning how to think in computer terms
4. Can I teach you to code
I know this probably wasn’t what you were asking but I’ll answer it anyway
Sure, I’d love to, coding one of the things I enjoy a lot because it combines logic and making things, and I love helping and teaching people things so teaching someone else to code sounds good to me :3
Stuff mentioned here
5 notes · View notes
ranjitha78 · 3 months
Text
The Complete Manual for Understanding Ethical Hacking
In order to evaluate an organization's defenses, ethical hacking—also referred to as penetration testing or white-hat hacking—involves breaking into computers and other devices lawfully. You've come to the correct spot if you're interested in finding out more about ethical hacking. Here's a quick start tutorial to get you going.
Tumblr media
1. "Getting Started with the Basics"
Networking and computer science principles must be thoroughly understood before getting into ethical hacking. Here are some crucial aspects to pay attention to: Operating Systems: Acquire knowledge of several operating systems, with a focus on Linux and Windows. Learning Linux is essential because a lot of hacking tools are made to run on it. Networking: It's essential to comprehend how networks operate. Find out more about
protocols include HTTP, HTTPS, DNS, TCP/IP, and others. Understanding data flow across networks facilitates vulnerability detection. Programming: It's crucial to know at least a little bit of a language like Python, JavaScript, or C++. Writing scripts and deciphering the code of pre-existing tools are made possible by having programming expertise.
2. Making Use of Internet Resources To learn more about ethical hacking, there are a ton of internet resources available. Here are a few of the top ones: Online Education: Online learning environments such as Pluralsight, Coursera, and Udemy provide in-depth instruction in ethical hacking. "Penetration Testing and Ethical Hacking" on Pluralsight and "The Complete Ethical Hacking Course: Beginner to Advanced" on Udemy are two recommended courses. Channels on YouTube: HackerSploit, The Cyber Mentor, and LiveOverflow are just a few of the channels that offer helpful tutorials and walkthroughs on a variety of hacking tactics.
3. Exercising and Acquiring Knowledge The secret to being a skilled ethical hacker is experience. Here are some strategies to obtain practical experience:
Capture the Flag (CTF) Tournaments: Applying your abilities in CTF tournaments is a great idea. CTF challenges are available on websites like CTFtime and OverTheWire, with difficulty levels ranging from novice to expert. Virtual Labs: It is essential to set up your virtual lab environment. You can construct isolated environments to practice hacking without worrying about the law thanks to programs like VMware and VirtualBox. Bug Bounty Programs: Websites such as HackerOne and Bugcrowd link corporations seeking to find and address security holes in their systems with ethical hackers. Engaging in these initiatives can yield practical experience and financial benefits.
Tumblr media
Dedication and ongoing education are necessary to learn ethical hacking. You can become a skilled ethical hacker by learning the fundamentals, using internet resources, and acquiring real-world experience. Always remember to hack wisely and ethically. Cheers to your hacking! I appreciate your precious time, and I hope you have an amazing day.
3 notes · View notes
goldeneducation · 9 days
Text
"DCA"(DIPLOMA IN COMPUTER APPLICATION)
The best career beginning course....
Tumblr media
Golden institute is ISO 9001-2015 certified institute. Here you can get all types of computer courses such as DCA, CFA , Python, Digital marketing, and Tally prime . Diploma in Computer Applications (DCA) is a 1 year "Diploma Course" in the field of Computer Applications which provides specialization in various fields such as Fundamentals & Office Productivity tools, Graphic Design & Multimedia, Programming and Functional application Software.
Tumblr media
A few of the popular DCA study subjects are listed below
Basic internet concepts Computer Fundamentals Introduction to programming Programming in C RDBMS & Data Management Multimedia Corel draw Tally ERP 9.0 Photoshop
Benefits of Diploma in Computer Application (DCA)
After completion of the DCA course student will able to join any computer jobs with private and government sectors. The certification of this course is fully valid for any government and private deportment worldwide. DCA is the only best option for the student to learn computer skills with affordable fees.
DCA Computer course : Eligibilities are here... Students aspiring to pursue Diploma in Computer Applications (DCA) course must have completed their higher school/ 10 + 2 from a recognized board. Choosing Computers as their main or optional subject after class 10 will give students an additional edge over others. Apart from this no other eligibility criteria is set for aspirants. No minimum cutoff is required.
Tumblr media
"TALLY"
A Tally is accounting software. To pursue Tally Course (Certificate and Diploma) you must have certain educational qualifications to thrive and prosper. The eligibility criteria for the tally course is given below along with all significant details on how to approach learning Tally, and how you can successfully complete the course. Generally, the duration of a Tally course is 6 month to 1 year ,but it varies depending on the tally institution you want to join. Likewise, tally course fees are Rs. 10000-20000 on average but it also varies depending on what type of tally course or college you opt for. accounting – Accounting plays a pivotal role in Tally
Key Benefits of the Course:
Effective lessons (topics are explained through a step-by-step process in a very simple language) The course offers videos and e-books (we have two options Video tutorials in Hindi2. e-book course material in English) It offers a planned curriculum (the entire tally online course is designed to meet the requirements of the industry.) After the completion of the course, they offer certificates to the learners.
Tally Course Syllabus – Subjects To Learn Accounting Payroll Taxation Billing Banking Inventory
Tally Course
Eligibility criteria: 10+2 in commerce stream Educational level: Certificate or Diploma Course fee: INR 2200-5000 Skills required: Accounting, Finance, Taxation, Interpersonal Skills Scope after the course: Accountant, Finance Manager, Chartered Accountant, Executive Assistant, Operations Manager Average salary: INR 5,00,000 – 10,00,000
Tumblr media
"In this Python course"
Rapidly develop feature-rich applications using Python's built-in statements, functions, and collection types. Structure code with classes, modules, and packages that leverage object-oriented features. Create multiple data accessors to manage various data storage formats. Access additional features with library modules and packages.
Python for Web Development – Flask Flask is a popular Python API that allows experts to build web applications. Python 2.6 and higher variants must install Flask, and you can import Flask on any Python IDE from the Flask package. This section of the course will help you install Flask and learn how to use the Python Flask Framework.
Subjects covered in Python for Web development using Flask:
Introduction to Python Web Framework Flask Installing Flask Working on GET, POST, PUT, METHODS using the Python Flask Framework Working on Templates, render template function
Python course fees and duration
A Python course costs around ₹2200-5000.This course fees can vary depending on multiple factors. For example, a self-paced online course will cost you less than a live interactive online classroom session, and offline training sessions are usually expensive ones. This is mainly because of the trainers’ costs, lab assistance, and other facilities.
Some other factors that affect the cost of a Python course are its duration, course syllabus, number of practical sessions, institute reputation and location, trainers’ expertise, etc. What is the duration of a Python course? The duration of a basic Python course is generally between 3 month to 6 months, and advanced courses can be 1 year . However, some courses extend up to 1 year and more when they combine multiple other courses or include internship programs.
Advantages of Python Python is easy to learn and put into practice. … Functions are defined. … Python allows for quick coding. … Python is versatile. … Python understands compound data types. … Libraries in data science have Python interfaces. … Python is widely supported.
Tumblr media
"GRAPHIC DESIGN"
Graphic design, in simple words, is a means that professional individuals use to communicate their ideas and messages. They make this communication possible through the means of visual media.
A graphic designing course helps aspiring individuals to become professional designers and create visual content for top institutions around the world. These courses are specialized to accommodate the needs and requirements of different people. The course is so popular that one does not even need to do a lot of research to choose their preferred colleges, institutes, or academies for their degrees, as they are almost mainstream now.
A graphic design course have objectives:
To train aspirants to become more creative with their visual approach. To train aspirants to be more efficient with the technical aspects of graphics-related tasks and also to acquaint them with relevant aspects of a computer. To train individuals about the various aspects of 2-D and 3-D graphics. To prepare aspirants to become fit for a professional graphic designing profession.
Which course is best for graphic design? Best graphic design courses after 12th - Graphic … Certificate Courses in Graphic Design: Adobe Photoshop. CorelDraw. InDesign. Illustrator. Sketchbook. Figma, etc.
It is possible to become an amateur Graphic Designer who is well on the road to becoming a professional Graphic Designer in about three months. In short, three months is what it will take to receive the professional training required to start building a set of competitive professional job materials.
Tumblr media
THE BEST COMPUTER INSTITUTE GOLDEN EDUCATION,ROPNAGAR "PUNJAB"
The best mega DISCOUNT here for your best course in golden education institute in this year.
HURRY UP! GUYS TO JOIN US...
Don't miss the chance
You should go to our institute website
WWW.GOLDEN EDUCATION
CONTACT US: 98151-63600
VISIT IT:
2 notes · View notes
nitunio · 3 months
Text
O2A2 Daily Log. DAY/NiGHT 1 (July 5th, 2024)
I'll be posting these until I get to the game's development conclusion!
Day I.
It was around 10 AM when I started working. My initial process laid in drafting the story. After deciding on the main character (in this case, Amaranth) I stripped the story to its two components – place and premise – because in other cases it’d be down to building the plot off of a character, and my mind runs wild whenever I construct it like that.
The place is the library, where souls come after they’ve passed, so an Afterlife Library. And the premise is quite simple – it’s a game for the player’s life! In this case, instead of a gamble it all comes down to outsmarting the machine, ahem, the experienced librarian.
And as a person who barely knows Python beyond freely coding in Ren’py, I wandered to the search engine to find a tutorial and realised that I’ll probably be better off searching on Reddit. One of the posts gave me a really good idea – the OP was talking about imagebuttons and logic and then it clicked for me.
Tic-tac-toe is a game where you draw the image inside the grid spaces, taking turns and adjusting your movements to your opponents’... Was it possible to code something like that?!
(duh, of course it was, this log is a testament to that)
I started by cropping the supposed “images” (solid blocks of two colours – one for the scroll and one for the charcoal), and cropped tiny squares of the scroll's colour. So the layering was like this – background scroll - big dark square - vertical box full of horizontal boxes of scroll’s colour, creating the illusion of a drawn grid, when in reality it is not.
Tumblr media
And this marks the beginning of my two-hour suffering. I ditched the idea of imagebuttons that I wanted to go with, since that’d require assets, which I only could use one of. So I opted for textbuttons, and it was the most Hell I’ve had coding.
At first I couldn’t get them to show up. Then, I remembered to set a box just for them (x/y maximum of 70ish, since the squares are 90), had nightmares doing the horizontal and vertical boxes, and increased the font. Hooray! Visible!
Setting a variable on click with “action” function was easy, and soon enough I could fill an entire board with. Xs and Os. Time to code Amaranth’s turn in! (scared)
It wasn’t as scary as I imagined: basically, all tiles are “if” functions, and if they’re empty the player can fill them. If it’s not their turn, they’re not active, and Amaranth is quick to respond (I did a test to see if she’d fill an empty cell and she did!)
Then came the invisible (for now) work – I coded in a win condition. I SCREAMED WITH JOY WHEN I SAW THAT MY ARRAYS FINALLY UPDATED! 
Tumblr media Tumblr media
That concluded my day-work!
Night I.
So I decided to push forward and actually coded in her responses!
I took and hardcoded the first two turns for her Xs and the rest was assigned at random. As for Os, I made it do everything at random, since she’s more experienced at playing Xs! (totally not because I didn’t want to look at tic-tac-toe ever again)
Each turn the machine checks if there are any free spaces and if any of the rows match winning conditions. If they do, the player gets to the end plot (I still haven’t written any of it, aaaa!). If they don’t, the game continues until it’s a draw or X’s/O’s win.
With that, I finally slumped into the bed. Even with taking breaks it was kind of a hard exercise to be jumping straight into after a. Year. Of not working with Python’s syntax.
[I’ve cut off a huge text segment of me trying to design a less clunky random placement system, but all of my endeavours led to dead ends caused by my inexperience and complex requests. Thank you for all the answers, StackOverflow! So many people asking the same question, it makes me feel like we’re all a part of a big community…]
Tumblr media
3 notes · View notes