PSA: make it easier to help you


#1

Sometimes questions on this forum fail to get a quick answer for reasons that may not be obvious to the person who opened the topic, but could be fixed easily when known. This is a list of suggestions that are commonly made, with the intention to make it linkable instead of being repeated every time.

Keywords are highlighted to make it easier to refer to specific points.

  1. Post quoted code, enclosing code blocks in triple-backticks ```:

    ```julia
    function f(x, y)
        x + y
    end
    ```
    

    This will highlight the syntax and use a monospace font.

    Don’t post your code as a screenshot, as it becomes very difficult to read and impossible to copy-paste, so many people will just ignore it.

  2. Indent your code to reflect its block structure (your editor should help you with this). Our eyes are used to indented code, and find it more easier for spotting errors.

  3. Make your example self-contained (“minimal working example”, MWE), so that it runs (or at least gets to the error that you want help with) as is, without any additional steps. This means including package loading, eg

    using ThatPackage
    

    and, if applicable, data that the code operates on. If your data is large or proprietary, generate test data and include the functions for that.

  4. Simplify your problem. Unless you are absolutely certain that the whole code is needed to exhibit what you want to show, make an effort come up with a simpler version. This step takes the most effort, but often this alone helps with locating the problem. Also, shorter and simpler examples get answers quicker.

  5. Include code instead of REPL output, except when the latter is relevant.

  6. People assume that you are using the latest stable version of Julia and released packages (you can ensure the latter with pkg> up). If this is not the case, make sure you note the relevant versions.

  7. If you have a plotting (style) question, including a plot with the desired output (possibly generated with other software) is helpful.

  8. You may not get a response here for packages with a very narrow audience. In that case, you may want to consider opening an issue on Github (or Gitlab, etc) for the package repository, just to ask a question. Most packages are OK with this.


Simple type question
Saving JUMPArray to JLD or JLD2 file
Format x-labels using VegaLite
91mUndefVarError: ClpSolver not defined
Mmap.mmap leaves the file open
Help with Logit NLP problem
Problem With Integer Stack Size
SharedArrays. Stability
JuMP Error: "Unexpected object missing in nonlinear expression"
Can the compiler automatically optimize this code?
Interesting problem with where parameters
Fast way to Implement a Loop
I need your Help!
Performance of log in nonlinear optimization
Help Couenne
Plotting with JuMP variables
Beginner: LoadError: InexactError: trunc..when convert dataframe
Julia falling asleep during optimization (blackboxoptim)
MWE - setindex bug?
Julia is slow questions - how to request information
Trying to use quadprog function from MathProgBase, has error "no method matching"
Library for (algebraically) complicated sums (and other expressions)?
BoundsError: attempt to access 5×100 Array{Float32,2} at index [[0, 5, … 490, 495]]
syntax: missing last argument in "2:" range expression when using include("MyModule.jl")
Unnecessary compilation happening on every call
MethodError
CUDAnative support for Float16
Applicationerror: solver (gurobi) did not exit normally
Parallelizing function returns no output
Why doesn't this code work? I can't figure out
Large size of plot files generated using Plots.jl with GR backend
ML feature importance in julia
Unexpected Type conversion
Is there a way to suppress "method overwritten" warnings?
Custom likelihoods in Turing.jl
Performance of Memory Mapped Arrays (vs. JLD2)
Function change
A usage about multi-dimension arrays
Testing a package with runtests.jl does not generate graphical outputs
s=ArgParseSettings()
Logical processes remain active after my parallelized program ends
Julia stops unexpectedly (after 10 mins of use)
Weave with PyPlot.jl
Slow runtime when assigning struct reference
Convert array to dictionary
Question on use of include from 0.6 -- 1.0
How to convert CartesianIndex{N} values to Int64
Trying to require Modules in a circular way, program just crashes
Where is the graphics documentation
Help speed up the function
Switch from HttpServer.jl to HTTP.jl
Problem with SPICE package installation
Use square brackets [] for indexing an Array
#2

This is great! Consider changing the title to something like “Guidelines for asking questions about code” (or something a little simpler).

Cheers,
Kevin


#3

Good idea. I do not even know what PSA refers to here :blush: I have two suggestions:

  1. Change the title to “Advice on posting to Julia Discourse”
  2. The advice (or an improved version) should be a Julia Discourse FAQ.

For more inspiration, here is the link to the equivalent FAQ for Stata:

https://www.statalist.org/forums/help

Update thanks to Google: PSA = Public Service Announcement


#4

Thanks for the suggestion, but I don’t think that a document like the Stata FAQ is what I had in mind, keeping it short was a priority.


#5

My personal addition:

  1. Be clear about which package you are talking about. A link to the github project repo is a good idea. Don’t assume there is only one package for doing a particular task, and that we will thus know what you mean when you say “the plotting package” or “the Markov Chain Monte Carlo package”. If you have an example following point 3 “Make your example self-contained” you should be fine.

#6

Thanks for the suggestions. I will wait a while for more and then edit. Another thing I missed is guidance about cross-posting.


#7

I’d like to add a comment for those seeking to post this in the future - while simply posting the link by itself may have the desired effect, including a sentence about why you’re posting it will be seen as far more friendly and welcoming. Eg:

Welcome to the Julia forums! Just so you know, you might have better luck getting answers if you follow some of these simple guidelines.

Or something.


#8

Very nice list!
I also had no idea what “PSA” might mean.
I’d especially value the 4th step: Simplify your problem. So I’d move that item to the top!


#9

Also to me it seems like a good idea to pin this topic.


#10

I would like to thank everyone for the suggestions. I updated the post, mostly minor rewording and highlighting keywords for easier reference.

This is a good suggestion, but I think that the point about MWE should cover this, so I decided not to make the list longer (lest it would not be read).


#11

We need a deep learning model built with Flux.jl to predict which posts needs this and a bot to auto reply with this.


#12

@xiaodai, maybe @discobot can help you with that


#13

Hi! To find out what I can do, say @discobot display help.


#14

@discobot display help

U r not a troll right?


#15

I currently know how to do the following things:

@discobot start new user

Starts one of the following interactive narratives: new user, advanced user.

@discobot roll 2d6

:game_die: 3, 6

@discobot quote

:left_speech_bubble: Carry out a random act of kindness, with no expectation of reward, safe in the knowledge that one day someone might do the same for you — Princess Diana

@discobot fortune

:crystal_ball: You may rely on it


#16

So u r a troll


#17

Why do you think so?

See here: https://blog.discourse.org/2017/08/who-is-discobot/


#18

I was assuming that the suggestion was the customization of the discobot welcome message to include this post.