Comments (12)
Might be.
from dlfilter.
AFAIK, hash tables enable you to look up the value against a key quickly for large numbers of keys. I believe that you can iterate over the hash table too, though that is not their purpose.
I am unsure how we can use a hash table for fast lookup of iswm
matching - we can use it as an array and iterate the values in order to get the values to iswm
with, but that is unlikely to be any faster then the long list of if iswm
.
But if there is a way to use a hash table effectively let me know and I will code it.
from dlfilter.
Hmmm - it seems that $hfind(hashtable, message, 1, W)
uses the hash table item or data as wildcard text - so perhaps this is possible.
from dlfilter.
Good find, I didn't know about that $hfind() option. My initial idea was just looping over hashmap/items, to make filters more easier to maintain, compared to endless if statements.
The hashmap should also contain the appropriate method to call on match, e.g.:
filter <--> method
*SpR JUKEBOX*filesize* TextSetNickColor
*DCC GET COMPLETE*from*slot*open* DLF_textfilter
from dlfilter.
Yes - we will need different hash tables for each group.
I have this mostly done on my PC (but not yet on GitHub) - when I do the next commit it would be helpful if you could deskcheck old and new code to make sure that I have create a like for like solution.
from dlfilter.
$hfind will be at least one order of magnitude more efficient/faster (and possibly two orders of magnitude) than a loop or list of if statements.
from dlfilter.
It really depends.
Hash map should be O(1), if Khaled has implemented it properly. However, since that $hfind() is a wildcard match on key, it probably loops internally and is O(n).
from dlfilter.
Yes - but it will be machine code (C?) rather than interpreted mIRC script.
from dlfilter.
I presume that mIRC compiles the script internally to bytecode/assembly-like on load and uses that. But you are probably right.
We can always do a performance test if we really care...
from dlfilter.
I don't really care TBH. It was performing OK on my PC as a list of IF statements.
But I think using hashtables is both more elegant and more maintainable.
from dlfilter.
Exactly. The if's just tickle my inner perfectionist in the wrong way.
from dlfilter.
Coded - see #7
from dlfilter.
Related Issues (20)
- Private messages filtered on network with no channels assigned.
- Avoid Chan.Spamfilter becoming spam itself
- Auto Notify functionality for query windows HOT 1
- Add anti-spam functionality for rapid messages
- xdcc get of a previous failed download fails to restart HOT 8
- Issue with options dialog when Windows Display scaling > 100% HOT 38
- Errors when trying to update from 2.0.4 HOT 4
- DLFilter Menu HOT 2
- Invalid parameters error HOT 5
- Check for server op on global notice
- I load the script and nothing happens other than mIRC warning me not to click Yes. HOT 3
- fltered my own typing to server window HOT 2
- mirc lockup with dlfilter HOT 1
- v210 spams channels that do not support searchbot HOT 10
- Please create a tutorial on how to make dlls for mirc using latest IDE's like VS 2019. HOT 1
- update check fails DNS lookup HOT 22
- Where is version 2.12? HOT 1
- No AppData message on installation of 2.12 HOT 1
- "Colour value invalid" when extended colours are selected in mIRC HOT 4
- Failed to establish socket connection: [10060] Connection timed out HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dlfilter.