egg|nomz|egg changed the topic of #kspacademia to: https://gist.github.com/pdn4kd/164b9b85435d87afbec0c3a7e69d3e6d | Dogs are cats. Spiders are cat interferometers. | Космизм сегодня! | Document well, for tomorrow you may get mauled by a ネコバス. | <UmbralRaptor> egg|nomz|egg: generally if your eyes are dewing over, that's not the weather. | <ferram4> I shall beat my problems to death with an engineer.
egg|laptop|egg has quit [Ping timeout: 180 seconds]
awang has quit [Ping timeout: 207 seconds]
<Qboid>
0d 18h 0m 0s left to event #23: Falcon Heavy [at 2018-02-06 18:30:00]. Say '!kountdown 23' for details
awang has joined #kspacademia
<soundnfury>
that ABC paper is like a car crash. I couldn't stop reading it even as it horrified me
<bofh>
soundnfury: what, the Inter-Universal Teichmüller Theory one?
<hattivat>
no more ugly old books for $400 on ebay
<e_14159>
Nice
<hattivat>
soon we will be able to get a pretty reissue for just $25
<hattivat>
and the cover is pretty nice, IMHO
<icefire>
cheers lads, what a launch
<tawny>
ooo
egg|laptop|egg has quit [Ping timeout: 180 seconds]
* UmbralRaptor
is suddenly reminded of a need to read Max Gergel's memoirs. >_>;;
APlayer has quit [Ping timeout: 182 seconds]
egg|cell|egg has joined #kspacademia
egg|phone|egg has quit [Ping timeout: 186 seconds]
egg|cell|egg has quit [Ping timeout: 182 seconds]
egg|phone|egg has joined #kspacademia
<SilverFox>
What is an elegant way of asking if a string of numbers contains any number above a certain number?
egg|cell|egg has joined #kspacademia
egg|phone|egg has quit [Read error: Connection reset by peer]
egg|phone|egg has joined #kspacademia
egg|cell|egg has quit [Read error: Connection reset by peer]
<SilverFox>
I'm working on that N-length superperm finder, since I figured out how to get the superperm of 3 from 5 minutes down to 20 seconds, I wanted to make that even less by making some decent assumptions
<SilverFox>
such as the number starting with 1-(N),1-(N-2) kind of thing to produce a string for 4! like 123412 because that's for sure going to be the first part which will give the lowest sequence
<SilverFox>
from there I plan on just adding onto the end an incrementing sequence of numbers up until N, where N is the number you want to get the superperm of, and after N just increment digit to the left by one and then check the string recursively for any position that is >N
<SilverFox>
wait, I wouldn't need to do it recursively if I reverse the string pattern coming in
egg|laptop|egg has joined #kspacademia
<egg|laptop|egg>
Sarbian: so the cafe de la paix was closed an hour earlier than indicated because of the weather >_<
<egg|laptop|egg>
fortunately hippo was still actually open as advertised
<UmbralRaptor>
SilverFox: I expect something with # of digits vs string position, bur you're already doing that?
<SilverFox>
what do you mean? I'm a little slow in the head, so if you could give an example that'd be great
<UmbralRaptor>
If your string is 4 digits long, it cannot contain a number larger than 9999, numbers larger than 999 must begin in the first character, numbers larger than 99, must begin with the 1st or 2nd, etc.
<SilverFox>
Num is the superperm we're trying to get, like the superperm of 3 gives us a Num of 3, because that's the max digit we can have, currentEnum is the stuff after the pre-made prefix that we are iterating
<SilverFox>
the pre-made prefix is the 123132 stuff for the superperm of 3, because that is the lowest possible start for it
<SilverFox>
the superperm of say, 12 contains all numbers from 1-9 right?
<SilverFox>
in a single digit space that is
<SilverFox>
oh but that means it needs to contain "10" "11 "12" and that takes up two digit spaces wow
<SilverFox>
with my code the superperm of 9 would be impossible to get
<SilverFox>
yall wanna see some disgusting ternary work?
<SilverFox>
test.Add(((bar > Num ? (char)(bar + 1) : c) > Num ? (carry = true) : false)? '1' : (char)(bar+1)); //if the char is greater than num, increment it, otherwise put the regular char in
<SilverFox>
but I needed to actuate two things at once, and that's a way of doing it
<icefire>
stop playing code golf
<soundnfury>
the assignment to carry is what gets me
<SilverFox>
if carry then I know that next one I add one
<SilverFox>
I might be able to work it in there, but that's enough damage for now
<SilverFox>
also I'm drunk
egg|laptop|egg has quit [Ping timeout: 180 seconds]
<soundnfury>
That explains much.
<soundnfury>
!wpn SilverFox
* Qboid
gives SilverFox a visible pounce-like sequence
<SilverFox>
yay more sequences
<SilverFox>
I reduced the line count by a lot
<SilverFox>
soundnfury, what about the assignment to carry that gets you?
<soundnfury>
assigning in one leg of a ternary, but not the other; also using the assignment as an expression is probably not a good idea in a line that's already that dense
* UmbralRaptor
can't into C++ tonight.
<soundnfury>
oh and unnecessary parens around it
<egg|phone|egg>
Side effects in one path of an otherwise functional construct
<egg|phone|egg>
Screams
<soundnfury>
needs refactoring into inline functions, needs more whitespace (give it some newlines and use indentation to show structure)
<SilverFox>
I could definitely if statement it, I just thought it was ternary-able
<SilverFox>
if(c.toint+1 > Num){ set c to 1; set next int to +1;} else { return c+1}
<SilverFox>
I could probably replace the boolean setting with the actual doing of the incrementing, but im too drunk for that
<egg|phone|egg>
If you're going to hard code a Boolean and then ternary it you could also comma; not that it would improve that horror measurably
<SilverFox>
I comment it decently so you should get what I'm doing
<awang>
soundnfury: There was something similar to pingfs posted to HN a while back
<awang>
I want to say it was storing data in DNS server caches?
<awang>
SilverFox: Also, if you're worried about performance, look at what the JIT is putting out
<awang>
Apparently JITs can do some amazing things nowaays
<SilverFox>
idk what it puts out
<awang>
s/aays/adays
<Qboid>
awang meant to say: Apparently JITs can do some amazing things nowadays
<SilverFox>
I normally run debug mode anyways
<SilverFox>
so it's just about writing good code
<awang>
"good code"
<awang>
(massive nested ternary statement)
<soundnfury>
SilverFox: wha... ... ....
<soundnfury>
what did I just read
<SilverFox>
awang, you should do > instead of the parenthesis
<SilverFox>
>good code
<SilverFox>
>massive nested ternary statement
<SilverFox>
is better
<awang>
Close enough :P
<awang>
Uh
<awang>
Does .NET automatically StringBuilder-ize concatenating strings?
<egg|phone|egg>
You worry about performance and reverse a vector, also build a string from it at the end
<awang>
If not, that's an easy performance win
<awang>
(what egg|phone|egg said)
<SilverFox>
idk what was said
<soundnfury>
wtf is this even *trying* to accomplish?
<egg|phone|egg>
Nobody knows
<awang>
SilverFox: Please pick better names for your variables
<awang>
Longer variable names don't slow your program down
<SilverFox>
I take a string, turn it into a list, reverse it, check each digit to see if it's greater than the max num, if so, then reset it to 1, and increment the next digit
<awang>
And it helps other people help you
<soundnfury>
"stringly-typed programming" :(
<SilverFox>
then I take that list and turn it into a string
<soundnfury>
SilverFox: but forwhy? 0_o
<SilverFox>
but i have to reverse it again so that I'm dealing with a properly facing string
<SilverFox>
if I reverse it I won't have to call the function recursively
<awang>
Uhhh
<awang>
Why not just loop backwards?
<egg|phone|egg>
Wherefore
<awang>
with a normal for loop?
<SilverFox>
HMMMMMMMMMMMMMMMm
<SilverFox>
for(int i = thing.length-1; int i > 0; i--;) ?
<SilverFox>
that kinda thing?
<awang>
>= 0
<SilverFox>
yeah
<awang>
But yeah, something like that
<SilverFox>
alright coo
<SilverFox>
thanks
<awang>
Basically the less time you spend messing with memory the better
<awang>
Also fix lines 20-24
<awang>
If test is long, that's going to get horrendously slow
<SilverFox>
listen, if test is long anything will get slow
<SilverFox>
everything will
<egg|phone|egg>
Also wherefore art thou writing this horror in the first place
<SilverFox>
whom'st'd've you what
<awang>
Yes, but why not make the easy things faster?
<awang>
Simple changes that prevent performance hits
<awang>
No reason not to
<awang>
Keep in mind that algorithmnic changes typically give you the best speedup