• Another thing on using NetBeans, I usually work on files directly located on my local xampp installation, this allows me to do changes and test them right away, when I  finished with some feature or just want to save the work made so far, I copy all the files (or just the files I modified) Breeze use to my folder where I keep the git repository.

    By using Netbeans I will have to work on the files in the git repository, meaning that I would need to copy those files to my localhost folder every time I want to test things.

    I know Neatbeans can run code, however since Breeze isn't a standalone script I can't really do that unless I load the entire SMF on my project somehow.
  • Nightwish | Re: Thinking, code monkey and software architecture
    April 15, 2012, 11:18:11 AM
    Another thing on using NetBeans, I usually work on files directly located on my local xampp installation, this allows me to do changes and test them right away, when I  finished with some feature or just want to save the work made so far, I copy all the files (or just the files I modified) Breeze use to my folder where I keep the git repository.
    You could probably use Netbeans' deployment feature to upload (or copy) files to a deployment directory (which would be the local git copy in your case).

    That's how I have setup my environment. I have only one single copy of my project (my local git repo). Whenever I need to sync it with the live site I sync my local repo with my server directly in the IDE and it will upload the modified files via SFTP to my live server.

    Quote
    By using Netbeans I will have to work on the files in the git repository, meaning that I would need to copy those files to my localhost folder every time I want to test things.
    Do it the other way around. Work and edit on the files on your local server and just sync with your local git repo when you're ready to commit, OR edit in your local git repo and deploy the files to your local server - I believe, it's even possible to sync automatically, so when you save the file in the IDE, it's automatically uploaded to the test site.

    Here is a bit about that feature.
  • Thanks for the tip! :D, I somehow manage to run the code on my local server, there is just a small conflict, although Breeze is mostly hooks only, there is some file edits, mostly in Sources/Load.php and sometimes I need to modify those files but I guest that is a small glitch, I can do the edit on notepad++, test it and then add it to the .xml file, another glitch is that the IDE doesn't copy the files to my local server, thus I cannot test it with a regular user account and when I run the code from the IDE it shows as guest (which is a problem since Breeze isn't intended for guest :( )

    I still find it weird not having the tabs, I configured so all the unnecessary spaces and tabs get removed on saving, however I still don't feel comfortable editing code there, too many options :P 

    Edit, OK I finally managed to configure it like I like, that is, use tabs, tab size is 4 and do line breaks if the line is too large, it still shows the horizontal scroll bar, dunno why, to me it's just space wasted.

    I'm still trying to configure the git thing, I'm still learning a lot of git stuff so I probably will just use the git GUI for now.
  • OK, I made some progress, it seems netbeans cannot copy the files to my local folder but with a batch file I can do that just fine.
  • Some more rants.

    One thing that annoys me is the Trailing Whitespace an empty lines with only tabs or spaces, in notepad++ I even created a shortcut for that and I was constantly using it.

    With neatbeans I can't find a way to do it (via short cuts) and the option to remove the Trailing Whitespace on save doesn't really do that, I save the file with netbeans, go and open the same file with notepad++ and there is a lot of lines with tabs only :(  for a control freak like me, that isn't good.

    On Notepad I had a custom shortcut Ctrl + Alt + q to insert a comment: /* Comment */  and with netbeans there is only a single comment // and the shortcut is weird: Ctrl + /  how exactly could I type / ? I usually do shift + 7 but non of the combinations seems to work.

    A list of shortcuts: http://kdelchev.com/2012/02/netbeans-eclipse-pdt-shortcuts-comparison/

    funny, the shortcut for comment in eclipse does work on netbeans: Ctrl + Shift + C, however it places the // first, then tabs then the comment when it should be tabs // then comment :(

    In resume, I am finding very frustrating the switch from notepad++ to an IDE, the only thing I did on this past week was configuring netbeans...

  • Nightwish | Re: Thinking, code monkey and software architecture
    April 18, 2012, 06:33:15 PM
    One thing that annoys me is the Trailing Whitespace an empty lines with only tabs or spaces, in notepad++ I even created a shortcut for that and I was constantly using it.

    With neatbeans I can't find a way to do it (via short cuts) and the option to remove the Trailing Whitespace on save doesn't really do that, I save the file with netbeans, go and open the same file with notepad++ and there is a lot of lines with tabs only :(  for a control freak like me, that isn't good.
    I guess, that comes from the auto-indent feature. It may indent empty lines when the previous line was also indented - yes, that's totally stupid and doesn't make sense, but I have seen this in quite a number of other editors as well.

    Quote
    On Notepad I had a custom shortcut Ctrl + Alt + q to insert a comment: /* Comment */  and with netbeans there is only a single comment // and the shortcut is weird: Ctrl + /  how exactly could I type / ? I usually do shift + 7 but non of the combinations seems to work.

    The default keyboard shortcuts are probably configured for an english keyboard where the / key is easily reachable. That's why many programmers prefer to work with an English keyboard layout even when their native language isn't English (like myself, I normally use english keyboard layout for programming, simply because so many important characters like / \ [] {} are much easier to type).

    Quote
    In resume, I am finding very frustrating the switch from notepad++ to an IDE, the only thing I did on this past week was configuring netbeans...
    Well, switching from a text editor to an IDE can be cumbersome, especially when you are doing this for the first time. The main advantages of an IDE is usually not a better text editor, but the overall environment (i.e. code inspection and analysis, code assistance tools like list members/autocomplete etc., integrated version control, tools for building / deploying and debugging projects, project management and much more).

    I have not found a single IDE with its editor comparable in flexibility to vim, emacs, textmate (on Mac) or sublime text (which is my personal favorite among all editors). The JetBrains products probably come closest, but they are not open source.

    It will take a while, though if you don't like Netbeans and sense a feeling that using it might not be beneficial for your work flow - stop wasting time with it and find something else. A week should be enough to find out whether you like it or not. If you still hate it, it's probably not worth the time :)
  • OK, I had this idea that the switch was necessary, at this point I don't think I'm using 5% of all the features the IDE provides, mostly because I don't really have any use for them, perhaps is still to early for me to move.

    I realize an IDE does make things easy for programmers but for someone who just plays around with code it seems like too much.

    I did like the sidebar with all the methods/functions and the tree with all the folders and files easily reachable  and the "go to line" shortcut.
  • OK, slowly moving.

    The notifications turned out to be a real pain in the posterior... and I haven't even touched the UI yet...

    It feels somehow hackish, loading the user's data every time I need to send out a notification, not to mention the possible combinations between Wall owner, Status owner and comment owner (when sending a notification for a new comment or a new status), that is, a wall owner can also be a status or a comment owner, there is multiple possibilities and a user may end with more than 1 notification for a single event :(
  • OK, been testing the notifications, there is some flaws on the design, this needs some serious re-write I'm afraid.

    First of all, I will not store the hardcoded url on the database, will just store the type, then based on the type, on showing the actual notification I will build the url.

    The same for the content, based on the type, I will build the message on showing instead of storing the message on the db.

    Basically I have a lot of sprintf() strings with things like: X commented on the status made by Y on Z's  wall.

    What I'm going to do is just pass the user ID of the people and build the actual link on showing, avoiding the clutter the message with hardcoded data as much as possible.
  • uff!  I finally finished the Query class  I'm pretty sure it is full of errors :P   to bad I created a new branch after I committed some of the changes to the master branch.
  • Been doing a lot of changes lately, I almost regret that I did it :(

    I'm goign to ditch the whole modules thing, I have no idea on how I can approach this one.
  • Finished with the changes already :)

    Now what worries me the most is how to load all the Status and all the comments for each status, currently I heavily abuse of the foreach construct, this may work with small sites but will be a server killer on medium to large sites.

    I use cache for both the Status and Comments, both are stored as multidimensional arrays with their respective ID as key.

    The problem is that both arrays are independent from each other and I need to assign all comments to each status.  And this is how I currently load the comments:

    Paste bin url: http://pastebin.com/L9fcVjVp

    This arrays may become massive at some point and I have no idea what is the best way to load them. Perhaps loading both status and comments with a single array, dunno.  :(
  • Some more problems.

    I did some changes to the way the queries were called to reduce the number of queries per profile page, I also did some changes to only load the comments for X particular profile rather than loading the entire comments huge array, it was until that point that I realize there is some problems with the way I'm calling the comments array.

    The first time I see X profile it all displays good, if I reload the page, then the comments array who was supposedly loaded from the cache this time its actually empty, it does use the cache but somehow it doesn't get displayed, I've been trying to figure it out this problem but no luck so far, I already checked the cache name, there are no duplicates, in fact, the cache file looks fine, argh!
  • Some more problems.

    I did some changes to the way the queries were called to reduce the number of queries per profile page, I also did some changes to only load the comments for X particular profile rather than loading the entire comments huge array, it was until that point that I realize there is some problems with the way I'm calling the comments array.

    The first time I see X profile it all displays good, if I reload the page, then the comments array who was supposedly loaded from the cache this time its actually empty, it does use the cache but somehow it doesn't get displayed, I've been trying to figure it out this problem but no luck so far, I already checked the cache name, there are no duplicates, in fact, the cache file looks fine, argh!

    Oh dear lord!!!  it was a freaking underscore!!!  3 hours looking at the code and when I finally gave up and wrote this reply, a few minutes later I found out it was an underscore!!!
  • OK, notifications time.

    I was thinking about using json for this, that is, the notifications table will only have 2 columns, ID which is an auto-increment value and "body"  or "content" or some other fancy word. Let's call it "body" as that is easier to type.

    body would be a json string containing the following:

             'user' => 'int',
             'type' => 'string',
             'time' => 'int',
             'read' => 'int',
             'content' => 'string',

    so far so good, I can query the table and use json_decode just moments after caching the result, but this leads to some problems, for example, the read value, is far more easy and faster to just update a plain and regular in column than going trough the hassle of rebuilding the json string just to update 1 value from 0 to 1 or vice-versa.

    At the moment I'm only using json in the last "content" column, this column and everything else is a separate column.

    Now, I already had some code for this and it actually was working, but creating the notifications was a real pain in the ass, lots and lots of verbose code. I need to find a way to simplify the process of creating/deleting notifications, to automatize the process as much as I can, to make it relatively simple to add the notification system not only for Breeze but for other forum aspects like new topics, replies, etc.

    And, as always, I have no idea on how to do that :P