Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Nao
946
Features / Re: New revs - Public comments
« on April 8th, 2014, 08:13 PM »
Quote from Farjo on April 5th, 2014, 10:12 AM
Thank you - yes that's what I do now, and then an FTP client synchronises what's on my PC to the web space. It's still a way away from a one-click solution but it's easier with less chance of missing changes.
Eventually, I'll stick my finger out of my arse, and I'll write a module to automatically update files from github as long as you're using an alpha or beta install.

Then again, it'll probably come *after* I write the code to automatically update files on non-alpha versions. (Which, in this case, will only retrieve official releases.)
947
Features / Re: New revs
« on April 8th, 2014, 01:04 PM »
[Commit revision 7126453]
Author: Nao
Date: Tue, 08 Apr 2014 13:03:41 +0200
Stats: 4 files changed; +32 (insertions), -15 (deletions)

  • Revert "* Attempting to overhaul the .note class system. Everything is now subdued: .notevoid is removed, .note will do a similar job; while .note will be replaced by .notewarn (orange hue), and the original .notewarn disappears (too visible for my current taste). The .notenice class remains, but gets a more pastel tone. (Boards.template.php, MessageIndex.template.php, index.template.php, index.css, sections.css)"
  • This reverts commit 02dd0528d5d9020eb6feefcdda0ebf90759b824d.
  • Note: leaving sections.css untouched, this one was okay. The rest was... Not particularly popular, and I did say I'd probably revert the commit.
948
Importing into Wedge / Re: Importer tool
« on April 8th, 2014, 01:04 PM »
[Commit revision aad30be]
Author: Nao (Signed-off)
Date: Fri, 04 Apr 2014 22:46:12 +0200
Stats: 1 file changed; +2 (insertions), -4 (deletions)

  • Fixing infamous bug in importer script where From paths were marked as invalid even though they shouldn't be. (import.php)
  • Note 1: this was due to XML settings not being loaded at the time the HTML headers were printed. I fixed it by transparently redirecting. The problem only happened if you had only one *_to_wedge.xml file in your root folder, and could be fixed by simply refreshing the page.
  • Note 2: I'm totally manipulating the commit date for this (which is really made on April 6)... Don't want to go back to playing with github's "longest streak" (committing every day when you don't always have something to commit is annoying), and I'm artifically stopping it at 100 days. Should give me about 265 days of tranquility, at which point GH may have allowed users to hide that annoying stat.

[Commit revision 1f3c70f]
Author: Nao (Signed-off)
Date: Sat, 05 Apr 2014 12:50:41 +0200
Stats: 1 file changed; +5 (insertions), -5 (deletions)

  • Should probably account for backslashes in paths. (import.php)
  • Details. (import.php)
949
Features / [Poll] Re: Board status icons: what's the point?
« on April 7th, 2014, 09:34 PM »
Yeah it's a nono.

Tried both subselect and left join queries. Without any restrictions, the former seems to be twice slower. Are you sure it's really better..? More readable yeah but better I don't know.

Also why did you remove the group by? PhP parsing isn't the best...
950
Archived fixes / [Posting] Re: external images not resized
« on April 7th, 2014, 08:15 PM »
Could you post the contents of that message? Not the HTML. Just the bbcode version. Thanks!
951
Features / [Poll] Re: Board status icons: what's the point?
« on April 7th, 2014, 06:51 PM »
With my new query? Well yeah of course it's faster. Often faster than the unread topics query, as I expected...

I just wanted to find a way to GI through all topics with it.
Also, I think subselects slow it down.
With a couple of left joins, we're sure it'll run these once per query. With a sub, I don't know if it'll cache the results. These tables are probably not big enough I think to justify getting rid of the left joins.
Try coming back to a left join, and benchmark. ;)

File sort is only used on the full query. And if we get hundreds of results, it's most certainly faster to do the sort by sqp rather than php...

Also I'm thinking. Instead of taking the last month worth of posts... Maybe just the new posts since last session..? Like unread topics by default in SMF (this was removed from Wedge but peter forgot to remove the corresponding database field.)
952
Features / Re: Lightbox effect on remote hosted images
« on April 6th, 2014, 03:44 PM »
Done this way on media items and regular attachments.

Knowing whether a remote link is an image would require server work. For instance, many people will just post a link to the remote page with the image and ads. If you're embedding the image directly into a post, then maybe you don't want it to be clickable. Or maybe you're embedding the thumbnail, in which case the clickable link might lead to the page with ads.

In other words, this doesn't seem like a reliable (and thus plausible) solution.

Yes I've thought about it before.
Posted: April 6th, 2014, 03:42 PM

This could be done through a plugin, though... Eg add a 'zoom', zoomedia or lightbox bbcode that will automatically act as a URL bbcode, but load the target in zoomedia.
953
Features / [Poll] Re: Board status icons: what's the point?
« on April 6th, 2014, 01:28 PM »
Quote from Pandos on April 4th, 2014, 11:58 PM
@Nao:
I'll take a look into it.
But not before Monday. Hope this is OK for you.
Okay, regarding optimization, I was able to slash the 0.2s query time down to about 0.02s at most... That's a factor of ten.
How did I do it..? Ahem.
I added an index on {db_prefix}messages.poster_time, and then simply added "m.id_msg > UNIX_TIMESTAMP() - 30 * 24 * 3600" before the big id_msg tests.
As a result, only the unread posts sent in the last month are shown, of course. But it's much better than taking the entire database into account.

Also, I turned the LEFT JOINs into sub-selects. I don't think it's helping with performance, though. It's only making it easier to understand. In fact, EXPLAIN gives me the exact same output (Using where; using filesort) if I don't use the timestamp index.

For reference, here's the new query.

Code: [Select]
SELECT COUNT(DISTINCT m.id_msg) AS co, m.id_board
FROM {db_prefix}messages AS m
WHERE m.poster_time > UNIX_TIMESTAMP() - 30 * 24 * 3600
   AND (
      m.id_msg >
      IFNULL(
         (SELECT lt.id_msg FROM {db_prefix}log_topics AS lt WHERE (lt.id_topic = m.id_topic AND lt.id_member = 1)),
         IFNULL(
            (SELECT lmr.id_msg FROM {db_prefix}log_mark_read AS lmr WHERE (lmr.id_board = m.id_board AND lmr.id_member = 1)),
            0
         )
      )
   )
GROUP BY m.id_board

What do you think..?
As a reminder, the unread topic counter is pretty much the same query, it only replaces 'id_board' with 'id_topic', and EXPLAIN doesn't give me a "Using filesort". Well, of course it's probably because it's reduced to a very limited number of messages to begin with... ;)
954
Features / [Poll] Re: Board status icons: what's the point?
« on April 6th, 2014, 01:21 PM »
Quote from CerealGuy on April 6th, 2014, 12:58 PM
Theres too much lookin the same. Messages & Notifications & Likes in Thoughts have the same style.
It's always been the case...!
They were all orange. The only thing I changed is the notification buttons. They used to be either orange or gray, now they're either orange or white.
Quote from CerealGuy on April 6th, 2014, 12:58 PM
I prefered the old way of the look. But the feature at itself is nice, even if i think its only interesting for latest topics or topics where i have "contact" to. For example if i replied on it or liked something of it. Otherwise its too much information.
Hmm... Dunno. Why not just use "Unread Replies", then...? Regular users never participate in MANY topics, and as such, they won't be overwhelmed by the information in that area...
955
Features / [Poll] Re: Board status icons: what's the point?
« on April 6th, 2014, 12:24 PM »
Theres already a green variation (.notenice)... Its used on likes where you clicked on like yourself.
956
Features / [Poll] Re: Board status icons: what's the point?
« on April 6th, 2014, 12:22 AM »
Update is online here...

Can you spell "boring"?!

I don't know what you'll think. I'm not happy with it, personally. I do like the effect on the main menu, though. Also maybe on the notification popups. The rest... Not so much. Not enough visible on topic pages, not enough on unread counters either.

Please share opinions.
Or, even better, screenshots of how you think it could be improved!

Note: I've reached the 100-day milestone on github's "longest streak", and as I promised myself I wouldn't go beyond that (I only kept committing everyday because I didn't want to end my longest streak on an unlucky number, but above 100 means I'd have to do that every six months, err, don't bother), I probably won't commit anything tomorrow. Or, if I do, I'll try to rewrite history so that it shows as from the day before... :P
Posted: April 6th, 2014, 12:08 AM
Quote from Pandos on April 4th, 2014, 11:58 PM
@Nao:
I'll take a look into it.
But not before Monday. Hope this is OK for you.
Well, I gave up yesterday, so you're my only hope at this point. :lol:

Honestly, I'd be happy with just a quick query that finds at least one unread post in every board, and stops after that. But I don't think it'll work in making the query faster.

Right now, here's what the query does:
- Gather all id_msg
- Gather all read positions (log_topics...)
- For each msg, determine if its topic is in the read topics list. If yes, if current msg is > msg of the read topics list, then consider we have unread posts in that topic. Mark as unread.
- If not, then try to find the same in log_mark_read.
- If not, then it means we never marked the topic as read, so it's unread. Mark as unread.
- Then, we just group by board.

One of the things that could be done to improve everything, is to store the last id_msg that was sent at the time of our registration. This would serve as a 'threshold', i.e. any posts sent BEFORE my registration should be marked as read.

I don't remember what log_mark_read does. I think it marks a board as read, meaning it makes our work much easier.
However, wasn't that what log_boards was supposed to do..? Hmm... I don't really remember. I'm tired. Bed time!
Posted: April 6th, 2014, 12:19 AM
Quote from Johnny54 on April 5th, 2014, 10:58 AM
Please allow one last stupid question on this.
There's already a list with all unread topics, complete with boardnames etc.
What makes it so hard to have a indication per board that the board has unread topics.
Well, that's what it's doing right now... If it has a number, then it's unread.
It's more precise than the old system. But it's also much slower.

And whether I store read status or number of unread posts, it's the same: it's very slow. I tried to cache that data, it makes it very fast of course, but it requires a load of work that I'm unwilling to put in for now. (Emptying the whole cache everytime a new post is sent somewhere or any of many other actions is performed, seems like unnecessary crap.)
957
Features / Re: New revs
« on April 6th, 2014, 12:02 AM »
[Commit revision 03f7a7a]
Author: Nao
Date: Sat, 05 Apr 2014 23:15:31 +0200
Stats: 1 file changed; +11 (insertions), -11 (deletions)

  • get_preferred_language() didn't account for malformed Accept-Language headers. (Subs.php)

[Commit revision 02dd052]
Author: Nao
Date: Sat, 05 Apr 2014 23:52:02 +0200
Stats: 5 files changed; +28 (insertions), -45 (deletions)

  • Attempting to overhaul the .note class system. Everything is now subdued: .notevoid is removed, .note will do a similar job; while .note will be replaced by .notewarn (orange hue), and the original .notewarn disappears (too visible for my current taste). The .notenice class remains, but gets a more pastel tone. (Boards.template.php, MessageIndex.template.php, index.template.php, index.css, sections.css)
  • Note: I'm reserving the right to revert this commit entirely. It's ONLY there to test the pastel effect and determine whether it's worth it.

Posted: April 5th, 2014, 11:52 PM

[Commit revision 2c1d301]
Author: Nao
Date: Sat, 05 Apr 2014 23:56:49 +0200
Stats: 1 file changed; +1 (insertion), -1 (deletion)

  • Last-minute typo. (Subs.php)
958
Features / Re: New revs
« on April 5th, 2014, 10:45 PM »
[Commit revision 06b0b02]
Author: Nao
Date: Sat, 05 Apr 2014 16:36:29 +0200
Stats: 1 file changed; +11 (insertions), -6 (deletions)

  • The response prefix was being cached for only a finite amount of time, when there's really no need to recalculate it except when changing language settings (in which case the cache is invalidated anyway.) (Subs.php)
959
Features / [Poll] Re: Board status icons: what's the point?
« on April 4th, 2014, 11:53 PM »
'kay, I'll try #3 as an alternative for the current stuff.

Yes Farjo, just the pictures.

Regarding the feature, I've hit a wall, and I don't know what to do.
- Spending 0.15s to 0.3s per page doing that query is out of the question for me.
- I tried to optimize it. I failed.
- Then I decided I'd give a try to retrieving only the EXISTENCE of an unread message for every board, instead of the number of unread messages. That would be faster, wouldn't it..? Wrong. At best, I get the same performance. At worst, I "optimize" the query even more and I end up with a 0.4s query... Uh, uh.
- Unless someone can help with optimizing (@Pandos?), I have to give up on this one.
- So, I also tried to cache the results... Of course, it's super fast this way. However, I'd have to clear the cache every time either log_topics or log_mark_read tables are modified... *And* every time a new message is posted, of course. I suspect that Wedge would thus spend way more time invalidating the cache, than actually reading from it.
- Finally, the last alternative is to add a user setting, disabled by default (to help with performance). This is a bit of a cop-out, and doesn't have the same 'wow' factor.
- Oh yes, yet another alternative would be that I restore log_boards... Ah, ah! Just kidding. Not only is it too late, but I removed the table for a reason.
- Also the possibility of just removing the feature, at the cost of upsetting Johnny54. I've spent a couple of days on this, and I don't know what's worse to me... Spending another couple of days on it (with the risk that it fails to work), or just accepting that Wedge won't please everyone.

Please feel free to comment on any of the points I mentioned in this post. I'm at a complete loss, and honestly if I don't get feedback on this, I'm prepared to remove the feature without second thoughts.
960
Features / Re: New revs
« on April 4th, 2014, 11:45 PM »
[Commit revision ba2d42e]
Author: Nao
Date: Fri, 04 Apr 2014 22:54:26 +0200
Stats: 1 file changed; +2 (insertions), -2 (deletions)

  • IE 10 and IE 11 perfectly support CSS gradients, so they don't need the filter hack. Only IE9 does. (Subs-Cache.php)