Jump to content
Larry Ullman's Book Forums

Edward

Members
  • Content Count

    1115
  • Joined

  • Last visited

  • Days Won

    27

Edward last won the day on December 27 2013

Edward had the most liked content!

Community Reputation

108 Excellent

About Edward

  • Rank
    Advanced Member
  1. Edward

    My Project Diary

    Post edit
  2. Edward

    My Project Diary

    My php is much better now, i hae had to rewrite parts of my project as my coding got better. The thing is when you improve things change the way you think and the way you structure things. So its quite hard because you have to go back and fix things. I am using model classes much better now, i have many many for each modell. This helps to cut down the code and help me organize things much more. So programming is really difficult especially on a big website, when you get better you have to keep fixing things so the process takes longer and longer the bigger the website gets. I think the main problem is i try to keep everyhing perfect and its not possible you just have to get things to work.
  3. Edward

    My Project Diary

    Still working on this.
  4. Edward

    Forum Issues

    This is a good forum. I have learned a lot here. Especially with my object orientated codeNibcan develop a good website after learning from from you? Because I know better object orientated code. This helps as its more advanced as to the general code that is written
  5. It's good you signed up with Larry Ullman he is a good web developer. You you will get a lot of knowledge from him he has many years.experience in web design.
  6. Edward

    Yii Elasticsearch

    I got the search up and running now. It took me a while to get it integrated into my website. But it was worth it this search engine is much better than the original search. Lucene worked out really good it has some advanced search features rather than the basic Myisam databases. So after a bit of extra work I got it figured out.
  7. Edward

    My Project Diary

    Still working on this.
  8. Edward

    Yii Elasticsearch

    That's why i love you Larry, i just created the a .bash_profile file in my home directory added the line you suggested export JAVA_HOME="/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home" and then everything works. Amazing. Thanks for your help, christmas is coming soon.
  9. Edward

    Yii Elasticsearch

    When i run java -version from terminal, it comes with: java version "1.6.0_65" Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609) Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode) Java 1.6 is unsupported by ElasticSearch, i have installed Java platform 1.8, product 1.8.0_25 with path /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java I am not sure what i have to do to change the Java being used. I don't know anything much about terminal. I have found this other thread that can help but when i tried this elastic search still gives the same error. https://docs.oracle.com/javase/tutorial/essential/environment/paths.html
  10. Edward

    Yii Elasticsearch

    I installed Java version 8 it shows the java icon in System Preferences on my iMac. When i try to run ElasticSearch from terminal i get this message coming up: Edwards-iMac:~ EDWARD$ /Users/EDWARD/Desktop/Elastic\ Search/elasticsearch-1.4.0/bin/elasticsearch ; exit; Exception in thread "main" java.lang.UnsupportedClassVersionError: org/elasticsearch/bootstrap/Elasticsearch : Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) at java.net.URLClassLoader.access$000(URLClassLoader.java:58) at java.net.URLClassLoader$1.run(URLClassLoader.java:197) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) logout [Process completed] I have looked at some of the threads on GitHub but i don't actually understand what they saying? Does anyone have any idea where and what i should edit into files? https://github.com/Homebrew/homebrew/issues/29610#issuecomment-47778002
  11. Edward

    Geolocation

    Thanks for the link, i came across this one before actually from StackOverFlow while running a search. Thanks for your help. Edward,
  12. Edward

    Geolocation

    Thanks for the fast response. I need such a request for such a page like eBay has for example http://www.ebay.com/sch/i.html?_from=R40&_trksid=p4712.m570.l1313.TR0.TRC0.H0.Xlarry+ullman&_nkw=larry+ullman&_sacat=0 This is their listings page. If i know where a user is from by either locating their country or using their signed in account info, i could add data to item listings specific to them for example if the seller offered international shipping or had free shipping available. There also has to be a buffer just incase i can't find their location and then I could just provide default data for a particular item. I really need the country to be picked up so it will work with my PHP script before the javascript even loads so i can perform specific page rendering. Obviously if i do have to trigger an API request i wouldn't want to repeat it everytime the page had to be reloaded, so I would either need to issue the user with a Cookie or possibly save the IP's country from the proceeding API request to the database to later act as a IP country look up table. Also i am unsure of what you mean by this? (If they're not (i.e., most desktop PCs), you can approximate their location by their IP address.) How can i find a users country via a IP address, i would need a lookup table or have to make a API request but from where exactly?
  13. If a user is surfing your website, how is the best way to get a users two letter country code e.g "US" if we don't know where they are located? I found the following options so far: http://php.net/manual/en/book.geoip.php http://ipinfo.io/developers https://developers.google.com/maps/documentation/geocoding/ My website will require numerous API requests for this info so i am looking for a sensible solution. Edward.
  14. I love the new book its well written. I found that if you have a website with buyers and sellers and not just an individual seller the carts database is not suffice. I think that in this case it would be best to create a cart and a cart_content database like this to make it easier to sort out members shopping carts with some simple relational queiries as apposed to some PHP logic. CREATE TABLE cart ( id INT UNSIGNED NOT NULL AUTO_INCREMENT, buyer_id INT UNSIGNED NOT NULL, seller_id INT UNSIGNED NOT NULL, date_created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, date_updated DATETIME DEFAULT NULL, PRIMARY KEY (id), INDEX fk_cart_user_buyer_idx (buyer_id ASC), INDEX fk_cart_user_seller_idx (seller_id ASC) )ENGINE=InnoDB; CREATE TABLE cart_content ( id INT UNSIGNED NOT NULL AUTO_INCREMENT, cart_id INT UNSIGNED NOT NULL, item_id INT UNSIGNED NOT NULL, price INT UNSIGNED NOT NULL, quantity INT UNSIGNED NOT NULL DEFAULT 1, date_created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, date_updated DATETIME DEFAULT NULL, PRIMARY KEY (id), INDEX fk_cart_content_cart_idx (cart_id ASC), INDEX fk_cart_content_item_idx (item_id ASC) )ENGINE=InnoDB;
  15. I was thinking about this as well you could just put user/member/username So loading up by there username instead of their id, i guess this only applies if your members have a username though.
×