« first day (2035 days earlier)      last day (2808 days later) » 

By legal proofs I meant meta post
 
@Anastasiya-Romanova秀 Sure. I personally wait a bit to give others a chance before answering myself, but that's just what I do.
 
@Anastasiya-Romanova秀 if you are interested here is the relevant help center post stackoverflow.com/help/self-answer
 
15
A: Can I compete in my own challenge?

ProgramFOXYes, particpating in your own challenge is allowed, no matter of which challenge type. The Help Center says: It’s also OK to participate in your own puzzles. But if you participate in your own challenge, it is recommended to wait some time before posting an answer to give others a chance to...

@RohanJhunjhunwala Wrong SE site. We probably have the same text right now, but that will hopefully change in the future.
 
@RohanJhunjhunwala I know that fact, what I'm asking is here
I'm asking about ethical aspect
Not general rules
 
4:03 AM
Oh my bad, Let me delete the post
@Anastasiya-Romanova秀 it is ethical as long as you dont win
 
@Dennis Thanks for the relevant meta post
 
@Anastasiya-Romanova秀 also like Dennis mentioned do allow others time to answer
 
@Dennis if the implementation is run on machine with infinite memory, yes
btw quick-question: which do u think is faster to learn C++ or Java?
I know C but i also am very familiar with OO concepts
 
@RohanJhunjhunwala You can win too. The meta post mentions it.
 
Java is faster to learn
 
4:06 AM
But it takes more time to type. :P
 
@Dennis yes while you technically can win, I do try not to have myself win a challenge
 
C++ is literally 100 times more complicated than Java.
 
@EᴀsᴛᴇʀʟʏIʀᴋ nice drawing although I disagree with the image
 
Java is fun come to the dark side
And learn lots of reflection (although C probably has it too)
 
@feersum I'm familiar with C so with that, isn't Java more complicated with all of its interface, class, public static main void?
 
4:07 AM
@Downgoat Um, sure.
 
@Downgoat an I borrow your machine with infinite memory, thanks! I only need it for a day or two
 
do u need to import System in Java? tutorial isn't showing it but I've swear I've seen it done before
 
Well, if you had to pass a test 'Write C++ code that does X', you could pass it with C.
 
@Downgoat it's fairly sinple.
@Downgoat do't rely on code golf code for best practices
import System is not needed
 
But if you had to know the rules of the language, C++ is much more.
 
4:08 AM
@RohanJhunjhunwala I guessed so but is it good practice?
 
But it can golf off bytes with System.out.println -> out.println() , I would say its generally not
 
ok
 
import System is un idiomatic as far as I can tell
 
I agree, no one does that in normal code.
 
question: what is java equivilent of header file?
 
4:09 AM
whoops
meant to edit
package
package somepackage;
 
does java have named properties?
 
@Downgoat Java
 
@Downgoat What does that mean?
 
@Downgoat Nothing
 
does java have loose-typed mode?
 
4:10 AM
idk, what named properties are
@Downgoat type inference
 
@Downgoat Basically automatic headers
 
@Dennis Right now I have no ability to create a programming language and it's unlikely in the future, so I'm wondering can I create my own 'built-ins' as a function or routine for competing in golf-code but the so-called built-ins is excluded from bytes count?
 
@RohanJhunjhunwala it has that? awesome
 
@Downgoat No, not even type inference (i.e. var)
 
ArrayList<Type> a = new ArrayList<>();
 
4:10 AM
Hi guys
 
@ASCII-only see the above comment
 
@RohanJhunjhunwala That's the only "loose typing" in java
 
Rarely used anyway
 
eh... I use it, solely cause netbeans recommends it
 
4:11 AM
Oh. So to understand: I can simple add files to a "package" and they all share their classes?
that's very nice
 
@Downgoat ?
 
@Downgoat that is correct
 
I'm putting together a healthbar renderer program (for a forum game I plan on starting soon), and this is what I have so far:
import java.awt.*;
import java.awt.image.*;
import java.io.File;
import java.io.IOException;
import java.util.*;

import javax.imageio.ImageIO;

public class BossHealthBar {
	public static void main(String[]arg) throws IOException{
		BufferedImage bi=new BufferedImage(2000,60,BufferedImage.TYPE_INT_ARGB);
		Scanner s=new Scanner(System.in);
		int hp=s.nextInt();
		int mhp=s.nextInt();
		int barsTotal=0;
		int barsLit=0;
		while(mhp>200){
			barsTotal++;
			mhp-=200;
		}
		while(hp>200){
			barsLit++;
 
@Downgoat Yes, use package <name>; at the top
 
@ASCII-only e.g. new Goat(breed: "sheep")
 
4:12 AM
@SuperJedi224 this is not code review
 
@Dennis i don't know a lot about this, but you may be interested (probably not) in shinh's bflisp github.com/shinh/bflisp
 
@Downgoat Goat upGoat = new Goat(Breeds.sheep);
where upGoat is the name of the new goat
 
49
A: A guide to moderating chat

bluefeetWhat tools are available to regular chat users? You, as a member of the community, have the ability help keep chat a place that is welcoming for everyone. There might be a variety of other users, including moderators and room owners, in chat with you. Users can be distinguished by the way thei...

 
@RohanJhunjhunwala oh so java has enums?
 
4:13 AM
brb googling >_>
 
@Downgoat No
 
@ASCII-only yes
 
> "Multiple users are discussing PHP" --> "ignore them"
Hahaha
 
C# is a lot better than Java in most things
 
4:13 AM
enum stuff{
}
 
@RohanJhunjhunwala That's not true named params
 
@Anastasiya-Romanova秀 By our rules, you'd still have to create a language. That doesn't have to be complicated though; the interpreter could simply define a set of function and eval the source code.
 
@ASCII-only Ease of programming is not one of them
 
@SuperJedi224 It is
 
@ASCII-only ?
 
4:13 AM
@ASCII-only I'd like to learn C++ or C# but i only have 1 hour....
 
Though frankly java's not great there either
 
@Downgoat C#, you get to use var
 
@Downgoat learn java come to the dark side
Code once run everwhere
 
@SuperJedi224 How
@RohanJhunjhunwala Same with C# + Mono
 
@ASCII-only shhhhh
Java is the language of the future
 
4:15 AM
@ASCII-only yes but i spent like 5 minutes and i know so much java
 
yes, I finally have gotten someone to join forces
Soon you'll be golfing bowling answers in java
With Geobits and I
 
@MitchSchwartz A C compiler in brainfuck? Oh dear...
 
C# has named and optional params
@Downgoat C# is more similar to JS, you'll learn C# faster
 
A C compiler in brainf*** which compiles C to BF is even more wizardry
 
> This file is too big to show. Sorry!
 
4:16 AM
@EᴀsᴛᴇʀʟʏIʀᴋ pls open an issue
 
@Downgoat java is superior
 
@EᴀsᴛᴇʀʟʏIʀᴋ pls open an issue
 
@ASCII-only are you kidding 50% of JavaScript is Java
i am also on mac so can't c# iirc
;_;
@RohanJhunjhunwala yes i agree now
 
@Dennis So it means I cannot create my custom built-ins for golfing here, right?
 
owow java has like same prop names as JS
 
4:17 AM
@Downgoat C# is basically a clone of Java with JS features that can be managed
@Downgoat Mono
 
@ASCII-only i will learn c# later maybe
 
@Downgoat C# is mostly the same, but they start with capitals
 
C# isn't option anyway
 
@Downgoat :D
 
@ASCII-only :D PascalCase FTW
 
4:18 AM
@Anastasiya-Romanova秀 No, you can, but you just have to call it a language.
 
@Anastasiya-Romanova秀 Sort of. You need an interpreter or at least a transpiler, and once you do, you pretty much created a new language.
 
@Downgoat seriously no var, no optional params and no named params is such a pain for larger projects
 
That's really all that V is
 
@ASCII-only i just need to know enough java for copmuter science teacher to know im legit
 
4:19 AM
I guess I made the image output too wide
 
@RohanJhunjhunwala google is giving me long answers. can you quickly tell me what different between String[] and ArrayList<String> is?
 
@Anastasiya-Romanova秀 What language are you planning on adding builtins to?
 
@Downgoat ArrayList allows you to add elements to the end
 
@Downgoat String[] is fixed-length, ArrayList<String> is not
 
4:21 AM
It is a dynamically resizing array
 
@Downgoat I guess it's good to learn though, I'm using it because Java is probably faster on Android
@Downgoat Basically ArrayList has add, remove, get and put
 
whole world also uses java
@RohanJhunjhunwala ah ok
how to convert array to arraylist?
 
Arrays.asList(someArray) @Downgoat (I think
or manually
 
Arrays?
 
ArrayList x = new ArrayList(); for(String s:array)x.add(s);
@Downgoat so static methods
Arrays is a static method library
oh my bad
clueless without netbeas d'oh
 
4:23 AM
no wait
 
@RohanJhunjhunwala what does :array do?
 
@RohanJhunjhunwala my bad, it is Arrays
@Downgoat in
 
ah ok
 
@Downgoat enhanced for loop
 
foreach(var s in array) basically
 
4:24 AM
^^
 
java is cool
 
@DJMcMayhem Well, by custom built-ins I meant functions that I can be used in the future for golfing but it must store in a repository here. Don't know how to use Github but we can use a sanbox on meta post
 
@Downgoat since no one else is, let me advocate C++. It took me a week to learn C++ while I have spent the last month and a half unsuccessfully trying to understand java. Not the case for everyone but C++ can be very easy to learn especially if you are familiar with C.
 
brb reprogramming cheddar in java
 
for(Type t:array) is for each t of Type t in the array
 
4:24 AM
Also I fiddled with the code for deciding the width of the output image, should work better now
 
I have converted Downgoat my life acheivement
 
Yeah, that's fine
 
@SuperJedi224 D: pointing to C#
 
It shows 12/24 BTW
@ASCII-only Now it's pointing at the post I meant it to point at
 
@EamonOlive C++ is definetly on my TODO list for languages to learn but while I'm familiar with C, I'm not an expert and considering my experise at JavaScript, I feel Java will be quicker to learn for me than C++
@RohanJhunjhunwala :D
 
4:26 AM
I kinda know C++, but not very well
 
@EamonOlive Yeah, but Downgoat is more familiar with OOP JS
 
@RohanJhunjhunwala ok if java regex doesn't have lookbehind I'm leaving
 
@Anastasiya-Romanova秀 What language were you planning on writing them in though?
 
:O :O :O :O
 
4:27 AM
@Downgoat No D: why
 
JAVA DOESNT HAVE REGEX LITERAL
OMG THIS IS DEAL BREAKING
 
Also, I highly recommend github, you should learn it
 
@Downgoat Use .NET regex, it's the most powerful
 
@Downgoat relax String.replaceAll();
 
hm but the regex flavor looks good
 
4:27 AM
@DJMcMayhem Doesn't exist yet
 
@ASCII-only ik
 
got to sleep now rip
gn
 
@RohanJhunjhunwala bai
 
@DJMcMayhem link
 
i gtg sleep too
 
4:27 AM
@Downgoat bai
 
bai
 
@Dennis @DJMcMayhem Let say I want to compete in golf-code using VBA that involves alphabet, but it turns out VBA has no built-in alphabet. So I create a function say A()="ABCDEFGHIJKLMNOPQRSTUVWXYZ" in meta sandbox then I can use that function in the future
 
@Anastasiya-Romanova秀 You can just assign to a variable to make it shorter
 
@ASCII-only I did, but it's 30 bytes
 
@Downgoat It is rather annoying
 
4:29 AM
@Anastasiya-Romanova秀 Oh yeah
 
@RohanJhunjhunwala PLS HALP HOW TO CHANGE STRING IN JAVA
 
If I can call function A, then it's a byte
 
@Downgoat Change?
 
strings in java are immutable
 
@Anastasiya-Romanova秀 The best way to do that would be make a VBA library, and put it somewhere online, then add import my_lib to any submissions using it
 
4:29 AM
everything is pass by vlaue too ;_;
idk how to anything anymore
 
@Downgoat How do you want to change string?
 
e.g.
 
@Downgoat Yeah, same as JS
 
Or whatever the syntax is
 
String a = "hai"
a = a+ " goat"
SO is telling me I can't do that
 
4:30 AM
wat
 
@ASCII-only wait sorry see again
6
A: Change string in Java

Mark ByersYour method cannot work with the current interface because of two reasons: Strings are immutable. Once you have created a string you cannot later change that string object. Java uses pass-by-value, not pass-by-reference. When you assign a new value to s in your method it only modifies the local...

 
@DJMcMayhem I wish I had that kind of ability but I couldn't. I'm still pretty new to code in general
I mostly use it for reporting purposes
 
@Downgoat You can, just not in a method
 
@Downgoat That's exactly backward. Everything in Java is pass by reference (Objects), except non-array primitive types.
 
wait wat
 
4:31 AM
Well, I did use it to evaluate Integral too in the past
 
@Downgoat Use semicolons
 
@Downgoat If you change in a method, it creates a new instance, so it won't change the variable passed in
 
@ASCII-only wait so is Java pass-by-reference like JS's?
I can pass a class and it won't copy it?
 
@Downgoat Yes
 
@SuperJedi224 oh sorry
@ASCII-only @internet Y U LIE TO GAOT ;_;
 
4:32 AM
Also, I drew this on Drawception a few days ago:
 
@Downgoat It's just you can't reassign a parameter in a method since it's pass by reference
 
Unfortunately java doesn't let you mark arguments as variable references, though JS really doesn't either
 
@Downgoat hmm .NET has no regex literal either
 
Anyway, I guess I need to go now
 
 
1 hour later…
5:54 AM
Hey @LeakyNun. I think I found the bug in my Bernoulli code, but I have another question for you
 
@Sherlock9 go ahead
 
You found an Actually program that would add fractions even with other stuff on the stack. Say you have a list of several fractions. How would you sum them?
 
@Sherlock9 find the product of the denominators
scale up each fraction
integer addition (sum)
then attach the product as denominator
then use the simplifier
 
Thanks a bunch :D I'll write it up as soon as I get home
 
6:14 AM
hi
*AHEM* HELLO
 
6:32 AM
@Sherlock9 here but it requires the stack to have no other elements
 
6:50 AM
@Dennis @MartinEnder @mods Could someone unfreeze the Pyth chat room: chat.stackexchange.com/rooms/24159/pyth
 
0
Q: Smallest palindrome divisible by the input

FatalizeGiven a positive integer N, output the smallest positive integer such that this number is a palindrome (i.e. is its own reverse) and is divisible by N. The palindrome (i.e. the output) must not need a leading zero to be a palindrome, e.g. 080 is not the valid answer for 16. Your program may tak...

 

« first day (2035 days earlier)      last day (2808 days later) »