Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Eric Marchand
@phimage
I failed to conform CollectionType and SequenceType to a new protocol RandomElementType { var random: Element } : "Extension of protocol ‘XXX' cannot have an inheritance clause"
Nikolai Vazquez
@nvzqz
You can't conform protocols to other protocols through extensions. You can extend with 'where Element : RandomElementType' or whatever you're trying to accomplish
Eric Marchand
@phimage
Just some idea
  • shuffle array, dico (using swap on random integer index)
  • random password ie. random string but with a limited set of charactere and a defined lenght, with or without symbol, number, uppercase or/and lowercase
  • Bounded/Limited Generator and Sequence ie. after X element returned, return nil to stop (we can create easily an Array of random element with specific size using the limited sequence)
  • (optional) random chuck norris fact
  • (optional) fusion the power of FileKit and RandomKit to get a random word or sentence from text file
Nikolai Vazquez
@nvzqz
That last one can simply be implemented with NSFileManager and/or NSString
Nikolai Vazquez
@nvzqz
Added shuffle() method and shuffled property to Array nvzqz/RandomKit@d381fe4
Eric Marchand
@phimage
Maybe to not confuse RandomType#random() and the random var in CollectionType & SequenceType;, this var could be renamed randomElement or randomItem or randomObject or like NSSet anyObject
Nikolai Vazquez
@nvzqz
randomElement would probably best because of the associated Element type
Nikolai Vazquez
@nvzqz
I just remembered why I went with random over randomElement. It follows the same convention as first and last. I don’t think it would cause confusion considering that its documented as returning a random value from the sequence/collection.
Nikolai Vazquez
@nvzqz
Any idea for a faster implementation for shuffling dictionary values?
Eric Marchand
@phimage
by faster you means less code or performance. Like you my first idea was to use zip
Nikolai Vazquez
@nvzqz
Performance is what I'm referring to
Nikolai Vazquez
@nvzqz
So the repo got a lot of stars and views today. Not sure why thats the case all of a sudden.
Eric Marchand
@phimage
Same problem, never discover why one of my framework receive many stars one week, no tweet, no blog found by google search. Maybe someone with many followers give a star
Nikolai Vazquez
@nvzqz
For FileKit I got a good number of stars from posting it on reddit but other times idk how
It's a good problem to have
Eric Marchand
@phimage
Id
I d'
I don't like to not understand
Nikolai Vazquez
@nvzqz
It also helps if you get enough stars to appear on Github.com/trending
Eric Marchand
@phimage
yes it could help to keep the flow of stars
did you use other way to advertise? than redit, swifttoolbox.io, awesome-swift
Nikolai Vazquez
@nvzqz
I wrote to two blogs suggesting they take a look at it and one of them did so that was nice
Eric Marchand
@phimage
I will use RandomKit to choose between a list of site to advertise
Nikolai Vazquez
@nvzqz
Ha ha that's pretty meta
Nikolai Vazquez
@nvzqz
do you think randomkit is ready for another release?
any other small features we can add beforehand?
Eric Marchand
@phimage
my idea box is empty