#there is possibly a better way to do this with javascript
Explore tagged Tumblr posts
xiao-come-home · 1 year ago
Note
stone faced anon (💫 anon if it's free) here; as someone who has a hyperfixation in IT and coding I also think it would be very funny if Boothill had an s/o who wasn't necessarily a mechanic but like a software engineer or just a real big nerd about coding or something. He'll be experiencing a malfunction or a memory leak and go "oh yeah this happens sometimes don't worry about it" and then 10 minutes later he's sitting down plugged into a laptop listening to his s/o rant about how terrible his code is (crack hc: boothill's code was written in javascript) and how it's a wonder he hasn't bricked* yet
Would also be mad funny if Boothill ever got hacked and his s/o basically says "no you're not" and uses a previously made system restore point or something because of course they would both use and design every feature imaginable to keep Boothill in control of his own body, can you imagine the stress that losing control would cause him?? Even better if whoever designed him originally intentionally left a backdoor incase he ever went against their orders and when they try to use it his s/o just goes "oh yeah I quarantined and encrypted all the old files related to that backdoor and whatever else you were planning on a partition as bait and personally rewrote every file and function involved since your code is *an actual crime against technology*. by the way i'm going to go ahead and format that partition i mentioned, boothill- we won't be needing anything on it now that we can trace whoever made it. trust me, this won't be happening ever again."
*(bricking is a term mostly used to refer to hardware that's been rendered basically completely nonfunctional and beyond saving by using it wrong, mostly by messing with system files. Kinda like how windows can't even repair itself if you delete the system32 folder. Though i guess you could still install it with a usb stick if you formatted your pc- i digress you get what I mean. also since this almost happened to me recently: if you manage to fill up a hard drive to the brim, with literally 0 bytes of space left, that bricks it. reminder to check your storage thoroughly and often!)
Honestly wow I read it all and I'm a little bit speechless 🥹 thank you 💫 anon, it was great 🙏
Tumblr media
Boothill would DEFINITELY appreciate a s/o who's a tech savvy in general! I think at some point, he'd be pretty shocked you're so knowledgeable and just sit there, listening to you rant.. and just letting you do your thing.
Don't get me wrong, he definitely knows a lot about his body, his system and the way he works, but once you start to get in the zone and explain stuff to him, berate his code even, he just sits next to you, plugged in to your laptop, leaning his cheek against his hand listening to you like he obviously understands everything you say.
His other hand begins to gently play with a stand of your hair, humming deeply when the soft clicking sounds of your keyboard reach his ears; he twirls your hair with his fingers and chuckles, "mmm, really now?" Boothill raises an eyebrow, "encryptin' this, encryptin' that... How about we do somethin' more fun instead?" And then you shut him down from your laptop (😭).
Jokes aside, he'd feel very secure with you especially when he first got his new body, just knowing you'll probably fix a lot of things that could possibly blow up his face in no time, maybe even improve his life even more.
245 notes · View notes
akaicodes · 9 months ago
Text
update to my roadmap of learning https://www.tumblr.com/akaicodes/744920785897111552/roadmap-of-learning-curriculum-related-so-far - 4 months later ♡
• C# - spent ~1 year so far practicing, more comfortable, can build whole sites/programs with little help
• HTML & CSS - started ~5 months ago, confident in both, can style a site without help online, still much to learn
• JavaScript + Vue - Axios - can build “full stack” applications where i do both backend & frontend and host online (love JS!!)
• REST - experienced for 5 months! can build my own REST API, use someone elses with axios & test it thoughoutly with Postman (+Javascript code)
• Unit testing & UI testing - learned so many better ways to unit test & UI test more indeph
• Started leaning Git more with commands
• SQL - can manipulate simple databases and more one from scratch
& huge thanks to my sister @niyacodes for being on this journey with me 💓
++++ I went to a 5 hour exam for all these subjects (+- more) and got the highest grade possible 🥹 (i failed my first programming exam in 1st sem!!!!) ((pic is my favorite after study-snack))
Tumblr media
40 notes · View notes
mentalisttraceur-software · 3 months ago
Text
DeepSeek R1 First Impressions
DeepSeek R1 is almost as good as me at belabored exhaustive analysis and application of C89 rules. For practical purposes, it's equally good.
I asked: "How would you implement zig-zag encoding in strictly portable C89?" It was spitting out thinking output for at least a minute, but it got a basically-perfect solution on first try:
unsigned int zigzag_encode(int n) { return (((unsigned int)n << 1) ^ ((n < 0) ? -1 : 0); }
It also provided a `zigzag_encode_long`.
Note that this code will optimize on modern C compilers to the best assembly you could write. There is no branch in the produced code with even just `-O1` (`clang`, `gcc`), the branch is how we portably tell the compiler the right idea.
The only thing DeepSeek did "wrong" vs the above, was redundantly add an `(unsigned int)` cast to the `-1`. I mentioned this as I would to a person: that the usual arithmetic conversions would take care of it at the `^`. It reasoned the rest on its own: yes, because the left operand is already at least an unsigned int, so integer promotion will make the left side an unsigned int as well.
We talked at length about how we can prove that the above is portable to the most pathological C89-conformant implementations. It kept taking longer to "think", but it didn't show any weakness until the very last question.
I asked it to help me rigorously prove if the maximum value of unsigned integers is required by the C standard to be a Mersenne number (2^n-1). To have all bits one, that is.
What if an implementation just decided to arbitrarily not use one or more of the top values? I.e., why not `#define UINT_MAX 0xFFFFFFFE`?
DeepSeek R1 didn't seem to conceive of this possibility until I made it explicit. (But it did a great job of ruling out all others.)
Finally, it gave a longer, non-trivial argument, which I don't find convincing. Basically, it seemed to be saying that since integers used "pure binary representation", and every value bit could be either one or zero, well then the maximum value always has all value bits one - in other words, it seemingly assumed that just because each value bit individually was allowed to be one or zero, the possibility of them all being one at once must be both legal and used to represent a distinct value.
I see a shorter argument, which follows directly from what the standard does say: C89 has two definitions of `~`:
flip all the bits;
subtract from maximum value of that unsigned integer type.
The only way both can be true at once is if the maximum value is all value bits one. DeepSeek R1 agreed.
So what does this all mean?
This is an insane level of competence in an extremely niche field. Less than a year ago I tested LLAMA on this, and LLAMA and I didn't even get past me hand-holding it through several portability caveats. DeepSeek R1 and I just had a full-blown conversation that most devs I've talked to couldn't have with me. DeepSeek R1 managed to help me think in an extremely niche area where I'm basically a world-class expert (since the area in question is C89 portability, "world-class expert" is derogatory, but still).
If it's this good in one domain, it's this good in most domains. I bet it can do comparably well in Python, Go, JavaScript, C++, and so on.
In other words, it's already better than many devs in areas like this. I've seen plenty of devs making 6-figure USD salaries who didn't bother to know any of their day job tech stack this deeply. There's a market adjustment coming. Knowledge and expertise are about to become dirt-cheap commodities.
AI will eat current software dev jobs even faster than even I thought - and I already thought it would be sooner than most expect. Meanwhile, much of the industry is busy rationalizing from human intuition and ignorance that it just can't happen.
For years I've thought that the future is human devs delegating to teams of AI. That future is almost upon us, and this AI is good enough that I will be seriously experimenting with making that future a reality. I think if you hack together the right script to hook it up to a sandbox with dev tools, and prompt it just right... you might already be able to get this thing to actually do useful dev work.
8 notes · View notes
bloodsadx · 4 months ago
Note
sometimes i think of that rpgmaker thing you did a while back, and how striking the style was. do you have any plans for anything like that again in the future?
i really loved drawing for that but i was put in a 3way suckage position:
1. making “manifesto rpg” before i finished making manifesto comics was like giving me an identity crisis bc i want to be primarily a comics artist and also to tell the specific manifesto story through a comic medium so i was writing like an obtuse semi canon story that involved those characters so that i wouldn’t like feel like i blew my load but also it was taking up so much time that while i was doing it i wasnt making comics and i was like man i should be making comics instead but ultimately i just couldnt do either at the time bc of my brain. but like writing the story for the game and adding enemies and plot details felt like i was walking through a minefield of longterm story planning where i was like “would i want the prospective audience of this game to know this detail before i finish my comics?” which is already something i struggle with in my comics with like nonlinear story telling and trying to decide the most optimal order of impacts to tell the specific story i want which changes based on my mood etc like it was genuinely stressing me out very badly so the story i ended up writing for that game bc this weird bloated thing that was simultaneously not going to be substantial but also felt like i was giving away my best kept secrets for free or something lol
2. i dont know how to write javascript very well so i couldnt make the class system as elaborate as i wanted and the battle system was extremely interesting to me to fabricate but learning javascript and also the like rpgmaker specific terms was really daunting and taking me weeks of time where i was doing bad at it and also not making any money and also paying rent
3. the amount of detail and one off art assets i was generating and the fact i was drawing everything traditionally in a specific style i was developing for the game then touching it up in specific ways and trying to hew as closely to red/black/white as possible was incredibly inefficient and incredibly time consuming and i have like an incredible litany of mental health disorders and at that time in particular i was extremely unable to genuinely focus on anything for very long and i basically hyper obsessed over that project for like 2-3 months and then completely crashed MOSTLY bc the feeling that i wasnt making money OR comics at the time made me feel like i was losing my way so i basically pivoted my entire shit back to screen printing soon after that so that i could make money
all of that being said, i would Love to do some shit like that again, i try to advertise that to people and put it in my portfolio and stuff, but i don’t have the time or money to do it, and also, the kind of art i make, the kind of ideas i have, in my experience are so like stylistically Me and like Strong, that often times i think people struggle to collaborate with me or are just patently uninterested in it bc it feels like “ivy stuff”, like it subsumes other stuff, and so i think if i did make something like that i would have to resolve the above 3 problems and do it mostly solo or have so much money that i could pay someone else to do coding stuff for me. idk. maybe one day. i do think ive gotten incredibly better at skills like project management and dedicating myself long term to finishing things in the years since then, like the hot sauce miku drop or a bunch of other personal projects ive taken on have taught me better. i have more friends and such. i am relatively optimistic one day something like this could happen
7 notes · View notes
green-crow · 4 months ago
Text
*breaks down the door*
I'm having more thoughts for the HTTYD text-based game. I think I've narrowed down the dragon options for almost every class, and I'm taking into account the size (medium or large), the fire breath type, and (sometimes not canon) extra abilities and weaknesses. For example, a woolly howl is medium size, has an icy breath so the player will be able to freeze water, has the ability to create strong winds with his breath, and has a weakness to water since the fur in its body would become too heavy when wet. This means my game will have 7 dragon options for the player, and from there there will be around 9 places to explore though I'm not 100% sure yet about that. I don't want to spoil too much but I'm just so excited to start another big project like this, even more so since it's related to one of my fav pieces of media now.
I do have to figure out whether I want to use Twine for this too or a new game engine also for text-games but more similar to Zork. On one hand having 9 possible "rooms" and 7 options at the beginning does mean I have to cook up a lot of scenarios, so smaller puzzles with limited options would be way easier to develop and probably better for my sanity... But then again, the first game I ever made also had some coding related challenges that ended up being my favourite part of the whole process (I'm looking at you inventory in twine with JavaScript).
Oh oh, and I also have an idea for the plot, even if I want to keep it simple and pretty much just be there to explain why the player is doing what starts the game in the first place. I don't want to reveal too much of the game but the main idea would be that you are a rider from Berk visiting an island a bit far away from the archipelago, with a list of rare resources only found in said place. You'll have to work along with your dragon and use your wit to find and collect these resources, not to mention, you might face some unexpected obstacles... ;)
Ahhhhh I can't wait to keep working on it! I have some retakes at the end of the month, but after this Wednesday I'll try to put some more effort into this project.
4 notes · View notes
piratesexmachine420 · 7 months ago
Text
Expanding and cleaning up on a conversion I had with @suntreehq in the comments of this post:
Ruby is fine, I'm just being dramatic. It's not nearly as incomprehensible as I find JavaScript, Perl, or Python. I think it makes some clumsy missteps, and it wouldn't be my first (or even fifth) choice if I were starting a new project, but insofar as I need to use it in my Software Engineering class I can adapt.
There are even things I like about it -- it's just that all of them are better implemented in the languages Ruby borrows them from. I don't want Lisp with Eiffel's semantics, I want Lisp with Lisp's semantics. I don't want Ada with Perl's type system, I want Ada with Ada's type system.
One of these missteps to me is how it (apparently) refuses to adopt popular convention when it comes to the names and purposes of its keywords.
Take yield. In every language I've ever used, yield has been used for one purpose: suspending the current execution frame and returning to something else. In POSIX C, this is done with pthread_yield(), which signals the thread implementation that the current thread isn't doing anything and something else should be scheduled instead. In languages with coroutines, like unstable Rust, the yield keyword is used to pause execution of the current coroutine and optionally return a value (e.g. yield 7; or yield foo.bar;), execution can then be resumed by calling x.resume(), where x is some coroutine. In languages with generators, like Python, the behavior is very similar.
In Ruby, this is backwards. It doesn't behave like a return, it behaves like a call. It's literally just syntax sugar for using the call method of blocks/procs/lambdas. We're not temporarily returning to another execution frame, we're entering a new one! Those are very similar actions, but they're not the same. Why not call it "run" or "enter" or "call" or something else less likely to confuse?
Another annoyance comes in the form of the throw and catch keywords. These are almost universally (in my experience) associated with exception handling, as popularized by Java. Not so in Ruby! For some unfathomable reason, throw is used to mean the same thing as Rust or C2Y's break-label -- i.e. to quickly get out of tightly nested control flow when no more work needs to be done. Ruby does have keywords that behave identically to e.g. Java or C++'s throw and catch, but they're called raise and rescue, respectively.
That's not to say raise and rescue aren't precedented (e.g. Eiffel and Python) but they're less common, and it doesn't change the fact that it's goofy to have both them and throw/catch with such similar but different purposes. It's just going to trip people up! Matsumoto could have picked any keywords he could have possibly wanted, and yet he picked the ones (in my opinion) most likely to confuse.
I have plenty more and deeper grievances with Ruby too (sigils, throws being able to unwind the call stack, object member variables being determined at runtime, OOP in general being IMO a clumsy paradigm, the confusing and non-orthogonal ways it handles object references and allocation, the attr_ pseudo-methods feeling hacky, initialization implying declaration, the existence of "instance_variable_get" totally undermining scope visibility, etc., etc.) but these are I think particularly glaring (if inconsequential).
5 notes · View notes
idrellegames · 11 months ago
Note
Coding Master, I hope you're well! I don't want to bother you but if you have a free moment I was hoping for some guidance. I was wanting to know if there was a way to make the choices in sugarcube visually similar to how Choicescript does it. (Each choice, in it's own seperate box.) I had recently come across this from Brushmen. I find that the way the choices are set up look great, but I sadly don't want to use tweego to do it. https://brushmen.itch.io/cs-like-sugarcube-template/devlog/520639/preparation-steps Any and all help would be appreciated, if not possible I would just be happy to be sent to where you think I could find help.
If you don't want to use Brushmen's template, then no, not easily? You would have to learn enough HTML, CSS and JavaScript to either edit the default SugarCube template yourself or make a custom one.
If you want to use the template, I would look into installing Tweego even if you don't want to use it to compile your game. That way you can decompile it into an HTML file that you can then upload into the Twine editor and poke around. However, as Brushman's template was designed to work with VSCode, Twee 3 Language extensions, and Tweego, you may find that it does not work exactly as intended and you may need to be prepared to adjust or fix things to your liking.
Tweego is a nice asset to have around regardless, depending on the size of your game. I have to use it myself because Wayfarer is broken into multiple story files on account of its size; there's no way I can work on it all within one story file.
If it's just designing the choice boxes to replicate how they work in ChoiceScript, this should technically be pretty straightforward with a little CSS, but you may need to strike out on your own.
Personally, if you're adverse to using Tweego, I would start from scratch by editing the default SugarCube look or by editing a custom template. You can learn a lot through the process of making something yourself; the more familiar you are with the systems you're using, the better you will be at fixing things when they go awry and your game can only benefit from it.
14 notes · View notes
tempkiriri · 1 year ago
Text
Spoiler-Covering on the T&B Wiki: Feedback *Needed*
Spoilers. It's kind of absurd and insane when you go on a wiki for the *latest* content and none of it is spoiler covered. And by latest I'm talking about like, maybe released 12 hours ago. At HeroTV Database, we don't do that. All story-related content is put under a year incubation period and must be covered. The only exception to this is S2 Cour 2, which whilst it still must be covered, has an indefinite embargo date atm.
I've made 3 iterations of a "Spoiler" template, aiming to hide text and images by default. Version 1 was just a ripoff of the template as seen on FE Fandom wiki (please forgive me) but that ran into the issue of the expand/collapse prompt being off to the right side and the more text was hidden I came to mind, the lower the click prompt fell, for some reason. It being outside of the box and floating away was not ideal for design. Also, this had to be used in-conjuction with another template to mark off the "end" of a spoiler. Most, not all (namely multiple paragraphs of info and anything containing images) needed this, and it's just very clunky to use and look at. Version 2 was promising at first, but two big issues were that it was a table of sorts and I couldn't find a way to make the drop-down opaque (either just white, or it copied the colour from the primary banner part), and spoilers must reside in the table, meaning if the content it contains is long enough, it will push itself down below any other templates or images just to display. Not great. Version 3 is the best one to date, and would be perfect if not for one problem: Every use of it on a page is recognised as the same instance, since the ID for the "Show me the spoilers" button in the banner is the same across all uses of it. Clicking on just one activates every single spoiler on the page, so you might want to see one but not the others and if you don't close the first one...problems. Yeah. This was so close.
After this specific failure of V3, I went to look for help in the Miraheze discord server, and everyone over there is oh so nice n helpful. Provided by a user going by 'canada' in the discord, they've given us code for a "block spoiler-cover" function that utilises CSS and JS to work, and is VIEWABLE ON MOBILE!!!! (This is something that would not be possible on Fandom, as Fandom Mobile has no JavaScript OR CSS support because Devs are liars when they say they want to make mobile fandom better.)
Before properly implementing it onto main pages, I *require* feedback. The link above is to the sandbox, where the spoiler boxes are being tested. Use the "Show all spoilers" to reveal all of them at once, or click/tap on a box to show, and click/tap again to hide. Tapping on an image takes you to the file page of an image, covered or not, so to not get taken to an image page, safest bet (usually) is to tap on a corner, or click where your mouse cursor does not shift into a hand ready to click. I'll see if there's anything I can put in the code to stop it from doing that. I'm certain I can change the colours of the spoiler box (current colours are purely placeholders), but colour suggestions should try to contrast with red, white, black and the shade of blue that's recognised as hex #2A3C45 (A darker blue intended for a dark mode). The colour should also be somewhat desaturated so it's not blinding to look at, so a pastel colour could be beneficial, maybe a pink or yellow, it's up to you what would look best! The more opinions the better!
The feedback is primarily for if we want this to begin with, and for stating adjustments you want before it does go into effect on main pages. If you do not want this to go into effect and want something else, please make that voice heard!
Thanks and Thanks Again!
7 notes · View notes
16naughts · 3 months ago
Text
Dev Log Feb 7 2025 - The Stack
Ahoy. This is JFrame of 16Naughts in the first of what I hope will turn out to be a weekly series of developer logs surrounding some of our activities here in the office. Not quite so focused on individual games most of the time, but more on some of the more interesting parts of development as a whole. Or really, just an excuse for me to geek out a little into the void. With introductions out of the way, the first public version of our game Crescent Roll (https://store.steampowered.com/app/3325680/Crescent_Roll juuuust as a quick plug) is due out here at the end of the month, and has a very interesting/unorthodox tech stack that might be of interest to certain devs wanting to cut down on their application install size. The game itself is actually written in Javascript - you know, the scripting language used by your web browser for the interactive stuff everywhere, including here. If you've been on Newgrounds or any other site, they might call games that use it "HTML5" games like they used to call "Flash" games (RIP in peace). Unfortunately, Javascript still has a bit of a sour reputation in most developer circles, and "web game" doesn't really instill much confidence in the gamer either. However, it's turning more and more into the de-facto standard for like, everything. And I do mean everything. 99% of applications on your phone are just websites wrapped in the system view (including, if you're currently using it, the Tumblr app), and it's bleeding more and more into the desktop and other device spaces. Both Android and iOS have calls available to utilize their native web browsers in applications. Windows and Mac support the same thing with WebView2 and WebKit respectively. Heck, even Xbox and Nintendo have a web framework available too (even goes back as far as Flash support for the Wii). So, if you're not using an existing game engine like we aren't and you want to go multi-platform, your choices are either A) Do it in something C/C++ -ish, or now B) Write it in JS. So great - JS runs everywhere. Except, it's not exactly a first-class citizen in any of these scenarios. Every platform has a different SDK for a different low-level language, and none of them have a one-click "bundle this website into an exe" option. So there is some additional work that needs to be done to get it into that nice little executable package.
Enter C#. Everyone calls it Microsoft Java, but their support for it has been absolutely spectacular that it has surpassed Java in pretty much every single possible way. And that includes the number and types of machines that it runs on. The DotNet Core initiative has Mac, Windows, and Linux covered (plus Xbox), Xamarin has Android, and the new stuff for Maui brought iOS into the fold. Write once, run everywhere. Very nice. Except those itty bitty little application lifetime quirks completely change how you do the initialization on each platform, and the system calls are different for getting the different web views set up, and Microsoft is pushing Maui so hard that actually finding the calls and libraries to do the stuff instead of using their own (very strange) UI toolkit is a jungle, but I mean, I only had to write our stream decompression stuff once and everything works with the same compilation options. So yeah - good enough. And fortunately, only getting better. Just recently, they added Web Views directly into Maui itself so we can now skip a lot of the bootstrapping we had to do (I'm not re-writing it until we have to, but you know- it's there for everyone else). So, there you have it. Crescent Roll is a Javascript HTML5 Web Game that uses the platform native Web View through C#. It's a super tiny 50-100MB (depending on the platform) from not having to bundle the JS engine with it, compiles in seconds, and is fast and lean when running and only getting faster and leaner as it benefits from any performance improvements made anywhere in any of those pipeline. And that's it for today's log. Once this thing is actually, you know, released, I can hopefully start doing some more recent forward-looking progress things rather than a kind of vague abstract retrospective ramblings. Maybe some shader stuff next week, who knows.
Lemme know if you have any questions on anything. I know it's kind of dry, but I can grab some links for stuff to get started with, or point to some additional reading if you want it.
3 notes · View notes
thegrayascendancy-if · 2 years ago
Text
Sugarcube, flat stats and setter links
As I spent an unspecified time trying to figure it out, maybe it will spare someone the trouble or build towards intuition for how stats work. Or maybe this is bait to see if anyone knows a better solution 😏
First of all, flat stats vs fairmath stats. Fairmath stat accumulation is designed to represent stat gain as inversely relative: the higher your stat value, the smaller your absolute gain would be expressed by the same relative number. E.g. 10% gain at 90 is different from 10% at 15. A bonus (and very important) effect of this is that the stat value increased or decreased via fairmath will never fall below 0 or rise above 100, doing all the stat clamping for you.
Fairmath is easy to test and observe in ChoiceScript, where you can run thousands of tests automatically. You cannot do that in Twine. This is my primary motivation for going with flatmath for my SugarCube project. Which means that someone has to handle clamping, as a gain of 10 at stat value 95 will set the value above 100.
The frequent code for handling that is during change:
<<set $stat to Math.clamp($stat + 5, 0, 100)>>
which, in this example, increases variable $stat by 5 and makes sure the result is not smaller than 0 and not greater than 100: clamping.
My problem with it is how much code repetition is there and how incredibly copy paste error prone this is. You will no doubt be copy pasting this code all over your game files and will need to make sure you are replacing the variable name twice each time, lest one variable will end up with the value of another in an oversight that is way too easy to miss. Ideally we want to specify not only the name of the variable, but also our bounds (0 and 100 respectively) only once.
There are two answers to this problem: widgets and JavaScript. A widget for this is one and done, but it is more fuss to integrate it into code, I found. In the JS solution you would need to figure out a function that works for your variable storage schema.
Let's cover the widget solution first:
<<widget "modify">>     <<print '<<set ' + $args[0] + ' to Math.clamp(' + $args[0] + ' + ' + $args[1] + ', 0, 100)>>'>> <</widget>>
Not only will the above check that each resulting value is within the [0; 100] range, it accepts the variable name as a parameter, meaning it will work for any stat (though you would need to pass the variable name as a String) and for subtraction too:
<<modify "$stat" -18>>
Now to problems. For my links between passages in the format for Twine I use, SugarCube, I strongly prefer the structure of setters:
[[Link text|NextPassageName][stat modifications]]
Calling a widget is not possible inside a setter link though. You would either need to do that in the next passage, which is inconvenient if you do not need that passage for anything else, or to marry two syntaxes in this unholy matrimony:
<<link [[Link text|NextPassageName]]>>   <<set $otherstat to "wowza">>   <<modify "$stat" -18>>   <</link>>
And this is just one link/option.
Now, for the price of extra JS code you can avoid all this. Depending on how you store your game variables, flat or in objects, you can employ tricks to save you time and code lines.
window.modifyStatA = function(value) {     State.variables.StatA = Math.clamp(State.variables.StatA + value, 0, 100); }
This anywhere in your custom JS file for the game will allow to do the following:
[[Link text|NextPassageName][modifyStatA(-18), $otherstat to "wowza"]]
and will change the value of $StatA by subtracting 18 upon clicking that link/option.
You can also do the following:
window.modifyStat = function(statName, value) {     State.variables[statName] = Math.clamp(State.variables[statName] + value, 0, 100); }
which creates a more generic function:
[[Link text|NextPassageName][modifyStat("StatA", -18), $otherstat to "wowza"]]
As you can see, this is suitable for flat stat storage (which I personally do not do). I suppose for the nested stats you could specify the object names as inputs in their order of hierarchy and access them so for a generic function, but I am not sure yet how to do that for a variable number of levels, e.g. Parent.StatGroup.statA vs Parent.statB
I believe this is geared to the very specific way I personally structure my passages and links, so I am ready to be proven wrong 😅
Cheers!
22 notes · View notes
biggaybunny · 2 years ago
Text
Modern software sucks shit because modern software development sucks shit. No one knows what they're doing and when they do they'll usually be told to do something else anyway. Non-transferrable skills are treated as transferrable; "programming" is an extremely broad field that we are still just beginning to map out. I'm not trying to oversell it here, I have no agenda, I just need to try and convey some perspective here that you can do a lot of different shit with computers, and lumping it all under "writing software" is kind of like lumping all "machines" together and expecting engineers who work with things like planes, cars, pumps, and cranes to be able to figure each other's shit out. There's some specialization happening in the field, but to be honest, most companies are pretty slow to catch on (outside of, yknow, searching resumes for whatever buzzword we're using now)
That's only the beginning of it, too. I don't know I could actually fit all the reasons software development sucks shit into one post. Basically, businesses hate the way software is made. They want software assembly lines, I've had as much said to me by a manager before. They want software products that are specced out, assembled, and shipped out. And that *really, really* doesn't work. Most of the time, when it comes to developing a software "product", they don't even know what they actually want or need. A lot of software bloat comes from early development work that had to be course corrected or repurposed; it's like being a sculptor and having someone behind you try to describe what they want sculpted, but also they're rushing you and don't understand what's even possible to do with sculpting in the first place.
The other thing companies hate about making software is that you can't throw just throw more people at the problem. It's like that math problem "If an orchestra of 50 people can play Beethoven's 5th in 40 minutes, how fast can an orchestra of 500 people play it?" That's how the people in charge want software to work, and after decades of absolute horseshit business paradigms (agile, kanban, scrum, agile-at-scale, extreme programming yes it's called that, etc) it's very clear that this will NEVER be the case, but by god that's not going to stop companies from trying. Because it's about maximizing profits, right? You couldn't possibly get better returns by like, investing in employee retention (dogshit in the business btw) or employee QoL. Just get more people fresh out of a javascript bootcamp and throw them at the issue until something works. So software development gets diced up into thousands of little pieces that can be worked on simultaneously and then glued back together, and as you'd expect end up as dysfunctional Frankenstein monsters. Plus, none of your employees are actually improving at software development because they're only allowed to see such a small piece of the puzzle.
And at the end, it just has to work. Not be good, work. Which is why companies skimp on QA all the time, and then undermine the QA they do invest in. The corner cutting is everywhere. Because it saves costs, you see. Why invest in QA? Just don't write broken code, obviously (this is not how this works). How much security do we need, really? Corner cut, corner cut, corner cut. Rush, rush, rush. Is it any wonder that the cleanest pieces of software tend to be made by small teams or even individuals, working on their own timeframe?
I could've summed up this entire post with "capitalism sucks" but I wanted to explain more. Software development isn't going to get good in a couple years. It's not going to get good in ten years. It's going to suck absolute shit for the foreseeable future. Corporate software, anyway. Maybe if open-source software got a little more love and support... well, who knows.
45 notes · View notes
watchmorecinema · 2 years ago
Text
Normally I just post about movies but I'm a software engineer by trade so I've got opinions on programming too.
Apparently it's a month of code or something because my dash is filled with people trying to learn Python. And that's great, because Python is a good language with a lot of support and job opportunities. I've just got some scattered thoughts that I thought I'd write down.
Python abstracts a number of useful concepts. It makes it easier to use, but it also means that if you don't understand the concepts then things might go wrong in ways you didn't expect. Memory management and pointer logic is so damn annoying, but you need to understand them. I learned these concepts by learning C++, hopefully there's an easier way these days.
Data structures and algorithms are the bread and butter of any real work (and they're pretty much all that come up in interviews) and they're language agnostic. If you don't know how to traverse a linked list, how to use recursion, what a hash map is for, etc. then you don't really know how to program. You'll pretty much never need to implement any of them from scratch, but you should know when to use them; think of them like building blocks in a Lego set.
Learning a new language is a hell of a lot easier after your first one. Going from Python to Java is mostly just syntax differences. Even "harder" languages like C++ mostly just mean more boilerplate while doing the same things. Learning a new spoken language in is hard, but learning a new programming language is generally closer to learning some new slang or a new accent. Lists in Python are called Vectors in C++, just like how french fries are called chips in London. If you know all the underlying concepts that are common to most programming languages then it's not a huge jump to a new one, at least if you're only doing all the most common stuff. (You will get tripped up by some of the minor differences though. Popping an item off of a stack in Python returns the element, but in Java it returns nothing. You have to read it with Top first. Definitely had a program fail due to that issue).
The above is not true for new paradigms. Python, C++ and Java are all iterative languages. You move to something functional like Haskell and you need a completely different way of thinking. Javascript (not in any way related to Java) has callbacks and I still don't quite have a good handle on them. Hardware languages like VHDL are all synchronous; every line of code in a program runs at the same time! That's a new way of thinking.
Python is stereotyped as a scripting language good only for glue programming or prototypes. It's excellent at those, but I've worked at a number of (successful) startups that all were Python on the backend. Python is robust enough and fast enough to be used for basically anything at this point, except maybe for embedded programming. If you do need the fastest speed possible then you can still drop in some raw C++ for the places you need it (one place I worked at had one very important piece of code in C++ because even milliseconds mattered there, but everything else was Python). The speed differences between Python and C++ are so much smaller these days that you only need them at the scale of the really big companies. It makes sense for Google to use C++ (and they use their own version of it to boot), but any company with less than 100 engineers is probably better off with Python in almost all cases. Honestly thought the best programming language is the one you like, and the one that you're good at.
Design patterns mostly don't matter. They really were only created to make up for language failures of C++; in the original design patterns book 17 of the 23 patterns were just core features of other contemporary languages like LISP. C++ was just really popular while also being kinda bad, so they were necessary. I don't think I've ever once thought about consciously using a design pattern since even before I graduated. Object oriented design is mostly in the same place. You'll use classes because it's a useful way to structure things but multiple inheritance and polymorphism and all the other terms you've learned really don't come into play too often and when they do you use the simplest possible form of them. Code should be simple and easy to understand so make it as simple as possible. As far as inheritance the most I'm willing to do is to have a class with abstract functions (i.e. classes where some functions are empty but are expected to be filled out by the child class) but even then there are usually good alternatives to this.
Related to the above: simple is best. Simple is elegant. If you solve a problem with 4000 lines of code using a bunch of esoteric data structures and language quirks, but someone else did it in 10 then I'll pick the 10. On the other hand a one liner function that requires a lot of unpacking, like a Python function with a bunch of nested lambdas, might be easier to read if you split it up a bit more. Time to read and understand the code is the most important metric, more important than runtime or memory use. You can optimize for the other two later if you have to, but simple has to prevail for the first pass otherwise it's going to be hard for other people to understand. In fact, it'll be hard for you to understand too when you come back to it 3 months later without any context.
Note that I've cut a few things for simplicity. For example: VHDL doesn't quite require every line to run at the same time, but it's still a major paradigm of the language that isn't present in most other languages.
Ok that was a lot to read. I guess I have more to say about programming than I thought. But the core ideas are: Python is pretty good, other languages don't need to be scary, learn your data structures and algorithms and above all keep your code simple and clean.
19 notes · View notes
malwary · 2 years ago
Text
Tumblr media
a little while ago @neuro-typical sent me this post by @bye2k of a popup that appeared when trying to right-click images on a shadow the hedgehog fan forum, known as Wishes are Eternal (after the SA2 line). this version of the site appears to be an archived snapshot on the wayback machine, and I'm happy to confirm that it is indeed real. though i couldn't get the popup to work in my own browser, the javascript does exist in the source code of the site, so it's very real and very cool.
i had a lot of things to say about this, but i didn't want to blast the notes of the OG post into oblivion with my big funny wall of text, so I've made my own post. below the readmore I'll explain javascript popups on the internet, some malware that has utilized this, and some very interesting sonic fan community history.
first of all: what is this? how did the webmaster manage to create a popup window in your computer to stop you from downloading images?
well, that would be javascript. because JS is just a normal script language that can do whatever you want, creating a popup is no exception. now, whoever ran the site did not write this script themself, this much is evident by the credit you can see in the source code for the site.
Tumblr media
this script is offered by a site called dynamicdrive.com, specifically for disabling right-clicks. you see how simple this is? javascript makes it possible to bother users in all sorts of creative ways. plenty of malware on the web utilizes javascript, and you're probably already aware of most good examples.
Tumblr media
you're most likely familiar with offiz, better known by the colloquial name "You Are An Idiot". though its status as malware is somewhat debated, most people can agree that the sites it was on abused a javascript function that allowed it to create hundreds upon hundreds of bouncing windows, slowing the user computer to a crawl and forcing the user to restart their machine, meaning any unsaved work they had open was now lost. in that way it was destructive, though indirectly.
offiz is an example of javascript malware that is harmless on its own, but not all JS malware is that friendly. javascript can be used to force your machine to download software, steal user data, serve you all manner of popups, employ many kinds of malicious code through xss, and more. although these cases are rarer than they were, say, a decade ago, that doesn't mean they don't still happen. here is a fascinating little instance of javascript being used maliciously very recently. it's hard to suggest ways to avoid these without just telling you to use common sense, but there's no other way to put it. as is the case with all malware, your best bet when it comes to not getting it is thinking before you click.
browser malware is extremely common. you may have encountered it going to a suspicious website. there is certainly a necessary aspect of social engineering to this type of malware, you have to be paying less attention to where you're going and what you're doing to stumble upon a site so unsecured that it could infect you. users who get themselves into these situations are typically looking for either p_rn or pirated stuff, so they're more likely to act in irrational or desperate ways to get to their content. don't be a fool online and you won't get played for one.
so, why? why does this old, obscure sonic fan forum have javascript that prevents you from right clicking images? prevents you from downloading images?
this forum is very, very old. the last posts on the entire site were about 10 years ago, even to this day. it's no surprise to me that a lot of this site is a relic of its time. the photobucket watermark on the header image, the collecton of midis of shadow themes playable on the site, the use of the term "ripped off" (as opposed to ripped) to describe the action of taking sprites from a game. it's all there on the very first page, the only one in this archive. despite what youtube video slideshows with a single text scroll that says "no copyright intended, pictures found on google" may imply, reposting images was indeed taken seriously at this time. this was a time when it wasn't too uncommon to see a credit to the person who made an anime girl image transparent (a render, for those unaware) in a forum signature. this was a time when someone got caught tracing every 5 days.
that's not to say there were no issues, but people were still very defensive over what they deemed to be theirs. this was especially prevalent in fanart. fan works are hard and are always a labor of love, so it's no surprise nobody wanted their work reposted, especially not without credit. this was especially clear when looking into some parts of the sprite ripping community. making spritesheets was much harder then than it is now, and it was especially impressive if sprites were hand-edited or even made from scratch. this incredibly painstaking work combined with sonic fans reputation for... unwavering passion... could often culminate in a very serious attitude towards doing something as simple as saving an image. in fact, for some people, this mindset has never truly left.
Tumblr media
in 2014, fangame creator Leemena Dan published Sonic Gather Battle on SAGE (the Sonic Amateur Games Expo) to mostly positive reception but ultimately little attention outside of sonic fans online. that is, until 2017, when after a seemingly inconspicuous update, players discovered what appeared to be an audaciously malicious form of DRM present in the game.
this malware had everything. all the bells and whistles. when a player would do any number of things from opening software made to decompile games to simply typing "sonic gather battle cheat" into their internet browser search bar, the payload would activate. (which, of course, means it tracks your keystrokes!)
it's difficult to find good footage of both layers of this DRM (or, rather, both payloads of this malware) that doesn't include a facecam of some gamer dude gawking and screaming at his computer screen. even so, I've found two decent ones. layer 1, and layer 2. this DRM also sends your IP address to a privately owned server, presumably so that the DRM would activate even when the game is uninstalled, and when trying to play it, a splash screen would show telling you to abide by the rules.
unsurprisingly, people did not consider this a proportionate way to respond to the threat of people ripping the sprites from a fangame, and the creator has since been banned from SAGE. to this very day, some people are simply so protective of their work that they'd be willing to go to any length to prevent you from saving it. as obnoxious as that can sometimes seem, it does make for some very interesting history.
33 notes · View notes
mousiecat · 2 years ago
Text
♥ ♡ Intro Post! ♡ ♥
post update (10/17/23)
uhh okay so eventually this will be more about coding again but I've been too busy
but I'm just gonna reblog and talk about whatever
---------------------------------------
Hi, I’m mousiecat 🐭🐱
I'm so excited to participate in the Codeblr community!
I'd love it if you checked out my Neocities!
If you're on Neocities, you can follow me here :)
♥ ♡ ♥ ♡ ♥ ♡ ♥  ♡ ♥ ♡ ♥ ♡ ♥
First, my main tags:
meow squeak - me! my own posts! includes asks
Reference - coding info to refer back to
Resources - useful tools and libraries
Learning Resources - tutorials, games, projects, or webinars for learning
Web Accessibility - learn to make things more accessible!
Goodies - yummy pixels and art that creators have shared for public use on your webbies ~ (always follow creators' crediting guidelines!)
♥ ♡ ♥ ♡ ♥ ♡ ♥  ♡ ♥ ♡ ♥ ♡ ♥
Read more for more about me!
Coding Origins
The golden age of Neopets! It was an HTML/CSS wonderland! You could catch my kid self building Sailor Moon guilds, spicing up my shop, and customizing my pet pages.
♥ ♡ ♥ ♡ ♥ ♡ ♥  ♡ ♥ ♡ ♥ ♡ ♥
Coding Rebirth
A bit ago, in a fit of nostalgia, I surfed Geocities archives and longed for the days the creative web still existed. Then I realized...HTML/CSS are still around, and people are still making cute, fun, independent sites with it. You don’t have to resort to uploading content to some billionaire’s website--you can still make your own!
So, I got on the Neocities train, and I've been really excited about the endless possibilities with coding! I especially love that, if you are able to access a consistent computer and internet connection, you can do everything else for FREE! Learning, creating, publishing, all of it. Kinda kickass.
♥ ♡ ♥ ♡ ♥ ♡ ♥  ♡ ♥ ♡ ♥ ♡ ♥
Currently Learning:
HTML/CSS, and soon JavaScript with FreeCodeCamp
Learning a bit of Python with Udemy (mostly to connect with a local lesbian coding group)
Attending random Meetup coding events until I find my groove~
♥ ♡ ♥ ♡ ♥ ♡ ♥  ♡ ♥ ♡ ♥ ♡ ♥
Goals:
My primary goals are fun and creativity! I especially wanna make cute lil games and activities for silly webpages :)
More and more, I also want to find ways to use coding for liberatory organizing, especially abolition, sex worker advocacy, and reproductive justice work. So far I've made a cute page for an event, and I've got some ideas for simple educational games :) I'd love to strategize beyond this ~~~~~
Down the line it could be really cool to get a paying gig, but it's not my central motive
I just want to keep learning more so I have a better sense of all the possibilities!!! Let's get this party STARTED!
♥ ♡ ♥ ♡ ♥ ♡ ♥  ♡ ♥ ♡ ♥ ♡ ♥
Codeblr Goals:
You know…I’ll post when I post and I won’t when I won’t! I have ADHD, so out of love for myself I don’t give myself assignments when I don’t have to. So, I’m not trying to post every day or anything. I just want a lil outlet for it when I’m feeling it! I love learning from everyone here, and it would be amazing to make connections!
20 notes · View notes
mvbit42 · 1 year ago
Note
ok scratchaddons kicks ass but honestly it does suck that we can't use it to make and add new blocks..
someone should make some way to interface with a javascript library with a custom version of scratch that would be nice
teehee :)
imagine scratch but Faster and Better in literally every way possible (that's this)
penguinmod is a mod of turbowarp, which in turn is a mod of scratch, that allows Custom Extensions to be made and imported to do literally whatever you want in your project
8 notes · View notes
ss-tech-services · 8 months ago
Text
Proven Techniques for Ranking Higher on Google
Tumblr media
Google is a powerful search engine, and seeking ways to place one's website at the top is important for enhancing the website's visibility, attracting more traffic, as well as the success of the online presence. At the digital marketing agency, we recognize that optimization is vital as there are millions of sites competing for the first places. Therefore, it is possible to use effective methods which cut across Google’s successful methods. In this article, we present systems that have been tested and proven to improve your google ranking and more traffic to your website.
1.Do a proper keyword research
Keyword research is the most important part of an SEO strategy. It is because by knowing what the intended audience is searching for you will be able to develop content that cuts across.
Action Steps:
Use Keyword Tools: Use high traffic specific keywords’ search volume tools like Google Keyword planner, Ahref, SEM rush etc. to search for keywords with low competition.
Analyze Competitors: Look at the keywords that are working for your competitors and narrow dow n on the related ones.
Focus on Long-Tail Keywords: The phrases are less competitive in nature and since they are more specific they lead to higher conversions.
2. Better the On-Page SEO Optimization
On page SEO Optimization is the process of editing and facilitating changes on the pages of a web document in order to make them rank well and fit to the targeted audience. Such changes may involve content optimization of the webpage, markup optimization improvement of the HTML source code.
Action Steps:
Rewriting and Optimization Strategy Title Tags and Meta Descriptions: Always ensure you note your page title and all the meta area as it has been promised to the readers and throughout the website.
Header Tags: Help cluster words and enhance comprehension by assigning H1 tags for the headline as the highest, H2, H3, etc for the subtitles.
URL Structure: Lines should be simple and moderate but include powerful words that are in line with what you are targeting.
Internal Linking: Where necessary links are created to other pages which are relevant to the current page being viewed by users and helps to spread out the link equity within the site.
3. Create High-Quality Content
Content is a very important element of SEO. Content, when properly designed, well written and is valuable and informative, will drive visitors, retain them and help establish credibility on a given niche.
Action Steps: Write for Your Audience: Use Solutions oriented approach where every word helps to eliminate audience problems.
Incorporate Keywords Naturally: Avoid abrupt keyword inclusion or excess use of keywords in the content.
Use Multimedia: Use of multimedia such as, images, animations, values etc to assist in a more appealing manner and also hold attention.
4.Enhance User Experience (UX)
The most important aspect with any Google ranking of the website is the user experience. Along with other factors, page speed, mobile usability, and site hierarchy are considerable for rankings.
Action Steps:
Improve Page Speed: It is possible to analyze why their site is slow through the use of Google PageSpeed and rectify the site’s speed. Spelling out some issues – Image compression, browser caching, CSS and javascript files minification.
Mobile-friendly Site Design: Create a website that is responsive to any device and that offers the same level of interaction regardless of the device used. With Google focusing on mobile first indexing, this becomes self-explanatory.
Utilize simple Structure: Website usability should be observed through the enabling of a better navigation structure and size of the website. This enables the website content to be easily accessed reducing the levels of bouncing.
5. Improve Quality of Backlinks
Links are an essential component of the parameters used in the Google algorithm, page rank among them. Backlinks from other websites with high reputation which are also relevant to the topic covered by a site will in most cases optimize the site.
Action Steps:
Develop Great Content: Write content that will drive people to share it, persuasive contents such as how to guides and case studies, original research.
Advertising through blogs: Write articles as a guest for reputable blogs in the niche and ensure to include a link to one’s site in the author information or within the article text.
6. Geo-targeting
For businesses that are into a certain geographic perspective, optimizing local search can get them local patrons and also enhance the local ranking.
Action Steps:
Claim Your Google My Business Listing: Your Google My Business profile must have all relevant details about your ventures such as addresses and business hours.
Social Media – Add Local Clientele Keywords: Identify local phrases and use them when generating content, title tags and meta descriptions.
Encouraging Reviews: Actively ask clients to review your services on Google and any other outlets and respond to them if possible, as good reviews will help boost your visibility in local search results.
7.Review and Performance metrics
It allows you to keep track of and evaluate your performance in line with search engine optimization. Bring out the strengths and weaknesses by utilizing the right tools.
Action Steps:
Google Analytics: Establish and analyze google analytical for effective tracking of such elements as the frequency of visitors, viewership and even exit of visitors.
Google Search Console: Use the GSC to see how well your web page performs, fixes, and submits the sitemap of your web page.
Finesse your strategies: With the use of prior or primary researches, refine any of your current seo methods. Adequate emphasis should be placed on aspects with some room for growth as well as recent developments on global search engine behaviors.
8. Follow New SEO Trends
SEO, as any other discipline, is dynamic, thus, it is important for the SEO professionals to go on top of the new developments and any new releases in a bid to keep their positions and even enhance them.
Action Steps:
Follow Industry Blogs: Sign up to popular and authoritative SEO blog sites and forums as fresh content and relevant changes are posted.
Participate in Webinars and Conferences: Join the SEO web-based presentations and conferences to listen to the views from other relevant fields.
Adapt to Algorithm Changes: Many changes concerning the Google algorithm are commonplace. This means these things are happening in a constant rush and therefore SEO strategies had to be altered with the changes.
Conclusion
Achieving a good rank on Google is a process that requires effective execution of multiple strategies like keyword research, website on-page and off page optimization, content writing and technical enhancement, etc. Downham Digital Marketing is dedicated to assist companies who wish to adopt these tested approaches to increase their online exposures. Keep in mind that SEO is not a one-time thing; it requires persistent revisions and improvements for the strategies to survive the competitive scene. For further assistance with your SEO efforts, be sure to contact our team of experts at SS TECH SERVICES as they employ state-of-the-art strategies and approaches.
2 notes · View notes