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.
2386
The Pub / Re: Stupid git?
« on October 27th, 2013, 11:17 AM »Using public git hosters is a bit unflexible. Why don't you set up your own git server?
Effectively, the main reason I'm going for git is because everyone's on github.
Also, I severely appreciate the fact that I can keep 'final' control over the codebase, while still allowing for proper crediting in the history. I always hated having to say 'thanks to ...' in the changelog to credit someone. Let's have their name in there! So it can be shown in stats, and things like that!
(But great that you're using git now. Better for branch management indeed.)
NetBeans for PHP code? Duh.
I have no idea how TE did his global variable removal through it, though. The various 'code cleanup' plugins don't work, for me.
(IDEs make smart people stupid.)
Now, of course, I use the best tools in each category (grepWin for search/replace, Notepad2 for SDI editing, Notepad++ for MDI editing, TortoiseGit for DVCS...), so I guess no IDE will ever satisfy me, because 'it's missing this feature from that tool...'
Commit yes, push no. ;)
My goal with my 'temp branches' is mostly to import the changes once I'm entirely done with them, in a single history commit, and delete the branch. I suppose it can be done, which is why I'm starting to do it, but it's still... A bit complicated, overall. Mind you, it's interesting. But I need more work to get into the git state of mind.
One of the latest issues of .net magazine has a tutorial on git. What's funny is that even in that stupid tutorial 'for absolute beginners', the guy CAN'T HELP but use words like 'detached-head state' here and there... Without even realizing that he didn't care to explain what they are in the first place. Seriously, it's like git documentation is only offered to people who don't need it in the first place. I don't know what I would do without stackoverflow, frankly...!
2387
The Pub / Re: Stupid git?
« on October 27th, 2013, 10:53 AM »
I'll get to answer the stuff above (thanks!), but I have a quick question...
Let's say I have branch master, and branch newfeature.
If I switch to newfeature, then do changes, then commit half of them, and leave some changes uncommitted...
When I switch back to master, do these uncommitted changes show up in the same files?
My #1 grudge against Git is that it seems to expect from you that you commit every little change you make at any moment. My workflow involves doing changes, and then launching the commit dialog, and regularly launching diffs of my (uncommitted) files to check out the changes I'm working on, and quickly spot what remains to be done. I'm not sure I want to go through the git show log dialog (for previous commits) to do the same; or is it, really, not that big a deal..?
Let's say I have branch master, and branch newfeature.
If I switch to newfeature, then do changes, then commit half of them, and leave some changes uncommitted...
When I switch back to master, do these uncommitted changes show up in the same files?
My #1 grudge against Git is that it seems to expect from you that you commit every little change you make at any moment. My workflow involves doing changes, and then launching the commit dialog, and regularly launching diffs of my (uncommitted) files to check out the changes I'm working on, and quickly spot what remains to be done. I'm not sure I want to go through the git show log dialog (for previous commits) to do the same; or is it, really, not that big a deal..?
2388
Features / Re: New revs
« on October 27th, 2013, 09:53 AM »
rev 2290 -- still very quiet in here, hmm...
5 files changed, 41 insertions(+), 22 deletions(-)
+ Restricted lists should now work. Needs testing, though. I can't believe I spent days wondering how to implement these efficiently, and it took less than 5 lines of code to actually do it. (Class-System.php)
+ Preliminary code for new ignore lists. Very very early, really. (Class-System.php)
* Renamed PRIVACY_JUSTME to PRIVACY_AUTHOR, for harmonization. (Class-System.php, Security.php)
* Moved get_privacy_type to Security; I should be using that file more, I'd say... (Security.php, Thoughts.template.php)
* More work on the topic privacy rewrite. It still won't work, mind you... (Post.php, Post.template.php)
5 files changed, 41 insertions(+), 22 deletions(-)
+ Restricted lists should now work. Needs testing, though. I can't believe I spent days wondering how to implement these efficiently, and it took less than 5 lines of code to actually do it. (Class-System.php)
+ Preliminary code for new ignore lists. Very very early, really. (Class-System.php)
* Renamed PRIVACY_JUSTME to PRIVACY_AUTHOR, for harmonization. (Class-System.php, Security.php)
* Moved get_privacy_type to Security; I should be using that file more, I'd say... (Security.php, Thoughts.template.php)
* More work on the topic privacy rewrite. It still won't work, mind you... (Post.php, Post.template.php)
2389
Features / Re: New revs
« on October 27th, 2013, 01:08 AM »
rev 2289 -- so, seriously, I've been the only poster today..?! :^^;:
5 files changed, 19 insertions(+), 49 deletions(-)
+ Topic lists now show the number of unread posts per topic, just like unread posts/unread replies have been doing. (MessageIndex.php, MessageIndex.template.php)
* Added a parameter in the unread post number retrieval code, to allow passing a straight array of topic IDs to look up. I probably should set that param to true by default, but... Whatever. (Subs.php)
- Removed duplicate code. (Unread.php, UnreadReplies.php)
5 files changed, 19 insertions(+), 49 deletions(-)
+ Topic lists now show the number of unread posts per topic, just like unread posts/unread replies have been doing. (MessageIndex.php, MessageIndex.template.php)
* Added a parameter in the unread post number retrieval code, to allow passing a straight array of topic IDs to look up. I probably should set that param to true by default, but... Whatever. (Subs.php)
- Removed duplicate code. (Unread.php, UnreadReplies.php)
2390
Features / Re: New revs
« on October 26th, 2013, 06:24 PM »
rev 2288
7 files changed, 34 insertions(+), 27 deletions(-)
+ Saved about 0.15s (25%-30% of total time) on index CSS cache regeneration by adding a simple lookbehind assertion in the very last regex. I can't believe that one single, ultra-simple regex to remove a few empty elements used to take as long as the entire process of nesting, which has dozen of complex regular expressions. And yes, I did tons of tests. Something is wrong here. Well, at least it's fixed now. (Subs-Cache.php)
+ Wess tests in the shape of @is() calls are now even more useful. Up till now, @is (test, if_true, if_false) would be a straightforward use, then @is (test, if_true) showed nothing if test was false; I've now added the simplest possible form, @is (test), which, instead of returning the desired string, returns true or false strings, making it possible to use @is tests inside variable declarations. (Class-CSS.php)
* And obviously, as a result, I've removed the simili-hack for can_flex/can_animate and replaced them with similarly named variables, $can_flex and $can_animate. Technically, I could already have done it long ago (and considered doing it), by just storing the list of browsers in the variables, but I didn't think it was worth cluttering the common CSS file. Since @is tests with no nested variables are executed before variables are parsed, it means Wess will only do the @is test once, instead of each time a can_flex/can_animate request was made before. This-- much better. Not much faster, but at least now I can safely use these as many times as I want. (Class-CSS.php, common.css, index.css, media.css, sections.css)
+ Also added aliases to 'true' and 'false', so that you can use them all alone in an @if/@is test, for debugging purposes (previously, you could only have them inside tests that has a variable in them, such as @if ($var && true)). Seriously, I should have done that one long ago. (Class-System.php)
7 files changed, 34 insertions(+), 27 deletions(-)
+ Saved about 0.15s (25%-30% of total time) on index CSS cache regeneration by adding a simple lookbehind assertion in the very last regex. I can't believe that one single, ultra-simple regex to remove a few empty elements used to take as long as the entire process of nesting, which has dozen of complex regular expressions. And yes, I did tons of tests. Something is wrong here. Well, at least it's fixed now. (Subs-Cache.php)
+ Wess tests in the shape of @is() calls are now even more useful. Up till now, @is (test, if_true, if_false) would be a straightforward use, then @is (test, if_true) showed nothing if test was false; I've now added the simplest possible form, @is (test), which, instead of returning the desired string, returns true or false strings, making it possible to use @is tests inside variable declarations. (Class-CSS.php)
* And obviously, as a result, I've removed the simili-hack for can_flex/can_animate and replaced them with similarly named variables, $can_flex and $can_animate. Technically, I could already have done it long ago (and considered doing it), by just storing the list of browsers in the variables, but I didn't think it was worth cluttering the common CSS file. Since @is tests with no nested variables are executed before variables are parsed, it means Wess will only do the @is test once, instead of each time a can_flex/can_animate request was made before. This-- much better. Not much faster, but at least now I can safely use these as many times as I want. (Class-CSS.php, common.css, index.css, media.css, sections.css)
+ Also added aliases to 'true' and 'false', so that you can use them all alone in an @if/@is test, for debugging purposes (previously, you could only have them inside tests that has a variable in them, such as @if ($var && true)). Seriously, I should have done that one long ago. (Class-System.php)
2391
Archived fixes / Re: Errors within new contact lists
« on October 25th, 2013, 09:29 PM »
These errors are expected. It's a wip and I did warn that some things would break until I'm finished rewriting ;)
Topic privacy won't work because they expect an integer but it provides a string. This is fixed on my local copy, but won't be committed until I implement member groups.
Tomorrow, possibly.
Topic privacy won't work because they expect an integer but it provides a string. This is fixed on my local copy, but won't be committed until I implement member groups.
Tomorrow, possibly.
2392
Bug reports / Re: Cleaning up duplicate language strings
« on October 25th, 2013, 04:23 PM »
Moved these posts to the correct topic...
awk is too esoteric for me. ;)
I'm already in enough of a mess, with having to learn the git intricacies over and over again (because I keep forgetting them), so... Let's not push it too far, eh eh... ;)
Still, I quickly cooked up a small script, because I was stupid enough not to post the script I mentioned in the first post, ahum...
Basically, I copied the languages folder to a new place (languages2), and ran this search & replace regex on it:
\$txt\['([^']+)'] = '(.*?)'; to: $txt['$1'] = '';
And then, ran this PHP on that folder:
Code: [Select]
Remaining duplicate strings, by number of occurrences:
Code: [Select]
So, basically, that's not a LOT of strings... And some of them really need to be duplicated, such as showDrafts.
awk is too esoteric for me. ;)
I'm already in enough of a mess, with having to learn the git intricacies over and over again (because I keep forgetting them), so... Let's not push it too far, eh eh... ;)
Still, I quickly cooked up a small script, because I was stupid enough not to post the script I mentioned in the first post, ahum...
Basically, I copied the languages folder to a new place (languages2), and ran this search & replace regex on it:
\$txt\['([^']+)'] = '(.*?)'; to: $txt['$1'] = '';
And then, ran this PHP on that folder:
$arr = array();
foreach (scandir('./languages2/') as $fil)
{
if ($fil == '.' || $fil == '..' || substr($fil, -4) != '.php' || strpos($fil, '.english.') === false)
continue;
$fichier = file('./languages2/' . $fil, FILE_SKIP_EMPTY_LINES | FILE_IGNORE_NEW_LINES);
$arr = array_merge($arr, $fichier);
echo $fil." (" .count($arr).")\n<br>";
}
$b = array_count_values($arr);
foreach ($b as $key => $val)
if (strpos($key, '$txt') !== 0 || $val === 1)
unset($b[$key]);
arsort($b, SORT_NUMERIC);
print_r($b);Remaining duplicate strings, by number of occurrences:
[$txt['plugins_repo_auth'] = '';] => 2
[$txt['notification'] = '';] => 2
[$txt['media_admin_bans_mems_empty'] = '';] => 2
[$txt['lang_rtl'] = false;] => 2
[$txt['date_format'] = '';] => 2
[$txt['not_activated'] = '';] => 2
[$txt['age'] = '';] => 2
[$txt['no_password'] = '';] => 2
[$txt['media_admin_modlog_desc'] = '';] => 2
[$txt['spider'] = '';] => 2
[$txt['registration_agreement'] = '';] => 2
[$txt['pm_read'] = '';] => 2
[$txt['view_all_members'] = '';] => 2
[$txt['ip_address'] = '';] => 2
[$txt['display_name'] = '';] => 2
[$txt['none'] = '';] => 2
[$txt['membergroups_add_group'] = '';] => 2
[$txt['showDrafts_desc'] = '';] => 2
[$txt['show_drafts_none'] = '';] => 2
[$txt['showDrafts'] = '';] => 2
[$txt['spiders'] = '';] => 2
[$txt['error_invalid_characters_username'] = '';] => 2
[$txt['preset_infractions'] = '';] => 2
[$txt['edit_draft'] = '';] => 2
[$txt['draftAutoPurge'] = array(] => 2
[$txt['ban_type_hostname'] = '';] => 2
[$txt['ban_invalid_member'] = '';] => 2
[$txt['ban_type_member_name'] = '';] => 2
[$txt['subscriptions'] = '';] => 2
[$txt['remove_all_drafts'] = '';] => 2
[$txt['remove_all_drafts_confirm'] = '';] => 2
[$txt['hidden'] = '';] => 2
[$txt['media'] = '';] => 2
[$txt['infraction_points'] = '';] => 2
Posted: October 25th, 2013, 04:21 PM
So, basically, that's not a LOT of strings... And some of them really need to be duplicated, such as showDrafts.
2393
Features / Re: New revs
« on October 25th, 2013, 03:53 PM »
rev 2287
5 files changed, 12 insertions(+), 8 deletions(-)
! Privacy constants weren't defined in SSI mode. They're probably better off in the user class file, then... (index.php, Class-System.php)
! Fixed redefined constants, and simplified (a bit) the skin option parser. (Ajax.php, Load.php, Subs-Cache.php)
5 files changed, 12 insertions(+), 8 deletions(-)
! Privacy constants weren't defined in SSI mode. They're probably better off in the user class file, then... (index.php, Class-System.php)
! Fixed redefined constants, and simplified (a bit) the skin option parser. (Ajax.php, Load.php, Subs-Cache.php)
2394
Features / Re: New revs
« on October 25th, 2013, 03:15 PM »
rev 2286
3 files changed, 8 insertions(+), 6 deletions(-)
! Wedge didn't even show the thought form if no thoughts were found in the database. Didn't make sense. Thanks Pandos for pointing it out. (Thoughts.template.php, index.language.php)
3 files changed, 8 insertions(+), 6 deletions(-)
! Wedge didn't even show the thought form if no thoughts were found in the database. Didn't make sense. Thanks Pandos for pointing it out. (Thoughts.template.php, index.language.php)
2395
Features / Re: New revs
« on October 25th, 2013, 02:45 PM »
rev 2285
5 files changed, 19 insertions(+), 14 deletions(-)
! Some Ajax requests still did skin-related testing, so let's just forget about being rigid about it, and initialize dummy versions of the most common skin variables, even in Ajax mode. (Load.php, Subs-Cache.php)
! Event detector in sidebar opener was actually broken, oops. (script.js)
- Old unused variable. (Class-CSS.php, install.php)
5 files changed, 19 insertions(+), 14 deletions(-)
! Some Ajax requests still did skin-related testing, so let's just forget about being rigid about it, and initialize dummy versions of the most common skin variables, even in Ajax mode. (Load.php, Subs-Cache.php)
! Event detector in sidebar opener was actually broken, oops. (script.js)
- Old unused variable. (Class-CSS.php, install.php)
2396
Bug reports / Re : Re: Where should I put up the source code?
« on October 25th, 2013, 10:27 AM »
Yeah, I think I removed a lot, but don't have a tool to find them automatically, so at one point I just went to something else.
TE, are there any tools for that in NetBeans...? :P
PS: are we talking $txt indices, or text content..? Because similar text content, while sometimes it could be simplified into a single string, might be of use as separarate strings, especially for very, very generic words.
TE, are there any tools for that in NetBeans...? :P
PS: are we talking $txt indices, or text content..? Because similar text content, while sometimes it could be simplified into a single string, might be of use as separarate strings, especially for very, very generic words.
2397
Features / Re: New revs
« on October 25th, 2013, 01:29 AM »
rev 2284 [master 8477fec]
2 files changed, 101 insertions(+), 37 deletions(-)
+ Implemented a converter for buddy lists to contact lists. Will only execute after you've made use of Thorsten's importer and thus gotten buddy lists from an earlier SMF install, for instance. (Load.php)
! Thoughts needed more work to work with the new privacy & contact list systems. It's not perfect yet, but it's getting there! (Thoughts.template.php)
2 files changed, 101 insertions(+), 37 deletions(-)
+ Implemented a converter for buddy lists to contact lists. Will only execute after you've made use of Thorsten's importer and thus gotten buddy lists from an earlier SMF install, for instance. (Load.php)
! Thoughts needed more work to work with the new privacy & contact list systems. It's not perfect yet, but it's getting there! (Thoughts.template.php)
2398
Features / Re: Plugin revs
« on October 24th, 2013, 09:41 PM »
rev 92 [master 9bcee1c]
5 files changed, 57 insertions(+), 8 deletions(-)
+ Added Language cache flushing plugin. (lang_cache_flush/*)
* Typical typos from some bloke I used to know: 'cannon' instead of 'cannot'. (wedgedesk/src/WedgeDesk-Post.php)
* Quotenazi. (ajax_qr/ajaxqr.js)
5 files changed, 57 insertions(+), 8 deletions(-)
+ Added Language cache flushing plugin. (lang_cache_flush/*)
* Typical typos from some bloke I used to know: 'cannon' instead of 'cannot'. (wedgedesk/src/WedgeDesk-Post.php)
* Quotenazi. (ajax_qr/ajaxqr.js)
2399
Features / Re: New revs
« on October 24th, 2013, 09:31 PM »
rev 2283 [master 955283b]
5 files changed, 37 insertions(+), 15 deletions(-)
! Fixed 'file not found' errors not actually showing the filename. (ManageErrors.php)
! Ajax requests didn't return any parseable HTML when errors occurred. (Errors.php, Errors.template.php)
* Try to minimize gaps between membergroup IDs if deleting groups right after creating them. (Subs-Membergroups.php)
- Don't show your avatar in the sidebar if you're a guest. Duh. (index.css)
! Fixed (hopefully without introducing new issues on other browsers..?) a scrollbar problem on pages that were shorter than the window height. (index.css)
5 files changed, 37 insertions(+), 15 deletions(-)
! Fixed 'file not found' errors not actually showing the filename. (ManageErrors.php)
! Ajax requests didn't return any parseable HTML when errors occurred. (Errors.php, Errors.template.php)
* Try to minimize gaps between membergroup IDs if deleting groups right after creating them. (Subs-Membergroups.php)
- Don't show your avatar in the sidebar if you're a guest. Duh. (index.css)
! Fixed (hopefully without introducing new issues on other browsers..?) a scrollbar problem on pages that were shorter than the window height. (index.css)
2400
Features / Re: New revs
« on October 24th, 2013, 09:27 PM »
rev 2282 [master 05be743]
8 files changed, 48 insertions(+), 32 deletions(-)
+ Second batch of privacy rewrites. Thoughts should now support contact lists, and everything (or most everything) should use integer values now. Phew. (Ajax.php, Post.php, Subs-Post.php, Thoughts.php, Thoughts.template.php, script.js)
- Removed unused variables. (Like.php)
@ Todo comment. (Load.php)
8 files changed, 48 insertions(+), 32 deletions(-)
+ Second batch of privacy rewrites. Thoughts should now support contact lists, and everything (or most everything) should use integer values now. Phew. (Ajax.php, Post.php, Subs-Post.php, Thoughts.php, Thoughts.template.php, script.js)
- Removed unused variables. (Like.php)
@ Todo comment. (Load.php)