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
4771
Features / Re: Plugin revs
« on July 12th, 2012, 03:35 PM »
rev 42 (oh yeah...)
(1 file, 1kb)

! [theme_selector] Disable the skin selector if we're in a board that forces an override. (ThemeSelector.php)
4772
Features / Re: Auto_increment madness...
« on July 11th, 2012, 04:50 PM »
So, err, no comment on my post above? ;)
4773
Features / Re: Github & stuff
« on July 11th, 2012, 02:10 PM »
Quote from live627 on July 8th, 2012, 07:16 PM
Hey, look at Wordpress. They seem to get by with SVN. Neither do they use SF or GC or whatever. Perhaps, staying with how you roll right now isn't such a bad idea after all.
WordPress is in its own league. Because it's been around since the days when SVN was the 'cool' thing to use (as opposed to CVS), and it's been very successful ever since, they don't really need to change their work methodology. They have enough devs already to work on SVN merging issues etc.
I'm sure one can quote dozens of major projects that are still using SVN (Wedge being among them!), but more than SVN vs Git, it's more of a question about methodology really. Do we want other developers to join in and share their code? Yes we do. Do we want to keep the whole thing secure and not give everyone commit access? Yes. Because of this, it's more realistic to rely on Git (or Mercurial) than SVN. Thus, I'm spending a lot of time trying to get used to the idea that I'll have to use that annoying pseudo-social network...

Heck, if the Netscape guy gave them $100M, I'm sure they can finally get to work on *actually* integrating ways to communicate with each other and modify own's homepage..?!
4774
Features / Re: Auto_increment madness...
« on July 11th, 2012, 12:37 PM »
Err... What for?
4775
Features / Re: Auto_increment madness...
« on July 11th, 2012, 11:57 AM »
Was looking for detail on ALTER IGNORE TABLE (apparently it doesn't play with auto_increment...), and found this:
http://dev.mysql.com/doc/refman/5.1/en/alter-table.html#c10750

Looks like the operation isn't 'free' on large tables, and I don't want to go with dummy rows (concurrent queries?), so if we ever implement that, it would have to be only on 'small' tables...
Quote from Arantor on July 11th, 2012, 12:57 AM
Almost everyone citing this doesn't even know which table engine they're using in on (and is repeating that comment from 2003), and in almost every case the advice predates MyISAM being deprecated as being the default. There are issues in InnoDB with it 'forgetting' the auto-increment value, which is specifically why I asked about it.
That's interesting. I just read about it, and to keep it simple: if the MySQL server is restarted, InnoDB will indeed recalculate (i.e. forget and recache) the auto_increment value for each table. Meaning that it basically does an Alter table auto_increment = 1 on each restart. I think...
http://dev.mysql.com/doc/refman/5.0/en/innodb-auto-increment-handling.html
4776
Features / Re: New revs
« on July 11th, 2012, 11:45 AM »
rev 1633 -- the Zoomedia commit. :)
(7 files, 9kb)

! Rewrote Zoomedia's initialization routine to improve handling of titles and descriptions. Seriously, it was horribly broken. Plus, the new version is shorter by 150+ gzipped bytes. It's all in a day's work for Byte Repair Man. (zoomedia.js, zoom.css)

* Harmonized/simplified Zoomedia call code. (Aeva-Gallery.php, Aeva-Subs-Vital.php, Subs-Media.php)

* All attachment resizing is now done through Zoomedia rather than a window popup or the expandThumbs function. (Display.php, Display.template.php)

! Give access to hidden/forbidden user albums to users who have explicit permission to post in them. (Aeva-Gallery.php)

! Fixed centering of media items. (Aeva-Subs-Vital.php, Subs-Media.php)
4777
Features / Re: Auto_increment madness...
« on July 11th, 2012, 12:41 AM »
Seriously, I don't really see how it could be 'dangerous'..?
Everywhere I go, people suggest doing that.
Heck, it's even mentioned in the comments on the auto_increment doc page at mysql.com...
4778
Off-topic / Re: Set class in jQuery
« on July 11th, 2012, 12:36 AM »
Well, there's nothing wrong is using className (or anything purely JS) even when jQuery equivalents are available. I usually choose to use jQ in these situations because the code is shorter and thus compresses better.

Speaking of which, I just finished rewriting Zoomedia... The code works much better, and is about 150 bytes shorter :D
4779
Features / Re: New revs
« on July 10th, 2012, 06:07 PM »
I'm sorry for such a huge changelog, but today I'm not strong enough to separate my changes into thematic commits... At this point I'm only praying that I documented everything and didn't forget any features or files ;)

rev 1632
(23 files +2, 36kb)

* Rewrote reqWin even more, mostly to add background dimming behind the popup, and to simplify the code. For instance, because we no longer attach events to unrelated elements, there's no need to fix the event format or unbind some events. (script.js, index.css)

* Fade out the reqWin popup when closing it via the 'Close window' link as well. (Help.template.php)

! Fixed reqWin centering in iOS. (script.js)

! Fixed errors in media playlists, and made the player use Wedge caching. (Aeva-Foxy.php, player.js)

! Fixed swfobject embedding, and harmonized version to 2.2. (Aeva-Foxy.php, Aeva-Subs-Vital.php)

* Trying not to have too many actions in the index file, I moved displaylike to Like.php and used a sub-action for viewing likes. (index.php, Like.php, Display.template.php)

* Increased post box height from 175 to 250px. I was through resizing it by myself. I'm sure no one will mind and it may actually encourage posting more. (Post.php)

+ Added a polyfill for IE 6-8 to support media queries. It'll only support min-width and max-width which are the most common cases, but at least it'll be fast (and short) enough not to bother me too much. (Load.php, respond.js)

- No need to fill in a $no_resize variable when it's only useful once. Removing it does add some extra code to old IEs though, hopefully it won't make them go crazy. Yes, it's just a call to an empty function for resize(), but I've seen worse from them. (index.template.php)

- Label selects in PM pages actually don't need to be fixed. (PersonalMessage.template.php)

- According to my stats, Opera < 9.5 is used by less than 0.2% of web users. If I'm going to drop support for IE6 one day, and I sure will, I have to set an example even if it's my favorite browser... So, removed Wysiwyg detection for Opera < 9.5. Saves about 20 bytes overall. For everyone... (editor.js, script.js)

* In post pages, moved topic icons inside their select box, and moved topic title input box to the right of the icon select box. Makes more sense. (Post.template.php, post.js)

* More space-saving optimizations. Saves something like 70 gzipped bytes when added to script.js, yay. (sbox.js)

* Some space-saving on CSS as well. Unless I'm horribly mistaken, "margin: auto" is the same as "margin: auto". No need to use both. (index.css, index.ie6.css, sections.css)

* Shortened param code for weToggle. It actually saves a nice amount of bytes, and is still easy to understand. (TEMPLATES: Admin, Boards, Display, index, ManagePermissions, Packages, PersonalMessage, Post, SCRIPTS: post.js, script.js, stats.js)
4780
Features / Re: Auto_increment madness...
« on July 10th, 2012, 05:24 PM »
Hmm... I think we already had this conversation long ago ;)

I *did* mean setting the auto_increment to 1, it wasn't just an example... MySQL will 'fix' that to use the earliest possible id, which is what we want. ;)

Believe me, I do it all the time in phpMyAdmin!
4781
Features / Auto_increment madness...
« on July 10th, 2012, 11:27 AM »
You all know I'm a bit odd from time to time... This is one of those days.

I was wondering if we shouldn't (couldn't) do something specific on each table row deletion.

Let's say we have a draft that we don't want to keep (or that doesn't need to remain on the server because we just saved the original post), so Wedge will delete it internally... So we go through Post2.php:904, and the draft is deleted. Along with the auto-incremented (likely) latest id_draft.
If we could simply call ALTER TABLE {db_prefix}drafts AUTO_INCREMENT=1, where the auto_increment value would be set to the earliest 'available' id, that means it would be much slower for the table to reach its maximum size. Granted, it's int in this case, but you get my point: by being too lazy about some tables, and not resetting the auto_increment when we could do it, we're basically wasting IDs.

So maybe we could have an optional feature in db_query that would check whether a table row is being deleted, and if it is, just set its auto_increment to 1, either by checking against a whitelist of tables with auto_increment fields, or just doing it automatically (I doubt MySQL would do anything else than ignore the request if it has no such field.)

Is it too crazy..? Too smart for its own good?

(Oh, did you notice how I changed the layout for the top of the post page? The icons are now inside the select box itself, and the select box was moved to the left of the title input... I like that. Hopefully you all do.)
4782
Off-topic / Re: Set class in jQuery
« on July 10th, 2012, 10:29 AM »
You mean .hasClass('class')...?
Or simply .is('.class')? (A bit slower though.)
If you want to assign a class, use .addClass('class') or .toggleClass('class'). The opposite is .removeClass('class').
If you want to get a list of all classes, you'll have to rely on $()[0].className or $().attr('class'), AFAIK.
4783
Off-topic / Re: Styling progress bars
« on July 9th, 2012, 10:16 AM »
I never looked into the progress bar, even though Opera was first to implement it and I'm always trying to keep up with what Opera does.
I've got to say though, Dragooon did a good job with his very own progress bars, and I didn't feel the need to look for anything above them!
4784
Features / Re: Very cool Thumbnail generation...
« on July 9th, 2012, 10:12 AM »
Quote from dwx on July 8th, 2012, 06:06 AM
Just a joke, since both Nao and Arantor are both quite skilled at optimization.  :P
I'm obsessed with it! I think Pete pities me :lol:
Quote from dwx on July 8th, 2012, 04:57 AM
Uniform thumbnail size is a feature that really improves the "look" of a gallery, or even an embedded "gallery" attached to a post. Their are a lot of ways to do this, but when I found Jcrop, I realized it was a good way to make relevant thumbnails quickly and simply, and a better alternative to overcropping the center of the image to the minor axis to create a thumbnail.
It's more complicated than that.
First of all, when I worked on AeMe, as I said I found out about a library to do cropping, but it was written in Ruby. Of course some of it was JS so I considered converting it to clearly use JS+PHP, it was actually in my to-do-list with a high priority. I also found out about Jcrop a few months after that. Anyway, what happened is that I try to fix bugs before adding major features, and I was at a point where I was considering dropping my work on AeMe to focus on non-SMF stuff, so I naturally never implemented that.

Secondly, and I think it's more important, the main reason I didn't implement that is because I was never sure about the upload process being too long already. I wanted to make it simpler, not more complicated, and adding an extra step like this, while certainly helpful in most situations, is not always going to be desired especially when you're trying to turn AeMe into a "perfect gallery", something that could be used stand-alone...
So, my plans were to use it only when requested -- i.e. keep the main file around, generate thumbnails and previews, and then if the user wanted, they could go to the item page, click a "Edit picture" button or something, and have the choice to (1) rotate the picture (and related thumbnail and preview), (2) resize and/or crop the picture, (3) crop the thumbnail or preview based on the stored picture.
I'm NOT very good at implementing good UI (it always takes me weeks to do that when others could do it in days), so at that point it became a low-priority item, even though it was officially high-priority. It's mainly because of UX (user experience), which I wanted to be 'perfect'.

Now, I'm still considering dropping attachments altogether from Wedge, and using AeMe instead. But first of all I'll need to fix some bugs (and even before that, try to spot them all), then work on a parallel implement of attachments vs uploads, and finally get rid of the attachment system and have someone develop a converter (or do it myself within Wedge...)

It's not an easy task, let me tell you. And it's not helpful that none of us is being paid for it...
Quote
I figured that Jcrop code would be more useful as an inspiration than anything else, and by the time you were through rewriting it, it would be 4 lines of code and compress down to 12 bytes!  :D
Well, size doesn't matter here, because it's a process guests don't get, so it has no influence over the apparent speed of a forum, and thus I'm not going to spend a lot of time optimizing it, if anything. Jcrop is a good enough solution, I could rewrite it to use 'proper' indentation and spacing according to my (Wedge's) standards, but I'd rather be able to easily update the script, and/or participate in its development. (Since it's available on github, it's something that can be done.)
Quote
The other thing I've been thinking Jcrop would be useful for is an intermediate sized "preview" image. A smaller subsection of the full image that could be used for an inline preview within the text of a post.
That is already 'done' in my mind.
As a reminder, AeMe has pictures (limited size but usually large), previews (usually 600x400 or something, for use on item pages) and thumbnails (usually 150x100 or something, for use on album pages). Depending on the type of preview (site homepage or blog), I'd automatically attach the thumbnail (on the left of the text preview) or preview (on top of the text preview, or in a carousel for instance).

Don't believe that just because it isn't in Wedge yet, I haven't thought about it a lot already ;)
Just check out http://nao.noisen.com for an example of how I want Wedge blogs to look like. And ideally I want to simply take the first graphic element in each post, get their thumbnail and offer this as post preview in smaller post lists. (eg site homepage, of which I currently have no example for you, except on sites I'm not related to.)
4785
Features / Re: New revs - Public comments
« on July 8th, 2012, 09:53 AM »
Quote from live627 on July 7th, 2012, 10:08 PM
Quote from Nao on July 7th, 2012, 09:13 AM
With what browser?
Firefox 13
It's working fine here for me....... :-/