• 6 Posts
  • 75 Comments
Joined 2 years ago
cake
Cake day: July 4th, 2023

help-circle





  • ReptoriantoProgrammingWhat are you working on?
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    19 days ago

    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.











  • ReptoriantoAdvent Of Code🦌 - 2024 DAY 2 SOLUTIONS -🦌
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    4 months ago

    G’MIC solution

    spoiler
    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}
    




  • ReptoriantoPythonIs Python Really That Slow?
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    4 months ago

    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.