« first day (2090 days earlier)      last day (2743 days later) » 

9:19 AM
1
Q: Ungolf batch programs

Roman GräfThis question wants you to golf batch programms. In Batch you can use set x=averylongbatchcommand %x% arg1 which expands to set x=averylongbatchcommand averylongbatchcommand arg1 Your task is it to expand these statements. As you can also use set for arithmetic purposes like this: set x ...

 
9:54 AM
-1
Q: Is there a way/service to mask a telephone number for calls?

GregoI would like to know on how to give a person 1 (who cannot know the actual telephone number) a number that is not actually the real telephone number, but when he dials this number, in the background it will actually call the real number, so the person who's calling gets a generic number but it is...

 
10:06 AM
@Sherlock9 Sorry, I force shut down during a system upgrade and had to figure out how to unbreak my laptop
@VTCAKAVSMoACE How is that even possible
 
 
2 hours later…
11:49 AM
@Dennis You've changed your avatar due to Halloween, or you just wanted a different color? ;)
 
11:59 AM
@KevinCruijssen Halloween
 
12:25 PM
1
Q: Advance to Boardwalk, If you pass Go, collect $200

jacksonecacMonopoly Board For this code-golf challenge we will be building the board game monopoly. Rules: Take no input. Output a 10x10 square where each ASCII character forming the square is the first letter of each space of the Monopoly Board. Go should start in the bottom right. Output the Monopoly B...

 
@Dennis Thought so.
_ /_
/^,^\
\\__//
Ok, that ascii pumpkin kinda failed..
 
@KevinCruijssen Put that in its own message, Ctrl+K
 
 _/_
/^,^\
\\_//
 
1:03 PM
0
A: Sandbox for Proposed Challenges

jimmy23013(Need a title.) Your task is to write up to 3 programs (or functions) that checks if the input is a string of balanced brackets satisfying the following criteria: The number of []s is always less than or equal to the number of ()s surrounding each position. The number of {}s is always less tha...

 
1:14 PM
0
A: Sandbox for Proposed Challenges

jimmy23013Balanced triplet brackets A "triplet bracket" (that I made up for this challenge) is one of the following: (...+...) [...:...] {...|...} <...-...> A balanced triplet bracket string (BTBS for short) is either an empty string, two BTBSes concatenated, or one of the above triplet brackets with e...

 
1:44 PM
Tfw i don't have Flash and haven't really needed it for 4 months
 
2:10 PM
mfw someone uses "m/t-fw" without posting a face
 
maybe it was "that feel when"
to which I could respond "I know that feel, bro"
 
I love tf
(not Team Fortress, I love that feeling)
 
Interesting spelling on that edit
 
Well it's a legit researchgate link
what is dubious is the content of the paper, given that no has heard of it and that it is shamelessy advertised on Wikipedia
 
Don't you know that only the best research from the best people gets published on the Internet? The Illuminati prevents their messages from being disseminated to regular people in the real world, in order to keep the lizard people a secret and ensure humanity's continual enslavement.
 
Well, as long as the right Lizard rules...
 
2:59 PM
0
A: Sandbox for Proposed Challenges

James WebsterMonopoly Continued So you've got your Monopoly board, shall we start a game? To start with, we'll need some dice and to know where we land! Write a program that outputs the rolls and resting places of a given number players for a given number turns. Input In any suitable format for your lang...

 
3:33 PM
test
 
3:45 PM
0
Q: Compute the Eulerian number

milesThe Eulerian number A(n, m) is the number of permutations of [1, 2, ..., n] in which exactly m elements are greater than the previous element. These are also called rises. For example, if n = 3, there are 3! = 6 permutations of [1, 2, 3] 1 2 3 < < 2 elements are greater than the previous 1 3 2

 
4:27 PM
Microsoft Onedrive's worst issue, by far, is that it doesn't allow me to download either a folder or multiple files at once: I have to do it one file at a time.
 
4:39 PM
@PhiNotPi Wha? I can multi-select. Just hit the checkbox.
 
Multi-select and download all at once?
 
Sure. It downloads it as a ZIP
 
That's odd... I remember seeing the download button disappear. There's a whole support forum post complaining about the lack of feature.
 
Huh. Granted, since I moved to Windows 10 around six months ago on my home laptop, I just access my OneDrive directly via Explorer, so I guess something could have changed.
 
I'm using the webpage interface.
Non-win-10 computer. Yeah the download button disappears when I multi-select.
 
4:48 PM
@ASCII-only Ah, that's fine. I have assignments to do, but I'll try to let you know when I'll get back to work on that answer
 
MichaelMalloy- [O365]
about halfway down
 
hey, I've got a function that returns true if its ordered smallest to largest, and false if its largest to smallest
what should the function be called?
it used to be isMaxOrdered(), but I think that's confusing
 
isAscending() ?
 
What happens if the input isn't sorted at all?
 
it always will be :)
 
4:54 PM
@Dennis isChaos()
 
@TimmyD oh, this is exactly what I want :)
thanks :)
 
You're welcome!
 
Hey
 
@NathanMerrill What does it return if the input has a mixed order, like [4,2,3,1]?
 
it won't
 
5:02 PM
0
Q: What's the Java policy with REPL existing?

Kaz WolfeAn extension of When do I have to include things like Java's public static void main. Unless you've (probably) been living under a rock, you (probably) know that Java 9 is (probably) going to have a REPL interpreter ready for use now. This means that all the boilerplate code is no longer necessa...

 
that's one of the contracts of the class
it'll always be ordered :)
 
Ah just saw that it was already asked. Was about to edit
At any rate, either isAscending() or isAscOrdered() may work
 
0
A: Sandbox for Proposed Challenges

OliverSieve of Eratosthenes, Step by Step Given a number N, draw a properly aligned NxN board of numbers, leaving 1 blank (as a space) (I will show diagrams with N=5) 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 Your job is to construct the Sieve of Eratosthenes, step b...

 
Question: Should a cast operator be right-assoc or left-assoc?
 
@NewMetaPosts WTF a Java REPL
 
5:06 PM
@Fatalize It exists
 
an official one
 
I wanna see a C REPL
 
Yep ._.
 
(I know that doesn't make any sense)
 
@TuxCopter It seems like [cast]var is the convention. I can't think of a language that casts on the right
 
5:06 PM
@TimmyD Cheddar for example
VSL is going to use :: as cast operator: 10::string
 
he's talking about a real language not Cheddar
 
Ouch
 
R U SAYING CHEDDAR IS NO REAL ಠ_ಠ
Or string::10 idk for the syntax
^ this will be the syntax
I think right-assoc is better
 
@DJMcMayhem I guess it's possible. Sounds like a neat project.
 
Pretty sure it exists.
 
5:17 PM
@Dennis But it would be really slow
 
gdb is basically a C REPL
 
25
Q: Is there a REPL for C programming?

SuryaI am on osx. I found this http://neugierig.org/software/c-repl/ but the links on that page for code seem to be broken.

 
@MartinEnder More a machine code REPL
 
You can't define structs or functions in gdb AFAIK.
 
@TuxCopter Who cares? You don't use the REPL for the final project, just for the bits you're testing without having to go through save-compile-run every time you make a change.
 
5:18 PM
yeah it's somewhat limited, admittedly
 
@DJMcMayhem I wanna C a C repl
 
wathow
Bison reported me a reduce/reduce conflict
brb
 
On an unrelated note, this bothers me every time I read/hear it.
By the way, the letters Ä, Ö, and Ü are called Umlaute (sound alterations), while the diacritic mark is called Trema, Umlautpunkte, or simply Pünktchen. Calling the diacritic mark itself umlaut in English is (sadly) commonplace, but this is wrong in German. — Dennis 5 mins ago
 
is "diaeresis" a correct term for it?
 
this is the first time I've heard "trema" in this context
 
5:22 PM
@ConorO'Brien In English, yes. In German, it means something else entirely.
sighs
 
._. one of a faux amis (false cognates), then
 
@Dennis But if you don't save-compile-run every time, how would you swordfight on chairs?
 
I code alone. How would that go?
 
you could pretend your arm is possessed.
 
It worked for Evil Dead
 
5:26 PM
I think I'm just going to keep my screen in inverted mode until halloween is over :P
 
@ConorO'Brien The problem here is that the dots are used differently in German. In most languages, they indicate the separation of the vowels in a diphthong, while ä,ö, and ü are entirely different letters in German.
 
oh, I thought you meant the term diaeresis
 
back
 
@ConorO'Brien I do. In German, a Diäresis is what the dots do in other languages.
 
@Dennis what I meant by that is that the term itself is used differently, i.e. has a different literal meaning in German. that is, "diaeresis" is a valid german word with a meaning distinct from that of english.
 
5:31 PM
@mınxomaτ this actually makes no sense >.>
 
@ConorO'Brien Sort of. There's a Diäresis (but no Umlaut) in naïve, while there's an Umlaut (but no Diäresis) in Diäresis.
Is that confusing enough? :P
 
wot
 
I think I get it.
whoa I think I found a chat bug
 
@Dennis Sort of. The nature of C and the concept of a REPL don't really mix that well
 
or a userscript bug
 
5:34 PM
The split?
 
I know that can happen if someone you've ignored says something between
Doesn't look like that happened here though
 
@Dennis Where were you a few days ago? :p chat.stackexchange.com/transcript/240?m=32973429#32973429
 
@DJMcMayhem isn't that the nature of compiled languages and REPL?
 
5:38 PM
@TimmyD Right there, apparently. Sorry.
 
@Dennis It's OK. I'll only hate you forever. ;-)
 
lol
 
I love Java
try {
  return true;
} finally {
  return false;
}
 
The island, the beverage, or the language?
 
5:42 PM
o_O
 
Any guesses what that does
 
Complains that there's no catch?
 
well that's valid
 
It returns true and anyway returns false
 
it does end up returning false
 
5:43 PM
But since return exit the try-finally it return true WAT
 
@TuxCopter cannot repro
 
@ConorO'Brien Now cat ran out of memory... that was a weird bug
 
eclipse even gives you a warning about it. something about "finally does not execute normally" or something
 
@Poke Oh, is the first return functioning like a break statement?
 
`cat "#{`where cat`.chomp}"`
 
5:45 PM
I guess so? No idea how java handles that, haha
 
Compiled from "Lol.java"
public class Lol {
  public Lol();
    Code:
       0: aload_0
       1: invokespecial #1                  // Method java/lang/Object."<init>":()V
       4: return

  public static void main(java.lang.String[]);
    Code:
       0: invokestatic  #2                  // Method hello:()Z
       3: pop
       4: return

  static boolean hello();
    Code:
       0: iconst_1
       1: istore_0
       2: iconst_0
       3: ireturn
       4: astore_1
       5: iconst_0
       6: ireturn
I don't speak JVM very well but I think it jump to the finally block after instruction 2 (Just before the return true)
 
@Poke Ah, that kinda makes sense.
 
Does anyone know where I can get a C-- compiler?
Can't find something that isn't a 404 anywhere
 
Quick C--
It's on GH
 
Here's another fun one: System.out.println(Long.toHexString(0x100000000L + 0xcafebabe));
What does that print out?
 
5:54 PM
@TuxCopter It isn't?
 
Wot
 
At least I can't find it. The only place I'm aware of that it exists was an old CVS server that appears to have 404'd
 
@Poke Probably something weird, because 0x100000000 is at the boundary of uint32
 
@TimmyD Yeah but it's a long
 
It is a long as quartata mentioned. (see the 'L' at the end)
 
5:57 PM
s/a/as
 
0
A: Sandbox for Proposed Challenges

milesClassify Alternating Permutations An alternating permutation of [1, 2, 3, ..., n] is an arrangement such that each element is greater than or less than the previous element. There is a further distinction that an alternating permutation can be either UP or DOWN. For UP, this means that the alter...

 
Well, in PowerShell at least, you get cafebabe back -- "{0:x}"-f(0x100000000+0xcafebabe)
 
that's correct
although idk how powershell is doing the int vs long
at first glance you might expect 1cafebabe in java
since you know that the int is being upcasted to a long
however decimal ints are a little different than hex ints in java in that decimal ints are only positive
you need to use the unary "-" to get a negative decimal int
 
@quartata The only thing I can find is a compiler that's no longer maintained: github.com/nrnrnr/qc--
 
when upcasting cafebabe you get sign extension
0xffffffffcafebabeL
 
6:02 PM
"QC-- was retired in 2007 or thereabouts. If you have trouble building the compiler or using it, Norman Ramsey probably cannot help, but you can send email to ..."
 
thus the result is just cafebabe
 
@mınxomaτ Code seems good to me: function isNotBatman
 
@Shebang Perfect, this is the compiler I was looking for
That's the "official" one
 
Current band obsession: Starset.
 
Quick C-- is effectively on GH, just not in the name Quick C-- ._.
 
6:25 PM
As a followup to the try-finally puzzle i mentioned earlier:
try {
  System.out.println("Hello");
  System.exit(0);
} finally {
  System.out.println("Goodbye");
}
What gets printed?
 
I don't know why you say goodbye I say hello?
I think it prints both, but I don't remember for sure
 
It only prints "Hello"
 
>.>
 
System.exit(0) halts thread execution
the jvm starts cleaning up
 
Compiled from "Lol.java"
public class Lol {
  public Lol();
    Code:
       0: aload_0
       1: invokespecial #1                  // Method java/lang/Object."<init>":()V
       4: return

  public static void main(java.lang.String[]);
    Code:
       0: invokestatic  #2                  // Method hello:()V
       3: return

  static void hello();
    Code:
       0: getstatic     #3                  // Field java/lang/System.out:Ljava/io/PrintStream;
       3: ldc           #4                  // String Hello
Yeah it jump to the finally after executing exit
> Intramar, the French Navy computer network, was infected with Conficker on 15 January 2009. The network was subsequently quarantined, forcing aircraft at several airbases to be grounded because their flight plans could not be downloaded.[18]
ok
 
7:06 PM
@Geobits Does Marky maintain the state of the RNN cells or is it discarded after processing a sequence
If not that's probably a potential improvement to his "context" abilities
@TuxCopter What is this output from?
A tool to pretty print bytecode like that would be nice
 
@quartata javap -c
 
@Poke PowerShell has strict casting, but it's very very loose on its conversions. You toss two things together and it'll happily try and mish-mash or re-cast or whatever to get it to work.
 
@TuxCopter Oh yeahhh I forgot about that
 
And for reference, the 0x is actually a special operator, not a type declaration. It takes a string input on the right consisting of [0-9a-fA-F] and interprets it as a hexadecimal number. It auto-upcasts the 0x100000000 to [int64].
 
hi all
 
7:13 PM
Then, because the left-hand of the + operator is [int64], there's an implicit up-cast from the explicit [int32] that 0xcafebabe produced.
 
I have a fastest-code suggestion.. How about computing the permanent?
 
@Lembik hey :D
 
hi @TuxCopter
 
@Lembik I was going to sandbox a code golf for that a while back but forgot
 
Do you have documentation for that? I thought it was just a way to define a hex literal
 
7:14 PM
I haven't posed really hard challenge for ages :)
@quartata ooh interesting
assuming you were asking me
 
oh sorry
@TimmyD
 
@quartata I think it's interesting as a fastest-code challenge as there isn't optimized code already out there as far as I can see
so it fits my criterion of being "almost useful" too :)
 
@TimmyD isn't it a compile-time operator though?
 
I suppose optimized code for permanent wouldn't be very useful since it takes exponential time.
 
@TimmyD The regex would need to be a bit more complex than that since underscores are allowed in numbers too
 
7:16 PM
If you really optimized, maybe you could increase N by 2 or 3!
 
0xFF_EC_DE_5E is valid
 
@Poke Not in PowerShell.
 
The approximation algorithms are more interesting IMO
 
@NathanMerrill PowerShell is interpreted, but yeah.
 
Oh we're still talking about powershell? My bad >.<
I mean Java :D
 
7:18 PM
Others are e, as in 2e3 = 2000, and kb, mb, gb, tb, pb for powers-of-two ... like 64kb = 65536
 
that's neat
 
Yeah. It's come in handy in a couple spots golfing as a way to get a big number quickly. Like, 2gb-1 instead of 2147483647 or [int]::MaxValue
 
There's the classic -1>>>1
(in java)
 
@Poke What
What does it do?
 
max int
 
7:23 PM
PowerShell it's -shl and -shr for bit-shift-left and bit-shift-right
None of this fancy << stuff
 
Ah I tought it was a << >_<
 
Is shr arithmetic or logical?
 
Arithmetic AFAIK
 
Yeah, arithmetic shifting
2-shl3 = 16
 
7:39 PM
how does powershell differentiate that from 2 - shl3?
 
Fun fact: C# doesn't have an unsigned right shift operator like >>> in java :[
 
neither do ruby or python
 
Does it have unsigned integer types?
 
yes
 
@ConorO'Brien that's cuz integers are infinite length in pthon
 
7:40 PM
Yeah you can do it with some casting, but it's not as nice as just >>>
 
Java only has that because there are no unsigned types.
 
@Maltysen yeah ik
 
also yes
 
Might as well not have the goes to operator either -->
3
 
@Maltysen And in Ruby
although there;s two types of integers, Fixnum and Bignum
 
7:43 PM
the goes to operator will always get a star in my book
@feersum Not exactly true. char is technically unsigned >.>
 
Yeah, stupid char. Always having to cast for math :(
 
^ those 5 bytes add up
 
Well you don't have to cast to do math, but you have to cast back to continue using it as a char. So six bytes :/
And that's if you don't need an extra set of parens, which you often do.
 
So, if anyone was here yesterday, looks like I don't have to worry as much about the actual building of the PC. I just need to worry about the triple touchscreen monitor setup and how it will interface with it.
 
yes that's what i meant
@Yodle that makes a lot more sense
 
7:46 PM
@Yodle Have it interface with frickin lasers.
 
They had interest in using a display splitter, does anyone know if a splitter will be able to handle three seperate displays at once? All I can find are people claiming no from like 8 years ago.
 
why not just get a good graphics card
 
^ that would be better
 
@Poke No idea what kind of card will be in it now, they wanna use a pc we already have.
 
Oh geez
 
7:47 PM
just turned a 100 line class into a 5 line function :)
 
nice!
 
er, 7, if you count the braces
given, there's tons of logic on each of those lines
 
See, this is why you should only add one extra line for braces. Learn from the Egyptians.
 
oh, the first brace is still on the function declaration
I have 5 lines of logic
 
Oh good :)
 
7:49 PM
During the meeting the guy brought up this: startech.com/AV/Displayport-Converters/…
 
I was in the process of converting over to using Eclipse.collections libraries
 
Now to make it perfect, make sure the indents are tabs.
 
...
 
and they have this awesome function 'aggregateInPlaceBy`
 
@Geobits ಠ_ಠ
 
7:50 PM
pls no tabs
 
@Geobits tabs and braces on declaration line, high-five!
4
 
I give it a function that returns a key to aggregate by
 
@Maltysen you know the truth as well!
 
@Maltysen It's the only way :)
 
@Yodle I don't know how much I would trust these. The DVI splitter was a hardware hack iirc. I would def look at reviews
 
7:55 PM
Seems like it works for some, not for others.
 
Out of all the things to go cheap on, you'd think the demo hardware for their main product wouldn't be the top choice.
 
@ConorO'Brien -shl is the operator. shl3 is meaningless and throws an error
 
@TimmyD do variables in powershell begin with $ or something?
 
Variables begin with $, yes. Almost every inline operator begins with -.
 
what about subtraction?
 
7:58 PM
Hence the "almost"
 
@Geobits It's a big company, the flight sim isn't our only product. Maybe for this specific team though, idunno.
 

« first day (2090 days earlier)      last day (2743 days later) »