Skip Navigation

InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)R
Posts
5
Comments
88
Joined
3 yr. ago

  • Sometimes, I just rewrite my code until it is good enough. Other times, I leave it to my memory, so I can figure it out later. And others, I'm just not happy about it, like the times I did bigbin2dec and it would only work well with something like thread-ripper.

  • It means that I made changes to code, so that it can work with any multi-threading strategy. G'MIC is a interpretative language with JIT support, and you don't have any control over automated multi-threading strategy. It can be thread 0 to thread N linearly, or even interleaved. So, the workaround is to make a image of size equal to cpus count, and do the multithreading there.

    Yeah, I love image processing, I worked on it for 8+ years now.

  • I use it for scripting too. I don't need Python as much as before nowaday.

  • As always, I do image processing. I'm a G'MIC filter developer. Recently, did some code changes to my combinatorics tools to be insensitive to multi-threaded strategy.

  • Just use Rust. Eazy Peazy. C++ will likely be still be used because it's just not realistic for some softwares to switch to a safer programming language.

  • Uh, that would be infuriating to see. (Yes, I can see tabs in KDE Kate)

  • What if you use tabs for indentations and space for alignment?

  • What if you prefer a DSL? I use G'MIC for image processing tasks.

  • I moved to Waterfox recently. Google Chrome, hell no.

  • I use states, but no classes. G'MIC is my main language. I do appreciate the functional way of thinking after writing in it for so long. States are just variables that defines the mode of something, right?

  • I dislike Python as well, but it has it place. I only use it for quick code tests before doing it in other languages.

  • G'MIC solution

     
        
    it day2
    crop. 0,0,0,{h#-1-2}
    split. -,{_'\n'}
    foreach { replace_str. " ",";" ({t}) rm.. }
    
    safe_0,safe_1=0
    foreach {
    	({h}) a[-2,-1] y
    	num_of_attempts:=da_size(#-1)+1
    	store temp
    
    	repeat $num_of_attempts {
    
    		$temp
    
    		if $> eval da_remove(#-1,$>-1) fi
    
    		eval "
    			safe=1;
    			i[#-1,1]>i[#-1,0]?(
    				for(p=1,p<da_size(#-1),++p,
    					if(!inrange(i[#-1,p]-i[#-1,p-1],1,3,1,1),safe=0;break(););
    				);
    			):(
    				for(p=1,p<da_size(#-1),++p,
    					if(!inrange(i[#-1,p-1]-i[#-1,p],1,3,1,1),safe=0;break(););
    				);
    			);
    			safe;"
    
    		rm
    
    		if $>
    			if ${} safe_1+=1 break fi
    		else
    			if ${} safe_0,safe_1+=1 break fi
    		fi
    
    	}
    
    }
    
    echo Day" "2:" "${safe_0}" :: "${safe_1}
    
      
  • I guess I can try this again in G'MIC.

  • People should use less Ai, and learn more how to program

    Yes. Once you know how, you can see pitfalls with AI.

  • Interesting, but I never needed AI for coding. Well, twice, and I had to do changes, but would not use AI to generate code.

  • My small Python (~100 lines of codes) codes aren't maintainable, but I'm happy with them. I don't ever plan to work on serious projects with Python, so I can't say much about it's maintainability. But, from limited experience, I'd rather use C++, C#, or in my special case, G'MIC if maintainability matters to me.

  • In my experience, it is.

    I had converted a Python code into G'MIC, and then some one else did a Python version of my own code. G'MIC is interpretative with JIT math parser. The results:

    Reversing digits in a 1024x1024 RGB image.

    Python: Without lookup table and numpy - 3+ minutes

    Python: With lookup table and numpy - 6.5 s (Some one else machine, but it shouldn't take that long)

    G'MIC: Without lookup table - .3 s

    G'MIC: With lookup table - .005 s

    And I did Lavander Binary Map on my machine, you can find code for Python version in github/gmic-community/include/reptorian.gmic:

    Python: 3 s (Without lookup table)

    G'MIC:.15 s (Without lookup table)

    G'MIC: .05 s (With lookup table)

    Honestly, I find Python pretty bad for image processing in general.

  • I use Levels filter tool for that in Krita. Already non-destructive.

  • Yes. <center></center> isn't part of HTML5. It is part of HTML4 though.