Jump to content
Larry Ullman's Book Forums
Sign in to follow this  
Edward

My Project Diary

Recommended Posts

Happy Birthday, Edward! I bought an iMac about 3 years ago and have been really happy with it. Lots of power for the price. It's a nice computer. I'm debating between buying a new Air or a Macbook Pro to replace my old MBP. Still unsure...

  • Upvote 1

Share this post


Link to post
Share on other sites

I would say it really depends on your usage. Keep in mind that the Air does lack ports for ethernet and DVI/HDMI and has only two USBs. The SSD, light weight, great screen and small size is the strength. I love the machine, and would not consider a Pro now, but keep that in mind. I have the 13 inch, and absolutely love it!

  • Upvote 1

Share this post


Link to post
Share on other sites

I think if I were spending someone else's money, I'd buy the Air. Spending my own, I'd get the MBP, I believe. You just get more computer for the money. I certainly see the appeal of the Air, though.

  • Upvote 1

Share this post


Link to post
Share on other sites

@ Antonio, i am glad you love your Mac Air, we have always had a MacBook here, i tried it but i never thought anything of it, i just hate the trackpad and find it very difficult to get things done. On the otherhand iMac is a totally different experience. I already installed MAMP i believe the process was easier than on windows, Mac just gives the appearance that no bugs will happen. Larry always used MAMP examples in his book for Mac so i believe if he thought XAMMP was more appropriate he would of done his examples with that.

 

@ Larry. Thank you very much. I did see MacBook's and i noticed that some of those were more expensive than my highest spec iMac.

 

Okay but to my notes, yesterday i spend most of the day sleeping as the first day i purchased iMac i spend most of the day on it and landed up with 6 hours sleep.

 

I am currently waiting for an email from adobe with my new Creative Suite CS6 Web Premium Serial Number, they are also sending me out a new CS6 CD which will arrive in 7 - 10 days. I currently downloaded the 30 day trial edition which i have been using.

 

I have always been very skeptical about moving over to Mac as i wasn't much impressed with the MacBook. However the iMac with the mouse is just so wonderful, i could easily type the word wonderful another 10 times and i don't think this would be an exaggeration.

 

I find that iMac is a very personal computer, the way everything is grouped together, i also find it easier to connect with its visual features. With windows i never felt i really knew the system, stuff was just everything, like spaghetti code.

 

With regards to some of my old games like Alone in the Dark 1, 2 and 3, i went back to GOG.com where i downloaded them and they had a Mac version also so i downloaded them. Some of the other games i owned on GOG were only available for windows versions. I also love the game Feary Tale Adventure which is good on the Genesis, i found an emulator for genesis for Mac, so i can no play that again. And for transferring pictures from my Samsung Galaxy Note to Mac i got an Andriod file transferrer. So with regards to the games situation its not that bad. Talking about games i downloaded the so called best game for Mac i found in a chart it was called Limbo, its quite good, its like your most worst nightmare as a child. And lastly about games, i know i shouldn't off done this as i spent hours before but i just couldn't help myself and subscribed for the online MMORPG World of Warcraft Mac version, hehe.

 

Anyway after what i have seen of iMac i can definitely say its 3 to 5 times better than your regular windows desktop. It is such a pleasure to work and type code into, the screen quality is just so great.

 

Today i spent a couple of hours working on the category selector for my website, mostly i have been trying to configure the CSS up to a level of which i can start doing the Ajax requests. I also got the categories database filled and put in groups of subcategories for testing with. So far everything is going well. Okay i am going to try World of Warcraft on the Mac, i used to be a lvl 85 and now its time to get back there again. :)  But don't worry i will keep doing my project and updating here, i am just a little bit excited with things right now.

Share this post


Link to post
Share on other sites

What? You disliked the track-pad on Macs? Seriously? I'm in shock. It's the only track-pad ever made that actually works how you expect it to, in my opinion. It's one of my main reasons for going for a Mac laptop in the first place. I normally want to throw every other laptop into a brick wall after five minutes of usage. I don't even bother with a mouse when I use Photoshop. :P

 

I had a Pro before, I switched because the Air was perfect for my personal usage. They are both awesome in my opinion. I absolutely second your opinions on price, though. It's not a great value-proposition by any stretch of the imagination. I think they are worth it personally, though. They also keep value really good. I earned around 150 dollar on the used Macbook Pro I owned for a year.

 

Games are tricky on Macs, yeah. That's why I keep my windows machine. Check out a game called The Binding of Isaac if you like random-generated rougelikes. You'll get it for under 5 bucks, and I've put 100 hours into the game. A lot of cool indie games available for Mac too. Steam has a section for Mac-supported games. Limbo is awesome, yeah!

 

Keep on enjoying your new iMac! It's something special opening Apple products. They really know how to give you a good experience. Quality! We only use iMacs at work, and they are awesome. (But I actually use my Air there too... I love that machine...)

  • Upvote 1

Share this post


Link to post
Share on other sites

@Antonio Yes i dislike trackpad seriously or any form of it, its slow and annoying, they don't live up to the speed and flexibility of mouse or especially a magic mouse :) . I have been using the mouse since my first computer which was a Commodore Amiga 500 back in 1990, so thats 24 years (ha longer than you've been alive) of using one and so far nothing comes close to it. I will take a look at The Binding of Isaac, i would probably advise you not to try World of Warcraft as it is highly addictive, its something i probably spend 10,000+ hours on before. It was the reason i dropped one of my Maths papers from a A to B grade, although all my other Maths papers were A's i was disappointed with that result and don't forget it to this day. Yeah i am still enjoying it, i cycled home so fast today i made a new speed record of 31.1mph and that was on a flat straight road with no wind, my old record was only 27.5mph, take into account this is also on a Mountain Bike its no racer.

 

Okay this is enough on the iMac and games now i got to get this thread back into gear with my projest. Ive come up with a plan for the category selector so will work on it now. Thanks

Share this post


Link to post
Share on other sites

Thursday, 2nd May 2013

 

Hmm, this is the second time i am typing this post, i accidently swopped left on my magic mouse and sent the browser back a page losing my post.

 

Okay so far things are going well on the Ajax Dynamic Category loader, well they are going well now but i had a real hard time with the CSS and had to find quite a few hacks to get things working. I had inline-blocks dropping down wrapping down to the next line when i needed them all on one line and a horizontal scroll bar to appear below. I fixed the problem using white-space: nowrap; although this fixed part of the problem it started another problem in which it applied the same formatting to child elements so within the child elements i had to use white-space: normal; Now i had another problem betwen my inline-block div's i had some spacing i tried for hours trying to remove it setting padding to 0 and margins extra. Then i found this online

 

http://css-tricks.com/fighting-the-space-between-inline-block-elements/

 

I thought this was good and applied the formatting so this worked it removed the space between my division blocks. But the problem was not yet over there was a space at the bottom of the division block and i found another resource online

 

http://salman-w.blogspot.com/2012/10/remove-space-below-images-and-inline-block-elements.html

 

Yes removing the space below inline block elements, ahh this css is really amazingly annoying, isn't it? Anyway i used vertical-align: bottom; and funnily enough it worked. :wacko:

 

Today i applied all the other css formatting to the Category selector since i have already wasted so much time on the CSS than i would of liked to and lookwise it is now 100%. Actually its the best looking category selector i have ever seen online but maybe thats just because i am viewing it on iMac, hahaha.

 

So now i guess its time to go and give the Yii book a little read to brush up on how ajax should be applied in Yii. Okay ill give this another bash shortly, time for a break.

Share this post


Link to post
Share on other sites

Monday, 6th May 2013

 

As of today i have finished of the ajax work and css involved in the dynamic category selector i have been working on. I found getting the CSS to work much harder than the coding. I thought ajax was difficult but it turns out it was just as easy as making a normal function. I wasn't able to use the Yii ajax functions for my project as the coding was slightly lower level so i used JQuery $.get function to fetch basic HTML code for the category's. I also used the data- html attribute which is availabe in html 5, however you can still use JQuery to find the attribute value of a give attribute with attr. So for my data attribute values i used for example for category number one data-category = "1". I did some further reading in to data- attribute and it still works on older browsers.

 

Another thing that i just had to solve when i added an event handler onclick to the bootstrap modal window close button it would no longer close. I checked the js for the modal window and found it has a hide function in its object. So to hide the modal window after the category is selcted you need to add this code $('#your-modal-whatever-it-is').modal('hide');

 

Another issue i would like to mention is when using $.get() JQuery function, if this was nested inside an onclick event handler then when you add the function you cannot use $(this), you have to reference the element again. So it appears the $.get() and the function it was within are not directly related.

 

Oh and i forgot to mention i used ajax loader gif for the time i had to wait for subcategories to load up. I used this resource to make the gif image.

 

http://preloaders.net/en/popular

 

I also used this resource from NetTuts for ajax requests in JQuery it was good to get started:

 

http://net.tutsplus.com/tutorials/javascript-ajax/5-ways-to-make-ajax-calls-with-jquery/

 

Tomorrow i need to finish of the selected category bread crumbs link then ive got some server side stuff to sort out to load up those div's if the submit button is clicked and validation is not clear which you know will result on all jquery actions being lost. I will use a hidden input to store the value of the selected category id if you were wondering.

 

Sneak peek at some of my jquery code

$(this).addClass('selected-category').parent().siblings().find('a').removeClass('selected-category');

Good Night!

  • Upvote 1

Share this post


Link to post
Share on other sites

Tuesday, 7th May 2013

 

I managed to complete the hidden field on the item listing form to store the category id and complete the jquery work that was required to fetch the category value from the last div ul li a which is selected.  Last night i wrote some complex jquery code but today i saw a simpler way of doing it and just redone the code and now its just a few lines for the same thing.

 

Like Larry said in his books if your stuck with something just step away from the computer and come back. It seems this is very regular for me getting stuck and spending quite a lot of time with a burned out brain. Then going away from the computer coming back and fixing the problem in a few minutes, then i wonder to myself why i wasted so much time when the solution was easy. Ive actually just been working on a category breadcrumbs link which has to come back via a server ajax request and guess what yes i am in the situation again of being stuck. I thought this problem was relatively easy, first i thought my ajax was wrong but its not, now ive done detective work back to the php server code and found it seems to be running okay and the source of the issue seems to be lying within a while loop. Well i am burned out now and will continue to work on the category breadcrumbs tomorrow, i am real close to finishing this now. Darn this item listing page is a lot of work, ive worked on it almost two months now (and there is a item update page arrrrgggghhhh), just one page but i guess its the first time i have written such code.

 

By the way if you were reading my project diary and were confused with yesterday's post of the html data- attribute here is a resource which you can read:

 

http://html5doctor.com/html5-custom-data-attributes/

 

Okay i am off for now, ill get more done tomorrow, happy coding everyone! :)

Share this post


Link to post
Share on other sites

Wednesday, 8th May 2013

 

Morning: Ive managed to complete the category breadcrumbs from the selected category, it to me roughly an hour. There was some tricky logical code and i had to use integer type casts and i had to make the use of adding comment debugging intensively to figure out the source of the problems. So now i can create nice category breadcrumbs like these.

 

Books > Catalogs > Owner's Manuals

 

I added the ajax function to my Category model, this function will also have to be used by the server script aswell as this link will need to be generated if the item listing page fails validation tests and needs to be redrawn.

Share this post


Link to post
Share on other sites

Wednesday, 8th May 2013

 

Night: Okay its night now and ive managed to get the category breadcrumbs link redrawing after the form is submitted and fails validation. I used the same ajax function i made earlier, so i made a mistake in saying i would do this server side, i actually just done it in the javascript on loading up the item data for the page.

 

Ive just used for the first time now a Jquery function called scrollLeft(), here is a link to the resouce from the JQuery website:

 

http://api.jquery.com/scrollLeft/

 

The problem i had is when i add many subcategory division blocks eventually a horizontal scroll bar will appear in the wrapper division block and the newly showing subcategory list will not appear. So i had to shift the scroll bar to the right a little each time on adding the new category div. I have actually used JQuery .animate() also to give this a more smooth animation.

$('#category-wrapper-div').animate( {scrollLeft: 200}, 'slow');

Well all this work now seems to be taking its toll, today i am feeling mentally tired and had to push myself to get this part complete. I think tomorrow i will take a day off and will get back to work again this Friday.

 

Edward <_<

 

Working into the night: After taking a rest and eating a spinach and cheese dish i decided to have another go at finishing things off and now i have. So i have finally finished the ajax dynamic category selector, i also added in a feature which requires the Jquery user interface library just to spice things up a little, well its working great its really awesome. Okay im definitely taking the day off tomorrow and will work on fishing the multiple image loader next.

  • Upvote 1

Share this post


Link to post
Share on other sites

Friday, 10th May 2013

 

I encountered a small bug the other day while using mac to resize the text in the browser. I have a Flash SWFUpload button which when you click it opens the file folder for upload. Now the problem is with a flash object you can only use a few styles of CSS which they provide, so you can't get that "yiibooster bootstrap effect". So what i done intialy was use a div and styled it with boostrap classes then i made manually set the flash object to the same size of it. I used the flash text and set the color to white. But the problem was when you enlarged the size of the browser text with mac using "command +" the div would get bigger but the text would get smaller.

 

I just spent 2 hours trying to figure out how to fix this problem i tried some stuff with CSS and looked online, i also found another website with the swfupload button and this time when you enlarged the browser text the button and its text got smaller.

 

I also found this article online, i came up with the idea that maybe i could attach a js onclick event to a div and that event would trigger the flash event.

 

i.e  ExternalInterface.call("function(){$('#button').trigger('click');}");

 

http://stackoverflow.com/questions/3788122/jquery-trigger-embedded-object-click-by-clicking-a-div

 

I thought this whole situation was starting to get ridiculous as i have swf files i don't even have .fla, i did find some flash .swf decompilers to .fla.

 

Anyway it happened again, i went away from the computer and came back again, probably 25mins and solved the problem. I have decided to post my solution since this was quite I would say a nasty one.

 

Solution:

 

In my view file i added this basic html, the span with the id swfupload must be put inside the span class as this will be replaced by the flash object. (Its probably hard for some of you to understand what i am going on about but if you are using the swfupload widget for yii you will know what i am talking about.)

 

<span class="swfupload-button btn btn-large"><span id="swfupload"></span>Upload Images</span>

 

Now in your swfupload.css file you need to add
 

/* -- SWFUpload Object Styles ------------------------------- */
.swfupload {
    position:absolute;
    left:0;
    top:0;
    width:100%;
    height:100%
}

 

and in your regular main.css file you will need to add a class for the class in the wrapper span class we have above called swfupload-button.

 

.swfupload-button
{
    position: relative;
}

 

This solution fixes the problem and now you have a swfupload button which scales proportionally when the screen is enlarged.

 

Thanks and goodnight!

Share this post


Link to post
Share on other sites

Thursday, 23th May 2013

 

I've decided i am going to end my project diary here because i am lacking the time to write all the updates. The project i am working on is taking a considerable amount of time due to unexpected bugs which have to be accounted for as well as trying to get complicated CSS tricks/features working 100%. But seriously if i was to start writing an update now it would probably take a couple of hours to finish talking about the recent material i covered.

 

I hope you enjoyed reading my project diary, thanks Edward!

Share this post


Link to post
Share on other sites

It's been cool following your project. Hit me up if you ever need help withsome CSS. I only did front-end coding & design before Larry pushed PHP knowledge into my stupid brain.

  • Upvote 1

Share this post


Link to post
Share on other sites

Thanks but usually those CSS problems are difficult, they involve many scripts and you would need to be here with me. Basically I've got jQuery and JavaScript doing a lot of the work, so it can be hard to figure out.

Share this post


Link to post
Share on other sites

I am still working at my project but it is taking a lot longer than expected due to many unexpected bugs and also different browser issues. Up until now I have had great success with the Yii framework which has also expanded my knowledge for Object Orientated programming.

Share this post


Link to post
Share on other sites

Larry Ullman you have been great. Your books are the best written on the market today. PHP is actually easy but it depends how it is explained to people you are very talented. I hope you will keep up your work. Also good luck on getting the yii book completed. I enjoyed reading your books on PHP especially as those have been the one's I've mostly used in my project till now.

Share this post


Link to post
Share on other sites

Thanks, Edward. Very nice of you to say. I'm continuing to do my best with "The Yii Book". Thanks, as always, for your patience.

 

You've definitely identified the two major hurdles to web development. First, there are lots of technologies to learn and use together. Second, navigating the browser differences can be a chore.

 

Good luck!

  • Upvote 1

Share this post


Link to post
Share on other sites
Guest Deleted

PHP is actually easy but it depends how it is explained to people...

 

This reminds me of something I think about when I use the PHP manual: "If the manual explained things better, would there be such a big demand for understandable sources of PHP education?" I've been using PHP since 2003 and I have studied the subject for countless hours but I still can't understand the PHP manual when it tries to explain how something works--not unless I already half understood the topic to begin with or can figure it out by looking at the example. Case in point: Yesterday I looked up array_map and the explanation was "Applies the callback to the elements of the given arrays" I was like "Uhh, what?" I sorta knew what a callback was but had no idea how you'd use that with an array. The example didn't help in this case. So I Googled and found a really good explanation on Stack Overflow. I caught on in no time :)

  • Upvote 1

Share this post


Link to post
Share on other sites

Reading documentation and manuals are horrible, but you get used to it after a while. One trick is to ignore all explanations and look at input params, return values and examples first. Knowing data types and structures are often also important. You notice the manual type hinted the first param as a "callable" in array_map? The type text is also a link, so looking at that would possibly make your life simpler. Doing such cross-referencing is very important.

 

Btw. The PHP manual is horrible compared to that of some other languages. I hope they fix a lot of that with the recent improvements of php.net. :)

  • Upvote 1

Share this post


Link to post
Share on other sites
Guest Deleted

Yeah, that's what I have to do about half the time with the function pages.

 

I liked CodeIgniter's documentation a lot. It really helped me get going with the framework. PHP on the other hand...they don't seem to have a clue when it comes to making things understandable. I almost feel like they think everybody who reads the manual is this epically awesome guru who is just there to review.

 

I still don't understand all the PHP manual's conventions. Know of any good sites that explain them? I do agree that being better with conventions would help me.

  • Upvote 1

Share this post


Link to post
Share on other sites

I like CodeIgniter's documentation too, but I find it a little too less concise some of the time. It's hard to strike the perfect balance for everyone, I guess.

 

I don't really have more to suggest. To exaggerate, I woke up one day and it all suddenly made sense. I guess it's one of those stepping-stones kind of thing where you reach a certain level of understatement, and it's beginning to makes sense from that point on. Good luck moving forward though.

 

Maybe someone have something else to add?

  • Upvote 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...