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 - "timestamps"
-
People complaining "oh I always have trouble figuring out if the clock goes forwards or backwards in October"
Bitch please, I'm dealing with 12 databases, with SQL dates as local timezone timestamps, and an influxDB in UTC. I'm dealing with a backend server configured in CEST and a middleware layer configured in Pacific time, and a hundred functions which try to keep everything straight because no one dares to migrate it all to UTC at this point.
In the whole argument about DST you hear about sleep psychology, electricity bills and farmers.
But what about me, the poor database administrator? What about all these ugly legacy systems, what about all the UX designers trying to fix time input pickers?
I spend 2 months a year in agony having nightmares of rips and folds in the flow of time. DAYLIGHT SAVING DOESN'T FUCKING MAKE SENSE HOW CAN TIME EXIST TWICE?17 -
DST is my arch enemy.
"Why did I get paid for 7 hours instead of 8?"
"Because you worked from 1:00 till 9:00"
"Yeah, that's 8 hours"
"No it wasn't"
"Why does this input field say invalid time for 02:00?"
"Because that time doesn't exist"
"Why are so many tests failing"
"Because they check timestamps and durations which don't make sense in non-continuous time"
October is even worse...6 -
I just spent an hour debugging my company's web app. More specifically, I was trying to fix a bug that made a label on a comment I just made say "Posted 3 days ago".
After confirming timestamps on the server are correct with a calculator, fiddling around with the js debugger, and ruling out weird timezone-related shenanigans, I came to a conclusion.
The bug was in fact sitting, quite comfortably, between the chair and the keyboard.
Yesterday I had moved the date on my computer roughly 3 days into the future, because I was testing out some unrelated code that was dealing with Redis, and I wanted to expire all of the keys stored inside of it.
Don't blame me, my parents told me I had fallen onto my head as a child.5 -
I'm going for longest rant. TL:DR; version here:
http://pastebin.com/0Bp4jX9y
then:
http://pastebin.com/FfUiTzsh
Twat Client,
As per our conversation, here is an invoice for the work you requested on behalf of U.S. Bloom. I realize that you ended up going with another designer, but you did request samples of what my take on the logo design would be. The following line item is indicative of 1 hour of graphic design consultation as per your request via Skype.
As I recall, you mentioned that this is not how Upwork "works" but considering it was you who requested that I converse with you via Skype instead of via the Upwork messenger, and since there were no clear instructions on how to proceed with Upwork after our initial consultation, It is assumed that you were foregoing Upwork altogether to work with me directly, thus the invoice from me directly for my time involved in the project. I would have reached out to you via Skype, but it seems that you may have severed our connection there.
After spending a little time researching your company, I could not find current information for Basic Media Marketing, but I was able to reach out to your former partner Not A. Twat, who was more than helpful and suggested that he would encourage you to pay for the services rendered.
It is discouraging that you asked for my help and I delivered, but when I ask for compensation in return for my skills, you refused to pay and have now taken your site offline and removed me as a contact from Skype.
{[CLIENT of CLIENT]},
I am sorry that I have bothered you with this email. I copied you on it merely for transparency's sake. I am sure that your logo is great and I am sure whatever decision was made is awesome for your decision. I just wanted to make sure that you weren't getting "samples" of other people's work passed off as original work by Twat Media Marketing.
I can't speak for any of the other candidates, but since Twat asked me to conduct work with him via Skype rather than through Upwork, and since he's pretty much a ghost online now, (Site Offline, LinkedIn Removed or Blocked, and now Skype blocked as well) one has to think this was a hit and run to either crowdsource your logo inexpensively or pass off other artist's work as his own. That may not be the case, but from my perspective all signs are pointing to that scenario.
Here is a transcript. Some of his messages have been redacted.
As you can clearly see, requests and edits to the logo were being made from Jon to me, but he thinks it's a joke when I ask about invoicing and tries to pass it off as an interview. Do you see any interview questions in there? There were no questions about how long I have been designing, what are my rates, who have I done work for in the past, or examples of my previous work. There were none because he didn't need them at this point.
He'd already seen my proposal and my Behance.net portfolio as well as my rates on Upwork.com. This was a cut to the chase request for my ideas for your logo. It was not just ideas, but mock designs with criticism and approval awaiting. Not only that, but I only asked for an hour of compensation. After looking at the timestamps on our conversation, you can clearly see that I spent at least 3 hours corresponding with Twat on this project. That's three hours of work I could have spent on an honest paying customer.
I trust that TWATCLIENT will do the right thing. I just wanted you guys to know that I was in it to do the best design I could for you. I didn't know I was in it to waste three hours of my life in an "interview" I wasn't aware I was participating in.
Reply from ClientClient:
Hello Sir,
This message is very confusing?
We do not owe your company any money and have never worked with you before.
Therefore, I am going to disregard that invoice.
Reply from TWATCLIENT's boss via phone:
I have two problems with this. One I don't think your business practices are ethical, especially calling MY client directly and sending them an invoice.
Two why didn't you call or email Jon before copying my client on the email invoice?
Me: Probably because he's purposely avoiding me and I had no way to find him. I only got his email address today and that was from a WHOIS lookup.
Really, you don't think my business practices are ethical? What about slavery? Is that ethical? Is it ethical to pass of my designs to your client for critique, but not pay me for doing them?
... I'LL HAVE TO CALL YOU BACK!
My email follow up:
http://pastebin.com/hMYPGtxV
I got paid. The power of CCing the right combination of people is greater than most things on Earth.14 -
Gf: "Why are you such a typist"
Me: "I promise not to buy more keyboards with blue switches..."
Gf: "No, I mean like being racist or sexist, but you discriminate types"
Me: "Uhhh"
Gf: "You are always bitching about how awful date/time types are, with timezones, leap seconds and daylight savings"
Me: Face turns pale, thousand yard stare, vietnam-flashback to when I was writing a calendar scheduling/meeting/matching tool which used 3 databases, with timestamps in different formats, and web frontends for people in offices around the world.
Me, with a soft broken voice: "So?"
Gf: "You've been working on that palette tool this week, and you keep talking about how interesting all these colorspaces, white balances and conversion formulas are"
Me: 🤔5 -
!rant && Announcement
The closed beta for the new DEVRANT TOOLBOX is starting for chrome users.
The Toolbox is an UNOFFICIAL web extension for Chrome and Firefox.
Additional features:
- Compact mode: reduced image height in the feeds
- Extended page navigation controls for feeds
- Timestamps for rants
- Image preview on mouseover
- Autoreload for the recent feed (180 sec)
- Highlighting new rants after a reload (recent feed only, see screenshot)
- Highlighting own rants (inside feeds) and comments (inside rants)
- Hiding personal scores (still visible by mouseover) and share buttons inside rants
- Colored notifs (different colors for the notif types)
- Notifs with clickable usernames: a click will open the rant AND the username (in a different tab)
- 3 additional Themes: Black, Monochrome, Dark blue
(Next themes to come: solarized light and dark)
- Global history.back on rightclick (for faster navigation)
- Increased feed width (see screenshot)
- Plain background (just the feed on screen)
- Weekly rant
All features can be switched on/off.
The weekly rant is a temporary feature. It uses the devrant api.
I will remove it when that feature is added to the original devrant webfeed.
@dfox: If you dont like the use of the api or some of the features please contact me.
Chrome users can join this group to get the beta:
https://groups.google.com/forum/...
I NEED SOME FEEDBACK!!!
Therefore a feedback is my term of use.
Please post it as a comment (or in the google group).7 -
Well, if your tests fails because it expects 1557525600000 instead of 1557532800000 for a date it tells you exactly: NOTHING.
Unix timestamp have their point, yet in some cases human readability is a feature. So why the fuck don't you display them not in a human readable format?
Now if you'd see:
2019-05-10T22:00:00+00:00
vs the expected
2019-05-11T00:00:00+00:00
you'd know right away that the first date is wrong by an offset of 2 hours because somebody fucked up timezones and wasn't using a UTC calculation.
So even if want your code to rely on timestamps, at least visualize your failures in a human readable way. (In most cases I argue that keeping dates as an iso string would be JUST FUCKING FINE performance-wise.)
Why do have me parse numbers? Show me the meaningful data.
Timestamps are for computers, dates are for humans.3 -
🐉
I once wrote a room planning application on unity, to allow people in my company to book meetings using tablets attached to the room doors.
Turns out the c# Datetime object unity uses was highly localized and therefore had a different formats on each different device.
I saved those timestamps into a SQL database and eventually all devices crashed due to having some Datetime format they could not parse.
Had to fully bypass the datetime and reinvent it essentially and had to reset the database.
I think it's needless to say I'm not particularly good in dating.4 -
I can't begin to express how utterly useless timestamps like "Today, about 15 minutes ago" or "Yesterday", or "Monday", or "Two Weeks Ago" are.
Those aren't times. Those are relative descriptions of times and are utterly useless.
If I don't know the current date for any number of reasons, such as when viewing a screenshot, it's a worse description than not having one at all.
Again, I am stymied by Apple's insistence to make everything that much less useful for literally no gain.7 -
Give everyone the ability to intuitively grasp the concept of unix timestamps.
No more timezones or DST, no more confusion about formats.7 -
There are so many weird hacks in the quite legacy app I work with I could write a book about all them hacks…
But I must admit, the worst of them all is internal time. Yes, so some blockhead thought it’s a good idea to represent time in a manner completely removed from Datetime objects or timestamps or even string representations. Instead we deal with them as intervals represented by integers - and because this is not fucked up enough by itself, the internal time doesn’t start at midnight, yet the integer representations do. It’s a bloody mess. No wonder most of the bugs we face have to do with dates and time…5 -
CTO: We'll use epochs for any time related fields in our services.
After service integration...
Dev from producer team: Hey the time field is showing up as 1970 and not null in your table. That seems to be a bug.
Me: Code looks fine. We are converting epochs to timestamps here. Null is taken care by the library function itself.
The same dev: Actually we are sending zero instead of null values in that time field. But we'd want the end table to treat that as null.
Me: Why can't you send null then?
The dev: Actually avro doesn't support nulls. Hence the zero.
Me: WTF??????
Manager to me: Actually you need to convert them as null. Anyways, this is not a blocker and we can live with it for now.
END OF RANT
Why can't they fucking send it as null? And when I asked about the details, that particular event type doesn't require that field. Still the manager insists on sending that field for it.23 -
https://youtu.be/1-xGerv5FOk- Alan Walker - Alone
My friend asked me,
"Can you make some thing like this?"
Timestamps:
00:06 (Link: https://youtu.be/1-xGerv5FOk?t=6s)
00:08 (Link: https://youtu.be/1-xGerv5FOk?t=8s)
00:13~00:22 (Link: https://youtu.be/1-xGerv5FOk?t=13s)
Me : *uhhh*3 -
Not a question per se but an assignment -
Design an application that could find logs between two timestamps where the logs are stored in 10000 files, each with a file size of ~16GB.
For an entry level position this was a really good and interesting problem to solve.11 -
We bring you messages from the future...
Is Apple rounding up timestamps, or have they started using Scala Futures? 😂😂3 -
We had 1 Android app to be developed for charity org for data collection for ground water level increase competition among villages.
Initial scope was very small & feasible. Around 10 forms with 3-4 fields in each to be developed in 2 months (1 for dev, 1 for testing). There was a prod version which had similar forms with no validations etc.
We had received prod source, which was total junk. No KT was given.
In existing source, spelling mistakes were there in the era of spell/grammar checking tools.
There were rural names of classes, variables in regional language in English letters & that regional language is somewhat known to some developers but even they don't know those rural names' meanings. This costed us at great length in visualizing data flow between entities. Even Google translate wasn't reliable for this language due to low Internet penetration in that language region.
OOP wasn't followed, so at 10 places exact same code exists. If error or bug needed to be fixed it had to be fixed at all those 10 places.
No foreign key relationships was there in database while actually there were logical relations among different entites.
No created, updated timestamps in records at app side to have audit trail.
Small part of that existing source was quite good with Fragments, MVP etc. while other part was ancient Activities with business logic.
We have to support Android 4.0 to 9.0 of many screen sizes & resolutions without any target devices issued to us by the client.
Then Corona lockdown happened & during that suddenly client side professionals became over efficient.
Client started adding requirements like very complex validation which has inter-entity dependencies. Then they started filing bugs from prod version on us.
Let's come to the developers' expertise,
2 developers with 8+ years of experience & they're not knowing how to resolve conflicts in git merge which were created by them only due to not following git best practice for coding like only appending new implementation in existing classes for easy auto merge etc.
They are thinking like handling click events is called development.
They don't want to think about OOP, well structured code. They don't want to re-use code mostly & when they copy paste, they think it's called re-use.
They wanted to follow old school Java development in memory scarce Android app life cycle in end user phone. They don't understand memory leaks, even though it's pin pointed by memory leak detection tools (Leak canary etc.).
Now 3.5 months are over, that competition was called off for this year due to Corona & development is still ongoing.
We are nowhere close to completion even for initial internal QA round.
On top of this, nothing is billable so it's like financial suicide.
Remember whatever said here is only 10% of what is faced.
- An Engineering lead in a half billion dollar company.4 -
PouchDB.
It promised full-blown CRDT functionality. So I decided to adopt it.
Disappointment number one: you have to use CouchDB, so your data model is under strict regulations now. Okay.
Disappointment number two: absolutely messed up hack required to restrict users from accessing other users’ data, otherwise you have to store all the user data in single collection. Not the most performant solution.
Disappointment number three: pagination is utter mess. Server-side timestamps are utter mess. ANY server-side logic is utter mess.
Just to set it to work, you need PouchDB itself, websocket adapter (otherwise only three simultaneous syncs), auth adapter (doesn’t work via sockets), which came out fucking large pile of bullshit at the frontend.
Disappointment number four, the final one: auth somehow works but it doesn’t set cookie. I don’t know how to get access.
GitHub user named Wohali, number one CouchDB specialist over there, doesn’t know that either.
It also doesn’t work at Incognito mode, doesn’t work at Firefox at all.
So, if you want to use PouchDB, bear that in mind:
1. CouchDB only
2. No server-side logic
3. Authorization is a mess
4. Error logs are mess too: “ERROR 83929629 broken pipe” means “out of disk space” in Erlang, the CouchDB language.
5. No hosting solutions. No backup solutions, no infrastructure around that at all. You are tied to bare metal VPS and Ansible.
6. Huge pile of bullshit at frontend. Doesn’t work at Incognito mode, doesn’t work at Firefox.8 -
So, today timestamps within my database saved me. I have one titled "created_at" to indicate when the item was originally created.
Today a large client called up to complain that they have 296 bookings but only 288 menu choices (each booking has a menu choice). Basically, saying I'd "programmed it wrong [sic]" :(
After taking a quick look at the date the client originally added the menu and the date the missing bookings were created, I made a discovery.
It turned out the client was at fault. They had set an event (customers book events and bookings have a menu choice) live without associating the menu. This meant the event had been live without a menu for customers to book.
I simply compared the timestamps of the missing bookings to the date the menu was originally added. The customer most likely made the event live for period (I estimate ~45 mins), realised they hadn't associated a menu and then added it afterwards. Of course at this point it was too late as people had already booked.
No need for a huge email either. I condensed the above into a 5 sentence email.
Timestamps are soooo useful1 -
DAYLIGHT SAVING!!
Up to this point, I was indifferent to the issue if it should be kept or not. My sleep schedule is fucked and non-routine anyway so one hour plus or minus doesn't play any role.
I got to a meeting scheduling problem, when I have 2 timestamps in variable timezones and want to calculate time difference. Both can have DST active. There is no algortihmic way to figure out. I checked SO and pytz and it's just a list of hardcoded dates when DST starts and ends. WHATHTEHELL.jpg
Not only we should abolish the DST, we should force the whole world into UTC/Zulu. And those, who refuse to adapt to UTC, will be forced to work with plain integer epoch dates.3 -
Difference between 2023-01-01 00:00:00 and 2023-12-31 23:59:59 is 11 months, 29 days, 23 hours, 59 minutes, 59 seconds ; so almost a year (by one second)
Difference between 2023-01-01 00:00:00 and 2023-01-31 23:59:59 is the same, almost a month by 1 second.
Same for february (even with 28 being the last day).
But then, 2023-03-01 00:00:00 and 2023-03-31 23:59:59 gives me :
1 month, 2 days, 23 hours, 59 minutes, 59 seconds.
WHY, are there fucking 34 days in March ? Is this a bug ? Is it confused with February being the previous month ?
Why would PHP do this to me ?
Why the hell is it always so painful to work with dates, it's not even like I'm stretching the standard library or using raw timestamps to hack things together
I used the diff method of PHP 7.4 DateTime, is someone wants to try it24 -
The beta version of the new DEVRANT TOOLBOX is available now.
Its an unofficial web extension for Chrome and Firefox.
Chrome Web Store:
https://chrome.google.com/webstore/...
Firefox:
The certifaction process takes a long time, therefore I provided a direct download for the xpi file (for side loading).
https://drive.google.com/drive/...
Additional features: DUAL FRAME MODE (feeds left, rants right), themes (black, mono, darkgray, darkblue, comic, solarized), scrollbar plugin (perfect scrollbar, FF only), extended controls, fixed header, sorted userprofiles (by votes), autoreload (recent feed, 180 sec), highlighting new rants (recent feed), personal filter, image preview (mouseover), keyboard shortcuts, timestamps for rants, compact mode, colored notifs with clickable usernames, weekly rant.
I tested the extension with Windows Browsers only.
It would be great to get a feedback how it works with other systems!
Have fun with the toolbox.7 -
Fucking Windows.
Everytime I update the system it acts like it got infected by yet another virus.
Everyone uses this shitty insult of an OS because one day Gates said "hurr durr look how fucking generous I am, y'all get my OS for free". And we got fooled big time.
Any E-mail I try to look up in Outlook that's older than a month doesn't exist, Excel converts anything I type into ISO-timestamps, and the most infuriating thing of all is that whenever something runs in an error, it just gives me a big
FUCK Something went wrong YOU
FUCK Ask your administrator if you have any questions YOU
FUCK Who do you think is sitting infront of the screen you big pile piece of shit software YOU
AFAIK Gates founded Microsoft as the hero mounting against the giants of its time, IBM to be concise. Looks like Microsoft lived long enough to become the villain themselves.5 -
so on my new lappy I'm testing XFS. After reading how bloody fast it is, I figured: why not give it a shot!
2 weeks later, I want to go back to ext4. XFS is SSSSOOOOOO fault-intollerant, it breaks my Chrome profile after each forced-poweroff (or power loss). And the on-boot fsck freezes. And after a successful bootup I see the log messages in syslog are all messed up (timestamps are all over the timeline!!!)
it's a mess... A very fast mess.17 -
So I'm having a discussion with frontend devs now and I'm curious how you folks are doing this:
suppose you have a rest api at BE and some js framework in FE consuming it. Where do you format display info at: BE or FE? Info like human-readable timestamps [according to user's TZ], i18n, displaynames with appropr. lengths, etc..
Is this a job for FE or BE in your oppinions?
[imo it's view's job to be responsible for view-speciffic matters, while BE should provide all required info for FE to do it's formatting et al.]18 -
Linux is great
Linux can be customized
Welp, not so much. Simple things are not possible to do.
After 1H research I can't have timestamp near each line over SSH.
I'm not talking "history", i'm talking live.
basiclly I want to see timestamp on every single output line.
Basiclly this :
https://unix.stackexchange.com/ques...
But running automaticly for each command ever.
To be fair, same problem exists in PowerShell on windows
https://stackoverflow.com/questions...
And no, I don;'t want to switch to some random halfbaked teminal.31 -
The CloudWatch API is an awkward piece of shit.
No convenient way to just ask for the latest value of a metric. Gotta supply a time window and hope metrics were actually reported within that window.
Oh and make sure your timestamps are in ISO 8601 or the request will fail (but the SDK does zero validation so a unit test won’t catch it of course).
Oh and you have to assign an arbitrary ID to each metric query in your request even if you don’t care about mapping the results back to the queries. And the regex for the ID is just fussy enough to be mildly irritating.1 -
"Copy the file sent to our warehouse management system to another folder so we can keep track of the deliveries we sent data for."
Why these geniuses think that having a folder with file names containing timestamps (and not delivery numbers) would make their job easier is beyond me... -
(I'm not completely sure of what I'm saying here, so don't take this too seriously)
Settling on a language to write the api for ranterix is hard.
I'm finding a lot of things about elixir to be insanely good for a stable api.
But I'm having a lot of gripes with the most important elixir web framework, phoenix.
Take a look at this piece of code from the phoenix docs:
defmodule Hello.Repo.Migrations.CreateUsers do
use Ecto.Migration
def change do
create table(:users) do
add :name, :string
add :email, :string add :bio, :string
add :number_of_pets, :integer
timestamps()
end
end
end
Jesus christ, I hate this shit.
Wtf are create, add and timestamps. Add is somehow valid inside the create, how the fuck is that considered good code? What happens if you call timestamps twice? It's all obscure "trust me, it works" code.
It appears to be written by a child.
js may have a million problems. But one thing I like about CJS (require) or ESM (import) is that there's nothing unexplained. You know where the fuck most things come from.
You default export an eatShit() function on one file and import it from another, and what do you get?
The goddamn actual eatShit function.
require is a function the same way toString is a function and it returns whatever the fuck you had exported in the target file.
Meanwhile some dynamic langs are like "oh, I'll just export only some lang construct that i expect you to specify and put that shit in fucking global of the importing file".
Js is about the fucking freedom. It won't decide for you what things will files export, you can export whatever the fuck you want, strings, functions, classes, objects or even nothing at all, thanks to module.exports object or export statement.
And in js, you can spy on anything external, for example with (...args) => debugger; fnToSpyOn(...args)
You can spoof console.log this way to see what the fuck is calling it (note: monkey patching for debugging = GOOD, for actual programming = DOGSHIT)
To be fair though, that is possible because of being a dynamic lang and elixir is kind of a hybrid typed lang, fair enough.
But here's where i drop the shit.
Phoenix takes it one step further by following the braindead ruby style of code and pretty DSLs.
I fucking hate DSLs, I fucking hate abstraction addiction.
Get this, we're not writing fucking poetry here. We're writing programs for machines for them to execute.
Machines are not humans with emotions or creativity, nor feel.
We need some level of abstraction to save time understanding source code, sure.
But there has to be a balance. Languages can be ergonomic for humans, but they also need to be ergonomic for algorithms and machines.
Some of the people that write "beautiful" "zen" code are the folks that think that everyone who doesn't push the pretty code agenda is a code elitist that doesn't want "normal" people to get into programming.
Programming is hard, man, there's no fucking way around it.
Sometimes operating system or even hardware details bleed into code.
DSLs are one easy way to make code really really easy to understand, but also make it really fucking hard to debug or to lose "programming meaning".7 -
Crypto. I've seen some horrible RC4 thrown around and heard of 3DES also being used, but luckily didn't lay my eyes upon it.
Now to my current crypto adventure.
Rule no.1: Never roll your own crypto.
They said.
So let's encrypt a file for upload. OK, there doesn't seem to be a clear standard, but ya'know combine asymmetric cipher to crypt the key with a symmetric. Should be easy. Take RSA and whatnot from some libraries. But let's obfuscate it a bit so nobody can reuse it. - Until today I thought the crypto was alright, but then there was something off. On two layers there were added hashes, timestamps or length fields, which enlarges the data to encrypt. Now it doesn't add up any more: Through padding and hash verification RSA from OpenSSL throws an error, because the data is too long (about 240 bytes possible, but 264 pumped in). Probably the lib used just didn't notify, silently truncating stuff or resorting to other means. Still investigation needed. - but apart from that: why the fuck add own hash verification, with weak non-cryptographic hashes(!) if the chosen RSA variant already has that with SHA-256. Why this sick generation of key material with some md5 artistic stunts - is there no cryptographically safe random source on Windows? Why directly pump some structs (with no padding and magic numbers) into the file? Just so it's a bit more fucked up?
Thanks, that worked.3 -
Inherited a legacy system from a developer and it's a freaking nightmare! The majority of the system uses timestamps and not record ID's to handle data. When the clocks change (daylight savings) none of the records can be seen in the system because the freaking timestamps don't match up!! Arrghh this is going to take me ages to fix!!2
-
Part 3
https://devrant.com/rants/9881158/...
I dropped subtitles and started extracting audio from movie, after that I use whisper to convert speech to text.
I parse srt from whisper, adjust timestamps to get >= arbitrary amount of voice seconds. I put text to vector database with timestamps and movie file name.
I query database by ex. “I don’t know” and extract first n results, after that I walk trough movies and extract parts with found text.
I normalize and merge parts into one movie.
Results are satisfying so now I decided to try to find a common dialogue that I can watch by combining multiple persons speaking from multiple movies.
Might also try to extract person from one movie and put it to other movie.2 -
I have a series of timestamps (second granularity). I need to derive a "frequency" from them and produce a string like "every X minutes/hours/days/weeks/etc", to where it fits closest.
Is there a well-known algorithm for this? I'm having trouble finding search terms.7 -
For some reason I always have a hard time mentally mapping "asc/desc" to dates. I think of stairs and mentally map the dates to unicode timestamps. Am I the only one? Sort descending by date is newest first, btw6
-
I recently started working on laravel. As the community says it was easy to get along with the framework and its methodologies. But then i had to do multiple login with framework in same domain.
Oh man, i spent a week to make it work. All those guards and middlewares realted to login was driving me crazy. The concept was clear, but somehow the framework was like "You! I shall make you spend a week for my satisfaction". The project demo was nearing and i was doing all kind of stuff i found. Atlast after continous tries it worked. Never in my 4+ years as a developer i had to face such an issue with login.
So here is how it works,if anyone faces the same issue:
(This case is beneficial if you're using table structures different from default laravel auth table structures)
1. Define the guards for each in auth.php
Eg:
'users' => [
'driver' => 'session',
'provider' => 'users',
],
'client' => [
'driver' => 'session',
'provider' => 'client',
],
'admin' => [
'driver' => 'session',
'provider' => 'admins',
],
2. Define providers for each guards in auth.php
'users' => [
'driver' => 'eloquent',
'model' => <Model Namespace>::class,
'table' => '<table name>', //Optional. You can define it in the model also
],
'admins' => [
'driver' => 'eloquent',
'model' => <Model Namespace>::class,
],
'client' => [
'driver' => 'eloquent',
'model' => <Model Namespace>::class,
],
Similarly you can define passwords for resetting passwords in auth.php
3. Edit login controller in app/Http/Controller/Auth folder accordingly
a. Usually this particular line of code is used for authentication
Auth::guard('<guard name>')->attempt(['email' => $request->email, 'password' => $request->password]);
b. If above mentioned method doesn't work, You can directly login using login method
EG:
$user = <model namespace>::where([
'username' => $request->username,
'password' => md5($request->password),
])->first();
Auth::guard('<guard name>')->login($user);
4. If you're using custom build table to store user details, then you should adjust the model for that particular table accordingly. NOTE: The model extends Authenticatable
EG
class <model name> extends Authenticatable
{
use Notifiable;
protected $table = "<table name>";
protected $guard = '<guard name>';
protected $fillable = [
'name' , 'username' , 'email' , 'password'
];
protected $hidden = [
'password' ,
];
//Below changes are optional, according to your need
public $timestamps = false;
const CREATED_AT = 'created_time';
const UPDATED_AT = 'updated_time';
//To get your custom id field, in this case username
public function getId()
{
return $this->username;
}
}
5. Create login views according to the user types you required
6. Update the RedirectIfAuthenticated middleware for auth redirections after login
7. Make sure to not use the default laravel Auth routes. This may cause some inconsistancy in workflow
The laravel version which i worked on and the solution is for is Laravel 6.x1