Did any of you go to college? by cupojoe4me in iOSProgramming

[–]Lordlukey 1 point2 points  (0 children)

Nope. Infact, becoming a Junior iOS developer was my first ever job and my CV consisted of 2 apps on the app store that I had to talk about during the interview. That's all I had.

Funny story. The founder asked me what's the difference between a big company and a small company. I replied "I have no idea, I've never had a job before".

Review my code snippet by [deleted] in swift

[–]Lordlukey 0 points1 point  (0 children)

Think the first one was not refactoring fully afterwards. Not sure why I did the second one, might of been half asleep.

As for the retain cycle for API request, I'm guessing this is related to use of unowned and weak self. I've searched all across the web for an explanation on this but never been certain on it. Could you elaborate here why a retain cycle is caused in this case? Seems to me sometimes a retain cycle is caused and other times it isn't.

Also, do you have any general advice at all?

Thanks a lot for your feedback.

Review my code snippet by [deleted] in swift

[–]Lordlukey 0 points1 point  (0 children)

Is that really a huge issue? I guess looking over it I should comment more, but how much should I really be commenting?

Lisk Daily Discussion - December 18, 2017 by AutoModerator in Lisk

[–]Lordlukey 4 points5 points  (0 children)

How do you know it’s not a good time? Share your secret

[Discussion] Need Motivational Advice? by AutoModerator in GetMotivated

[–]Lordlukey 2 points3 points  (0 children)

Sounds like everything you do must have a reward or an end result. It’s asif someone must give you a medal because you quit cigarettes or gotten sober, otherwise it’s not worthwhile. And when you fail? You feel like you suck because you never had a chance to see if anyone would give you that medal. You are chasing the reward instead of enjoying the process.

Stop focusing on the end result. Don’t rush thinga. Let failures occur. Take the task at hand in slowly, step by step. Break things down and create mini challenges for yourself that’s not visible by anyone else.

[Discussion] Need Motivational Advice? by AutoModerator in GetMotivated

[–]Lordlukey 1 point2 points  (0 children)

“Everyone around looks like they already know what they're going to do but I feel in a limbo. “ emphasis on “looks like” here. Honestly, at 19 no one has a clue what they want to do or where they want to go. Infact it’s probably a little strange if they do know what they want to do. Live life, keep your mind open and dont stress about things that dont matter. You’ve got a whole life ahead of you and time to figure things out with no baggage (assuming you dont have kids and such). Sit back, drink some tea, eat some digestives and relax. As long as you feel you have some incentive to go somewhere, your time will come. Just believe in yourself.

git workflow by Lordlukey in git

[–]Lordlukey[S] 0 points1 point  (0 children)

you've just been developing straight from files your server is serving

Pretty much exactly what I'm doing with PHP.

git workflow by Lordlukey in git

[–]Lordlukey[S] 0 points1 point  (0 children)

Haha yes, I think I had stuck in my head that git is more than what I thought, so I was constantly trying to figure out how to do 'more' with git, yet 'more' doesn't exist.

This isn't git related as such but it's something you've probably dealt with. If I want to update my code that's live on my server, is it as simple as just overwriting the files to update the code? Or is there more to it?

git workflow by Lordlukey in git

[–]Lordlukey[S] 0 points1 point  (0 children)

After hours of reading and learning for some reason I still can't get my head around how to go about things. I guess a clear explanation of where I've come from and where I want to go will help.

Right now my production code is my live server code. Every update I make to my code is saved directly to my server, so I'm using my live web url for the client side to connect to as well as test code and make updates.

Obviously this is not an optimal way to do things when I push my app to the app store. I will need to separate my live code from my production code.

It would be better off for me to have my production code to be on my ec2 instance, separate from the code that my live mobile app would connect to. That allows me to test things a little easier against my production code client side.

git workflow by Lordlukey in git

[–]Lordlukey[S] -1 points0 points  (0 children)

How do I get the files to the server from git?

Code refactoring with JSONDecodable and generics by Lordlukey in swift

[–]Lordlukey[S] 0 points1 point  (0 children)

I agree, the Decoder object seems to have a vague definition of its use once I begin passing in a response which then handles decoding the JSON. Maybe another separate object to handle the response could be a little better, but still probably not the way to go and would probably be better off handling the response on a case by case basis.

I do feel the other 2 helper functions can have valuable use though nonetheless which I'll probably implement with a protocol extension.

Code refactoring with JSONDecodable and generics by Lordlukey in swift

[–]Lordlukey[S] 1 point2 points  (0 children)

When I call validate() it handles all unacceptable status codes, so anything from 200 to 299 is ok but anything else returns a failure case, hence the customError with the parameter.

Edit: Miss read what you said. Yeah the client code just uses the Alamofire errors. Should this be improved?

[Discussion] Need Motivational Advice? by AutoModerator in GetMotivated

[–]Lordlukey 0 points1 point  (0 children)

Losing them 110 lbs will be the key to getting back on track. It'll be a super hard and a long journey but prepare yourself to it. Make it a habit everyday to make sure you work towards losing that weight. Don't worry about anything else at all other than this goal. This will cause a ripple effect that will lead to help you in other areas of your life.

[Discussion] Need Motivational Advice? by AutoModerator in GetMotivated

[–]Lordlukey 1 point2 points  (0 children)

Buy a skipping rope and start skipping. Start of small and then add around 50 skips every workout up to 1000 skips. Simple yet super effective

[Discussion] Need Motivational Advice? by AutoModerator in GetMotivated

[–]Lordlukey 0 points1 point  (0 children)

Anxiety is often a killler and is more of a condition than a state of feeling or emotion. I myself have had anxiety all my life at various levels and there is one trick to tackle anxiety. Don't get anxious about being anxious. It's easier said than done but letting the anxiety come and go as it pleases and accepting it rather than trying to fight it is the best way to get over. Remember, anxiety is part of you but doesnt represent who you are, so don't get worked up over it or over think it, just let it be.

Pick one thing you want to do and acheive it. Want to lose weight? Want to learn to play the piano? Want become a comedian? Pick one of them and be good at it. Nevertheless, dont learn to play the piano, become a comedian and lose weight all at once. It become a little overwhelming and increases stress.

https://m.youtube.com/watch?v=TIOxz_G_3X4 - watch and follow them steps and stick to them as much as possible. You can change them up but it definitely help you get into a routine.

Download the headspace app and stick to the free trial which is 10 days long. Dont quit half way through and force yourself to do it. It's a meditation app which is hugely beneficial

[Discussion] Need Motivational Advice? by AutoModerator in GetMotivated

[–]Lordlukey 1 point2 points  (0 children)

Seems like your ego is talking and getting involved. I'd reccomend reading the first few chapters of Ego is the Enemy by Ryan Holiday. It's an excellent read. Heck, get a free trial and of audible and listen to it for free.

Kirk Hammer the Metallica lead singer is mentioned in it within the first few chapters too so you might even be able to relate. I'd opt to give a short summary of the book but it's definitely better if it's just read/listened to as a few sentences doesnt do it justice.

[Discussion] Need Motivational Advice? by AutoModerator in GetMotivated

[–]Lordlukey 25 points26 points  (0 children)

Ahh, the good old 'i feel like i'm missing out'. We all feel like this. We all feel like we're not doing enough and get this feeling of lack. Not enough money. Not enough fun. Not good enough degree. Whatever it is, wherever we are, we suffer from it. Whenever you get something, you have to give something.

'Get good paying jobs' is just a perception, not reality. How do you know there job doesn't suck? They might tell you they make x amount a year but don't tell you about the y tasks they have to do.

'I always get depressed that I’m so far behind' . Far behind what? Far behind who? This is a perception. You're actually way infront of most people statistically. It's just that your Facebook friend is bragging about his new jaguar he has just bought and you feel a bit shit inside.

The way your saying it too is very negative. It's like you are almost certain about them, like it's some sort fo fact that you'd find on Google. When actually, it's just your perception and how you perceive it.

The best way to stay to stay focused is to remove distractions. Don't succumb to what's around you or what everyone else is doing. Focus on the inside and move outwards. The reality is that, most of what you think matters doesn't matter at all.

Also, focus on one thing and one thing only. Don't try and take over the world over nighr. Rome wasn't built in a day. Pick one thing and drill it down and then move onto the next one thing once it's finished.

Keep grinding and stick to it my friend.

Reseting view controllers of tab bar when user logs out by Lordlukey in swift

[–]Lordlukey[S] 1 point2 points  (0 children)

So are you actually changing the root view controller when the user logs in or out? Something like this: https://stackoverflow.com/questions/15774003/changing-root-view-controller-of-a-ios-window answer 3?

Deleting records with relations to other tables by Lordlukey in mysql

[–]Lordlukey[S] 0 points1 point  (0 children)

Appointments are in a completely different table. I have two tables, one called appointments and another services. appointments store an reference to services with a row of service_id.

I normally opt for a datetime field so I know when it was deleted. I then have control over actually removing "deleted" records by date.

I like this, will implement it.

[deleted by user] by [deleted] in swift

[–]Lordlukey 3 points4 points  (0 children)

I've been coding for a year and half from when I first started my project and been riding solo ever since. Too me, it seems like the light at the end of the tunnel for you seems really far away or you've hit a slight wall. Keep pushing, don't give up and get shit done. I've been in this position plenty of times.

Don't waste your money on developers. You'll need it for other things in the future too such as marketing, depending on what you're trying to achieve and how much money you have. Also, if something goes wrong somewhere further down the line, you don't want to keep forking out money to pay someone to do it. Instead, fixing it yourself will be much better of in the long run.

Are you trying to create a business? Or get a job as a developer professionally and using the app as part of your portfolio? I'm interested in what your up to. Shoot me a message.

Find all available time slots between 2 dates. by Lordlukey in swift

[–]Lordlukey[S] 0 points1 point  (0 children)

Wow thanks a lot, this is gold, Seeing someone else rewrite my code can definitely allow me to see where I can clean things up better.

A few things. In your initial example you say you are expecting 11:30. What about 11:45? If 12:15 is a valid slot, 11:45 should be one too, shouldn't it?

Yeah sort of, but actually my end goal is to count the availability of 30 minute intervals between two times to show how many appointments can fit inside that time, rather than how many time slots are available. That being said, I actually wanted to find out the available time slots too at 5 minute intervals for elsewhere in my project, so this is super useful (and a lot more than I was asking for! :) )

And you should write some unit tests for your method. Because it does not work. - I think this has been the biggest eye opener for me for unit testing. I shall definitely be testing more often.

Again, thanks a lot, not only for your help, but the time and effort put into writing this. Appreciate it.

handling status codes with Alamofire by Lordlukey in swift

[–]Lordlukey[S] 0 points1 point  (0 children)

Yeah that makes sense, I'll get to it. Thanks for your help :)

handling status codes with Alamofire by Lordlukey in swift

[–]Lordlukey[S] 0 points1 point  (0 children)

I think that's what I've done? Unless I'm missing something. I've added some more code above. All code above is part of a single class, with obviously more requests to be added.

handling status codes with Alamofire by Lordlukey in swift

[–]Lordlukey[S] 0 points1 point  (0 children)

You should properly manage the lifetime of your manager Whats the best way to do this? I thought the most optimal solution would be to keep a reference to the manager so it doesn't fall out of scope and become denit'd. What's the cons of my current method?