[ home ] [ pony / rp / canterlot / rules ] [ arch ]

/canterlot/ - Canterlot

Site related staff board
Password (For file deletion.)

[Return][Go to bottom]


File: 1508288704811.png (198.26 KB, 540x540, 1:1, thorax.png) ImgOps Google

Hi everypony! We've been working behind the scenes to resolve issues in our development pipeline and today I bring you the results of that effort. Yes, I am talking about the most elusive and coveted of features, the edit button! You should now have an edit button next to the delete and report buttons which does exactly what it says on the tin. If you aren't seeing the button, you may want to try a ctrl+F5 or to clear your browser cache.

Understand that what we have now is about the minimum for edit functionality. The major limitation is that, just like for deleted posts, the thread auto updater does not effect existing posts. As the person doing the edit, you will see your change immediately, but others who have already had the thread auto update will not see your change unless they manually refresh the page (though if you edit goes through before someone auto updates, they will see the editted post). The auto updater is a pretty complex system, so it will take a little more time to work in automatic updates (and deletes) into that framework.

What's next? I already have the next update set aside with a few quality of life improvements. I plan to let the edit thing simmer for a few days and post another update later this week with these new additions. For the curious, the features planned for that update include:

-Control Shortcuts. Ctrl+[b/i/u/s/r]. Wraps the appropriate tags around text when some text is selected. Adds the appropriate tag at the cursor when no text is selected.
-Inline text quoting. Post links and quoted text will be injected at the cursor instead of the end of the post.
-New tag [tt] for preformated (fixed width) text.
-Fixes an issue where the horizontal width of the quick reply box cannot be resized down in Google Chrome.
-Fixes an issue where text in screenshot images is blurry

After that, I have the ponymotes system 90% done that I want to get added to the site with a small sample of icons. More will be added to the system as they are created.

I am hoping to use this thread for a time to receive feedback and communicate directly with the community about what development features are most in demand. There are a few things already in Canterlot (such as the laggy youtube embeds) but I'm hoping to hear firsthand what people are looking for (also I don't want to scrape through a bunch of Canterlot posts because I'm super lazy).

That's it for now I guess. I'll be updating this post as I roll out the other things I have ready to deploy, so stay tuned.


File: 1508288979957.png (737.6 KB, 1035x973, 1035:973, 1403597__safe_artist-colon….png) ImgOps Google


edit : no really


Question threads will never be the same.


I hate to complain but I may have found a small bug.

I just used the new edit feature in >>610541 and it stripped out the carriage returns so I had to edit again and put them back in.




That's funny. This is what I get for testing on small strings. I can probably fix that up pretty quick.


I didn't reconfirm it.

Good work, Mr. Bug Pony King.  Seems to update right away from my terminal.


File: 1508290393805.jpg (96.73 KB, 1280x720, 16:9, maxresdefault (1).jpg) ImgOps Exif Google

The edit button works!
Now I won't be frustrated all the time when I see my grammar errors in my posts.

Now I can fix them!

Thank you very much Thorax"


File: 1508293675915.png (47.68 KB, 200x187, 200:187, cute smile flutteryshy.png) ImgOps Google


File: 1508293810654.jpg (117.69 KB, 1200x1200, 1:1, Coy Smile Celestia.jpg) ImgOps Exif Google

A special thank you to !!Thorax, our newest Developer, for helping us finally get the edit feature online!

We are so very fortunate to have your help! Here's to a bright and productive future for our humble home!

To our dear users, thank you for your patience and understanding. If you can, do thank !!Thorax as well, for his hard work and dedication!


>what development features are most in demand
fix the memory leak?  pretty absurd that a pony imageboard is crashing browsers & computers


I have only really heard of this memory leak in passing. It is actually not so crazy an idea that a pony image board could crash a browser. This site's codebase is probably 10x more complex than the average website.

I haven't really had any problem like this myself, which makes it hard to debug (and even if I had, memory leaks and notoriously difficult to debug as is). Something that can be replicated (by me) can hopefully be fixed. Otherwise I'll just be taking stabs in the dark at whether I'm helping or not. Can you describe the circumstance of when you experience a crash? Were you hanging out a long time in the same thread, or moving from thread to thread? Did you have more than one tab open? What browser and platform are you working off? Do you have any non-default settings like reply notifications on?


File: 1508295675362.png (796.55 KB, 1536x1536, 1:1, 1443994__safe_artist-colon….png) ImgOps Google

Let me try it out.

Edit: Doesn't work quite how I was expecting, but hey, it works!


>>1219  at home on PC, firefox, leaving the site open on a single page for an extended amount of time > lags and if I leave it open long enough, lags Windows and freezes computer.  I'm using reply notifications on PC.
on my phone, Android w/ Chrome, autorefresh almost instantly kills the browser.  turning off autorefresh, I can refresh 2-3 times before it becomes glitchy and I have to close it myself.  essentially the site is unusable on my phone.  for what little I can use it, I use desktop mode on my phone because mobile mode is unusable due to layout issues (giant images and squished text).  no reply notifications.


File: 1508295969741.jpg (148.77 KB, 711x989, 711:989, 1487730078724.jpg) ImgOps Exif Google

Thanks, !!Thorax!  


This happening in any thread, or specifically large threads like HAY?

I've opened the HAY thread, all 1442 posts, on my Nexus 6p in Android Chrome and it is humming along no problem (took a minute to load all those posts, but that can't be helped). What kind of phone are you using?


>>1223  last 50 posts of large threads.
LG K20  

edit:  never mind; don't worry about it.  apparently no one else is having this problem.


You're having a problem with it, which makes it important to me. Since it seems to be effecting you the hardest, I would suggest a few troubleshooting steps on your side:

-Download Malwarebytes and run a scan. Most free antivirus is pretty shitty and misses things. I've found Malwarebytes to do a better job of finding problems.
-Try downloading desktop chrome specifically to browse the site for a while. If unmodified chrome isn't having the same problem, you might want to reinstall firefox or try toggling some plugins off.

I'm going to try to coax the issue out myself using the info you've provided, though it is left to be seen whether I can turn it up.


File: 1508300038430.png (363.8 KB, 700x721, 100:103, jpeg-the-strongest.png) ImgOps Google

Site for works fine for me in Lynx under xterm. :^)


File: 1508301667421.png (49.26 KB, 250x180, 25:18, thumb.png) ImgOps Google

First, thank you to you guys for spending your free time on this stuff!

-Inline text quoting. Post links and quoted text will be injected at the cursor instead of the end of the post.
I am really looking forward to this one, posting mostly from mobile devices this change will save me from so many cut and copies.

If there is room for requests, maybe you could look into the text wrapping next to images at some point?

I me
an I
t is
d to read when it does that thing.


I post primarily on mobile, so the stupid links and quoted text being dumped at the end of the post has been my biggest annoyance. True story, I pretty much took this gig so I could fix the issues that have bothered me the most personally, so it is no wonder that is going into the first round of quality of life improvements.

I'm going to get to the text wrapping thing for sure. Though I might redo the whole quick reply box for mobile first. I don't know about you but it is practically unusable for me on mobile.


File: 1508307731719.jpg (11.72 KB, 236x259, 236:259, 2.jpg) ImgOps Exif Google

I don't know if I believe this works.

Edit: You're a goddamn american hero


File: 1508307937945.jpg (13.97 KB, 263x263, 1:1, underwater-thumbs-up.jpg) ImgOps Exif Google

He, I am lucky to post in the same way as the changeling dev then!

The reply box is…? If it didn't place itself 20px too far to the right I would be mostly okay with it.
Have you noticed the image bug? If you add an image to the quick reply box and scroll up to the normal one the image disappears. It comes back if you scroll down. I don't know if it post the image if you hit post at the top, but I doubt it.

But yeah, reply box is a good candidate for improvements.


Reply box:

It'd be way cool if it could be resized.  It's hard to compose textwalls in the small space.


File: 1508310129476.png (358.41 KB, 649x743, 649:743, scurred.png) ImgOps Google

can it be

edit: oh lawd


On mobile right? Because it resizes fine on a PC.

I wonder how sage works if added after a bump… Hmm.


File: 1508317823248.jpg (56.39 KB, 491x768, 491:768, BH8GtzB4iooBaCRpKJXzJWKUL6….jpg) ImgOps Exif Google

It's uh… little more steps than the Ponychan system but… it seems to be there and working, so nicely done.


Good news boat, the test I ran overnight produced results! I can confirm the issue you are reporting, at least on desktop firefox (still seeing no problems on Android Chrome, but I just had an idea about that…). I can start drilling down into this and hopefully find a fix. Something I found remarkable about this was that even after closing firefox completely, the lag immediately returned once I reopened firefox, even though I wasn't even on ponyville. I had to use CCleaner to clear out all the firefox temp and cache files before I could even use firefox again.

I'm going to try a few more tests to see if I can isolate the issue further, but I'm pretty sure it has something to do with the notification options. If I can confirm exactly what starts causing the lag, then it becomes much more realistic to find a fix.

Hi Rose! You should make me an image set for Thorax. I don't know how to avatar post, lol.

My problem with quick reply is that it is situated in a manner as to block as much screen space as possible. When I am composing a larger, more complicated post I usually want to review the things people are saying and maybe pull out words to quote and that damn quick reply box is too big, and situated in a position where it takes up more space that it needs to. I'm hoping to revamp all of the css for mobile eventually.

I assume you mean on mobile. The quick reply box is a dump on mobile, see my comments to Anon above. I personally have gone in the options and turned it off completely because it is unusable as far as I am concerned. The normal reply box at the top of the thread actually can be resized on mobile. You just have to be able to zoom in and precisely touch the bottom right corner of it and drag. I've done it before, but I just tried doing it again and I couldn't actually touch that dang pixel to be able to drag it. Maybe I will add a button for mobile only that lets you size up and down the reply box.

On ponychan, there are two flows for editing a post. They have this exact same method for post editing, and they also have the little inline javascript edit button that appears on your own posts. I haven't worked in the second 'quick edit' feature yet because I barely know what I am doing in php/javascript and I would rather get something functional to the users than delay this thing any longer. But, the inline 'quick edit' thing will show up eventually, once I figure out what I am actually doing in javascript.


File: 1508342306393.gif (92.82 KB, 500x385, 100:77, Jump Jump Jump.gif) ImgOps Google

For the dev, it would be my pleasure! I can't promise that you'll like it, avatar posting is a bit of an either you love it or either you hate it thing.


File: 1508342684546.gif (2.12 MB, 640x480, 4:3, Q3cUg29.gif) ImgOps Google

True, it does take up quite a bit of screen real estate without providing much benefit on mobile.

It is okay for a single line or two and a picture, which I guess is most of my posts.

I am not sure how the HTML looks on Tinyboard, but on Kusaba it was nested in weird ways that made mobile layouts hard to do. But a mobile friendly layout would definitely be appreciated.


I don't know if this is the real cause of the issue. However it would appear by default the browser stores a metric fuckton of 'thread_last_notification_XXXXX' keys in local storage seemingly indefinitely in order to enable the auto update feature. Whether this is partially or wholly the cause of the leak I can't say based on just my bored curiosity some time ago. However leaving a thread open would cause these keys to accumulate overtime and are not cleared upon closing.

Similarly the local storage item 'own_posts' stores all your own posts to enable the (you) functionality indefinitely. Obviously this shouldn't grow by just leaving the tab open. But I don't see why this shouldn't just store the last X posts instead of every post you make.


File: 1508344906845.png (440.7 KB, 1000x1000, 1:1, 20.png) ImgOps Google

Here you go ^_^

See if that works for you. It's not a big folder, but it's a start.

Hope you enjoy, mr developer <3


File: 1508347891095.png (472.39 KB, 1280x1280, 1:1, 1.png) ImgOps Google

That was fast, thanks a bunch Rose! As you know, I don't really do avatar posting as anon but I realized I probably should for this role. Since you said the offer was open anytime, I figured I could use your generosity here. Thanks again.

Thanks for the hints. Despite being dev here, I hardly understand how this board works. I specialize in bashing my face into things until they do what I want them to do. So it's great to have a place to start looking.


awesome; thanks for looking into it!
and yeah, the lag remains; which is one reason it's sometimes easier to just hard reboot my computer rather than deal with it.
thanks again
can't it just use a cookie for that?
>last seen post is X
>is there anything after X?
>if yes, show posts, update X
this is how I did it for my own forum.  it was incredibly efficient.


OOps this is my stupidity, it does resize fine if I click on the right place.  I didn't see the little thingy there and was trying to use the actual corner of the dialog box.


roight roight.


File: 1508353865675.png (4.41 MB, 1900x2250, 38:45, EbonTopaz_MyLittleSuki02.png) ImgOps Google

Oh boy, Ponyville is evolving to next-gen!

Will the theme that I built be introduced in the new update too?


File: 1508355835638.png (67.31 KB, 512x512, 1:1, crouching rose, hidden cat.png) ImgOps Google

Oh, man, that was you?! I'm glad I was able to do something for you. You seem like a real swell dude c:


File: 1508357643738.png (894.62 KB, 1590x1621, 1590:1621, 10.png) ImgOps Google

>can't it just use a cookie for that?
I don't think those are the objects causing the problem (though it sounds like that system could be improved). I assume all the HAY regulars would have been making the same complaints if it were just that. I'm pretty sure it is related to turning on notifications, that's how I replicated it. To be sure of that, I went back and setup the same test again with notifications off. Either way I should be whittling it down to one or the other soon and that's a good first step in fixing the problem.

I should be able to drop a theme in quite easily. I'm guessing moony has it somewhere but it'd be easier if you could provide it to me directly. I'll of course need to get approval from moony before putting it up, but I assume that won't be an issue.

Lol, I was wondering if you thought a random staff member was hitting you up for avatars. "Yo Rose, gimme all your avatars now or no edits for u!" No, I just happen to do Dev work on top of the other bits you happen to know about me.


File: 1508358062705.png (616.89 KB, 1330x740, 133:74, hangout thanks.png) ImgOps Google

>Lol, I was wondering if you thought a random staff member was hitting you up for avatars. "Yo Rose, gimme all your avatars now or no edits for u!"
I legitimately thought that was what was happening rofl.

Wow, what else do you do?! Wait, don't tel me, you're also a superhero, right?



File: 1508359819290.png (2.78 MB, 7284x4096, 1821:1024, 6.png) ImgOps Google

I obsessively keep tabs on everyone here and every interaction. Knowledge is power while fear breeds in the unknown. I assume it is plain as day who I am when a start talking to people. It's like, "no you are anon and nobody else is thinking that hard about your identity."

I do code at work, I do code for this site, I argue in arguing threads, sometimes chat in chat threads, play splatoon when Salmon Run is up, and play board games when I can round up enough people. I try to keep it simple.

Not a superhero, but if I was a superhero, my power would be to find a way to make systems work together. I specialize in problem solving. That's why I do code work, ha.


File: 1508360080876.jpg (68.6 KB, 918x870, 153:145, roseluck_by_vanillaghostie….jpg) ImgOps Exif Google

Yeah, there are a lot of argumentative anons. It's really hard to pick you out.

What's your language of choice? If you were to reccommend something, what do you think would be the best way for an inexperienced coder (me) to learn python?

Ohh, that sounds stressful :c

Doesn't it make you nervous to be getting that many notifications?


File: 1508363434022.png (168.85 KB, 335x347, 335:347, Filly Flutterjoy.png) ImgOps Google

Let there be Edits, Thorax said! And there was.


File: 1508363471447.gif (36 KB, 102x128, 51:64, 21.gif) ImgOps Google

Ah, I wasn't so clear. I should say I remember every interaction I have with every poster on this the site (and I mean everything, sometimes trivial things from years ago factor in). I do my fair share of lurking (and I use that to understand various posters), but I don't actually read every post here. That'd be much, even for someone like me.

I don't know python at all. I tried to get into it but it was a bore to me. My language of choice is the Bash shell. I write a lot of bash scripts at work. You can automates some incredibly complex tasks if you know what you are doing. Though the majority of my work is in java. Java is alright, it gets the job done I suppose. I preferred c++ in college, but I can get by in java.

If you are getting into programming, it doesn't matter so much what language you use. It's all about your reasons for learning programming, what you want to do with it. I wrote my first programs on a crappy graphing calculator because I wanted to make a game. If you just want to know programming because it may be handy to know, you'll probably not get very far. If you have an idea of where you want to go with programming, I might have a better idea how to guide you there. So, why do you want to know Python?


File: 1508364085413.png (2.32 MB, 5600x5200, 14:13, 1205283__safe_solo_simple ….png) ImgOps Google

You remember everything?! Kinda like photographic memory kinda deal? Wait, you are a superhero!

I wanna build video games, and I wanna become more efficient at doing statistical analysis of large datasets!


File: 1508364820539.png (137.94 KB, 900x748, 225:187, roseluck_vector_by_thejour….png) ImgOps Google

I went to bed if you see this, Thorax

see you in the morning


File: 1508365198098.jpg (54.06 KB, 600x600, 1:1, 0d0e7dc411f4eb76d8ba47ba76….jpg) ImgOps Exif Google


What if they never see it?  Does that mean you stayed awake?


The button, it's actually here! Huh. Good job!


>I don't think those are the objects causing the problem
I didn't really think so either. But I brought it up because storing that much junk did seem silly.



Silly is my middle name between Dumb and Stupid.

I just assumed the (you) thing was a display filter comparing back to the name used within a certain amount of time but I can see how that approach would increase the processor load and potentially lag the display routine so I see why a local stored history would be a better approach.  


File: 1508376667906.jpg (14.31 KB, 216x233, 216:233, images.jpg) ImgOps Exif Google

Photographic memory isn't quite right. My superpower would be above-average detail retention! I notice a lot of details people miss and hold on to all the minor details that most people would discard (at least I hold on to them a lot longer than most people would). I use all that data to create models for how someone might react to my posts (it is less stressful talking to people if you think you can predict how they will react). It is all very scientific, I assure you. I dunno how much faith you put in myers-briggs, but the description of an INTJ is very close to describing me.

What kind of video games do you want to make? Is this just for yourself, or do you hope you can one day release a product?

I sometimes do work on large datasets for my job. Python would certainly work, but Bash is easier for me. How I usually approach learning a language is to just learn by example. Being good at google searching is the strongest skill a programmer can have. I hardly know anything about the technologies behind this website, but I get things working by just finding solutions that other people have posted online. So, you could take some data in a file and start asking google how to do everything you need to do. "python + read file line by line", "python + sort large dataset", "python + average an array of numbers". No matter how basic the task, someone has asked the question and had it answered already for you.

Officially I am a programmer, but I suck hardcore at programming. Like I said, I am great at making systems work, so I take all the little bits and pieces of programming knowledge I can gather from the internet and logic out how to put it together. Eventually I've built something good enough to fool people into thinking I know what I'm doing.


So I had firefox open in HAY without notifications on and left it there to auto refresh while I was at work. Once I checked it after work, the damn thing lagged out just like before. But, this time when I restarted firefox it didn't continue to lag. I guess all I really know is that there is definitely a problem that needs fixing and it is somewhere in the javascript.

One other thing I noticed was that firefox was doing a hell of a lot of disk writing while the lag was going. I think it was doing around 40-50 mb/s for me. That is so very far from anything reasonable while things are essentially idle.

I'll hammer away at this over the weekend and see if I can turn up a fix.


File: 1508393382076.png (340.75 KB, 800x800, 1:1, bestest_friends_ever_by_wh….png) ImgOps Google

I don't actually put a whole lot of faith in the Meyers Briggs, it's interesting that you should ask :p I'm much more of a big five guy myself.

>video games
I wanna make a roguelike game. It's just for me, I don't really expect anyone to play it, since it's my first game and all.

Maybe eventually it would be baller to make some money off of it, but that's really secondary to having fun with it.

Thanks for the advice! That helps me out a lot.

our hero c:


File: 1508408998088.png (575.92 KB, 2000x2166, 1000:1083, 11.png) ImgOps Google

That's right. Something at the back of my mind was telling me you weren't into myers-briggs. Almost forgot that you did the OCEAN thread back then. I happened to do the calculation in a notebook so I still have the result. O10 C10 E2 A13 N10. The E and N probably stand out as telling, but I define myself by the result for C. Even if I am an introverted, neurotic mess I have made a life for myself through sheer force of will and discipline.

Have you tried any of the game making tools out there yet? There is all sorts of engines and junk. It isn't like you are going to make a game in python (I mean you probably could, but that'd be a little crazy).


File: 1508412774536.png (285.89 KB, 318x458, 159:229, so cuuuuuute.png) ImgOps Google

I think the OCEAN thread was mine.

But we did make similar threads pretty much at the same time so it could have been either-or


File: 1508415140131.png (67.31 KB, 512x512, 1:1, crouching rose, hidden cat.png) ImgOps Google

Wow, those are some extreme scores!

Yeah, I respect that. Conscientiousness is also said to be one of the most beneficial traits in today's society, so good on you c:

Yeah, I've been using pygame and libtcod! So far I have drawn a map on screen and the player can walk around on it and bump into walls. I hit a bit of a coders block, though, and lost motivation.


I think I see why, but why do you say conscientiousness?


Hmm, what do you mean? I started talking about it because thorax mentioned it was what he defined himself by.


My bad. I mean why is conscientiousness considered the most beneficial trait in today's society?

I know it's related to ability to plan ahead and things like that.


Really? I'd take your word for it if you said you made that thread, but I don't remember it that way. Maybe Rose was just active in your thread and was pushing Big 5 as well. I have minor recollections and hints of the truth, but all I really know for certain from that thread was that Moony scored himself N10, which made me feel sad. You don't give yourself N10 unless you are stressed as fuck.

It was all self reported, so who knows how well those scores really represent me. I can say with confidence that they at least belong near the extreme ends.

>Yeah, I've been using pygame and libtcod!

lol, I guess you are making it in python and it isn't crazy at all. Sorry, I hope that last post didn't come off as callous "who'd even make a game in python, that's absurd". I didn't have the imagination to think there were libraries for game making in python.

That's cool though. Are you just stuck trying to figure out how to solve a certain coding problem? Or are you just a little fatigued by it all? One thing that helps me work on the website is that I just leave it all open in the background on my desktop. The inertia of getting your programing environment setup can make it easy to put off doing anything. If it is always just there and you can jump into it on a whim, you are much more likely to indulge in doing a little coding.


File: 1508429598778.png (482.21 KB, 893x895, 893:895, roseluck_by_pondisdant-d6r….png) ImgOps Google

Probably. But too much of it, and you could be in danger of a behavioral disorder like OCD or an anxiety disorder. It's all about the situation you're in, and what will help you adapt to it the best.

Conscientiousness is correlated positively with a lot of positive factors, such as wage size, life expectancy, general health and happiness.

But mind you, so are a lot of the other factors. Extroverted people tend to be more physically fit, and have higher wages. People that are very open have higher IQ scores, are more creative, and curiously, despite IQ being positively correlated with wages on its own, earn less than their more closed counterparts. Neurotic people tend to live longer, surprisingly, it probably has something to do with extremely non-neurotic people having very risk-taking tendencies. They are also, however more prone to mental disability.


File: 1508429739514.jpg (65.15 KB, 805x992, 805:992, spring_roseluck_by_malwina….jpg) ImgOps Exif Google

That's some good advice. Yeah, I'm really just fatigued in general I think. All of my hobbies suffer equally in my current mental state.

Rethinking it, maybe instead of taking on another project, I need to be cutting back a bit right now.


I have a small request.
It would be nice if the embed box could take links shared from the app on mobile devices.

Regular urls look like this: https://www.youtube.com/watch?v=rR_TOiJa5Yw
The url copied from the youtube app looks like this: https://www.youtu.be/rR_TOiJa5Yw

Seeing as the ID at the end is the same I will make an ass out of u and me and assume that it wouldn't be too much trouble to parse this type too?


File: 1508450476501.png (103.49 KB, 182x289, 182:289, OH NO FRECKLE.png) ImgOps Google

I second this.

It's like, the moment I decide I want to embed a video instead of just link it, it doesnt work.

Rows was more active in my thread than I was, so it probably was mine you're thinking of. Those things usually get too far ahead of themselves for me to keep track of for very long, always devolving into discussions about the accuracy rather than just doing what the thread was made for.


File: 1508459558463.gif (633.61 KB, 407x407, 1:1, 1493599725755.gif) ImgOps Google

Thank you!


File: 1508463727886.jpg (7.97 KB, 208x200, 26:25, images.jpg) ImgOps Exif Google

>Rethinking it, maybe instead of taking on another project, I need to be cutting back a bit right now.

It's wise to know your limits. Take care Rose.


I looked into it and the site is already built to be able to handle those urls, it is basically just a matter of allowing it. I'll put that into the update I have planned.

>always devolving into discussions about the accuracy rather than just doing what the thread was made for.
I feel like I remember that now. Sounds too real not to be true.


Another quality of life improvement for mobile users!
Yay! Thank you.


File: 1508491399274.jpg (59.11 KB, 500x711, 500:711, 0e5c635b177c711fc9511e17e8….jpg) ImgOps Exif Google

Yeah, I was annoyed because people kept coming in with results from other quizzes or whatever when  I was trying to get them to use the specific one I made.

Then once it turned into a in depth discussion about it I ended up just tuning it out.


File: 1508548639956.jpg (132.29 KB, 1440x1080, 4:3, sakura-sip.jpg) ImgOps Exif Google

>. My language of choice is the Bash shell.
Dear God, why???


Because I enjoy automation and scripting. What do you have against Bash?


File: 1508558855819.png (17.85 KB, 945x945, 1:1, Bigmac-shrug-1301110073143.png) ImgOps Google

Bash has been about the only thing in this thread that I recognize.  It goes all the way back to regular C, that's what I know, or knew if I remember anything.  

I also wonder what anyone would have against it.  


>What do you have against Bash?
[tt]rm -rf ~/$MY_TEMP_DIR[/tt]
Guess what happens by default (without "[tt]set -e[/tt]") if $MY_TEMP_DIR is undefined?  Yes, that's right, it goes ahead and deletes your entire home directory!

And then there's the clusterfuck around filenames with whitespace (although setting IFS can help somewhat) and filenames that begin with a "[tt]-[/tt]".


File: 1508600253081.jpg (8.9 KB, 196x257, 196:257, images.jpg) ImgOps Exif Google

>rm -rf ~/$MY_TEMP_DIR
>Guess what happens by default (without "set -e") if $MY_TEMP_DIR is undefined?  Yes, that's right, it goes ahead and deletes your entire home directory!

If you didn't want to delete your home directory, why did you tell bash to delete your home directory? Just because the language requires some expertise to operate doesn't make it bad. The only thing that sets bash apart is that bash is used in a setting where programming mistakes can be more devastating. It isn't the fault of bash if it is misused.

There are plenty of ways to not accidentally delete your home folder in your example. For instance:

if ! [ "${MY_TEMP_DIR}x" == x ]; then
   rm -rf ~/"$MY_TEMP_DIR"


rm -rf ~/"${MY_TEMP_DIR:?Error variable MY_TEMP_DIR unset}"  # Warning, parameter expansion might not work in some versions of bash. yes, you are required to know what you are doing before executing a command

Also, unless set -e behaves differently in other versions of bash, it would not help in this situation. Unless there were files in your home folder which you didn't have permission to delete, that rm command would return 0. And even if it returned 1 (in which the script would exit) your files would already be deleted.

>And then there's the clusterfuck around filenames with whitespace (although setting IFS can help somewhat) and filenames that begin with a "-".

I doesn't take much effort to handle whitespace in filenames. Use quotes appropriately and it is pretty much a non-issue. And as you stated, there is IFS for those few cases it is needed.

As for files beginning with "-", all you need to do is drop – before it which tells bash that no more arguments past this point will be flags.

touch – -myfile  #Edit: that should be two minuses/dashes, - - without the middle space
rm – -myfile

I respect if you don't like bash, it isn't for everyone. I do happen to like it a lot and have done some really cool things in it.


>Also, unless set -e behaves differently in other versions of bash, it would not help in this situation.
Oops, I meant "set -u".

And yeah, Bash can do a lot of cool stuff, I just wish that it was easier to write robust code than non-robust code.  E.g.,

   rm $foo

works in most cases, so testing is unlikely to reveal the error unless you know to test with problematic filenames.  And the correct code is longer and more complicated:

   rm -­- "$foo"

It would nice if the straightforward syntax was correct.  E.g., in C,


works correctly regardless of the filename.


No disagreements there, Bash could definitely be better. Even very basic tasks can be complicated by the little rules governing white space, special characters, and escaping. As someone with a lot of bash experience, it hardly is a bother to me anymore. But getting to this point took writing thousands of buggy statements and having to go back and understand why it wasn't working how I would have expected.

Still, in my opinion, nothing beats opening a terminal and dropping commands into a file in terms of getting things done. I hate fussing with IDEs and dealing with compiling and all the arcane incantations (public static void main) necessary to make a java program work.

[Return] [Go to top]
[ home ] [ pony / rp / canterlot / rules ] [ arch ]