Jump to content

Umberto

Member
  • Posts

    93
  • Joined

  • Last visited

Posts posted by Umberto

  1. 43 minutes ago, DrMacintosh said:

    Yeah, shortcuts would work after taking a bunch of photos and batch rename them after the fact. That not what I'm looking for. The photos names would have to start at IMG_0001 with no conversions or renames needed after the photo was taken.

    You can create a shortcut that takes a photo, adds a "IMG_0001" text overlay and then saves the photo to the files app as IMG_0001.heic

    You can add a loop that increments a variable for sequential naming. 

  2. 3 hours ago, Donut417 said:

    Nope. I’m set as adult. It’s a known issue and heavily documented. In Apples eyes it’s working as intended. 

    Oh, it's "Family purchases and payments" that is the culprit. If your sister disables that you will still be able to share subscriptions from apps that offers family sharing (all Apple services do), but purchases will be billed to each separate apple id. 

  3. On 3/12/2022 at 2:24 AM, Donut417 said:

    The only negatives I have about Apple's ecosystem has to deal with their family grouping. So if you and members of your family all have iPhones or Apple devices you can create a family. This allows you to share cloud storage and other apple services. For example my sister has Apple TV+ and because Im part of the family so do I. The issue is I periodically have to put the CVC code from my sisters credit card in, in order to make purchases via the App Store. Even if Im using my own card or have gift card balance. 

    The cause for this is likely due to your apple id in the family sharing group is setup as a "child" account. 

  4. 22 minutes ago, 38034580 said:

    I can't display a colon with SevenSegmentDigits, so I need separate min and sec displays. Also, the mainminuteLabel and mainSecondLabel are for the seperate shot clock screen.

    Look up f-strings

     

    What I mean is instead of doing this:

    if scoreboard.seconds<10 and scoreboard.minutes>0:
        if scoreboard.minutes<10:
            minuteLabel.set_value(str(scoreboard.minutes))
            secondLabel.set_value('0'+str(scoreboard.seconds))
            clockLabel.config(text='  '+str(scoreboard.minutes)+':0'+str(scoreboard.seconds))
            mainminuteLabel.set_value(str(scoreboard.minutes))
            mainsecondLabel.set_value('0'+str(scoreboard.seconds))
        else:
            minuteLabel.set_value(str(scoreboard.minutes))
            secondLabel.set_value('0'+str(scoreboard.seconds))
            clockLabel.config(text=str(scoreboard.minutes)+':0'+str(scoreboard.seconds))
            mainminuteLabel.set_value(str(scoreboard.minutes))
            mainsecondLabel.set_value('0'+str(scoreboard.seconds))
    elif scoreboard.minutes==0:
        if scoreboard.seconds<10:
            minuteLabel.set_value('0'+str(scoreboard.seconds))
            secondLabel.set_value(str(scoreboard.tenths))
            clockLabel.config(text='0'+str(scoreboard.seconds)+'.'+str(scoreboard.tenths)+'  ')
            mainminuteLabel.set_value('0'+str(scoreboard.seconds))
            mainsecondLabel.set_value(str(scoreboard.tenths))
        else:
            minuteLabel.set_value(str(scoreboard.seconds))
            secondLabel.set_value(str(scoreboard.tenths))
            clockLabel.config(text=str(scoreboard.seconds)+'.'+str(scoreboard.tenths)+'  ')
            mainminuteLabel.set_value('0'+str(scoreboard.seconds))
            mainsecondLabel.set_value(str(scoreboard.tenths))
    else:
        if scoreboard.minutes<10:
            minuteLabel.set_value(str(scoreboard.minutes))
            secondLabel.set_value(str(scoreboard.seconds))
            clockLabel.config(text='  '+str(scoreboard.minutes)+':'+str(scoreboard.seconds))
            mainminuteLabel.set_value(str(scoreboard.minutes))
            mainsecondLabel.set_value(str(scoreboard.seconds))
        else:
            minuteLabel.set_value(str(scoreboard.minutes))
            secondLabel.set_value(str(scoreboard.seconds))
            clockLabel.config(text=str(scoreboard.minutes)+':'+str(scoreboard.seconds))
            mainminuteLabel.set_value(str(scoreboard.minutes))
            mainsecondLabel.set_value(str(scoreboard.seconds))

    Where each set_value method is duplicated 6 times, you can remove all of that using f-strings and calling each method once.

    For minuteLabel it would look like this:

    minuteLabel.set_value(f'{scoreboard.seconds:02d}' if scoreboard.minutes==0 else str(scoreboard.minutes))

     

    Edit: This would reduce 39 lines of code down to just 5. 

  5. Obvious duplicate code is :

    minuteLabel.set_value(str(...))
    secondLabel.set_value(str(...))
    clockLabel.config(text=str(...))
    mainminuteLabel.set_value(str(...))
    mainsecondLabel.set_value(str(...))

    That you call 6 times.

     

     

    Use f-strings:

    f'{scoreboard.seconds:02d}'

    returns the desired formatted string

  6. 18 hours ago, MrMitty said:

    The 16GB M1 Air is US$ 1350 and the 16GB M1 13" MBP (not the new 14 inch M1 Pro/Max) is US$ 1600. I have a $250 trade-in for an older Mac so my net price would be $1150 for the Air and $1400 for the MBP. 

     

    From my research, the MBP has better speakers, camera, slightly brighter screen and a 2 hour longer battery life. 

     

    This machine will not be used for coding / video editing / gaming. It will be used for productivity work and entertainment. I like to have lots of Chrome tabs open where I watch YouTube videos and Netflix. When I say lots of tabs, I mean like 40 with maybe 15-20 being videos in YouTube. So, my understanding is that 16GB of RAM and the 8-Core GPU should be sufficient, right? 

     

    Which machine is best for me? Will the Air be fine for streaming even though it doesn't have a fan? That and the brighter screen are the only two reasons why I'm thinking about the Pro. 

    There's very little difference in performance between the Air and the Pro so that shouldn't be a factor. It's the other factors that you should consider (brighter screen, bigger trackpad, touchbar etc). I went from a 13" Intel Pro to an M1 Air because I couldn't justify the higher price tag for the pro and I don't regret my decision. It doesn't get hot.

  7. On 10/19/2021 at 9:35 PM, Alexander Pushkin said:

    Starting to dig into Swift... it sucks. https://forums.macrumors.com/threads/starting-to-dig-into-swift-it-sucks.1934555/

    Swift SUCKS https://devrant.com/rants/1044530/swift-sucks-why-because-of-its-absolutely-useless-complexity-a-total-simple-thin

    Four Years On, Developers Ponder The Real Purpose of Apple's Swift Programming Language https://apple.slashdot.org/story/18/06/11/1438259/four-years-on-developers-ponder-the-real-purpose-of-apples-swift-programming-language

    Swift is a Bit of a Mess https://kakubei.github.io/2014/11/15/swift-is-a-mess/

    iOS Development: Why XCode Sucks [Swift 2021] https://www.youtube.com/watch?v=kW7KkoR1ZcU

    😂 

  8. On 6/8/2021 at 9:49 PM, Flannelist said:

    Here's my biggest gripe about Photos. Because of the nature of it, the entire photo library is 1 file. 1 ginormous file. It's great if you don't ever need to access the files on anything other than a mac. it preserves your albums and can sync across multiple devices, blah blah blah. But what if you want to switch to a different platform. Or use that photo in another program on your mac. You need to export it. And if you need to export a lot, or perhaps your whole photos library because you're ditching mac altogether, It's an ever loving pain. And if your photo library gets corrupted somehow, and can't be repaired or isn't backed up anywhere, or the backup is also corrupted. Well. then. You're out your entire photo library.

    It's not a file; it's a folder. Right click on your library and select "Show Package Content", et voilà. 

  9. To clarify, the feature-richness of iOS/iPadOS I talk about are not features like "window-snapping" but specifically security and reliability features. System features. It's not something a regular user would notice or care about, but they are important and they do affect the user experience.

     

    Talking about macOS specifically, the last generational leap from Classic Mac OS to Mac OS X gave us, as I mentioned earlier, protected memory and preemptive multitasking.

     

    Protected memory is not a feature like "window-snapping", but it's very important nonetheless. Without protected memory, a process can access other processes' memory, which obviously isn't very secure. It could potentially corrupt memory belonging to other processes, which would cause crashes which obviously affects the reliability of a system. However, while having protected memory is more restrictive, more locked down, having it also makes for a more secure and reliable system. It's a feature. The next generational leap from Mac OS X to iPhoneOS (that became iOS and iPadOS) puts even more restrictions on apps. Not only are they restricted to what memory they can access, they are also restricted to which files they can access thanks to the strictly enforced sandboxing on iOS. Just like before we had protected memory and no restrictions on memory access, the desktop app has few restrictions on file acees and can read other apps' files, which isn't very secure, and potentially corrupt them, which isn't very reliable. Some apps use files for inter-process communication which can cause race conditions and all sorts of problems, just like some apps before protected memory would pass pointers between them for the same purpose. Sandboxing is more restrictive, just like protected memory, but it also makes the system more reliable and more secure. It's a feature. 

     

    On Classic Mac OS, preemptive multitasking didn't really exist and a process could greedily hog all system resources and prevent other processes from doing work. With Mac OS X and preemptive multitasking, the system decides how resources are shared between processes. This is more restrictive, more locked down, but it also increases reliability. It's a feature. The next iteration on this idea is present in iOS. The app lifecycle in iOS can be simplified in the following states: Foreground -> Background -> Suspended. When an app is in the foreground it has "full" access to system resources but once you hit the home button or switch to a different app, the first app will enter a background state. In the background state the app has limited time to finish up whatever it was doing and unless it explicitly calls any of the provided background APIs (like audio playback, location service etc) the app will be suspended and the system can reclaim it's resources at any time. So the game you opened on your iPhone last week that you still can see in the app switcher, is not running or doing anything, but on the mac the app would just continue to run for a week unless I quit it and if after a week the app hits a bug that makes it use 100% cpu it will ramp up my fans and drain my battery. This scenario is obviously worse in terms of reliability. Restrictive management of app states is a feature, a reliability feature, just not a "window-snapping" feature. 

     

    9 hours ago, SenKa said:

    ?? The only feature im aware of that isnt in macOS that is present is window snapping, which is a necessity... They added features on top of *iOS* to make iPadOS

    And they added features on top of macOS to make iOS. That's my point. iOS is macOS with new added things to replace the old (cocoa touch instead of cocoa), removal of old legacy stuff (like carbon) and new security and reliability features. 

     

    9 hours ago, SenKa said:

    This isnt special to iPad OS whatsoever,  even within apples ecosystem.

    iOS launched in 2007 with all these features already in place, and slowly over time they have added new capabilities and new APIs without breaking the security model. The model never changed. It is special to iOS/iPadOS, macOS has been playing catch up ever since and slowly added features like sandboxing, notarization, file access restrictions etc but the fundamental model is different. The mac might get there at some point though but there is a big challenge to migrate the mac app ecosystem to this new model. It might be easier to replace it with apps from the iOS ecosystem (which could be one explanation for mac catalyst). 

     

    9 hours ago, SenKa said:

    iPad OS is not a desktop operating system whatsoever, stop calling it one and stop comparing it to one.

     

    I have never called it a desktop operating. Desktop doesn't mean better necessarily, it just means old. 

     

    9 hours ago, SenKa said:

    Contradicts the point above. You started that it is more feature rich and advanced than macOS, but there are things you cant do on an iPad that you can on macOS???

    Also, what features are you missing out on that arent requisite of a tablet (rear facing cameras)? Actually curious

    The underlying technologies are more feature rich, yes. The security model is clearly the future as evident by the fact that the mac is slowly implementing similar features. I need xcode and it doesn't exist for the iPad. That doesn't mean that it can't exist without breaking the security model, it just doesn't yet. The features I'm missing out on on the mac are the security and reliability features that I mentioned. 

     

    10 hours ago, SenKa said:

    Proper handling of background app management, on apples mobile devices it will simply shut down an app in the background if you are near RAM capacity. This is especially annoying with youtube where you will just lose whatever video you were on.

    That's not how it works. There are APIs for persistent state preservation so that's an app-problem, not a system problem. 

  10. 2 minutes ago, Koitsu said:

    This is probably the worst take I've ever heard about the ipad pro. You are absolutely nuts if you think ipados is anywhere near usable as a main operating system. It can't do 10% of what macos can. Even if you were the absolute casualist of all the casual users, as in you only use it for emails, browsing social media and watching youtube, it is STILL way worse than macos.

     

    I cannot stress enough how much this is just simply not the case. There is MAYBE the argument to be had that macos is "good enough" for general computing, but there is no chance it is 'more feature rich and more advanced'--that is absolutely laughable.

    You missed my point completely. 

  11. 1 hour ago, Koitsu said:

    ...

    it's not and will never be a laptop replacement, not unless they put full macos on it.

    ...

    The ipad pro is like $1400 fuckin dollars, you can get a lot of laptop for that, and a real operating system.

    I see this opinion a lot that iOS/iPadOS is not a "real" operating system and that it's just a stripped down version of macOS. But the reality is actually the opposite: Apple hasn't removed features from macOS to make iPadOS -- they have added features on top of macOS to make iPadOS. Just like the last generation of operating systems created "restrictions" like memory protection and preemptive multitasking, this new generation of operating systems expanded on those ideas with sandboxing and more restrictions on running processes' access to system resources. It's a further improvement on the same ideas. It's extra work. More code. 

     

    So, iPadOS is not a lesser "toy" system but a more feature rich and more advanced system than its predecessor macOS. It's just not features in the same sense that youtube tech reviewers think. However, if users feel that they are too restricted on an iPad then obviously the available APIs are not enough and need improvement. And as a heavy macOS user I look to the iPad with envy of the features that I'm missing out on. But! Next generation or not, there are things I just can't do on an iPad so I'll just have to wait. 

  12. On 4/10/2020 at 10:16 PM, Twilight said:

    I often have more than 10 tabs open, sometimes more than 20 in Safari, and other than getting some messages of pages reloading because I only have 8gb of ram, my 2017 dual-core MacBook Pro feels fluid still, desktop animations look smooth, and it's in general not a bad experience. 

     

    I have the same model as you except 16gb of ram and currently Im running:

    20 tabs in 5 windows in safari

    3 tabs in chrome

    3 projects in xcode + 1 simulator

    octave-cli

    slack

    2 pdfs in preview

    13 files in sublime

    (18 days uptime)

     

    And this is pretty much what's running on my macbook at any given time, except I don't always have chrome running and usually I have like twice as many safari tabs opened. I can't say I feel held back by my measly dual-core cpu (I wasn't even sure what cpu I had to be honest, I had to check before writing this post). I do incremental builds in xcode for the most part so performance there is not a problem but when I do a clean build it will take a while and the fans will go on full blast, but I can still watch youtube or whatever in the meantime. Very rarely do I have to do a clean build though. 

     

    Out of curiosity, I just did 2 clean builds of two projects that took about 10 minutes to complete in total and I didn't notice any difference from doing just 1 project, except that it took longer obviously. 

     

    Test number 2: Clean build of the same projects while also recording the screen. This took 18 minutes, most of which I spent playing a 12 minute youtube video and web browsing. Chrome was a lot more laggy than usual but safari worked pretty much like normal, spotlight took a lot longer than usual to show search results. No UI issues or anything like that. I also had all that other crap I mentioned above running while doing these tests. 

     

    Lessons learned: Use native apps, there is some software stuff going on here. Also, for certain workloads (like gaming) where timing is important, this isn't really helping you because if it takes 80% longer to render each of your frames you will have a pretty bad experience. But for most other workloads it doesn't affect the experience much, except that it takes longer to complete the task (~4 minutes for 1 project clean build, ~10 minutes for 2 projects clean build, ~18 minutes for 2 projects clean build + screen recording) while still leaving the rest of the system in a good usable state.

     

    Just looking at the core count and drawing conclusions seems like a very simplistic approach. 

  13. Any progress? Here's how you start.

     

    Open Xcode and go to file > new > project. Select iOS and "Single View App". Name your project and choose where to save it. 

     

    Xcode has now created the project for you with a bunch of different files, but the only one that really matters for now is ContentView which is the root view. Currently it looks like this:

     

    import SwiftUI
    
    struct ContentView: View {
        var body: some View {
            Text("Hello, World!")
        }
    }
    
    struct ContentView_Previews: PreviewProvider {
        static var previews: some View {
            ContentView()
        }
    }

    In the preview to the right of the screen, you'll see a preview of your app and it will display the text "Hello, World!". Unsurprisingly, its this line of code that produces that output: 

    Text("Hello, World!")

    Now then, change the code in ContentView.swift to this:

    import SwiftUI
    
    struct ContentView: View {
        @State var x = 10
        @State var y = 5
        @State var showAnswer = false
        var body: some View {
            VStack {
                Text("\(x) * \(y) = ?")
                HStack {
                    Button(showAnswer ? "Hide Answer" : "Show Answer", action: {
                        self.showAnswer.toggle()
                        
                    })
                    Button("Next Problem", action: {
                        self.x = Int.random(in: 1...12)
                        self.y = Int.random(in: 1...12)
                        self.showAnswer = false
                    })
                }
                
                if showAnswer {
                    Text("\(x * y)")
                }
            }
        }
    }
    
    struct ContentView_Previews: PreviewProvider {
        static var previews: some View {
            ContentView()
        }
    }

    Let's go through what the code does. 

     

    This creates three variables: x, y and showAnswer. x and y are integers with an initial value of 10 and 5, respectively, and showAnswer is a boolean set to false. Why we need "@State" in front of the variable declaration is not something you need to care about for now. 

    @State var x = 10
    @State var y = 5
    @State var showAnswer = false

     

    Just like "Hello, World!" displays that text, "\(x) * \(y) = ?" displays "10 * 5 = ?". \() is a way to escape the value of a variable and convert it to a string. If we didn't escape the values and only did "x * y = ?" we would display the text "x * y = ?" instead of the values of x and y. 

    Text("\(x) * \(y) = ?")

     

    There are two components to a button: what it does, and what it looks like. This button:

    Button(showAnswer ? "Hide Answer" : "Show Answer", action: { self.showAnswer.toggle() })

    Displays the text "Show Answer" when the variable showAnswer is false. if showAnswer is true, it will display the text "Hide Answer". The way it's written is called Ternary Conditional Operator and uses the format: question ? action if true : action if false. See the link. The next part of the button is its action which toggles the showAnswer variable.

     

    The next button:

    Button("Next Problem", action: {
    	self.x = Int.random(in: 1...12)
    	self.y = Int.random(in: 1...12)
    	self.showAnswer = false 
    })

     Displays the text "Next Problem" and performs the following actions: 

    • Sets the x variable to a random integer between the values 1 and 12
    • Sets the y variable to a random integer between the values 1 and 12
    • Sets the showAnswer variable to false

    This code calculates and displays the answer x * y, but only if the variable showAnswer is true

    if showAnswer {
    	Text("\(x * y)")
    }

    Lastly, VStack and HStack stands for Vertical Stack and Horizontal Stack, and arranges its content (child views) in a vertical line, and horizontal line, respectively. The view structure of our app is:

    VStack {
        Text()
        HStack{
            Button() Button()
        }
        Text()
    }

    Which means that we stack three views vertically: a Text, an HStack and then another Text. Within the HStack we place two buttons, and they will be placed side by side because they are in a horizontal stack. 

     

    Play around with the code and see what happens. Change the code to calculate the sum instead of the product. Change to code to calculate the product of two random integers between 1 and 10 instead of 1 and 12. And so on. You'll get the hang of it. 

×