« first day (3153 days earlier)      last day (29 days later) » 

1:42 AM
Update: I got linux to work but deleted the windows bootloader.
RIP
 
@PhiNotPi How did you manage that?
 
 
1 hour later…
2:59 AM
@Mego I tried to reinstall linux but I couldn't figure out a way to do it without overwriting my boot sector. I tried to do it without reformatting but the installation GUI kept giving me a "hardware error".
At this point I've said "screw it" and am reinstalling both OSes, which sucks but all my data is on a different drive.
 
It's fine for Linux to overwrite your boot sector. It's actually required - you need GRUB in order to boot into Linux
And GRUB can handle passing off the boot duties to Windows's bootloader just fine
The usual method is: make two partitions, install Windows on one, install Linux on the other, and use GRUB to pick which you boot
 
Remembering to install Windows first, because Windows will delete GRUB and not happily let you boot linux
 
And after doing so, I tried a boot repair tool in linux, but it wasn't able to find windows boot manager. And the windows installation media couldn't find it either.
 
CMC: Define a function that takes a list of functions and an argument, and returns a list containing the results of applying each function to that argument. E.g., [Sin, Cos], 0 => [0, 1]
 
@Pavel You can always just reinstall GRUB from a live usb. I've made that mistake a fair few times, and thankfully it's not too painful to fix.
 
3:11 AM
1
Q: Decimal “XOR” operator

dan04Many programming language provide operators for manipulating the binary (base-2) digits of integers. Here is one way to generalize these operators to other bases: Let x and y be single-digit numbers in base B. Define the unary operator ~ and binary operators &, |, and ^ such that: ~x = (B - ...

 
@Pavel Haskell, 17: flip(map.flip id)
 
Mathematica, 15: f_~x~a_:=#@a/@f
I keep trying to think of a way that doesn't require naming the function, but if you nest lambdas you lose access to the outer lambda's arguments from the inner one. You can pass an argument from outer to inner, but then your inner takes two arguments and you can't use it in /@ anymore, and Curry is an entire 5 bytes by itself
 
Do the arguments need to be in a particular order?
 
Nah
 
Oke then
Haskell 12: map.flip($)
 
3:18 AM
Ah, I was assuming arg order
Much simpler with them flipped :P
 
Honestly so was I
It didn't occur to me how much easier it gets when they're flipped
This CMC brought to you buy: My math homework requiring me to find the Sin, Cos, and Tan of a bunch of numbers over and over and over again
 
Elm 14 bytes: List.map<<(|>)
Saves bytes on haskell since flip($) is built in as (|>) but loses bytes since << is longer than . and map requires a qualifier.
 
4:19 AM
0
Q: What's a number?

dan04Similar to What's a string? If a challenge says that the input will be “a number”, what data types are acceptable? Obviously, types like int and float are numeric. What about strings? Command-line arguments and stuff read from standard input will naturally be string or sequence-of-char object...

 
 
1 hour later…
5:24 AM
Ayyyy I have both OSes reinstalled, grub menu working, and linux hibernation working.
Only took 9 hours or so of work.
 
5:55 AM
nice
 
6:14 AM
0
Q: Escape the labyrinth!

ArnaudYou are trapped in this 5x5 labyrinth - each room is labelled from 1 to 25 and the exit is in room 1. You are given as input the room you are currently in. Your task is to output the shortest sequence of moves (north, east, south, west) needed to reach room 1. Moves can be given in any format...

 
 
2 hours later…
 
2 hours later…
10:55 AM
1
Q: Simulate a 1D Game-of-Life-ish Model

jaaqThis question just trended over on code-review and I figured you might like it adapted as a codegolf challenge: You are given a non-empty list of x houses represented as booleans. Each day, the houses compete with adjacent ones. 1 represents an "active" house and 0 represents an "inactive" house...

 
 
1 hour later…
11:56 AM
0
A: Sandbox for Proposed Challenges

AlienAtSystemThe Celestial Bureaucracy In Imperial China, ranks in society were not decided by birth or wealth, but by a person's ability to excel in the Imperial Examinations. The Jade Emperor, divine ruler of the Heavens, has called for all his subjects to be examined to determine their worth, and whom to ...

 
 
2 hours later…
1:55 PM
1
Q: I reverse the source code, you negate the output!

TwilightSparkleYour task, if you wish to accept it, is to write a program that outputs a non-zero number(can be integer or float). The tricky part is that if I reverse your source code, the output must be the original integer negated. Rules You must build a full program. That is, your output has to be printe...

 
 
1 hour later…
3:08 PM
Crossed out 4 still looks like 4.
Also, my second-ever Jelly answer. Woo!
 
3:37 PM
@AdmBorkBork Not that surprising for Jelly, usua... In powershell!?!?
 
Yeah, hehe. :D
 
Why does a quadratic Bézier curve have 3 points, and a cubic Bézier curve have 4? -_-
 
3:57 PM
0
A: Sandbox for Proposed Challenges

BeefsterDuct Tape a Regex Decider duct-tape-coding parsing decision-problem Your task is to create a program that determines whether a given string is a valid regular expression or not using code snippets sourced from other sites on the StackExchange network. For the purposes of this challenge, the ...

 
@DJMcMayhem From the definition? Linear has P<sub>0</sub> and P<sub>1</sub> for two points, and so on.
 
4:28 PM
@DJMcMayhem To restate what Adm said, two points define a line, three define a quadratic, etc. Alternatively, the formula for a line is of the form Ax + B = C (two degrees of freedom), for a quadratic is Ax^2 + Bx + C = D (three degrees of freedom), and so on.
 
5:28 PM
@DJMcMayhem what exactly is surprizing you here?
 
quad- == 4 and cube == 3?
But I get it now
 
ah I see:)
 
5:56 PM
2
Q: Counting creatures on a hexagonal tiling

Peter KageyThis challenge will have you count "creatures" in the tile game Palago. A creature is any closed shape that can be formed by Palago tiles of matching colour in a hexagonal grid. The game Palago consists of tiles like this: These tiles can be rotated \$120^\circ\$, \$240^\circ\$, or not a...

 
6:18 PM
CMS: When you first learned programming, did you do so before or after you learned about the notion of a variable in mathematics?
 
Definitely after for me.
 
@flawr I learned programming 2~3 years after algebra
 
ngn
@flawr after
 
@flawr Before.
@flawr Also, CMS?
 
Survey, I'll bet.
 
6:24 PM
@flawr I first started programming in BASIC when I was like 5 or 6, so definitely way before Algebra.
 
@flawr Probably like 5-6 years after
Although I don't remember how old I was when I first learned algebra
 
Hmmm. I just realized that I was thinking of "first learned programming" as being when I learned Blitz Basic at ~15 years old (9th grade?), but my true first programming experience was Java in 7th grade, and I'm not sure if that was before or after Algebra. Maybe the same year. I definitely actually learned how to program with TI-BASIC which was also 7th grade, or maybe 8th.
 
@flawr after, for sure.
 
Oct 5 '16 at 15:33, by TimmyD
@trichoplax Oh yeah. I was self-taught programming via BASIC on the VIC-20, and later QBasic. I'm pretty sure that's part of the reason why I'm a terrible programmer.
3
 
6:43 PM
@El'endiaStarman Do you still have a copy of Blitz Basic? I've found it difficult to find, nowadays.
 
@Adám chat mini survey
 
@wizzwizz4 Yeah, I'm sad about that too. I might be able to dig it up from an old external harddrive but I don't really see a whole lot of value in doing so.
 
@AdmBorkBork Who is this Timmy imposter?
 
@Adám @AdmBorkBork Do you think it is a drawback or advantage for one or the other if you learn about the mathematical variables after? (assuming the languages you learned included variables)
 
@DJMcMayhem I dunno, but he's a jerk.
 
6:48 PM
@flawr The mathematical usage of the word was very confusing to me. What do you mean tell me the value of x, you haven't told me what it is: VALUE ERROR
 
@Adám hehe:)
 
@flawr I found it to be an advantage, because I already had this concept of "this thing is a placeholder for some value." I think programming early on had a big influence on my aptitude for mathematics when I was older.
 
@Adám your first language was definitely not prolog:)
@AdmBorkBork oooh
@TimmyBorkBork == @AdmD
who knew???
 
@flawr Past me is usually a jerk. Keeps leaving stuff for me to do.
 
> That's a problem for future Homer. Man, I don't envy that guy.
 
7:12 PM
One day, I'll get a time machine and kick Past me's ass. I just have to hope I'm currently not Future me's Past me.
 
@Veskah why don't you kick yourself in the ass right now, or ask someone else to do you the favour? :)
 
Every day, I'm surprised when someone else doesn't do it.
 
ok well kicking oneself in the ass is probably hard if you are not two persons:)
 
> When people talk about traveling to the past, they worry about radically changing the present by doing something small, but barely anyone in the present really thinks that they can radically change the future by doing something small. -- @TheWeirdWorld
6
 
@AdmBorkBork Shower thought I had a lot was what's the minimum amount of kinetic energy it takes to create a parallel dimension
 
7:29 PM
@Veskah The minimum is probably very negative.
 
0
Q: I reverse the source code, you negate the input!

AdámBlatant rip-off of a rip-off. Go upvote those! Your task, if you wish to accept it, is to write a program/function that outputs/returns its integer input/argument. The tricky part is that if I reverse your source code, the output must be the original integer negated. Examples Let's say your so...

 
8:05 PM
 
@NewMainPosts @Adám Does reverse to ?
 
@J.Sallé No, of course not!
 
Q: Can input (for a general challenge) be taken in a command line flag? E.g. passing the flag --flag=<input>?
 
@Adám It was supposed to be kind of a joke but I genuinely got worried about that after asking
 
8:12 PM
@cairdcoinheringaahing why not
@cairdcoinheringaahing if there is no entry yet add it to the defaults question on meta and let people vote
 
CMC: Given n > 1, output an @ followed by n^2 - 2 dots (.) (Example: 4 -> @..............)
 
@cairdcoinheringaahing
 
@flawr Yep :P It's 2 bytes in a language I'm working on
 
@cairdcoinheringaahing Dyalog APL, 20 bytes: ('@','.'⍴⍨2-⍨(⊢*∘2))
 
8:27 PM
@J.Sallé I have 13
@J.Sallé (⊢*∘2) is just ×⍨, no?
 
@cairdcoinheringaahing 2 bytes in Levels: "@. Takes input in the flag --size=n :P
 
@J.Sallé That's 18, btw.
 
8:49 PM
@Adám indeed, and I also counted the outer parens because of TIO hahahahah
I was in a rush though, I'll check it out later
 
@J.Sallé Why "because of TIO"?
 
@Adám It said 20 characters because I forgot to remove the outer parens
 
@HenriqueLemesBaron Hello! Welcome to TNB!
 
@HenriqueLemesBaron Hi.
 
 
1 hour later…
10:00 PM
@cairdcoinheringaahing Dyalog APL, 13 bytes: '@',2↓'.'⍴⍨×⍨
 
@EriktheOutgolfer Nice. I had '@.'/⍨1,¯2+×⍨ which could be argued as a more APLish way to do it. Certainly going to be faster.
 
@Adám lol yours is 73% faster for input 500
and 87% faster for 1000, yeah looks like there's a whole different time complexity
 
@EriktheOutgolfer Yours should be O(3n²) while mine should be O(n²).
 
@Adám then yours should generally be ~66.7% faster, but it looks like the percentage converges to something greater
 
10:16 PM
Hello!
 
@EriktheOutgolfer Odd. Each of '.'⍴⍨ and 2↓ and '@', is n² since ≈n² bytes need to be written for each. I have only '@.'/⍨ writing ≈n² bytes. What am I missing here?
@JL2210 Welcome!
 
@Adám maybe the internal processing?
 
So, I'm getting started with Code Golf. I have some experience with the Stack Exchange network (I'm a regular on Stack Overflow), but Code Golf is wildly different. Where should I start?
 
Just try some challenges. Active is an alright place
 
10:20 PM
Do we not have a guide page on Meta for newcomers‽
@JL2210 Which language(s) do you use?
26
Q: Community FAQ for Programming Puzzles & Code Golf

DoorknobCommunity FAQ For the Programming Puzzles & Code Golf site For official guidance from Stack Exchange, visit the Help Center. Posting Challenges/Solutions How can I incorporate good-looking mathematical exposition into my question/answer? Posting Challenges What details should always be ...

 
C
 
137
Q: Tips for golfing in C

CaseyWhat general tips do you have for golfing in C? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to C (e.g. "remove comments" is not an answer). Please post one tip per answer. Also, please include if your tip applies to C89 and/or C99...

 
11:03 PM
@JL2210 Learn a few wacky esolangs and have fun!
(not necessarily golflangs)\
 

« first day (3153 days earlier)      last day (29 days later) »