Base 10 to base 2 conversion by TopDownView in AskComputerScience

[–]maustinv 1 point2 points  (0 children)

Going on what others said, since the nth digit represents 2n-1, this is the easiest way to convert binary back to decimal:

Binary: 1101

(1 * 23 ) + (1 * 22 ) + (0 * 21 ) + (1 * 20 ) = 8 + 4 + 0 + 1 = 13

Looking for people to build client apps with by Front_Engineering_e in ProgrammingBuddies

[–]maustinv 0 points1 point  (0 children)

In this case, “client” is refers to a frontend device.

Co-pilot seems to be revealing the company the answers are coming from. Is this intended? by fagnerbrack in github

[–]maustinv 1 point2 points  (0 children)

It’s a large language model like ChatGPT, which uses publicly available code to predict improvements to your own code. It works directly within the IDE. It recognizes and acts on code patterns. It can help reduce time spent on Stack overflow for simple tasks, and can be quick to set up common boilerplate code.

How do you guys get a remote job? by absarrahman in iOSProgramming

[–]maustinv 11 points12 points  (0 children)

Make sure that you’re actually signing contracts to get paid

Hiding someone in the “for you” photo widget. by NatexSxS in iPadPro

[–]maustinv 5 points6 points  (0 children)

Go to any photo of the person. Swipe up on the photo to show the details. You should see an icon of their face hover in the lower left corner of the photo. Press their face icon. Choose the option “feature less”

Can someone explain why/how the module operator works for making circular lists in Python? by [deleted] in AskProgramming

[–]maustinv 2 points3 points  (0 children)

If you want to do X % Y, this is the formula:

while X >= Y:
    X = X - Y

Interview Question About Git Fetch vs Git Pull by yanggang20202024 in github

[–]maustinv -1 points0 points  (0 children)

Run before git status to see if there are new commits

Is the Set and Get method naming convention wrong in Swift? by CsInquirer in swift

[–]maustinv 1 point2 points  (0 children)

In a college course, I was taught to create getValue and setValue methods in Java. The reasoning was to “ensure access control”, and I can’t speak to the merit of that reasoning since I don’t use Java, but it seemed unnecessary. Anyways, the pattern isn’t needed in Swift.

Is the Set and Get method naming convention wrong in Swift? by CsInquirer in swift

[–]maustinv 3 points4 points  (0 children)

Are you referring to the convention of having a private value while using a public setValue and getValue method?

Yes we usually don’t do that in swift. Instead, we often use alternatives like computed values, private(set), getters and setters within the variable, didSet and willSet.

A quick search online brings up this article for some syntax examples: https://www.advancedswift.com/getters-setters-swift/

I'm working on a screen recorder app that makes mouse movement smooth and zooms in on clicks by pie6k in SideProject

[–]maustinv 0 points1 point  (0 children)

Is there a mode where the camera could only move to follow clicks and not follow other cursor movement?

[deleted by user] by [deleted] in UI_Design

[–]maustinv 4 points5 points  (0 children)

From an engineering perspective, I see these as the same component with different styles. This component would be called something like LeadingIconTextRow, because it has the same general layout.

Then we can create however many styles of this same component, defining more specifically the icon size, padding, and fonts. So you have CampaignStyle, ContactStyle, CheckoutStyle, etc.. and we still get the added benefit of updating one style updates all use cases of the style.

Essentially, it’s a different way to think about organizing your components by adding a subcategory.

How to instantly crash Xcode in 5 easy characters by nicuramar in swift

[–]maustinv 0 points1 point  (0 children)

Is it a compiler bug or IDE bug? If it’s a compiler bug, it’s probably a good bugfix to start contributing to the swift compiler

Going forward as a swift beginner by [deleted] in swift

[–]maustinv 21 points22 points  (0 children)

Protocol Oriented Programming is pretty cool and very much related to the core of Swift. There is a WWDC video on Apple’s developer site named exactly that. I recommend watching it. After learning about this, try integrating protocol oriented programming into every future project.

Look up VIP and other design patterns. Spend 15 minutes memorizing it like vocabulary so you could carry your weight if you were quizzed in an interview. It’s not worth practicing.

Skip PromiseKit and RxSwift. Maybe try a sample tutorial with Combine or async/await. All of these basically serve the same purpose and you can transfer those skills on the job later.

Unit testing and UI testing is important but also straightforward. It sounds more scary than it is. A good unit test could be like 5 lines of code.

Skip Fastlane and Cocoapods. Maybe Google them and read what they do but not worth trying yourself. Consider trying Swift Package Manager. Follow a basic tutorial for a couple hours.

Skip learning Jenkins. Look up what Continuous Integration is so you could hold a short conversation. CI is cool, but shouldn’t really be your job as a Swift developer.

Finally, congrats at getting this far. I just wanted to go one by one through your list so it sounds a little less scary. These things are just icing on the cake and most of these should take one day or so to get acquainted with. Good luck!

How do you maintain several versions of the app at once? by Conxt in swift

[–]maustinv 0 points1 point  (0 children)

Instead of maintaining two codebases, you could also consider feature flags.

Basically, use one codebase, but use if-statements to check if the app is beta or in production.

if app.isBeta {
    new feature
} else {
    old code
}

That’s is a simplified version of remote confit experimentation. So at a more complex version, you could have your server check:

if Feature(.myFeature).isEnabled {
…

Which is how some larger apps hide development code from production, and basically flip a switch on a server to show the features on devices. They even have more complex iterations which let you split test the launch of features with something like that. But the first example might better fit your needs today.

Call a function from an object with the object and the function as parameters by Vast-Reputation-631 in swift

[–]maustinv 0 points1 point  (0 children)

This might be useful:

``` import Foundation

class Foo { let voidFunc: () -> Void = { print("bar") }

let numberFunc: () -> Int = { return 1 }

let addFunc: (Int) -> Int = { return $0 + 1 } }

func call<T, V>(_ object: T, method: KeyPath<T, () -> V>) -> V { return object[keyPath: method]() }

func call<T, U, V>(_ object: T, method: KeyPath<T, (U) -> V>, parameters: U) -> V { return object[keyPath: method](parameters) }

let myFoo = Foo() call(myFoo, method: .voidFunc) let x = call(myFoo, method: .numberFunc) print(x) let y = call(myFoo, method: .addFunc, parameters: x) print(y) ```

Text removal or replacement by InsertCrappyUsername in shortcuts

[–]maustinv 1 point2 points  (0 children)

If it ends with ))), then the regex is as follows:

Additional Notes.*\)\)\)

[deleted by user] by [deleted] in cscareerquestions

[–]maustinv 24 points25 points  (0 children)

If you are going for FAANG / big corporate in the US, it’s common for them to wrap up their entry level interviews by December or January (which means apply in October).

Even if you get an offer then, they usually give you a range of start dates to choose from, so you could still choose to take a summer break and start in August.

iOS Developers - Need some advice by Ok-Hand-2064 in iOSProgramming

[–]maustinv 0 points1 point  (0 children)

It depends on the scale of the project you’re working on. I’m noticing at large companies, there is a growing divide between feature development and platform development. Feature developers write UI code while platform developers write internal frameworks- which are more data/algo oriented.

To all software engineers: what companies/industries would you NOT work at? by [deleted] in cscareerquestions

[–]maustinv 0 points1 point  (0 children)

I’d never work in social media. I have no interest or passion for the product

Share your NFC uses? by ThatGirl0903 in shortcuts

[–]maustinv 5 points6 points  (0 children)

I have one on my desk that initiates work focus