@pixel@social.pixels.pizza
@pixel@social.pixels.pizza avatar

pixel

@pixel@social.pixels.pizza

This profile is from a federated server and may be incomplete. Browse more on the original instance.

pixel, to mentalhealth
@pixel@social.pixels.pizza avatar

Swift debugging driving me nuts.

I have a multiline file that I’ve loaded into a string using String(contentsOfFile:encoding:)

I'm trying to split the string using “someString.components(separatedBy: "==========\n“)

But it... just doesn’t. I know that particular string does exist in the file multiple times.

If I change the separator to just a linefeed it does split the file into 1600 items just fine. So for some reason it's not finding the "==========\n“ ?

I'm stumped.

pixel,
@pixel@social.pixels.pizza avatar

@GeekAndDad Nope! tried that too.

pixel,
@pixel@social.pixels.pizza avatar

@GeekAndDad it's definitely the same character - I thought the same thing so I copied it straight from the file. There's no other invisible characters (turned on invisible chars in BBEdit).

Can't escape it like that, compiler yells (as it should)

its so weird.

fun new clue: changing the separator to just “=" crashes with the error "Swift/ContiguousArrayBuffer.swift:600: Fatal error: Index out of range”

Also, this is Swift running as a command line script (i.e. with hash bang on first line)

pixel,
@pixel@social.pixels.pizza avatar

@GeekAndDad .utf8

interesting thought.

pixel,
@pixel@social.pixels.pizza avatar

@GeekAndDad ok, that's not it. tried a few others and they didn't work. opened in BBEdit and resaved as UTF8 just to make sure that's what it is, and still get the error. WEIRD.

pixel,
@pixel@social.pixels.pizza avatar

@GeekAndDad LOL ok, that was a good idea.

it's /r/n. I guess BBEdit shows the same character for /r/n and just /n EXCEPT if I do ""=\r\n" it crashes with the "Swift/ContiguousArrayBuffer.swift:600: Fatal error: Index out of range” error

pixel,
@pixel@social.pixels.pizza avatar

@krzyzanowskim yeah, I copied it straight from the file.

pixel,
@pixel@social.pixels.pizza avatar

@krzyzanowskim yup. just tried that

pixel,
@pixel@social.pixels.pizza avatar
pixel,
@pixel@social.pixels.pizza avatar

@GeekAndDad the definition for it is "func components<T>(separatedBy separator: T) -> [String] where T : StringProtocol”

textfiles, to random
@textfiles@digipres.club avatar
pixel,
@pixel@social.pixels.pizza avatar

@textfiles They're not even really trying anymore.

pixel, to apple
@pixel@social.pixels.pizza avatar

The story of how the graphing calculator application made it onto the Mac.


http://www.pacifict.com/Story/

StillIRise1963, to random
@StillIRise1963@mastodon.world avatar

Bathrooms should be divided into assholes and not assholes.

pixel,
@pixel@social.pixels.pizza avatar

@StillIRise1963 but we all have those. lol

pixel, to random
@pixel@social.pixels.pizza avatar

This theraflu needs to work faster. I need to breathe.

tubetime, to random
@tubetime@mastodon.social avatar

another silicon valley electronics flea market thread!

pixel,
@pixel@social.pixels.pizza avatar

@tubetime That might be the same electronics kit I had as a kid

fahrni, to random
@fahrni@curmudgeon.cafe avatar

I’ve been seeing a little critter run around our yard over the last few days. I think it’s a vole?

pixel,
@pixel@social.pixels.pizza avatar

@fahrni Yup looks like a vole! I love those ears.

dyani, to pixelart
@dyani@social.coop avatar
pixel,
@pixel@social.pixels.pizza avatar

@dyani did you glue the little guy on him or did you just come across it. either way i love it

pixel,
@pixel@social.pixels.pizza avatar

@dyani amazing. i need a bag of little people now. cornstarch was a good idea!

pixel,
@pixel@social.pixels.pizza avatar

@dyani just ordered some 1:100 scale ones. this will be fun.

brianvastag, to Hawaii
@brianvastag@sciencemastodon.com avatar

Count the turtles (my friend got up to 57 before deciding it was impossible because they're on top of each other and moving around).

pixel,
@pixel@social.pixels.pizza avatar

@brianvastag Ho’okipa!

pixel,
@pixel@social.pixels.pizza avatar

@brianvastag totally! one of my favorite places. here’s a couple of my fav photos.

image/jpeg
image/jpeg

schwa, to random
@schwa@mastodon.social avatar

Always current with the latest fads… i played around with tilt-shift a little last weekend.

pixel,
@pixel@social.pixels.pizza avatar

@schwa oh what. I need that.

pixel,
@pixel@social.pixels.pizza avatar

Oh and it’s reasonably priced!

pixel,
@pixel@social.pixels.pizza avatar

Omg it’s f1.4?! And half the price of the canon 50mm 1.4.

pixel,
@pixel@social.pixels.pizza avatar

@schwa ahhh ok. Still want one.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • provamag3
  • thenastyranch
  • magazineikmin
  • InstantRegret
  • cisconetworking
  • cubers
  • Youngstown
  • vwfavf
  • slotface
  • Durango
  • rosin
  • everett
  • kavyap
  • DreamBathrooms
  • megavids
  • mdbf
  • khanakhh
  • Leos
  • modclub
  • ethstaker
  • osvaldo12
  • GTA5RPClips
  • ngwrru68w68
  • normalnudes
  • anitta
  • tacticalgear
  • tester
  • JUstTest
  • All magazines