Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Josh @ Dreamland

1111
I implemented uninitialized variable reporting in debug mode a while ago. Apparently it's since been broken. I'll reimplement it at some point. In the meantime, disregard polygone—that function is unrelated.

1112
Debug mode.

1113
Announcements / Re: News points
« on: March 21, 2012, 07:33:27 AM »
@fede - No.

Ugh, secondpage'd

Yes, DarkAceZ, I've not yet installed a button. Probably won't, either, because they didn't unify that segment of the API.

1114
Announcements / Re: News points
« on: March 20, 2012, 08:18:51 PM »
No.

1115
Announcements / Re: News points
« on: March 20, 2012, 02:09:52 PM »
I'm sorry, but it was just waaaaay too homo to read in that voice.

1116
Announcements / Re: News points
« on: March 20, 2012, 10:57:34 AM »
Fixed.

Now I'ma break it all again.

So I broke it.
But then I fixed it.
And now it's much cleaner.
I also fixed these tags' CSS.
Now they are less ugly when squeezed together.

Everything works with them now.


ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEF

Code: (EDL) [Select]
global int a; ///< A random global
variant b = "Mary had a little lamb"; // I LOVE THAT SONG
with (instance_nearest(x,y,obj_0)) x = 50; /* weeeeeeeeee */
return 0 + 'a'; /** Random documentation **/ /* weeee */ /*! more docs */

1117
I moved your post here because it seemed more appropriate. And yes; the reason I posted this topic at this stage is because I wanted input on precisely how varargs overloads would be resolved. I think it will be a lot easier on everyone if I resolve them like this:

1) Check if an exact overload exists.
2) Check if a castable overload exists.
3) Check if a varargs overload exists which would encompass it.

That way, max(double,double) is still used for max(int,int), but max(1,2,3) gets the varargs overload.

Also, the above makes it possible to extend a JDI method for the job.
Code: (C++) [Select]
function* get_overload(args) {
  function *r = jdi::get_overload(args);
  if (!r) {
    for (overload *o in r) {
       // Magically check for varargs overloading
    }
  }
  return r;
}

While I am on the subject... Would anyone be interested in int function(int a, varargs bcdwxy, int z) being a valid overload?

1118
Announcements / Re: News points
« on: March 20, 2012, 01:52:28 AM »
Well, this has been a productive night.

Syntax highlighting works, if you can't tell.

a2h, if you delete it this time, I swear to GOD...

Code: (PHP) [Select]
                        array(
                                'tag' => 'code',
                                'type' => 'unparsed_content',
                                'content' => '$1',
                                // !!! Maybe this can be simplified?
                                'validate' => isset($disabled['code']) ? null : create_function('&$tag, &$data, $disabled', '
                                    global $txt;
                                          $data = \'<div class="codeheader">\' . $txt["code"] . \': <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">\'
                                    . $txt["code_select"] . \'</a></div>\' . ($context["browser"]["is_gecko"] || $context["browser"]["is_opera"] ? \'<pre style="margin: 0; padding: 0;">\' : "")
                                    . \'<code class="bbc_code">\' . $data . \'</code>\' . ($context["browser"]["is_gecko"] || $context["browser"]["is_opera"] ? \'</pre>\' : "");
                                        '
),
                                'block_level' => true,
                        ),
                        array(
                                'tag' => 'code',
                                'type' => 'unparsed_equals_content',
                                'content' => '$1',
                                // !!! Maybe this can be simplified?
                                'validate' => isset($disabled['code']) ? null : create_function('&$tag, &$data, $disabled', '
                                    global $txt;
                                          global $context;
                                   
                                                $lang = $data[1];
                                    $geshi = new GeSHi(rtrim(html_entity_decode(preg_replace("/\&nbsp\;/"," ",preg_replace("/\<br \/\>/","\n",$data[0])),ENT_QUOTES|ENT_HTML5)), $lang);
                                    echo "<style type=\"text/css\">".$geshi->get_stylesheet( false )."\n.$lang { margin: 0; overflow-x: auto; }</style>";
                                    if($geshi->error() == GESHI_ERROR_NO_SUCH_LANG) {
                                                        $data[0] = \'<div class="codeheader">\' . $txt["code"] . \': (\' . $data[1] . \') <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">\'
                                      . $txt["code_select"] . \'</a></div>\' . ($context["browser"]["is_gecko"] || $context["browser"]["is_opera"] ? \'<pre style="margin: 0; padding: 0;">\' : "")
                                      . \'<code class="bbc_code">\' . $data[0] .  \'</code>\' . ($context["browser"]["is_gecko"] || $context["browser"]["is_opera"] ? \'</pre>\' : "");
                                                }
                                               
                                    $hrname = $geshi->get_language_name();
                                    $ndata = \'<div class="codeheader">\' . $txt["code"] . \': (\' . $hrname . \') <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">\'
                                      . $txt["code_select"] . \'</a></div>\' . ($context["browser"]["is_gecko"] || $context["browser"]["is_opera"] ? \'<pre style="margin: 0; padding: 0;">\' : "")
                                      . \'<code class="bbc_code" style="color:black;">\';
                                     
                                                $geshi->set_encoding("UTF-8");
                                                $geshi->enable_classes();
                                                $geshi->set_overall_class("source-$lang");
                                                $geshi->enable_keyword_links(false);
                                                $geshi->enable_line_numbers(false);
                                                // $geshi->start_line_numbers_at($args["start"]);
                                                $out = $geshi->parse_code();
                                                $err = $geshi->error();
                                               
                                                if($err)
                                                        $ndata .= $data[0];
                                                else
                                                        $ndata .= preg_replace("/[\r\n]/","<br />",$out);
                                               
                                                $ndata .= \'</code>\' . ($context["browser"]["is_gecko"] || $context["browser"]["is_opera"] ? \'</pre>\' : "");
                                                $data[0] = $ndata;
                                        '
),
                                'block_level' => true,
                        ),

Also, added languages to snip tag. this->test(c++); Was a pain in the ass because GeSHi insists on using <div> or <pre>. Wasn't even that rewarding, because you can't even tell anything in that snippet is being highlighted. <_<"

1119
Announcements / Re: News points
« on: March 19, 2012, 11:32:29 PM »
Okay, so maybe that isn't all. Going to try for syntax highlighting.

Code: [Select]
Basic code. Nothing special.

Code: (C++) [Select]
// C++ code
#include <iostream>
using namespace std;
int main(int argc, char *argv[]) {
  cout << "hi world";
  return 0;
}

Code: (YAML) [Select]
%YAML
---
yaml
: aint
markup
: language

1120
Announcements / Re: News points
« on: March 19, 2012, 10:27:16 PM »
One quick rule:

None of this faggotry.

That is all.

1121
Announcements / News points
« on: March 19, 2012, 10:25:46 PM »
Greetings, all; I have a few small pieces of news to report.

First and foremost, recent parse progress is here. Lines 2-110 were read in by the program as input; lines 114 and forward are complete program output. It should be a completely capable C parser by the end of tomorrow. Note: I said "C" parser, not "C++" parser. The difference being massive.

Second off, Gary is working on our mailserver issues. New members can't register at the moment because the server is incapable of sending mail. For those of you who have attempted to register, please hold tight, we will resend your emails once the mailserver is back up.

Lastly, I have added two BBCode tags.
The first is called "bubble." This is the default bubble. You can also specify your own color for maximum overkill.
The second is called "snip." I introduced this tag in the past in a custom BBParser, but now I added it to SMF. The snip tag allows you to put snippets of code inline with the rest of your sentence. To demonstrate, I will give usage.

The code [bubble]Hello, world![/bubble] gives this: Hello, world!

The code [bubble=green]Hello, world![/bubble] gives this: Hello, world!

The code [snip]Hello, world![/snip ] gives this: Hello, world!

And now you know everything.

Perhaps later I will add syntax highlighting again and we can all live happily ever after. Perhaps.

1122
1) Yes.
2) No. varargs uses only variant. I will see about supporting varargs<typename>.
3) It will more than likely be a static array, as the compiler will know the exact space to allocate. It will still offer quicksort and reverse functions.

1123
Proposals / Re: Edit Image/subimage... Button?
« on: March 17, 2012, 09:03:44 AM »
Oh, in that case, I'll be happy to load you up some keylogger functions. As long as it's for benevolent or educational purposes.

1124
There is no more overhead than using the old system. In fact, there might be less, since this is probably somewhere close at all times.

1125
Code: [Select]
void instance_destroy(enigma::object_basic* _E_SELF)
{
  if (enigma::cleanups.find(_E_SELF) == enigma::cleanups.end()) {
    _E_SELF->myevent_destroy();
    _E_SELF->unlink();
  }
}

Code: [Select]
void path_start(object_pathext* _E_SELF, int pathid, .......)
{
  _E_SELF->path_index = pathid;
  .........
}