Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "locale"
-
Wow, what a fucking mess this sunday was.
My boss wrote me an email that one route of a RESTful API we wrote for a customer was not working anymore and puking back a status 500 with some error mentioning invalid UTF-8 characters.
Not one single person has had touched nor changed the code on production in some 6 months, so what the fuck could it be?
Phpunit did not give any errors (running only locally), the code had no syntax errors and the DB dump did not contain any invalid bytes (tested with a hex editor).
WHAT THE FUCK?!
OK so I started to comment out lines (all tested directly on production of course) until the error vanished.
Guess what was the culprit?
.
.
.
.
.
.
In the code (PHP) we used strftime(...) to get nice time strings. Of course we set the correct locale on the server, thus having months and days formatted in German.
So, in Geman there is this one mysterious month called "März" which contains an umlaut character.
Calling strftime generated the date with März in it, but the server locale was de_CH.iso-8859-1 and not fucking de_CH.utf8, so the "ä" was returned as 0xE4 instead of 0xC3A4 (valid UTF-8), which json_encode(...) did not want to swallow but instead threw an exception.8 -
After working as a developer for 4-5 years I finally took up school again.
The teacher at our first programming course insisted that we named all our variables in our locale language (swedish) and always started arrays at index 1.18 -
I fucking hate it when developers don’t respect user locale. My phone language is UK English, my Discord app language is UK English and my region is UK.
Then why the fuck is Discord showing me MM/DD/YYYY date format? How hard is it to pass locale when parsing time?19 -
Imagine saving Integers and Floats in a MySQL table as strings containing locale based thousand sepatators...
man... fickt das hart!
Wait, there's more!
Imagine storing a field containing list of object data as a CSV in a single table column instead of using JSON format or a separate DB table.... and later parsing it by splitting the CSV string on ";"...7 -
Bossman kept giving me a new “high priority” every month. Which would’ve been fine except for the fact that the prior month’s “high priority” was always a type that needed several months to come to full fruition. So he was constantly pulling the rug out from under me just as I was starting to gather steam and make progress. Also, he was begrudgingly paying me only half of the market salary for my job title in my locale. Would have loved to have paid me less and worked me twice as hard. I endured about 9 months of that and then I quit. Now my job is the exact opposite. Paid nearly twice as much with no micromanaging and plenty of time to work on my projects.1
-
Every language ever:
"You can't compare objects of type A and B"
Swift, on the other hand:
"main.swift:365:34: note: overloads for '==' exist with these partially matching parameter lists: (Any.Type?, Any.Type?), ((), ()), (Bool, B ool), (Character, Character), (Character.UnicodeScalarView.Index, Character.UnicodeScalarView.Index), (CodingUserInfoKey, CodingUserInfoKey ), (OpaquePointer, OpaquePointer), (AnyHashable, AnyHashable), (UInt8, UInt8), (Int8, Int8), (UInt16, UInt16), (Int16, Int16), (UInt32, UIn t32), (Int32, Int32), (UInt64, UInt64), (Int64, Int64), (UInt, UInt), (Int, Int), (AnyKeyPath, AnyKeyPath), (Unicode.Scalar, Unicode.Scalar ), (ObjectIdentifier, ObjectIdentifier), (String, String), (String.Index, String.Index), (UnsafeMutableRawPointer, UnsafeMutableRawPointer) , (UnsafeRawPointer, UnsafeRawPointer), (UnicodeDecodingResult, UnicodeDecodingResult), (_SwiftNSOperatingSystemVersion, _SwiftNSOperatingS ystemVersion), (AnyIndex, AnyIndex), (AffineTransform, AffineTransform), (Calendar, Calendar), (CharacterSet, CharacterSet), (Data, Data), (Date, Date), (DateComponents, DateComponents), (DateInterval, DateInterval), (Decimal, Decimal), (IndexPath, IndexPath), (IndexSet.Index, IndexSet.Index), (IndexSet.RangeView, IndexSet.RangeView), (IndexSet, IndexSet), (Locale, Locale), (Notification, Notification), (NSRange,
NSRange), (String.Encoding, String.Encoding), (PersonNameComponents, PersonNameComponents), (TimeZone, TimeZone), (URL, URL), (URLComponent s, URLComponents), (URLQueryItem, URLQueryItem), (URLRequest, URLRequest), (UUID, UUID), (DarwinBoolean, DarwinBoolean), (DispatchQoS, Disp atchQoS), (DispatchTime, DispatchTime), (DispatchWallTime, DispatchWallTime), (DispatchTimeInterval, DispatchTimeInterval), (Selector, Sele ctor), (NSObject, NSObject), (CGAffineTransform, CGAffineTransform), (CGPoint, CGPoint), (CGSize, CGSize), (CGVector, CGVector), (CGRect, C GRect), ((A, B), (A, B)), ((A, B, C), (A, B, C)), ((A, B, C, D), (A, B, C, D)), ((A, B, C, D, E), (A, B, C, D, E)), ((A, B, C, D, E, F), (A , B, C, D, E, F)), (ContiguousArray<Element>, ContiguousArray<Element>), (ArraySlice<Element>, ArraySlice<Element>), (Array<Element>, Array <Element>), (AutoreleasingUnsafeMutablePointer<Pointee>, AutoreleasingUnsafeMutablePointer<Pointee>), (ClosedRangeIndex<Bound>, ClosedRange Index<Bound>), (LazyDropWhileIndex<Base>, LazyDropWhileIndex<Base>), (EmptyCollection<Element>, EmptyCollection<Element>), (FlattenCollecti onIndex<BaseElements>, FlattenCollectionIndex<BaseElements>), (FlattenBidirectionalCollectionIndex<BaseElements>, FlattenBidirectionalColle ctionIndex<BaseElements>), (Set<Element>, Set<Element>), (Dictionary<Key, Value>.Keys, Dictionary<Key, Value>.Keys), ([Key : Value], [Key : Value]), (Set<Element>.Index, Set<Element>.Index), (Dictionary<Key, Value>.Index, Dictionary<Key, Value>.Index), (ManagedBufferPointer<Hea der, Element>, ManagedBufferPointer<Header, Element>), (Wrapped?, Wrapped?), (Wrapped?, _OptionalNilComparisonType), (_OptionalNilCompariso nType, Wrapped?), (LazyPrefixWhileIndex<Base>, LazyPrefixWhileIndex<Base>), (Range<Bound>, Range<Bound>), (CountableRange<Bound>, Countable Range<Bound>), (ClosedRange<Bound>, ClosedRange<Bound>), (CountableClosedRange<Bound>, CountableClosedRange<Bound>), (ReversedIndex<Base>, ReversedIndex<Base>), (_UIntBuffer<Storage, Element>.Index, _UIntBuffer<Storage, Element>.Index), (UnsafeMutablePointer<Pointee>, UnsafeMut ablePointer<Pointee>), (UnsafePointer<Pointee>, UnsafePointer<Pointee>), (_ValidUTF8Buffer<Storage>.Index, _ValidUTF8Buffer<Storage>.Index) , (Self, Other), (Self, R), (Measurement<LeftHandSideType>, Measurement<RightHandSideType>)"17 -
This.
Not the worst but almost all of us (including me) handle strings like fucking morons.
If the input doesn't need to be an exact match we use a explicit comparison operator, when the input should explicitly match we do a loose comparison operator.
I'll format the crap out of a number, convert it, validate decimal places, check for float rounding hell, give it a absolute value and return it correctly formatted for the users locale but half the time I forget to trim their input. 🤦♂
Like I said - just a tad fucking moronic isn't it?3 -
Fun issue
Swedish client is unable to enter a currency conversion rate in a field and submit. 'Not a float' well we can clearly see that it is a float when he does it (0.5 for example), not an issue for us though.
Reproducing was a nightmare, eventually it boiled down to the fact that the framework we were using had automatic locale checks. Now because our numeric fields are actually weird text fields (front end nonsense), it was converting the period to be a comma (Swedish people would write 0,5 normally). And if you actually entered 0,5 the range check (0.01-1000) failed because it couldn't parse the comma (no locale check on that one)
Godamn facepalm. Really confused the hell out of us when we saw the error, had to go diving through library code. To top this off, locale checks are supposed to be disabled as of about 2 years ago
In revenge against our oppressor :PHP: on slack is now an alias for the shit emoji5 -
Years later, I finally understood how to git CLI fully, with most of its advanced features.
Thank you, oh the great creator of this interactive tutorial.
https://learngitbranching.js.org//...2 -
Petition for devrant to start using iso dates. Or at least pick up the format from the device's locale. But preferably iso. Seeing m/d/y does my head in.12
-
I live in Italy and in here we all write the date like we're French...
What's up with these "locale" not working properly?7 -
WHAT THE FUCK IS THIS SHIT?
Like seriously, I don't want to see this shit. I HADN'T TOLD YOU TO SHOW ME THIS SHIT YET YOU STILL FORCE ME TO. I never set the keyboard to Danish. And in fact, IT'S NOWHERE TO BE FOUND. Then why for he love of god do you think I need to have the option to change my keyboard to Danish when I have insisted on not having this option. Is it because my locale is set to Danish? Is that it? I'll gladly change my locale then ffs, but THIS SHOULDN'T HAPPEN.
My Windows display language is English, when I installed this shit I even set the keyboard to English US, I even disabled the change keyboard shortcut because I knew that for some reason Windows would find a way to add a Danish layout. SOMEHOW.2 -
I just saw my friend on a promotional poster… Looking all cool beside a green on black terminal… Showing off the "locale" command… And the poster had nothing to do with anything IT…3
-
Upgraded our internal samba fileshare. Was getting too old. So updating the apt sources list and push the dist-upgrade: what could possibly go wrong?
Everything.
Somehow the locale went astray, updating the manpages gave too many errors and now finally everything's fucked up, because it somehow deleted the sudo binary and root is locked or we don't have password.
We noobs.
But samba was updated and it's still serving our files.7 -
Everyone loves freebies!
So solicited spam time 😎
Developer Nation is running a survey to gain insights, explore trends and track developer experiences across platforms, languages, revenue models, verticals, tools, segments and regions.
Yea ok, it's a massive questionnaire, but did I mention the freebies?
https://developereconomics.net//...7 -
Excel is a powerful and extremely versatile application, but one thing that really SUCKS about it, is that formulas are language-specific! So if using Outlook in - for example - Swedish you can't write "IF(<expression>,<then>,<else>)" but instead "OM(<expression>;<then>;<else>)". Note the semi-colon instead of comma (because in Swedish comma is used as decimal). AAARGGH! This pisses me off!2
-
So happy!
I made my first project (or at least started) using my iPad (with some help from my laptop).
I am trying to make it possible for web comic artists to upload their comics without any text in the speech bubbles and then load the text using javascript for the specific locale.
It’s in an early stage (a few hour old) and the editor and the viewer share data only with cookies and local storage instead of a server but it's still a concept.
What do you think?
Github: https://github.com/konstantintuev/...2 -
I've been wondering about renting a new VPS to get all my websites sorted out again. I am tired of shared hosting and I am able to manage it as I've been in the past.
With so many great people here, I was trying to put together some of the best practices and resources on how to handle the setup and configuration of a new machine, and I hope this post may help someone while trying to gather the best know-how in the comments. Don't be scared by the lengthy post, please.
The following tips are mainly from @Condor, @Noob, @Linuxxx and some other were gathered in the webz. Thanks for @Linux for recommending me Vultr VPS. I would appreciate further feedback from the community on how to improve this and/or change anything that may seem incorrect or should be done in better way.
1. Clean install CentOS 7 or Ubuntu (I am used to both, do you recommend more? Why?)
2. Install existing updates
3. Disable root login
4. Disable password for ssh
5. RSA key login with strong passwords/passphrases
6. Set correct locale and correct timezone (if different from default)
7. Close all ports
8. Disable and delete unneeded services
9. Install CSF
10. Install knockd (is it worth it at all? Isn't it security through obscurity?)
11. Install Fail2Ban (worth to install side by side with CSF? If not, why?)
12. Install ufw firewall (or keep with CSF/Fail2Ban? Why?)
13. Install rkhunter
14. Install anti-rootkit software (side by side with rkhunter?) (SELinux or AppArmor? Why?)
15. Enable Nginx/CSF rate limiting against SYN attacks
16. For a server to be public, is an IDS / IPS recommended? If so, which and why?
17. Log Injection Attacks in Application Layer - I should keep an eye on them. Is there any tool to help scanning?
If I want to have a server that serves multiple websites, would you add/change anything to the following?
18. Install Docker and manage separate instances with a Dockerfile powered base image with the following? Or should I keep all the servers in one main installation?
19. Install Nginx
20. Install PHP-FPM
21. Install PHP7
22. Install Memcached
23. Install MariaDB
24. Install phpMyAdmin (On specific port? Any recommendations here?)
I am sorry if this is somewhat lengthy, but I hope it may get better and be a good starting guide for a new server setup (eventually become a repo). Feel free to contribute in the comments.24 -
Hy to all,
I managed to install Archlinux after 3 days of continues documentation but I still have some problems that I need to solve.
1. Any idea how to run gnome-terminal?
I've set the locale if you guys are wondering and installed vt3.
2. Couldn't install visual studio code.
3. How do I install themes. I have gnome gui.
I've read the arch documentation but still can't figure out how to solve some of the problems. If you guys have a website with a good guide or any tips that would be great.
Thx in advance.1 -
Possibily the weirdest coincidence I've experienced... I was just searching for, specifically and explicitly, the ebook version of O'Reilly pocket references for a babydev since physical copies, if/when available, are expensive and slow delivery. While googling the PHP one, somehow, 1984 (orwell) in russian was oddly high in the search results.
1984 is my favourite book and I've been meaning to take time to brush up on my russian. Normally I'd blame the result on things like tracking data, but this was via a clean, isolated, never logged into anything, system. The only factors that couldve been skewing results are my explicit locale settings, primary- german/germany, secondary- english/US, additional languages- dutch, russian, arabic, spanish. No other cookies or previous search history and using a static IPv4 that has been allocated, but until a few hours ago, totally unused for ~6mo (part of my /28 block).
It's so serendipitous that I keep mulling over everything trying to figure out wtf I missed... seriously, how the hell does "O'Reilly pocket reference php ebook" return a russian paperback of 1984???
I'm totally gonna find and buy one now too (the actual result is costly, plus would ship from germany so more costly).5 -
I have one question to everyone:
I am basically a full stack developer who works with cloud technologies for platform development. For past 5-6 months I am working on product which uses machine learning algorithms to generate metadata from video.
One of the algorithm uses tensorflow to predict locale from an image. It takes an image of size ~500 kb and takes around 15 sec to predict the 5 possible locale from a pre-trained model. Now when I send more than 100 r ki requests to the code concurrently, it stops working and tensor flow throws some error. I am using a 32 core vcpu with 120 GB ram. When I ask the decision scientists from my team they say that the processing is high. A lot of calculation is happening behind the scene. It requires GPU.
As far as I understand, GPU make sense while training but while prediction or testing I do not think we will need such heavy infra. Please help me understand if I am wrong.
PS : all the decision scientists in the team basically dumb fucks, and they always have one answer use GPU.8 -
Timecalculations and Datetime manipulation from UTC to locale where locale can be anything are by itself annoying but Javas Date and Calendar APIs always make me feel like "Seriously?! Fuck you! What do you want from me?! "
Argh....
Wasting so much time right now to get a fairly easy app built as showcase for new customers and continue with my life!2 -
Why the fuck doesn't React Native have proper date.toLocaleString() support!? Polyfills don't even seem to exist for it... Now I have to use a giant locales library just to support one locale that should be native. 😡
-
Another day, another struggle with time zones.
How many fucking helper methods do I need to create for dates and time zones? How many components, pipes and services do I need to wrap just so two datetimes line up? Apparently another one today. At this point I'm ready to accept flat earth theory if it means no more time zones. I'm fucking sold on it if so.
It's not even the time zone that's the issue. It's business needing it formatted, but also offset properly, based on your browser locale, but with points that cross into DST observing time zones of a different locale simultaneously. Sometimes those times are the same, sometimes they're different, sometimes they're different but only in winter. And despite a plethora of libraries to help with these calculations, nothing ever seems to just work out of the box. So here's to another layer of abstraction, because time zones (and DST) are bullshit.1 -
Why Android makes it a pain in the ass to make apps that let theie users choose their own language? This pushes me to reinvent the wheel just to avoid their broken mess named Locale.
-
Using input type time and the format is set by chrome language.
Is there any way to force 24h-format other than change locale if using a external library such as date picker isn't an option?
I have found out that South African is a locale in English with 24h-format time. -
https://hahaxo.xlog.app/JetBrains-x...
this shit registers intellij ultimate until 2048, for free. and it works even for the latest version of intellij
whoever this chinese man is, is a fucking genius. Been looking for a fucking intellij crack for way too long!9