Showing posts with label apple. Show all posts
Showing posts with label apple. Show all posts

Tutorial: Run Swift on Windows 10 the Easy Way (Using Linux Subsystem)

Posted: Wednesday, 7 September 2016

Running Apple's Swift programming language on Windows 10 is as simple as 1, 2 and 3.
  1. Setup the Linux Subsystem for Windows 10 Anniversary Edition
  2. Run sudo apt-get install build-essential (and optionally sudo apt-get install clang)
  3. Download, and Run swift!
  4. Note: for each of these links you can click or scroll down for more
Alternatively, the video below demonstrates the steps in motion...
https://www.youtube.com/embed/Z0PZc7WqPtE


And that's it.

Just note that both technologies are unstable as of September 2016
  • Swift is a fairly immature programming language
    • Due to the absence tools like a beautifier - though third-party tools such as Haaakon's SwiftFormat https://github.com/haaakon/SwiftFormat does the trick
    • Due to missing tangible desires such as bug reports & support from fellow Windows users of Swift (of which there is none)
    • And with breaking changes each major version of Swift (which might be why the Swift 1.0 code you found won't work on Swift 2.2 or even Swift 3.0 beta).
  • And the Windows Subsystem for Linux (WSL) is still in beta, with normally trivial tasks, such as interacting with the subsystem programmatically, almost impossible: https://github.com/Microsoft/BashOnWindows/issues/


Setting up WSL

To set up the Windows subsystem for Linux, an official guide can be followed here: https://msdn.microsoft.com/en-us/commandline/wsl/install_guide
Here's a summary:
  • Start Menu -> Search "Turn Windows features on or off"
  • Scroll Down to "Windows Subsystem for Linux (Beta)", and click the checkbox
  • Restart your computer, it should display a screen along the lines of "Configuring Windows", similar to a Windows Update
  • Once your computer has restarted, launch a normal Windows Command Prompt: Start Menu -> Search "Command Prompt" (or alternatively, cmd)
  • Type the command "bash", and press enter
  • Accept the T&C (or not, skipping this section and booting into Ubuntu is effectively the same)
  • Wait for the ~200MB Ubuntu Subsystem Image to Download, Extract and Install

And that's it! A mini non-Linux environment within Windows. Similar to how OS X does it, only 10 years behind.

Takes around 30 minutes.

Those Linux commands


With how administrative/root privileges work in WSL, you don't need "su/sudo" to run what are normally root commands (if you've skipped setting up the root user).
apt-get install build-essential should work on its own.
The build-essential package is required to run Swift. Without it, Swift would just fail in executing scripts. Unfortunately, this is quite a large package on Ubuntu, and even on Windows its no exception.
So run the command and wait it out, a tip to speed up the process of downloading packages is shown in the video.
Running apt-get install clang allows for Swift code compilation support in Windows via swiftc (swiftc with build-essentials alone does not work). Interestingly the resulting binary that swiftc compiles is a native Linux/Ubuntu ELF instead of a Windows exe.

Takes around 30 minutes.

Swift

Download Swift from here: https://swift.org/download/, note that you'd want the Ubuntu 14.04 version, if still offered.
Extract the archive just like you would on Ubuntu (or extract it using the Windows method, whichever you prefer), and run /usr/bin/swift through bash.

Takes around 10 minutes.


And that's it! Swift (the programming language) running on Windows 10 using the Windows Subsystem for Linux!

Although REPL doesn't really work, and you're not exactly working with native Windows goodness.




iOS 9 Feature Rip-Offs

Posted: Saturday, 13 June 2015

If you've watched the Apple WWDC Keynote for 2015, then you'll notice some of the new features that Apple introduced for iOS 9. If you're also a Windows Phone user, then you'll notice some blatantly obvious ripped-off features from WP8.1 in iOS 9.

So let's start.

The Notes App Rip-Offs

Link to the Notes section in the keynote
The iOS 9 notes app is mimicking the Windows Phone "OneNote" app as much as possible. But that's just an opinion - the recently introduced features reinforces this, but what's the point of complaining. Here's some actual content.

2013 Apple Event Countdown (iPhone 5S, 5C reveal)

Posted: Wednesday, 11 September 2013

Apple is expected to announce the launch of a new generation of it's flagship product, the iPhone - speculated to be called the "iPhone 5S", it is said to contain features and specs which matches those of a Samsung Galaxy S4, once again an attempt by Apple to strengthen Apple's position in a mobile market in which a new era of Android devices now dominates.
Furthermore, it is rumoured that an iPhone 5C would be released alongside the iPhone 5S, namely as either a "Cheaper" alternative to the standard iPhone or as one specifically designed for use in China - an emerging market for mass-produced smartphones.

Long-time iOS user burn

Posted: Saturday, 4 May 2013

As an Apple user for more then 4 years, I have seen Apple's exceptionally good products suddenly burn and die once a new device comes out. Sure they could optimize and fix bugs on new updates, but every update that you apply to your iPhone, iPod touch, or iPad lags it. I have a second generation iPod touch like many other early adopters of the touch-screen technology (and touch screen apple devices) and it was revolutionary and could run silky smooth, doing what I wanted it to do without any lag. Then the updates kept rolling month after month, until the iPhone 4 was announced, and iOS 4 was released.. Since then, it takes around half a minute to open the music app, longer to read emails and minutes to browser the web on Safari. Turning off spotlight helped with the lag dramatically, but until this day, iOS
4.2.1 is what my iPod touch has been stuck at, and performance isn't perfect (at all).. What Apple did to the device was to cripple the hardware through the software updates, and as an iPhone user, I feel burned and disappointed by Apple for not providing a product that can last.

Tl;dr: I'm disappointed at Apple, they killed a perfectly good iPod touch off

Campus Life Hack [no jailbreak required]

Posted: Wednesday, 16 January 2013

This post was intended to showcase the flaw for a short period of time (while it was still exploitable) and no-longer works on newer Campus Life versions

Yesterday, I received a very unwelcoming message on Game Center.

About computers, in general

Posted: Saturday, 12 January 2013

Doing some very basic hacking.. It looks like iOS6 doesn't allow modificationx to the file directories of actual apps, else I would be releasing some mad hack for iOS [that I created while I was still on iOS5]. However, I still have my Second Gen iPod Touch to save my arse, still being stuck on iOS 4.2.1 has it's perks.

How to delete photos off an iPhone with Windows 7/8

Posted: Tuesday, 8 January 2013

If you own an iPhone or pretty much any iDevice and ever had a need to clear out the Photo Roll (also known as the "Photo App"), you might find that you're unable to delete everything off the phone at once though Apple's inbuilt app.

This is because you cannot directly delete folders, such as the "Camera Roll" fold off an iPhone, instead doing so individually.

To delete photos off an iPhone however, you first plug the device into a computer and delete photos in batch.

Which are the following steps:

  1. Visit "My Computer"/"This PC".
  2. Select the device of which you want to delete files from.
  3. Navigate to the hard drive directory called "Internal Storage".
  4. Navigate to the folder called "DCIM".
  5. And there will be a collection of folders of which you would have to perform the step below in each and every one of them:
    • Press Control+A to select all the images from each of the folder and press the "Delete" key in order to delete them.

There is considerable benefit to using the baked-in method of deleting files of the iDevice as opposed to an external solution, as instead of having to rely on external software or software downloads alongside the hassle of spending money on spammy software, all the functionality that you require in order to delete photos are there on your computer already.

This technique works with the iPhone 3G, iPhone 3GS, iPhone 4, iPhone 4S, iPhone 5, iPhone 5S, iPhone 5C, iPhone 6, iPhone 6 Plus.

And also with the iPod Touch 2nd Generation, iPod Touch 4th Generation, iPod Touch 5th Generation

Alongside the Original iPad, iPad 2, iPad 3, The New iPad, The iPad Air, and the iPad Air 2.

Oh. And it's more obvious in Mac OS X: