« first day (1578 days earlier)      last day (3258 days later) » 

Anonymous
12:00 AM
but I don't want to write one by one all the indexes... and I know how to select a subset of a normal array
 
Anonymous
but I just can't figure out the syntax for selecting 2..16 from an anon array
 
Anonymous
$notas{$currentasig}{'primersemestre'}{'notas'} = [$rows]; # but i don't want the whole $rows... just 2 through 16... damn
 
So, $rows gives the pointer to an anonymous array?
 
Anonymous
yes
 
Anonymous
I've tried countless permutations, copying that array into something normal, etc
 
Anonymous
12:01 AM
I think I'm failing at something pretty darn obvious, syntactically
 
To get an Nth entry, I think it's ${$row}[N]
 
Anonymous
I still stand firmly on how perl is a beautiful language
 
Anonymous
@PhiNotPi i'll try
 
@orlp not again...
 
@MartinBüttner ?
 
12:03 AM
But I don't know how to get a range.... I'll search for that
 
Anonymous
$notas{$currentasig}{'primersemestre'}{'notas'} = [${$rows}[2..16]]; should work then?
 
@orlp it would be a standard loophole if cat actually met our requirements for being considered a programming language
 
Anonymous
heh nope it did not
 
@MartinBüttner it was more of a joke
 
Try without the outer square brackets on the right?
 
Anonymous
12:04 AM
you mean $notas{$currentasig}{'primersemestre'}{'notas'} = [${$rows}2..16]; ?
 
No, the outer ones.
 
@orlp the sad truth, some people still try to get away with stuff like that :P
 
${$rows}[2..16];
 
Anonymous
the outer make it so that it feeds the whole array into it... without them I only got the cardinality of the array rather than its contents... but will try anyway
 
Anonymous
nope, didn't work again
 
12:06 AM
Hmm... yeah... I can't remember much about anonymous arrays then.
 
Anonymous
i mean i can just do it manually i guess and screw fanciness...
 
Anonymous
but where's the fun in that
 
Well. I think there might also be problems in the way that you are accessing it in other parts of the program.
 
Anonymous
@PhiNotPi why?
 
[stuff] returns the memory address of the array.
So, in other parts of the program $notas{thing}{thing}{thing} won't give the array, it will give the address of the array.
 
Anonymous
12:09 AM
@PhiNotPi but it works haha... I had a little json file with the parsed table
 
Anonymous
I just feed the whole hash into Mojo::JSON and there I go
 
Anonymous
a neat representation of the obfuscated data in that table
 
Check out this program I wrote: codegolf.stackexchange.com/a/16274/2867
 
Anonymous
my eyes... they bleed
 
Of course, I don't know if I could replicate that feat today without re-researching a bunch of stuff.
 
12:12 AM
@randomra You probably want to set pagesize=100 and you'll still need to check hasMore to do it properly
 
Anonymous
@PhiNotPi is perlmonks code golf site still active?
 
Anonymous
you should be there haha
 
I don't know.
I don't think I'm actually that good at Perl code golf.
 
@randomra I'd argue that a JavaScript solution looks much simpler.
 
Anonymous
@PhiNotPi why would you say that
 
12:14 AM
Though yours probably does stuff mine isn't bothering with
 
Back to your problem, this is where I would insert a ton of debugging outputs.
 
Anonymous
@PhiNotPi data::dumper all the day
 
Anonymous
i just did an ugly, ugly hack
 
Anonymous
but it works
 
Have it print $rows, ${$rows}, ${$rows}[2..16] etc.
"ugly, ugly hack" You're probably doing it right.
 
Anonymous
12:20 AM
it's perl... there's always someone who has done a worse job than me at keeping his codebase tidy
 
Anonymous
also, what I'm doing is just a little PoC, I can just tidy it up later
 
Anonymous
 
I have now...
 
Anonymous
@PhiNotPi also, do you think this code is unreadable and/or too much of a mess?
 
12:35 AM
Since I only know what that one line is, I can't really say.
 
Anonymous
12:53 AM
 
I would probably write some of this as a For loop or something:
			if ($rows->[13] ne '-') { push(@notassegundo, $rows->[13]); }
			if ($rows->[14] ne '-') { push(@notassegundo, $rows->[14]); }
			if ($rows->[15] ne '-') { push(@notassegundo, $rows->[15]); }
			if ($rows->[16] ne '-') { push(@notassegundo, $rows->[16]); }
 
Anonymous
@PhiNotPi that's kinda what I wanted to avoid with my question
 
Anonymous
hence the ugly hack
 
For loops aren't that bad, are they?
 
Anonymous
@PhiNotPi oh let me rephrase: I wanted to avoid if if if if if
 
Anonymous
1:01 AM
how would you implement that in a for loop that only iterates from indexes 2 through 16?
 
for (my $i=2; $i <= 16; $i++) {
     if ($rows->[$i] ne '-') { push(@notassegundo, $rows->[$i]); }
}
If you want to make it a little more hack-y, you could use the default variable $_ instead of $i.
for (2..16) {
    if ($rows->[$_] ne '-') { push(@notassegundo, $rows->[$_]); }
}
 
Anonymous
@PhiNotPi immediately thought of $_
 
Anonymous
well I just tested it-- works as intented. thanks!
 
Anonymous
over a year since I last coded... some tricks are forgotten with ease
 
Anonymous
this table took 90 lines to parse... god and I thought it'd be worse
 
1:39 AM
@PatoSáinz You can also do for loops like this:
 for my $i (2..16) {code}
 
Anonymous
@PhiNotPi hmm that's succint
 
Anonymous
but I think I'll keep the expresiveness of (my $i=2; $i <= 16; $i++)
 
Normally this is called a "foreach" loop. In Perl, for and foreach are literally the same thing.
 
Anonymous
@PhiNotPi yes! I actually use foreach a lot more than for
 
Anonymous
by the way, I tried a couple of other tables with the same layout and the script has holded up
 
Anonymous
1:42 AM
thanks for everything @PhiNotPi
 
Anonymous
tomorrow: fiddler fun in order to intercept the login process of the site where I extract my tables
 
Have fun!
 
Anonymous
thanks!
 
Anonymous
My final objective is to have a little web frontend with statistics derived from the data I extracted from these tables
 
2:49 AM
0
Q: Compute the Resistance of a 4 Band Color Coded Resistor

Calvin's HobbiesResistors commonly have color coded bands that are used to identify their resistance in Ohms. In this challenge we'll only consider the normal 4-band, tan, axial-lead resistors. We'll express them as: xyzt Where x is the first band for the first significant figure, y is the second band for the...

 
 
2 hours later…
4:52 AM
0
Q: Minimum in Python

ibanez221What is the shortest amount of code that can find the minimum of an inputted polynomial? I realize that you can import packages like Numpy and others, but using only user defined functions, what is the shortest way to do this? For example, if 6x6 + 4x3-12 is entered (ignore parsing issues), what ...

 
 
2 hours later…
6:40 AM
@orlp in your dreams ? :P
 
7:13 AM
0
Q: Metaprogramming Madness!

EdiYou're working in the devils language. Looser than PHP, more forgiving than Javascript, and more infuriating than LOLCODE. You've had it up to here with this language (and you're a tall guy) so you sit down and think of a solution and then all of a sudden it smacks you straight in the face. Figu...

 
7:31 AM
how do I change a character in Retina to newline? \n just prints \n
 
0
Q: Let's build a race car track!

da capo ariaIntroduction My niece wants to make a race car track. She has wooden parts that fit together to form the track. Each part is square shaped and contains a different shape. I'll use the pipe drawing characters to illustrate: │: the road that goes vertically ─: the road that goes horizontally ┌ ┐...

 
7:47 AM
hahaha, anyone remembers this code?
http://www.crazyforcode.com/probability-knight-stays-chessboard/
 
not me, why is that interesting?
 
Exactly the same solution was posted yesterday (link).
And we deleted it.
But not because it was a copy.
 
I see, funny that the linked page has the same picture as the question
was there a link to the crazyforcode article?
 
No.
Yeah, this Edi guy seems to be posting random challenges he finds on the web.
 
the OP didn't link to the question or give any credit either on both challenges
 
7:55 AM
Yes, this metaprogramming-madness is even a copy of an ongoing programming competition.
 
btw if I write a challenge to PPCG, strictly speaking, I loose the right to use that in a different place without crediting PPCG/SE, right?
 
I think so, yes
In the same way, if you post a challenge on some other site first and then post to PPCG, I suppose you'd have to credit the other site
 
yay, solved "Multiplication by Self-Modification" in Retina using the -s multi-line flag, I hope that is ok with the rules
 
8:54 AM
0
Q: Sourcecode selfie

PlarsenObjective: A guru once said a perfect code selfie is best shot diagonally from upper left corner. A code selfie is almost like a Quine - but rotated 45 degree clockwise. Your mission is to code a program that outputs a code selfie. Rules: You can use any programming language. Your programs sh...

 
lol, Shubham Mishra's answer got deleted a few days ago, because it didn't satisfied the runtime conditions. So he simply posted it again without any improvements.
 
9:38 AM
@Sp3000 why did you delete ?
 
10:20 AM
Hello!
 
@Optimizer Unique 16
 
I've an idea for a challenge but I'm not sure what the right format for it would be.
The idea is that you take a regular expression and transform it so that the resulting regular expression matches non-greedy.
 
10:42 AM
0
Q: Counting leap years

NicoAThis challenge is quite simple. You will take an input witch will be a year from 1801 to 2400, and output if it is a leap year or not. Your input will have no newlines or trailing spaces: 1954 You will output in any way that you like that clearly tells the user if it is or isn't a leap year (...

 
@FUZxxl you mean basically adding ?'s to *,+,? ? (I'm not good with regexes so not sure.)
 
@randomra well, not quite. non-greedy quantifiers will not be allowed of course.
 
@FUZxxl also: will you reveal a solution for this: codegolf.stackexchange.com/questions/48335/… ?
 
An answer to the challenge is going to involve constructing a DFA and modifying it so it matches only the least greedy case, then reconstructing a regex from that.
@randomra Not yet.
 
@FUZxxl ok, waiting... :)
 
10:46 AM
The problem with that challenge idea is that the solution sounds slightly complicated and I'm not sure if code-golf would be the right form for it.
 
what do you mean by least greedy then?
 
it would make a good code challenge but there is no possible winning criterion beyond “you solved it” so it's not an interesting “race” where multiple answers improve themselves
See, for instance, the regular expression <!--.*--> to match html5 comments. If this regular expression is matched “greedy” (that is, the longest string matching that expression is matched), it would match the string <!-- foo --> --> completely
if it was least greedy, it would only match the <!-- foo --> part.
one can transform a regular expression so it matches least-greedy even under a greedy matcher
this is done by transforming the regex so it can't match any longer strings than the shortest possible match
 
so simulate the non-greedy version of the input without non-greedy quantifiers?
 
yes.
non-greedy version of the matching
 
I would guess parsing a regex by hand would be a pain alone
 
10:53 AM
it's okay. I'm going to restrict the grammar for regular expressions appropriately.
 
11:31 AM
Huh, surprised nobody posted a Towel Day challenge yesterday.
I would have, but I only remembered what day it was at about 11 PM. :P
 
0
A: Sandbox for Proposed Challenges

KatyaQuestion about extrapolating data from an incomplete tennis scoreboard code-golf Introduction It is a fine day at the Stack Exchange tennis club. The players have just finished playing a grand tennis tournament in a round robin style (every player plays every other player once). The final resu...

 
12:28 PM
@MartinBüttner somehow, its 15 unique now. so I still end up with 29 bytes
{s03457;95c126ic++eeSf.*N*}_~
 
@Optimizer because there's two 5s now
 
damn
 
12:46 PM
@MartinBüttner I can actually use any nonspecial escaped char, right? (I tried \x and failed so used \ [ as I thought it should be a real escape)
 
no, .NET does not accept arbitrary escape sequences
there are only a few that can but don't have to be escaped
{ or } probably work as well
 
\a seems to be working, \z does some weird stuff I not yet understand...
\c fails, all different...
Figured out them...
] can be escaped for consistency?
@MartinBüttner how do you put newline in a substitute line? I could figure that out
 
you can't currently :/ ... I need to patch that in, because .NET's replace syntax doesn't have an escape sequence for it
@randomra yeah I guess
nice job btw, that's a really nice answer! :)
 
1:03 PM
@MartinBüttner I see, golfing in Retina might give the most usable skill in real situations
 
2K to 20K!
 
people accept ugly regex more than ugly code
 
@Optimizer I'm disappointed in the lack of golfiness of that message. 18K!
 
@MartinBüttner thanks, that question brought a lot of different approaches
the 8-byte CJam is really clever
 
@MartinBüttner pff :P
@randomra and orlp was happy that he beat 11 bytes :D
 
1:08 PM
Haven't read all 7 answers thoroughly but I think they are all different approaches which is pretty cool.
 
Dennis' both are almost similar ..
 
yey 1k rep!
 
1:27 PM
It's going to be a good day today
> Cookies in the breakroom, now with 22% more Diabetus.
 
the badge system here is unfair.
people get 25 upvotes even before they hit 1000 views
 
what's unfair about that?
 
@Optimizer I noticed yesterday that I can almost have a gold badge if I retract one of my upvotes. :)
 
@MartinBüttner its not proportional ..
@randomra populist ?
 
@Optimizer yep
 
1:36 PM
@Optimizer it never was. there are silver badges that are rarer than some gold badges.
 
If you want views, the very next time you have to ask Google how to spell something, search EL&U to see if it has been asked before. If not, ask.
 
@MartinBüttner shouldn't they be changed then .. ?
 
Your question will be closed quickly, and you'll get tons of views
 
@Rainbolt I want them on PPCG :/
 
@randomra you'd need two more upvotes yourself
 
1:37 PM
 
5K in 1 yr is not that much tbh
 
@MartinBüttner hence "almost" (how you found it? )
 
I think it's a lot for a closed question
 
@randomra just checked your top unaccepted answers
 
@Optimizer badge type shouldn't reflect its frequency but its 'value'
 
1:41 PM
@randomra a badge's value is its rarity and difficulty
so if a silver badge is more difficult to get and is rarer then some gold badge, then there is something wrong.
 
*value for the community
 
@randomra how do you define it then ?
 
with quotes :)
 
what quotes ?
 
just common sense, like e.g. Tumbleweed shouldn't be a gold badge even if its very rare
 
1:49 PM
The thing is that most of the badges are directed at SO, and some don't have that much relevance in this site
 
@randomra I agree. Tumbleweed should be diamond, not gold.
 
Generalist for example, Illuminator, Tenacious/Unsung Hero
Is it possible to have custom badges for a site or are they more fixed than that? I'm sure some other concepts would be better suited as badges in this site than those
 
I'm not aware of any custom badges on the network, but I don't know if it's actually impossible
@Optimizer so... when is the next AAoD coming?
 
2:05 PM
We could throw in our own custom badge ideas :P
 
@MartinBüttner tomorrow maybe.
 
Tumbleweed v2: Win a code-golf comp by being the only entrant
 
thinking b/w zodiac signs and snowflake..
@Sp3000 100 times
 
+1 for snowflakes
 
@MartinBüttner but you only said that they are not so fun :P
 
2:06 PM
-1 for snowflakes
 
I said snowflakes are not fun?
 
@PhiNotPi so you even art ?
 
Personally I'm not sure about zodiacs. It seems like there's two parts to the challenge, dates and kolmog, neither of which look particularly interesting to me right now
 
@Sp3000 dates will be two numbers, so nothing special
 
2:07 PM
Well you'd have to code in the date ranges somehow, so it'll be like double kolmog actually
 
@Sp3000 oh, which one to print. yes
May 21 at 10:59, by Martin Büttner
tedious :D
 
oh right, to generate them as a random walk
still a better challenge than zodiac
an argument against snowflakes is that you already did 6-fold symmetry in #2, and if we do the mash up for #5 it's going to have 6-fold symmetry again... so you might want to keep that for one of the last instalments
 
@MartinBüttner #2 had no symmetry what so ever
it just looks symmetric
 
it consists of _\/ which needed to be rotated by 60 degrees
 
2:25 PM
@MartinBüttner at a very minute level. still its completely different from the kind of rotational symmetry in snow flakes
and its more of a "replace / with something and _ with something else" than symmetry/rotation
 
it's a fairly important component of all three challenges (flow snakes, snow flakes, diamond tilings). I think the series could use a bit more diversity.
 
@MartinBüttner zodiac signs is giving that :P
 
you could always forget about the actual date and just ask for output of the zodiac sign from 1 to 12
 
nooo
what is fun in that ?
I want to be able to enter my birthday and get my sign
 
then do two challenges, one to get the sign, the other to draw it
 
2:37 PM
not sure if that is bringing anything good to the plate here ..
 
and then sign 01/12 | draw_zodiac
 
I've completed a Java-only version of the Strategic Voting controller.
 
so that makes it a no for separate question
 
it's a simplification, if that was really the problem
 
3:00 PM
I'm currently experiencing a facepalm (?) moment with selecting college courses.
Just because some of the courses are so mind-blowingly bizarre and pointless.
 
Cheese Tasting Methodologies in Medieval Europe?
 
How do you even ... ?
 
"Psychology of the Zombie Apocalypse"
 
@PhiNotPi that actually sounds helpful
 
"Why do we find zombies fascinating? What in our psychology attracts us to the zombie phenomenon? What does our fear of zombies tell us about ourselves? We will investigate these questions and others through the lens of neuroscience, abnormal and social psychology, popular culture, epidemiology, and related fields."
 
3:04 PM
@PhiNotPi Sounds related to epidemiology in general, with a catchphrase name to draw students.
 
It's an honor's level class.
 
Who doesn't want honor's in Zombie Psychology ??
 
Honor students like zombies, too :P
 
0
A: Sandbox for Proposed Challenges

BrainSteelPermutations of the Fifteen Puzzle (Title to be determined) Consider the following diagram of the Fifteen Puzzle in its solved state: _____________________ | | | | | | 1 | 2 | 3 | 4 | |____|____|____|____| | | | | | | 5 | 6 | 7 | 8 | |____|____|____|____| | |...

 
Apparently 15 people do, because the class is completely booked.
 
3:06 PM
Go for the cheese tasting one instead then.
 
I feel like I've done something very wrong to get two answers to my question, in Haskell and IDL
(more wrong that it's those specific two languages than that I've only gotten two)
 
which one ?
 
Wow, and it's your only question. The gods hate you ;)
 
@Geobits there is only one.
 
3:10 PM
I sorta expected to see a 20-30 byte cjam or J or pyth solution
 
@Optimizer question or god?
 
both
 
If you say so.... :D
 
okay, 1 last call. Random Walk Snow Flakes or Zodiac Sign ?
first three voters decide
 
I vote snow flake, even though I won't participate. I like random walks and pretty pictures.
 
3:13 PM
I vote snowflake for not-zodiac :D
 
@Geobits doesn't count
1-0 score
 
I had a feeling that would be the case ;)
 
snowflake
 
ok then, will get the spec ready before i sleep
 
I vote for neither
(although if it's between the two, I'll vote zodiac just so that it isn't snowflakes)
 
3:22 PM
Due to the non-ASCII version of snowflakes that has already been?
 
no, because it's another _\/ challenge (and #5 is probably gonna be one as well)
 
ASCII art will almost always contain at least one of _\/
 
@Optimizer btw, are you intending to do 9 instalments?
 
@MartinBüttner I can't do more ?
 
@Optimizer the point is, it's only those three, and they represent rotated versions of each other
@Optimizer sure you can, just wondering.
 
3:24 PM
well, lets see..
 
@Optimizer ascii art containing _\/ isn't the same as "a _\/" challenge which I interpret to mean "an ascii art challenge specifically about hex/tri grids"
 
@Sparr both my #2 and snow flakes are not about hex or tri grid
 
And the most annoying part of those challenges is trying to find a clever way to tell your code that you can't rotate \/ 60 degrees in either direction because you can't overlap / with _
 
they are both about taking a segment of the ascii art, made up of _\/ and rotating it.
 
@Sparr I am not sure anymore what you are talking about ..
 
3:26 PM
_\/ ascii art is inconsistent
you can represent certain shapes in certain orientations but not other orientations
 
@MartinBüttner just one part of it. both have a major part which is not just about rotation.
 
that inconsistency is the core of any algorithm for interpreting or drawing things in that system
 
@Doorknob you sandboxed something D: ... what happened?
@Optimizer I didn't say they are duplicates of each other...
 
@MartinBüttner do you have a feed or something ?
@MartinBüttner I know, I meant that both are not just about rotation of _\/
 
@MartinBüttner lol :D Mostly because I couldn't think of a catchy title, and I'm fairly certain that there's at least a few holes in the spec
 
3:28 PM
of course there's more to the challenges (or they would be duplicates). I'm just saying that gives both of them the same flair (as far as ascii art goes), so you might want to spread them out a bit more in the series.
@Optimizer no, I just happened to have the sandbox still open in a tab
 
now, if you stick to 120 degree angles, then I'm a lot happier about _\/ :)
 
@Sparr snowflakes is about 120 degrees only
it has 3 degrees of symmetry .. (or whatever its called)
 
link?
 
@Sparr I mean any snowflake, but here, the last one
 
the last one is chinese shrine?
 
3:32 PM
@MartinBüttner erm, what exactly did your edit change?
 
oh, yeah, I see the snowflake one down there
"/_" <-- this string is what pisses me off about many hex/triangle ascii art challenges
 
wow, reddit is weird. on the same post, gives me different vote count and % upvote each time i reload
 
there's a missing line segment that's impossible to represent in ascii art. if you rotate the whole thing 60 degrees then that segment will be represented.
 
@Doorknob you had the order of n and n-1 wrong
@Optimizer that's a feature
 
@MartinBüttner I never said its not ;)
 
3:34 PM
if you actually want to know if you got an upvote, you'll have to check your karma
 
just a "weird" feature
 
ah, heh, I see now
 
@MartinBüttner oh.. no . you were being serious ..
it becomes consistent after a few reloads
and the %upvote is accurate
only initial couple reloads are random
how many you see here ?
 
doesn't load right now
5 points, 100% upvoted
 
3:37 PM
yes, so if I keep reloading, I will sometime get 4, 3, 85% , and whatnot
 
so that is actually broken ..
(jokes apart)
 
what is broken?
 
oh wait ..
but i see point score changing too
that should remain 5 always.
 
no I think it always fluctuates
 
3:40 PM
0
A: Sandbox for Proposed Challenges

Doorknobsandbox note: help thinking of a catchy title would be appreciated :) Description You will be given two points that the laser passes through and the size of the laser, and you must determine where the laser must have gone, could have gone, and could not have gone. The laser can be horizontal, ...

 
form FAQ : "The points score is correct, but the vote totals are "fuzzed"."
what else is points score here then ?
 
maybe your own karma? because that's constant
 
my karma is too less to fluctuate :D
 
well mine doesn't
@Sparr J or APL might have a chance at a really concise solution, but at least in CJam it's quite tricky I think
I don't see any neat shortcuts.
 
I have all prime badges
not for long ...
 
3:53 PM
@MartinBüttner I need to do some programming in one of the tiny stack languages to get a better idea of what they do best.
@MartinBüttner can you at least find the minimum seam sum, without being able to identify the seam afterwards, quickly?
 
that shouldn't be too bad
 
that seems like just a huge set of nested map operations over the array
 
I think it's a mix of reduce and vectorised additions
 
ok, I can see how that would work
@Optimizer up minus down = real score. when up fluctuates, down fluctuates.

that also makes the %s fluctuate, obviously.
 

« first day (1578 days earlier)      last day (3258 days later) »