I have programmed a chatbot which can enter sourcecode on AI.stackexchange. The problem is that the button for insert a codesnippet doesn't work, because the chatbot isn't able to find the correct location of the icon. Is it possible to use a different HTML form than the normal one of Stackexchange to simplify the edits?

original message

I just noticed something in AI stackexchange. Apparently we cannot insert pieces of code in the question or the answer i.e the java-script/HTML/CSS snippet. Why so?

I understand this site does not try to entertain implementation details, but still it would be a useful feature to have, to write algorithms in a beautiful way. What is the community's opinion on this and what should be done?

| |
  • $\begingroup$ @ManuelRodriguez I think it might have been better to simply create a new question, rather than editing DuttaA's older question to suddenly turn it into something completely different... That said, you can format blocks of code (without syntax highilighting or anything like that) simply by putting 4 extra spaces in front of every line. Putting it in between <pre></pre> or <pre><code></code></pre> tags may also work. Also see meta.stackexchange.com/q/22186/376651 $\endgroup$ – Dennis Soemers Aug 23 '18 at 8:09
  • $\begingroup$ @Dennis I'm trying to understand what the OP is about. DuttaA wrotes “Apparently we cannot insert pieces of code in the question or the answer i.e the java-script/HTML/CSS snippet.” but he can use the pre-tag for the java-script snippet too, isn't it? $\endgroup$ – Manuel Rodriguez Aug 23 '18 at 8:15
  • $\begingroup$ @ManuelRodriguez i do not use math notations so i don't know if you are talking about that..but i found a way to go around by simply copying the header and footer from SO $\endgroup$ – DuttaA Aug 23 '18 at 8:18
  • $\begingroup$ @DuttaA Ah, you save a Stackoverflow URL as a HTML file on the local harddrive and embedded this into a pdf document for publication. Clever idea. So you had problems with exporting the sourcecode from the SO website? $\endgroup$ – Manuel Rodriguez Aug 23 '18 at 8:28
  • $\begingroup$ @ManuelRodriguez LOL no..i just copy the header and enders which follow a code snippet on SO which makes it a code snippet here $\endgroup$ – DuttaA Aug 23 '18 at 8:51
  • 1
    $\begingroup$ @DuttaA I see, we are understanding each other very well. Greetings to India (according to the profile page this is shown as your timezone) $\endgroup$ – Manuel Rodriguez Aug 23 '18 at 9:34

I am thinking this could be in part of the variety of computers we could be on, the variety of the computing powers of said computers, and the variety of computation power required for various types of Neural Nets and such.

Say a specific piece of code works just fine on your Chromebook. This piece of code would also work just fine on any other device that can do parallel computations. This piece of code may still work on a RaspPi 3, but take 15-times longer to set up, train, test, etc.

What gets even worse is when the Library you use only supports a specific set of OS. You don't know what anyone seeing your question/answer uses.

So the main issue is the variety of computers out today, the variety of computation power supplied by those computers, and the variety of computation power required by various implementations of AI.

Therefore, not much can be done but test a piece of code on every device possible, and then and only then post the code. This becomes an issue when newcomers do not know about this. They may post a piece of code that works just fine on their computer, but results in disaster on others.

| |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .