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

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.

Announcements / Re: News points
« on: March 20, 2012, 10:57:34 am »

Now I'ma break it all again.

[bubble=red]So I broke it.[/bubble]
[bubble=green]But then I fixed it.[/bubble]
[bubble=blue]And now it's much cleaner.[/bubble]
[snip=cpp]I also fixed these tags' CSS[/snip].
[snip=perl]Now they are less ugly when[/snip] squeezed together.

Everything works with them now.


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 */

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: (cpp) [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 [snip=cpp]int function(int a, varargs bcdwxy, int z)[/snip] being a valid overload?

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]
'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,
'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->start_line_numbers_at($args["start"]);
$out = $geshi->parse_code();
$err = $geshi->error();

$ndata .= $data[0];
$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. [snip=cpp]this->test(c++);[/snip] 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. <_<"

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: (cpp) [Select]
// C++ code
#include <iostream>
using namespace std;
int main(int argc, char *argv[]) {
  cout << "hi world";
  return 0;

Code: (yaml) [Select]
yaml: aint
markup: language

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

[bubble=red][bubble=orange][bubble=yellow][bubble=green][bubble=blue][bubble=purple][bubble=violet]None of this faggotry.[/bubble][/bubble][/bubble][/bubble][/bubble][/bubble][/bubble]

That is all.

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." [bubble]This is the default bubble[/bubble]. You can also specify your own color [bubble=red]for maximum overkill[/bubble].
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 [snip][bubble]Hello, world![/bubble][/snip] gives this: [bubble]Hello, world![/bubble]

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

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

And now you know everything.

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

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.

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.

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.

Code: [Select]
void instance_destroy(enigma::object_basic* _E_SELF)
  if (enigma::cleanups.find(_E_SELF) == enigma::cleanups.end()) {

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

Proposals / New ENIGMA Implementers' API; this concerns all developers
« on: March 15, 2012, 09:16:17 pm »
As the new parser approaches completion, it is time to start considering the implications. I have already made the executive decision of implementing half of this in the past, but what has been implemented will need some recoding, and the new parser allows for marvelous new extensions I would like to take advantage of. As such, I figure it would be good of me to draw up this proposal both to inform developers and open the floor for comments before they are implemented.

Developers heretofore have used the global [bubble]enigma::instance_event_iterator[/bubble] to determine the current instance and interface with its locals. At first glance, there's nothing wrong with this, but when we really consider its implications, we start to see its limitations:
  • Threads cannot manipulate this variable concurrently.
  • Sideways casts between virtual ancestors cannot be made correctly in other files.
  • Functions which change scope must synchronize their use of this variable.
  • This variable does not, in itself, affect the scoping of scripts and functions called therein.
We can correct all of this by having reflexive functions, such as [snip=edl]instance_destroy()[/snip], take an additional parameter, [bubble]_E_SELF[/bubble], of a particular C++ instance type (eg, [snip=edl]_OBJ_object0*[/snip]).

This is similar to the mechanism with which you are likely already familiar, the  [bubble]varargs[/bubble] type, which allows you to request an stdargs-like overload which you can treat like an array of parameters. It is similar in that each of these are semantics that can be declared in C++, but only used in EDL via the intervention of the parser.

The proposal, then, is as follows:
  • Any parameter with the type [bubble]enigma::varargs[/bubble] will be allowed to be passed an infinite number of parameters, as an array. The parser will handle packing the parameters given into the array in an efficient manner.
  • Any parameter with the name [bubble]_E_SELF[/bubble] and a pointer-to type will be invisible to the user and filled in by the compiler with a pointer to the instance in question, meaning [snip=edl]this[/snip] in events and member scripts, and [snip=edl]with->inst[/snip] in [snip=edl]with[/snip] statements.

The lexical stipulations should be my concern rather than yours. Basically, don't assume you can do anything stupid. For instance, the following is a set of legal overloads:
Code: (cpp) [Select]
int max(double, double);
int max(double, double, varargs);
While the following is ambiguous:
Code: (cpp) [Select]
int max(double, double);
int max(varargs);

The reason, of course, is that if you pass it two doubles, both functions are equally logical choices. Now, I could choose to give weight to the concrete matches precedence, but I'm asking for your opinions on that, first.

Now, as for the [bubble]_E_SELF[/bubble] parameter, if you think you have a better method of unambiguous identification for this which corrects issue (2) given above, let me know. Or, if you prefer a different name, such as just SELF, let me know as well. Otherwise, this will be the new format for the prototype:
Code: (cpp) [Select]
void instance_destroy(enigma::object_basic* _E_SELF);

So, post suggestions, or be aware that these two modifications mean changes to the API, including existing functions.

Floor's open. Be informed. Feel free to contribute.

Proposals / Re: Edit Image/subimage... Button?
« on: March 15, 2012, 02:19:08 pm »
I'm mostly trolling, but... :P

Proposals / Re: Edit Image/subimage... Button?
« on: March 15, 2012, 09:54:54 am »
So it's a keylogger?

Games use WM_KEYDOWN. Applications use the hotkey API. Keyloggers use hardware scan functions.

Proposals / Re: Edit Image/subimage... Button?
« on: March 12, 2012, 11:53:54 am »
It is pretty different, isn't it. I think DarkAceZ wants a button with the little pencil and paper icon ("edit") between the paper with the star ("new") and the big X ("delete").

Also, I'd move that "wrap" checkbox on its own somewhere where it's more noticeable and less hideous. Like under that scroll pane with the subimage thumbs. Then right-align the arrows.

While we're proposing features, I'd like to see a button myself, with the icon you use for the effects tile. It should have options to quickly invert all subimages (255 - channel), flip/rotate all, reverse order, add reverse order, and if you're feeling jumpy, any of GM6's stock effects (fade from one subimage to another, rotate by a fraction of a given angle each subimage, shrink from a given subimage, grow to a given subimage, etc). Depending on just how jumpy you feel, I'm personally in the market for a "color to alpha" and "alpha to color" function--the former does some math on the color channels to determine the alpha channel (probably comp<,,>(<,,>)), the latter just renders the image over a background of that color.