Details
-
AboutI am sak96
-
SkillsI code and rant :/
-
Location127.0.0.1
Joined devRant on 5/17/2017
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
-
Just did my first JobIntentService on Android. Hoo, boy.
The problem: I need to send a network request.
The issue: Android.
Of course, you can't do network on the main thread. That's silly in any application. Android really does try to punish you, though. The Android lifecycle can really fuck you over here. Imagine a long-running network operation, like 15 seconds. Plenty of time for the user to do something silly, like rotate the screen.
If you opened up a good old new Thread from Java, you'd get a crash because of a screen rotation. Same thing with Android's AsyncTask, which is the top answer on StackOverflow. AsyncTask is made for things that will take no longer than a few seconds (less than 5!). Network, especially cell network, can take longer.
So the solution? Create a JobIntentService class. It's a service, it will run in the background. You need to register it in your Android Manifest and ask for a new permission (wake lock). You need to implement another class for the receiver, and then you need to go to your activity and implement the receiver interface you just wrote.
Just. For. A. Network. Request!
And as far as I'm aware, this isn't even that bad considering the rest of Android's bullshit.
What a headache!8 -
So I cracked prime factorization. For real.
I can factor a 1024 bit product in 11hours on an i3.
No GPU acceleration, no massive memory overhead. Probably a lot faster with parallel computation on a better cpu, or even on a gpu.
4096 bits in 97-98 hours.
Verifiable. Not shitting you. My hearts beating out of my fucking chest. Maybe it was an act of god, I don't know, but it works.
What should I do with it?241 -
Millennials are getting right f*cked.
Low paying jobs,
Many hours of travel to work because one can't afford to live closeby,
working 10 hour a day, and
there is no hope of owning a home.
Then people say 'oh what do you do when you get home?'
Sleeeep for the limited hours left!
Then your partner says 'oh you just come home to sleep'
Then you have instagram and all these 'influencers' saying go after your dreams... while they very well know they only get paid for heavily edited images.
Wish things were better for everyone.25 -
Are you using socat?
Any interesting use case you would like to share?
I am using it to create fake / proxy docker containers for network testing.7 -
Gets run over by truck. Laptop in peaces. Insurrance needed to be sure it was actually broken. Sends laptop to a repair center. They tell me its broken. Repair center asks if I want my laptop back. I said: yes pls. Get laptop back. RAM stolen SSD stolen. Reee! They forgot to send it back..... I mean, you did not have to take out those parts to see it i broken.12
-
Yes. Please. Stop putting hidden files in my home directory. It's not the place for it.
https://0x46.net/thoughts/2019/...14 -
This is the problem with big media, they overplay all the news and buzz words. Like wtf why is there a fucking robot. And you don't need an ai to stop people from sharing passwords14
-
Just watched this video on modern feminism, power relationships and hierarchy, marriage, workplaces, a lot of social issues that revolve around the different genders. As this stirring by modern day feminists is now also increasingly intoxicating the technological field, I think this really is something that I'd like as many technologists as possible to watch. Granted, it's 240p potato vision, but it makes for a great podcast.
https://youtu.be/rlvMAS_20K413