[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • You may highlight syntax and preserve whitespace by using [code] tags.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


[Advertise on 4chan]


What are you working on, /g/?

Previous thread: >>107840984
>>
>>107873347
feel free to explain how applying design patterns before any implementation is better, especially in the context where someone is asking about design patterns the first place, which implies they have no experience with them

>refectoring is somehow just renaming bunch of functions
do you think renaming is all an IDE can do?
>>
I implemented a better pruning algorithm for my text generator. I prune the top percentile of contexts by "cost" where cost is (roughly speaking) the ratio of the size of the context to the probability it is to be selected. The issue I'm running into now is sometimes the pruning process fails due to OOM. Pruning is triggered when the process hits its memory limit, but pruning itself requires a small amount of memory (removing a token from a context requires creating a new copy with the token removed, then freeing the old one), I currently work around this by reserving a small amount of memory that can only be used during pruning, but due to fragmentation even this will fail occasionally. I'm not sure how to work around this other than by gradually bumping the memory limit on OOM during the pruning process, but I want to be able to hard-limit the memory usage. Maybe some kind of compactifying allocation scheme could work? Like instead of using pointers to separate context objects, I could use keys in a map, and on OOM I could iterate the map to compactify several contexts together, thereby reducing fragmentation. I think it would work but makes everything more complicated (entries in the map would need to be tracked whether they're part of another allocation, etc.)
>>
File: it's it's over.png (25 KB, 616x359)
25 KB
25 KB PNG
>>
>>107877044
>shit on runtime, good on memory
don't be stingy with caching or otherwise keeping things in memory, recalculating will always be slower
this is what ram usage minimalists seem to never get
>>
>>107874369
Just got to OOP in the roadmap on the courses I'm following

Everyone kept telling me how scary OOPs but it's fun so far
still kinda new in programming and learning it
currently using C++
>>
>>107874369
I lost all interest I had for programming. I used to care so much about the language, the editor, the dev environment, algorithms, etc. Now I just do whatever solves a problem with the least effort from me.
>>
>>107877892
You've grown to be a good code monkey.



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.