Forum Replies Created
-
AuthorPosts
-
Also, you can write & use extension methods, look at example:
Monkey12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152Namespace myapp#Import "<std>"Using std..Function Main()Local st:=New Stack<Int>st.AddAll( New Int[](-2,0,10,54,3,-7) )Print "source values:"For Local i:=Eachin stPrint iNextst.RemoveIfLess( 0 )Print "filtered values 1:"For Local i:=Eachin stPrint iNextst.RemoveIfGreater( 50 )Print "filtered values 2:"For Local i:=Eachin stPrint iNextEndClass Stack<T> ExtensionMethod RemoveIfGreater( valueToCompare:T )Self.RemoveIf( Lambda:Bool( value:T )Return value>valueToCompareEnd )EndMethod RemoveIfLess( valueToCompare:T )Self.RemoveIf( Lambda:Bool( value:T )Return value<valueToCompareEnd )EndMethod RemoveIfEquals( valueToCompare:T )Self.RemoveIf( Lambda:Bool( value:T )Return value=valueToCompareEnd )EndEndNovember 14, 2017 at 6:11 am in reply to: [Solved] can't use JsonObject.All, don't understand Iterators #11692Some additional iteration cases:
Monkey12345678910111213141516171819202122232425262728Namespace myapp#Import "<std>"Using std..Function Main()Local json:=New JsonObjectjson["hello"]=New JsonString( "Hello, " )json["world"]=New JsonString( "world!" )' case 1 - using Map.Node<String,JsonValue>For Local node:=Eachin jsonPrint "1: "+node.Key+" : "+node.Value.ToString()Next' case 2 - using Map.Keys, key is String hereFor Local key:=Eachin json.Data.KeysPrint "2: "+key+" : "+json[key].ToString()Next' case 3 - using Map.Values, val is JsonValue hereFor Local val:=Eachin json.Data.ValuesPrint "3: "+val.ToString()NextEnd@hezkore, you totally removed Windows Kits folder, and my project can’t compile.
I added this folder and now can compile it. Maybe we can ‘clean’ this folder too to reduce size.
And maybe will be better to put instructions.txt into archive to have all-in-one.
Very nice file size.
Maybe 7z compression by SFX format (self extracting).
@hezkore thanks for your prepared version!
I tried to repack files into 7z format and I got 252 mb, in zip it is 752 mb.
But… Less size + MORE expensive extraction time = small profit (or not).
I think it would be good to have precompiled msvc-ish version on itch.io.
Here are the themes updated to use ‘TabButtonLocked’
Tx! Pushed into dev.
If you ever want any help with the themes or anything Nero, either mail me or drop by the IRC room and tell me what you need.
Okay.
Yesterday I fixed some issues with docs tree view, pushed into dev:
- Fixed incorrect mouse click position;
- Show help for ident by second F1 press;
- Fixed results highlighting.
I also tried to show-results-only in tree, would it be usefull for anyone? see screenshot.
But I left all items, with results highlighting.
Attachments:
I can’t read the last item in this list
Added it TODO.
The IDE displays fine on the laptop but if I drag the window onto the monitor then it gets clipped (see attachment)
Seems to be addressed to Monkey2 not ted2go to fit window into current monitor dimension. Will read SDL docs.
You can use App.KeyEventFilter in any place, but OnKeyEvent only inside of View-based classes like Window.
What if my key-logic know nothing about window?
You can specify own application key filter and grab any keys:
Monkey1234App.KeyEventFilter += Lambda( event:KeyEvent )' do something by key eventEndThis works BUT currently also creates a new material for the frame instead of just sharing the same material as the atlas – so my version was initially slower than ethernaut’s by a large margin! Fixing this so that all images created from other images ‘share’ the same material gives a considerable speed up – was getting about 50K images @60hz with ethernaut’s version, now get about 180K with mine!
Will push this change to the repos soon.
Super-good!
But how does user ‘know’ they are using an extension and it’s safe to skip ‘?.’?
If there’s a possiblility an object could be Null, coder should always use ?. or check for null IMO, regardless of whether member is an extension or not. Extensions should, IMO , behave as much like ‘normal’ methods as possible.
I agree.
Main rule here: all code – including extensions – should be fully documented!
I don’t invite you to write all null-checks inside of extensions, I just shown the way we *could* to use it.
There is a String.IsNullOrEmpty() extension method in c# to eliminate null checking until it has ?. operator that comes with c# v6.0.
Yes it should. Self in extension not equal to self in usual class.
Extension methods converted into plain functions by mx2cc. I think we need to have explanation of it in docs if have no yet.
Thanks!
New stuff in dev branch: Project tree – added Cut / Copy / Paste actions on files and foldes.
Now we can create copy of files, with showing “enter new name” dialog if file or folder already exists.
Comfortable and rapid development is here.
Attachments:
-
AuthorPosts

