|
Shadowing: Not Even Once.
|
# ? Mar 29, 2017 01:59 |
|
|
# ? Jun 5, 2024 06:33 |
|
Does -Wshadow catch that?
|
# ? Mar 29, 2017 03:59 |
|
So I wanted to concatenate some strings in Open Office
|
# ? Mar 29, 2017 15:40 |
canis minor posted:So I wanted to concatenate some strings in Open Office Yes that's how date/time values are represented, courtesy of Excel. (I don't know if earlier spreadsheet software had date/time values/handling.) Integer part is days since some epoch date, fractional part is time of day as a fraction of 24 hours. If you want to format the date/time value for string concatenation you need to use a formatting function.
|
|
# ? Mar 29, 2017 15:51 |
|
What, are you still using imperial time? Americans and their fear of the metric system I tell you...
|
# ? Mar 29, 2017 15:51 |
|
nielsm posted:Yes that's how date/time values are represented, courtesy of Excel. (I don't know if earlier spreadsheet software had date/time values/handling.) Integer part is days since some epoch date, fractional part is time of day as a fraction of 24 hours. If you want to format the date/time value for string concatenation you need to use a formatting function. But it's a string, it's not timestamp, since my confusion. And indeed, resetting formatting changes it to 0.4166666, even though the person that created the spreadsheet didn't format it as time. What I've done is copied the entire column to notepad and back in - since copy to clipboard copies the displayed value, and not the "actual" value, thus dropping the formatting and preserving what I want, but still - how is that sane?
|
# ? Mar 29, 2017 16:16 |
|
phpredis: A PHP redis library that can't handle high load. Thankfully someone reported an issue in 2011. Fast-forward to 2017 and...people are still trying to add reproduction scenarios and having failures. Edit: Some more Redis talk here. Apparently Redis is single-threaded and you shouldn't do blocking and long-running things with it. Who knew? Sagacity fucked around with this message at 17:11 on Mar 29, 2017 |
# ? Mar 29, 2017 17:05 |
|
canis minor posted:What I've done is copied the entire column to notepad and back in - since copy to clipboard copies the displayed value, and not the "actual" value, thus dropping the formatting and preserving what I want, but still - how is that sane? Maybe it might make sense to have the CONCATENATE function automatically use the formatting of the source column when it outputs the string, but if you're already doing string manipulation with functions, just use more functions to make sure the output is exactly what you want.
|
# ? Mar 29, 2017 17:05 |
|
canis minor posted:But it's a string, it's not timestamp, since my confusion. It's a timestamp or it would be shown as '10:00:00. One way to concatenate is as noted to format the time: =CONCATENATE("Time is ", TEXT(L2, "hh:mm:ss"), " WOW") See also http://stackoverflow.com/questions/220672/convert-time-fields-to-strings-in-excel
|
# ? Mar 29, 2017 17:08 |
ulmont posted:It's a timestamp or it would be shown as '10:00:00. This. Note the apostrophe in '10:00:00 -- that would force it to be parsed as a string (the apostrophe is not part of the cell value), but when it's absent it's parsed as a time, stored as a fractional time, and displayed as a formatted time when used with Standard format. Even in the formula editor.
|
|
# ? Mar 29, 2017 17:15 |
|
nielsm posted:This. Note the apostrophe in '10:00:00 That's pretty nifty - thanks! Jethro posted:Maybe it might make sense to have the CONCATENATE function automatically use the formatting of the source column when it outputs the string Yup, that's what I'd expect - although that probably opens up another can of worms. Still, as an inexperienced user with Excel this behaviour strikes me as absurd - if I saw "0.416667" in the top bar, but "10:00:00" in the cell, I'd know the matter is with formatting of a specific value. If I see 10:00:00 in both I'm thinking - this is definitely a string. And I know for sure the person that created the sheet didn't apply time formatting to this column, so why should the app in this case try to fix the data for the user? edit: to clarify - if I open a blank spreadsheet, put in first cell: "10:00:00", second cell "=CONCATENATE("Time is ";A1)" I don't expect it to output: "Time is 0.416667" and I consider it weird that that's the standard behavior. vvv That's a hilarious read canis minor fucked around with this message at 18:56 on Mar 29, 2017 |
# ? Mar 29, 2017 18:20 |
|
Jethro posted:The vast majority of the time users will enter data into a spreadsheet as a string representation, but then they want it to be treated as data, not a string. So it makes perfect sense to take strings that look like numbers, dates, or times and automatically convert them to numbers, dates, or times respectively. An alarming number of scientific papers contain Excel errors.
|
# ? Mar 29, 2017 18:42 |
|
canis minor posted:Still, as an inexperienced user with Excel this behaviour strikes me as absurd - if I saw "0.416667" in the top bar, but "10:00:00" in the cell, I'd know the matter is with formatting of a specific value. If I see 10:00:00 in both I'm thinking - this is definitely a string. And I know for sure the person that created the sheet didn't apply time formatting to this column, so why should the app in this case try to fix the data for the user? quote:edit: to clarify - if I open a blank spreadsheet, put in first cell: "10:00:00", second cell "=CONCATENATE("Time is ";A1)" I don't expect it to output: "Time is 0.416667" and I consider it weird that that's the standard behavior.
|
# ? Mar 29, 2017 19:34 |
|
That are great points you're making - especially about sorting "9:00" and "10:00"; still, I'd say I prefer Google's approach - it is, what it is, until user makes a conscious decision about changing it
|
# ? Mar 29, 2017 20:05 |
|
canis minor posted:That are great points you're making - especially about sorting "9:00" and "10:00"; still, I'd say I prefer Google's approach - it is, what it is, until user makes a conscious decision about changing it Where does google do that?
|
# ? Mar 29, 2017 20:48 |
Date/time values in Excel are slightly special in that they degenerate to regular numeric values as soon as you feed them into any function at all. There also (as far as I know) is no function specifically to isolate the date or time from a value, you have to use the FLOOR function to do that. In particular, the functions named DATE and TIME are borderline useless for that, their purpose is assembling the numeric date/time values from year/month/day/hour/minute/second components. (Extracting the time component of x is in fact x-FLOOR(x), which is madness.)
|
|
# ? Mar 29, 2017 20:59 |
|
I believe MOD(x, 1) would also do the job?
|
# ? Mar 29, 2017 21:02 |
Doom Mathematic posted:I believe MOD(x, 1) would also do the job? Huh yeah it does. I pretty much only think of modulo in the context of integer-integer division but yes of course it should work just as well.
|
|
# ? Mar 29, 2017 21:06 |
|
Sereri posted:What, are you still using imperial time? Americans and their fear of the metric system I tell you... Is this just a really bad joke or do you live in some weird country that actually uses a base-10 system of time?
|
# ? Mar 29, 2017 22:07 |
|
Jethro posted:Where does google do that? Oh, indeed, by default it assumes it's time as well, even though nothing is selected. I must have been looking at field where I've already selected text format and thus it worked, apologies
|
# ? Mar 29, 2017 22:13 |
|
QuarkJets posted:Is this just a really bad joke or do you live in some weird country that actually uses a base-10 system of time? Revolutionary France isn't weird, just dead. http://mentalfloss.com/article/32127/decimal-time-how-french-made-10-hour-day The calendar lives on, though. https://www.frenchrepublicanwallcalendar.com/
|
# ? Mar 29, 2017 22:35 |
|
Jethro posted:The magic has to stop somewhere, and a function that depends on you knowing what string means is as good a place as any and probably better than most. This is almost exactly (date versus time) the scenario Excel uses in its example of the TEXT function. https://support.office.com/en-us/article/TEXT-function-20d5ac4d-7b94-49fd-bb38-93d29371225c
|
# ? Mar 29, 2017 22:44 |
|
ulmont posted:Revolutionary France isn't weird, just dead. Madmen
|
# ? Mar 30, 2017 06:48 |
|
QuarkJets posted:Is this just a really bad joke or do you live in some weird country that actually uses a base-10 system of time? https://www.timeanddate.com/time/internettime.html
|
# ? Mar 30, 2017 08:28 |
|
QuarkJets posted:Is this just a really bad joke or do you live in some weird country that actually uses a base-10 system of time?
|
# ? Mar 30, 2017 08:54 |
|
Civic UK are a company who supply a 3rd party service for hosting UK cookie law compliance pop ups. Today their site went completely dead which resulted in an error pop up appearing on your site if you use them. On every page. We do and so one of our sites was hosed. Coding horrors: No failsafe at our end for their service being unavailable No contact details for the company - their twitter had last been updated in November The best part though is the service was also being used by the Information Commissioner's Office. So the people who are meant to regulate companies displaying these cookie notifications also had problems with their cookie notification.
|
# ? Mar 30, 2017 22:15 |
|
Alan G posted:Civic UK are a company who supply a 3rd party service for hosting UK cookie law compliance pop ups. This is an actual company? gently caress, I wish I had thought of doing this.
|
# ? Mar 31, 2017 01:28 |
|
That company would be 99% sales and 1% tech which seems borne out by their tech quality.
|
# ? Mar 31, 2017 19:46 |
|
Those loving cookie notifications/warnings are a legislative horror. They do nothing but annoy people & teach them that every website uses cookies and to just click OK to make the dumb thing go away.
|
# ? Mar 31, 2017 20:29 |
|
Powaqoatse posted:Those loving cookie notifications/warnings are a legislative horror. They do nothing but annoy people & teach them that every website uses cookies and to just click OK to make the dumb thing go away. It's the online version of California's Proposition 65 (the "this thing may give you cancer" one).
|
# ? Mar 31, 2017 21:21 |
|
The hilarious bit is that the same EU board that insisted on the cookie warnings in the first place later suggested that they didn't mean every website would have to have a form agreement, and that a setting in the browser would be enough. You know, like every browser always had..
|
# ? Mar 31, 2017 21:22 |
|
They should also warn you if a site uses javascript.
|
# ? Mar 31, 2017 21:28 |
|
Seat Safety Switch posted:This is an actual company? gently caress, I wish I had thought of doing this. Yeah . Seems like a licence to print money. We were like: In 2 years this law comes in In 1 year this law comes in Hey that law was meant to come in but it has an extension Eventually legal went: This law comes in in X days, why are you guys not doing this. So using this 3rd party was the quickest way to finally get it done when the task got suddenly got put into a sprint...
|
# ? Mar 31, 2017 21:37 |
|
Rubellavator posted:They should also warn you if a site uses javascript. code:
|
# ? Mar 31, 2017 21:38 |
|
"This site does not use cookies. This message will reappear every time you reload the page. LEARN MORE / GOT IT"
|
# ? Mar 31, 2017 22:14 |
|
The tendency for the EU to ignore locked-in or established technologies with things like the Right To Be Forgotten seems like a good double-edged sword to me. On the one hand it makes things ridiculously impractical to internet, on the other hand the way lock-in works probably inspires 90% of the horrors on this thread that people find in production code and there's merit in the idea that laws shouldn't be written by the firm with the biggest marketing department.
|
# ? Mar 31, 2017 22:31 |
|
Rubellavator posted:They should also warn you if a site uses javascript. This, but unironically.
|
# ? Mar 31, 2017 22:39 |
|
hyphz posted:The tendency for the EU to ignore locked-in or established technologies with things like the Right To Be Forgotten seems like a good double-edged sword to me. On the one hand it makes things ridiculously impractical to internet, on the other hand the way lock-in works probably inspires 90% of the horrors on this thread that people find in production code and there's merit in the idea that laws shouldn't be written by the firm with the biggest marketing department. Yeah, most of the time it seems like the intent of it comes from a good place. For instance, warn people that their personal info is being gathered, but the implementation is just so often completely destroyed by a combination of industry lobbyists and technically illiterate legislators. Obviously every person has a slightly different idea of "too much", but imo "Right to be Forgotten" is totally fine. The intent of the law was pretty clear that it's like if you search for an otherwise private person, not a politician or anything, and there's a news article from the early 2000s about him putting his dick in an exhaust pipe or something, he has a right to get that specific result, for that specific query annulled. It doesn't count if it was a criminal or civil offense, you can't block those. Google intentionally interprets the law in the broadest and annoyingest way possible; it often feels like pretty much any combination of given name + surname will result in a bunch of worthless results (no newspapers) + the disclaimer "some results may have been removen due to blah blah blah", which was specificially not what the whole thing was about. P sure they're doing this on purpose to undermine the law. Obv I cant speak to the wording, but they're very much subverting the intent to bridge the idea of "right to be forgotten" = "annoying law" in people's minds. e: whoa sorry for ranting
|
# ? Mar 31, 2017 23:42 |
|
Maybe people could just stop using cookies on sites that don't need them instead of annoying people with popups!!
|
# ? Apr 1, 2017 00:38 |
|
|
# ? Jun 5, 2024 06:33 |
|
Found at work today: no code needed, the function name says it all. TrimAndAddSpaceAtEnd
|
# ? Apr 1, 2017 04:45 |