Jump to content

minxomat

Active Members
  • Posts

    304
  • Joined

  • Last visited

  • Days Won

    5

minxomat last won the day on November 14 2015

minxomat had the most liked content!

About minxomat

  • Birthday May 27

Profile Information

  • Location
    Germany
  • Interests
    I'm a commercial lawyer.

Recent Profile Visitors

912 profile views

minxomat's Achievements

  1. Thanks to another contributor, zQuery now has even more ES6.
  2. Modern JS is great and does all sorts of things. Some of them have been in browser engines for years. Sometimes you just don't need jQuery (a huge library often just included for the sake of it). jQ has become so ubiquitous that some JS entry level devs think it's a completely different language. zQuery (long name zeroQuery) is an attempt to inform about old and new techniques that all have two things in common: The don't use jQuery, but have the same functionality, and they're faster, have wider support or are just cooler in general[citation needed] zQuery is a essentially a cheat-sheet, a quick reference, to build your own atomic APIs for whatever you are developing, without jQuery. It doesn't only contain plain JS alternatives, but also neat JS hacks (unlike the similar youdontneedjquery). You can find zQuery at the (share-friendly ) URL git.io/zQuery. Star it, read it, and if you have something in mind, contribute! An example plain JS plugin that uses zQuery techniques is my context-menu plugin justContext.js.
  3. @pedrit0, It seems the OOPE is the most popular project that I maintain. I provide support for OOPE and other projects almost exclusively on GitHub (since I don't actually use AutoIt anymore, I do not visit these forums frequently). My general policy is that I support every project I maintain on GitHub at the best of my abilities. So the answer is a question: Do you need a specific feature? Some features are in preparation but they depend on Beta functionality. I realize the OOPE is not as well documented as it could be . If you have an issue or a request, just open a GitHub issue - I don't bite . I can only judge the "stable"-ness of OOPE in the context of my own needs and thoughts. I encourage you to use it for whatever you want. Abuse it, hack it, that's the spirit anyway. Then you are very likely to run into bugs. E.g. the macro processor uses lazy parsing and might break on weird code. If that's the case, again, just open a GitHub issue, document your problem and I'll try my best . *cough*AutoIt*cough* Well, the same applies here. If through some miracle new features or syntax break version compatibility with AutoIt, open an issue (because it's essentially a bug). I developed OOPE with the then-current beta version (because Maps and stuff) and only dumbed it down a bit to make it work with the stable. Well, maybe, if the "bug" (It's a bug for me, I'm sure the AutoIt devs heavily disagree) I mentioned in my LINQ thread is "fixed" so we can indeed call functions by reference from Maps, I just might rework OOPE to include stack-based LINQing. I don't know yet , so don't wait for it. If you do any kind of development that needs to be stable, you should run automated tests. I didn't create tests for OOPE, so that's you responsibility. AFAIK AppVeyor is a CI that should support AutoIt.
  4. This is a continuation of my "series" of how to introduce some new machinery into AutoIt through syntax shenanigans. The first one was Stack-based LINQing. And like the first one, this also is purely for entertainment purposes. Some languages have a syntax construct "die", providing a quick way to make a somewhat graceful exit when something horrible happens (also, in PHP, you should die() at the end of every major execution path). There are two elements to a statement with die(): Check if something has gone wrong, and die() if it has. (Optional: Make horrible puns about dying) I decided to abuse the logical, short-circuit (this is important, non-short-circuit languages like VB.NET have extra keywords for this) "Or". To enable statements as expressions, we need to disable Au3Check. Here's a basic example: #AutoIt3Wrapper_Run_AU3Check=n $sTest = "hllo" "hllo" == $sTest Or Die("Oops") ; Works "hallo" == $sTest Or Die("Oops") ; Dies Func Die($s) Exit ConsoleWrite("!> " & $s & @LF) EndFunc Notice how there is no left side to the expression. If you provide a left side (e.g. a variable assignment), you can leave Au3Check on. A more elaborate example: #AutoIt3Wrapper_Run_AU3Check=n (SomethingImportant() Or Die(ErrGUI)) ; Works (SomethingImportant() Or Die(ErrCLI)) ; Dies Func SomethingImportant() Static $bFail $bFail = Not $bFail Return $bFail EndFunc Func Die($f = ErrCLI) Exit $f("Error while doing something important.") EndFunc Func ErrGUI($s) MsgBox(0, "Error", $s) EndFunc Func ErrCLI($s) ConsoleWrite("!> " & $s & @LF) EndFunc Notice the extra parens. Those are needed because the "()" after "SomethingImportant" close the expression and cause an error. As always, have fun
  5. VB6 is a completely different, no longer sold (but still supported) language from VB.NET (which the current version of is VB14). Pointers in VB6 are native pointers. What you need is exactly this: Yes. I suggest you read the AutoIt Helpfile on that topic, which should make this clearer.
  6. Uhm, could you rephrase that? This is a very weird sentence. A few hints though: AddressOf This .NET operator creates a delegate. One example of this is to provide other methods with handlers to digest events (eg. clicking a button). Pointers DllCallbackGetPtr get's a real pointer to an AutoIt callback method. Native code (not .NET) can use this pointer to call functions in your AutoIt script. This is not at all comparable to AddressOf, since the Dllxxx function use actual pointers. The last version of VB to support real pointers (and pointer arithmetic) is VB6. VB14's AddressOf has nothing to do with this. What you are looking for is Function References This (relatively) new feature in AutoIt allows you to pass references to functions as values in AutoIt. This can be used for the same purpose as AddressOf, here's an example: ; Actual code ProvokeError() ; will do nothing ProvokeError(True) ; will show error in console ProvokeError(True, UIHandler) ; will show error MessageBox ; Examples of handlers for different purposes Func ConsoleHandler($msg) ConsoleWrite("!> Error. Message: " & $msg & @LF) EndFunc Func UIHandler($msg) If MsgBox(4, "Error", "Message: " & $msg & @CRLF & "Do you want to exit?") = 6 Then Exit EndFunc ; This will do something Func ProvokeError($bFail = False, $hErrorHandler = ConsoleHandler) If $bFail Then $hErrorHandler("$bFail was true.") EndFunc
  7. Unfortunately, this means the death of my support of the Perseus project. I promise that the original VB source and the partly finished AutoIt port will remain public in my github account. I'm still convinced they provide a great learning resource.
  8. This is purely for entertainment purposes. It occurred to me that function pointers could be stored in Maps (why shouldn't they...), but the current beta mistakes them as objects when calling. Here's a workaround: Just explicitly cast the pointer to an expression (by using brackets) and go on from there. Of course, Au3Check needs to be disabled for this. So I built a proof-of-concept boilerplate code for LINQing over 1D AutoIt arrays using a global stack. This example shows the following: ; Example 1 ; ; 1) Get all three character strings from the input ; 2) Sort the list alphabetically ; 3) Delete items that don't match /M.+/ ; So with my code, this should work fine in theory: LINQ($aNames).Where(StringLen, Is, 3).Sort().All("M.+") But since this isn't implemented yet, we have to use two additional (ugly) brackets for this to work: _ArrayDisplay( _ (((((LINQ)($aNames).Where)(StringLen, Is, 3).Sort)()).All)("M.+") _ ) This works perfectly in the current Beta. Every query starts by feeding the array into the LINQ function. This function, and all other keywords (Where, Sort etc.) provide all other LINQ keywords to the next one. This enables nested queries. A query ends with All() and returns the result array. Anywho, here's the code: #include <Array.au3> Local $aNames = ["Hans", "James", "Alice", "Max", "Tom", "Mat"] ; Example 1 ; ; 1) Get all three character strings from the input ; 2) Sort the list alphabetically ; 3) Delete items that don't match /M.+/ ; _ArrayDisplay( _ (((((LINQ)($aNames).Where)(StringLen, Is, 3).Sort)()).All)("M.+") _ ) #cs This will be working when the func ptr is fixed: LINQ($aNames).Where(StringLen, Is, 3).Sort().All("M.+") #ce ConsoleWrite(@LF) Func LINQ($Input, $ReturnTo = ConsoleWrite) #AutoIt3Wrapper_Run_AU3Check=n If Not IsDeclared("LINQMEM") Then Global $LINQMEM[0] __linq_alloc($Input) If Not IsDeclared("provideFuncs") Then Global $provideFuncs[] $provideFuncs.Where = __flinq_Where $provideFuncs.All = __flinq_All $provideFuncs.Sort = __flinq_Sort Return $provideFuncs EndFunc Func __flinq_Sort() Local $storeResults = $LINQMEM[UBound($LINQMEM)-1] _ArraySort($storeResults) __linq_alloc($storeResults) Return $provideFuncs EndFunc Func __flinq_Where($executeFunc, $compareFunc = Null, $expectedValue = Null) Local $storeResults[0] Local $doMatch = $compareFunc <> Null For $Each In $LINQMEM[UBound($LINQMEM)-1] $tempVal = Null If $doMatch And $compareFunc($executeFunc($Each), $expectedValue) Then $tempVal = $Each ElseIf Not $doMatch Then $tempVal = $executeFunc($Each) EndIf If $tempVal = Null Then ContinueLoop _ArrayAdd($storeResults, $tempVal) Next __linq_alloc($storeResults) Return $provideFuncs EndFunc Func Is($a, $b) Return $a=$b EndFunc Func __flinq_All($regExp = "") Local $aTop = $LINQMEM[UBound($LINQMEM)-1] ReDim $LINQMEM[UBound($LINQMEM)-1] If $regExp = "" Then Return $aTop Local $storeResults[0] For $Each In $aTop If Not StringRegExp($Each, $regExp) Then ContinueLoop _ArrayAdd($storeResults, $Each) Next Return $storeResults EndFunc Func __linq_alloc($newMem) ReDim $LINQMEM[UBound($LINQMEM)+1] $LINQMEM[UBound($LINQMEM)-1] = $newMem EndFunc As you can see, this code can be easily extended: Add comparison keywords by defined clones of the Is() function, Add LINQ keywords by defining new __flinq_* functions and providing them via the LINQ initializer, Extend the handling for multidimensional arrays (and string (and numbers etc. (basically every AutoIt object))) I thought this was an interesting experiment and would be nice to share, Have fun.
  9. It's that time of the year again. Well, not quite yet, but soon, from March 25th to 28th 2016 in Saarbrücken, Germany to be precise. Revision is a demoparty held yearly on Easter since 2011 in Saarbrücken, the state capital of Saarland, located in southwest Germany. It is organized by the non-profit organization Tastatur und Maus e.V. and a large, international team of sceners. As an event purely from and for the demoscene Revision features everything you could wish for: multiplatform competitions, socializing and partying, awesome seminars and of course the unique Revision atmosphere created by us and YOU! It's time to prepare to meet and chat with awesome developers and learn new skills in seminars (with usually drunk hosts). Maybe you'll even spot some AutoIt folks there. It has happened before: (@UEZ and @AndyG if you wondered). This years theme is the return of EvilBot. A demoscene-hating robot that was introduced as Revision's main antagonist in 2012. Now he's taking over again, and even tries to run for president (#StillBetterThanTrump). How did that happen? You can watch the official 2016 invitation here (below) or download it here and run it on your own PC.
  10. Oh come on! Don't say you searched, because clearly you didn't. I said: And look, it is literally the second result: Which also contains a splendid example of the integration process.
  11. And here's the other trick I know: Use 32bit Bitmaps. You probably don't know what they are or that AutoIt supports them, so I give you the TL;DR: 32bit Bitmaps (aka Bitmap 5) are 8bit-transparent .BMP files. That means you can design UI elements as PNGs (with dropshadows and whatnot) and convert them using this utility. You won't be able to display them in the Windows photo viewer etc, but once loaded using GuiCtrlCreatePic, they're displayed with transparency and can be overlayed and handled just like ordinary controls. Furthermore, you can set the drawing z(!) direction using the extended window styles. Also pay attention to the order you create your controls in. Another tip: No harm is done if you utilize child GUIs to build easily manageable custom controls. You can also access the DeviceContext of every control, especially aforementioned bitmaps to apply other effects using clever blitting algorithms. The Windows MSIMG32.DLL provides some excellent tools for alphablending two or more DCs btw. Here's another screenshot of another project I did ages ago (for a client), where they gave me an SVG spritesheet of all pre-designed UI elements and I used the tricks mentioned above to put together a small interactive GUI. This shows the project in the early prototype (or proof-of-work) stage. Every element is working and interact-able, but the whole script only uses a couple of AutoIt controls bundled to custom controls using child GUIs.
  12. ITT: Snippets/screengrabs of horrible or otherwise funny code you've seen in the wild. I'll start of with something I wrote myself. This is in fact valid C# and is meant to compare two abstract objects. It is a recursive(!) expression body using nested ternary operators. Funny enough, it had no negative impact on the code maintainability index:
  13. I already use HTML for UI's in AutoIt. Search the forum for embedded IE 11 (or something like that). This allows you to include newer versions of IE and fire precise events from the DOM back to AutoIt, allowing seamless integration. Below is a screenshot from a project I did a while ago but dropped (IDE for Perseus 6). The whole GUI is done by AutoIt, except for the code editor field, which is an embedded, local, HTML page. The framework, the project treeview and toolbar etc. are AutoIt controls used in unusual ways. Why? Because it is something AutoIt is not made for and ultimately can't do: Display large amounts of styles dynamic content. That is what HTML and CSS are for and the possibility to use it is already there - you just have to put some effort into it. Don't expect a programming language to spoonfeed you the right tools . BTW: The icons used are already on your system. They are defined in the OEM Unicode section of the Windows System font (use charmap to explore): Segoe UI (Light/Symbol/Math). Be sure to experiment with the antialiasing option of GuiCtrlSetFont to get rid of some artifacts. Project Explorer Closed Project Explorer Open
×
×
  • Create New...