+ Reply
Page 3 of 7 FirstFirst 12345 ... LastLast
Results 41 to 60 of 138

Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.


Thread: Improving our Coding Skills

is a discussion within the

File Mods

forums, a part of the

iPhone Modding

section;
Originally Posted by RKO1195 Dam I'm proud of you Thanks RKO! That means a lot coming from you, bro! It's starting to come together slowly.. I remember as I was
...
  1. #41
    The Big D NewdestinyX's Avatar
    Join Date
    Jan 2012
    Posts
    9,389
    Thanks
    3,662
    Thanked 8,448 Times in 4,291 Posts

    Quote Originally Posted by RKO1195 View Post
    Dam I'm proud of you
    Thanks RKO! That means a lot coming from you, bro! It's starting to come together slowly.. I remember as I was learning Spanish, my 2nd language.. I was moving really slowly for about 3 years. And then in year 4 - a lot just started coming together... And I remember a Spaniard friend of mine not correcting much of what I had to say one night after a rehearsal.. and he started speaking to me in Spanish as 'just a person' - and not a 'person TRYING to learn' his language (being real slow). I was understanding only about 70% of what he was saying - but it was enough. I understood the whole JIST of the conversation - and my speaking back was NOT confusing him either. It was an amazing feeling of accomplishment.

    Sometimes - things just start to click.. And with studying code casually for over a year - and more seriously now for the last 2 months... things are really starting to 'make sense' to me. I just want to try and help it to make sense 'quicker' for others.. In post 1 - I try to talk in 'artists' language and not 'engineer's' language. Most of the great modders here are 'artists'. Since I'm an artist first (musician) and 'techy head' 2nd.. I think I can help explain some of this stuff in layman's terms..

    But I have so many of you to thank.. If it weren't for ALL the questions Durben, Dacal, Ian, Drifter, King and MamaJaay have born with from me over these last 18 months - I'd be nowhere. CSS and HTML were simpler to learn... Javascript is the real 'deep stuff'.

    Thanks, bro...
    Grant
    Here to help if I can. If I can't I know someone who can!

  2. The Following 2 Users Say Thank You to NewdestinyX For This Useful Post:

    King_O_Hill (09-18-2013), RKO1195 (09-16-2013)

  3. #42
    The Big D NewdestinyX's Avatar
    Join Date
    Jan 2012
    Posts
    9,389
    Thanks
    3,662
    Thanked 8,448 Times in 4,291 Posts

    Ras,
    Have you ever worked with Bing Maps API? It seems they have a free key too. But I'm having a hard time finding the 'get.JSON' syntax for them from many articles I've read this morning. Don't know if you know how they are. There are pros and cons with every one of these methods.
    • The Yahoo Feed Apple uses in their Weather APP (that's used in WW too) is free (no API key) and gives three different locales: city, city2 and neighborhood. Within those three you'll find you place name. BUT it's never quite pinpoint accurate. It's often off by miles.
    • Google's feed is also free (no API key) is VERY accurate but it's output response file has no rhyme or reason to it. The fields return different formats almost at will and there's no way to test for any one format being on one line or another line
    • WeatherUnderground is by far the most accurate city pinpoint. But, though free, it requires an API key. And it's output Response files ONLY contain "main" city place naming. No alternate city (township/municipality) and no neighborhood.

    The best combo for my needs is to use WU for main city name on line one and then Yahoo for City 2 and neighborhood... but all my IF THEN statements for line 2, when comparing city to city2, etc don't work because I THINK the JSON call to WU is coming back to the widget too late for the code to get it before the "functiondealWithWeather" runs. I need to learn about ASYNCHRONOUS and SYNCHRONOUS code now to get the "function dealWithWeather" code to WAIT for the Response from WU to return BEFORE it executes all the IF/THEN/ELSE statements for determining the content of Line 2 (City2/neighborhood stuff from Yahoo).

    So I was investigating more FEEDS from reverse-geocoding places. It seems like the pure MAP services don't have things quite as useful as the weather services do.
    Last edited by NewdestinyX; 09-16-2013 at 11:42 AM.
    Here to help if I can. If I can't I know someone who can!

  4. #43
    My iPhone is a Part of Me
    Join Date
    Aug 2009
    Posts
    666
    Thanks
    325
    Thanked 2,140 Times in 490 Posts

    Sorry, never tried or even looked at Bing Maps. So, no idea how that works.
    It is a sad fact that no one service is perfect, so I made the best compromise that is the best for me here in the UK. I use Weather Underground for the weather info as it is the most accurate one and also has the advantage to being available in different languages (no translation.js file needed as you need for english-only response files) and I use Google Maps solely for the location name, whereby formated_address[3] gives me the best info (correct village name, correct county name, country) here in UK. That info is different in US and properly in other countries as well. It works great for me here in the UK. Yahoo and iOS Weather App show most of the time wrong village name or wrong county name.
    However I still can change the weather info from Weather Underground to Yahoo or WorldWeatherOnline within seconds just to see what current conditions they come up with, no respring or so needed.

  5. #44
    The Big D NewdestinyX's Avatar
    Join Date
    Jan 2012
    Posts
    9,389
    Thanks
    3,662
    Thanked 8,448 Times in 4,291 Posts

    Quote Originally Posted by rasputin007 View Post
    Sorry, never tried or even looked at Bing Maps. So, no idea how that works.
    It is a sad fact that no one service is perfect, so I made the best compromise that is the best for me here in the UK. I use Weather Underground for the weather info as it is the most accurate one and also has the advantage to being available in different languages (no translation.js file needed as you need for english-only response files) and I use Google Maps solely for the location name, whereby formated_address[3] gives me the best info (correct village name, correct county name, country) here in UK. That info is different in US and properly in other countries as well. It works great for me here in the UK. Yahoo and iOS Weather App show most of the time wrong village name or wrong county name.
    However I still can change the weather info from Weather Underground to Yahoo or WorldWeatherOnline within seconds just to see what current conditions they come up with, no respring or so needed.
    Yes. That makes sense. I forgot about WorldWeatherOnline! Does that give more than just 'main city'? And is their API free as well? Maybe you could give us that JSON call as well. I'd lke to try them.

    WeatherUnderground gets the city the best for me. So that's what I'll use for my personal version of the City iWidget I've created. I'll use Weather Widget's Yahoo info for 'secondary city' and county info.. as it's always on the money..

    Formatted Address 3 doesn't give me all the information I need for US cities/towns. I need aspects of 1,2 AND 3 to get all that Yahoo gives. But both Google and WU are more accurate in terms of the reverse geolookup. For SURE!.
    Here to help if I can. If I can't I know someone who can!

  6. #45
    My iPhone is a Part of Me
    Join Date
    Aug 2009
    Posts
    666
    Thanks
    325
    Thanked 2,140 Times in 490 Posts

    THIS is the WorldWeatherOnline thread, you can get all the info from there. But Dacal had problems with correct location name and I never tried it, just too happy with Google maps.

  7. The Following 3 Users Say Thank You to rasputin007 For This Useful Post:

    King_O_Hill (09-18-2013), NewdestinyX (09-16-2013), RKO1195 (09-17-2013)

  8. #46
    The Big D NewdestinyX's Avatar
    Join Date
    Jan 2012
    Posts
    9,389
    Thanks
    3,662
    Thanked 8,448 Times in 4,291 Posts

    What would be the code line to transfer
    this: VILLANOVA
    to this: Villanova

    Thanks in advance,
    Grant
    Here to help if I can. If I can't I know someone who can!

  9. #47
    King Kong ain't got nothing on me! King_O_Hill's Avatar
    Join Date
    Apr 2011
    Location
    USA
    Posts
    8,835
    Thanks
    39,029
    Thanked 16,347 Times in 5,986 Posts

    Quote Originally Posted by NewdestinyX View Post
    What would be the code line to transfer
    this: VILLANOVA
    to this: Villanova

    Thanks in advance,
    Grant
    Code:
    sString = sString.toLowerCase();
    sString = Character.toString(sString.charAt(0)).toUpperCase()+sString.substring(1);
    Something like that.
    Widget-Weather App Now Available! Also with MyLocation Support!
    Check out the thread here - Widget-Weather
    To install the Widget-Weather app, just go to Cydia and install. This will also remove MyLocation, as it is built in!
    Want to protect your JailBreak! Add this repo http://cydia.myrepospace.com/iLEXiNFO/ & Install "iLEX R.A.T."
    It will allow you to bring your phone back to a fresh jailbroken state!

  10. The Following 2 Users Say Thank You to King_O_Hill For This Useful Post:

    NewdestinyX (09-24-2013), RKO1195 (09-24-2013)

  11. #48
    The Big D NewdestinyX's Avatar
    Join Date
    Jan 2012
    Posts
    9,389
    Thanks
    3,662
    Thanked 8,448 Times in 4,291 Posts

    Quote Originally Posted by King_O_Hill View Post
    Code:
    sString = sString.toLowerCase();
    sString = Character.toString(sString.charAt(0)).toUpperCase()+sString.substring(1);
    Something like that.
    Does it appear in the context of the documentGetElementByID line?
    Here to help if I can. If I can't I know someone who can!

  12. #49
    The Big D NewdestinyX's Avatar
    Join Date
    Jan 2012
    Posts
    9,389
    Thanks
    3,662
    Thanked 8,448 Times in 4,291 Posts

    Quote Originally Posted by King_O_Hill View Post
    Code:
    sString = sString.toLowerCase();
    sString = Character.toString(sString.charAt(0)).toUpperCase()+sString.substring(1);
    Something like that.
    Here's what ended up doing it for me. Same 'two steps' as King's slightly different syntax though.. Convert to ALL lower case first.. then add the capital first letter.

    Code:
    var cityname = cityname.toLowerCase();
    document.getElementById("city").innerHTML = cityname.substring(0,1).toUpperCase() + cityname.substring(1);
    Here to help if I can. If I can't I know someone who can!

  13. The Following 2 Users Say Thank You to NewdestinyX For This Useful Post:

    King_O_Hill (09-25-2013), RKO1195 (09-25-2013)

  14. #50
    The Big D NewdestinyX's Avatar
    Join Date
    Jan 2012
    Posts
    9,389
    Thanks
    3,662
    Thanked 8,448 Times in 4,291 Posts

    Do 'switches' NOT work in a 'function init ()'???? I just converted several IF/THEN statements for positioning into a SWITCH/CASE statement.. This works everywhere else in my code and WORKS on my computer from within my HTML Editor Live Preview - but on the phone itself the repositioning elements within the switch get ignored... Any thoughts? This is what worked on the phone...
    Code:
    //DEAL WITH LINE 2 distance from top
    if (sizevariable == 18) {document.getElementById("Line2").style.top="10px";}
    if (sizevariable == 24) {document.getElementById("Line2").style.top="17px";}
    if (sizevariable == 30) {document.getElementById("Line2").style.top="22px";}
    if (sizevariable == 36) {document.getElementById("Line2").style.top="23px";}
    
    //DEAL WITH LINE 3 distance from top
    if ((sizevariable == 18) && (Line2Data == true)) {document.getElementById("Line3").style.top="19px";} 
    else {document.getElementById("Line3").style.top="12px";}
    if ((sizevariable == 24) && (Line2Data == true)) {document.getElementById("Line3").style.top="29px";} 
    else {document.getElementById("Line3").style.top="17px";}
    if ((sizevariable == 30) && (Line2Data == true)) {document.getElementById("Line3").style.top="37px";} 
    else {document.getElementById("Line3").style.top="22px";}
    if ((sizevariable == 36) && (Line2Data == true)) {document.getElementById("Line3").style.top="44px";} 
    else {document.getElementById("Line3").style.top="23px";}
    }
    But when I converted to this v v v - it worked on editor in computer but NOT on phone.. Text on all three lines was on top of each other.
    Code:
    //DEAL WITH LINE 2/LINE 3 distance from top
    if (Line2Data == true) {
    switch (sizevariable) {
    		case 18: {document.getElementById("Line2").style.top="10px"; document.getElementById("Line3").style.top="19px";}
    		break;
    		case 24: {document.getElementById("Line2").style.top="17px"; document.getElementById("Line3").style.top="29px";}
    		break;
    		case 30: {document.getElementById("Line2").style.top="22px"; document.getElementById("Line3").style.top="37px";}
    		break;
    		case 36: {document.getElementById("Line2").style.top="26px"; document.getElementById("Line3").style.top="44px";}
    		break;
    			} /* Closes switch */
    		} else {
    switch (sizevariable) {
    		case 18: {document.getElementById("Line3").style.top="12px";}
    		break;
    		case 24: {document.getElementById("Line3").style.top="17px";}
    		break;
    		case 30: {document.getElementById("Line3").style.top="22px";}
    		break;
    		case 36: {document.getElementById("Line3").style.top="23px";}
    		break;
    			} /* Closes switch */
    		} /* Closes [if Line 2 == true] */
    ANY THOUGHTS?
    Last edited by NewdestinyX; 09-26-2013 at 09:09 AM.
    Here to help if I can. If I can't I know someone who can!

  15. #51
    widget modder RKO1195's Avatar
    Join Date
    Aug 2010
    Location
    Alabama
    Posts
    2,212
    Thanks
    9,811
    Thanked 5,008 Times in 1,711 Posts

    Have you tried taking one of the brackets off at bottom? } And run it in chrome and it will tell you what's wrong

    edit
    If your widget is working and the switch isn't working then scratch that above lol I miss read your post. I was thinking you said that it wasn't working at all
    Last edited by RKO1195; 09-26-2013 at 07:12 PM.
    WidgetWeather ​Thread

  16. #52
    The Big D NewdestinyX's Avatar
    Join Date
    Jan 2012
    Posts
    9,389
    Thanks
    3,662
    Thanked 8,448 Times in 4,291 Posts

    Anyone know of a code editor for Mac that shows opening and closing brackets (only) in a consistent color? I kinda need Live Preview too. I love TacoHTML Edit - but it's color coding is very limited. I have no access to a PC.
    Here to help if I can. If I can't I know someone who can!

  17. The Following User Says Thank You to NewdestinyX For This Useful Post:

    King_O_Hill (09-28-2013)

  18. #53
    widget modder RKO1195's Avatar
    Join Date
    Aug 2010
    Location
    Alabama
    Posts
    2,212
    Thanks
    9,811
    Thanked 5,008 Times in 1,711 Posts

    I've heard TextWrangler was good for Mac it's free

    http://www.barebones.com/products/te.../download.html
    WidgetWeather ​Thread

  19. The Following 3 Users Say Thank You to RKO1195 For This Useful Post:

    King_O_Hill (09-28-2013), NewdestinyX (09-28-2013), Simon (09-28-2013)

  20. #54
    Superbad Modder-ator Simon's Avatar
    Join Date
    Nov 2007
    Location
    Bermuda
    Posts
    46,246
    Thanks
    6,599
    Thanked 14,786 Times in 6,879 Posts

    I use BBedit on Mac.

  21. The Following 3 Users Say Thank You to Simon For This Useful Post:

    King_O_Hill (09-28-2013), NewdestinyX (09-28-2013), RKO1195 (09-28-2013)

  22. #55
    The Big D NewdestinyX's Avatar
    Join Date
    Jan 2012
    Posts
    9,389
    Thanks
    3,662
    Thanked 8,448 Times in 4,291 Posts

    Thanks guys.. I already use TextWrangler too.. But it has no live preview and I don't think it has the color coding for opening and closing brackets.

    I've heard about BBEdit.. Does it have a live preview?
    Here to help if I can. If I can't I know someone who can!

  23. The Following User Says Thank You to NewdestinyX For This Useful Post:

    King_O_Hill (09-28-2013)

  24. #56
    Superbad Modder-ator Simon's Avatar
    Join Date
    Nov 2007
    Location
    Bermuda
    Posts
    46,246
    Thanks
    6,599
    Thanked 14,786 Times in 6,879 Posts

    Quote Originally Posted by NewdestinyX View Post
    Thanks guys.. I already use TextWrangler too.. But it has no live preview and I don't think it has the color coding for opening and closing brackets.

    I've heard about BBEdit.. Does it have a live preview?
    Yes it does, it's made by text wrangler people. So it's basically the paid version of text wrangler with more features.

    http://www.barebones.com/products/bb...omparison.html

  25. The Following 3 Users Say Thank You to Simon For This Useful Post:

    King_O_Hill (09-28-2013), NewdestinyX (09-28-2013), RKO1195 (09-29-2013)

  26. #57
    The Big D NewdestinyX's Avatar
    Join Date
    Jan 2012
    Posts
    9,389
    Thanks
    3,662
    Thanked 8,448 Times in 4,291 Posts

    Quote Originally Posted by Simon View Post
    Yes it does, it's made by text wrangler people. So it's basically the paid version of text wrangler with more features.

    Bare Bones Software | BBEdit Comparison Chart
    Thanks, Simon. I'll get it. I need a better coding tool now. Thanks for the research!
    Here to help if I can. If I can't I know someone who can!

  27. The Following User Says Thank You to NewdestinyX For This Useful Post:

    Simon (09-28-2013)

  28. #58
    The Big D NewdestinyX's Avatar
    Join Date
    Jan 2012
    Posts
    9,389
    Thanks
    3,662
    Thanked 8,448 Times in 4,291 Posts

    Quote Originally Posted by Simon View Post
    Quote Originally Posted by NewdestinyX
    Does it have a Live Preview?
    Yes it does, it's made by text wrangler people. So it's basically the paid version of text wrangler with more features.
    Just laid down the $50 for BBEdit.. I like the syntax checker better but I'm disappointed that it doesn't have the 'color coding' for the brackets like I was hoping to see if you missed any opens and closes.. And it's not a 'true' live preview. You have to save the last edit you do before anything shows in the preview window - and the preview window requires a keystroke to refresh it that doesn't even have a Mac Command key assigned to it. YOu have to choose the refresh from a pop down menu.. TacoHTMLEdit is a lot better in that regard. When you first ask for the Live Preview from a .js or .css doc it asks for the 'associated html doc' to preview.. And thereafter every single character you change in the js or css doc auto-refreshes the live review.. And all that 'for FREE' with TacoHTMLEdit.. Unless I'm missing the functionality of BBEdit - I sorta feel like I wasted $50..
    Here to help if I can. If I can't I know someone who can!

  29. #59
    Superbad Modder-ator Simon's Avatar
    Join Date
    Nov 2007
    Location
    Bermuda
    Posts
    46,246
    Thanks
    6,599
    Thanked 14,786 Times in 6,879 Posts

    Quote Originally Posted by NewdestinyX View Post
    Just laid down the $50 for BBEdit.. I like the syntax checker better but I'm disappointed that it doesn't have the 'color coding' for the brackets like I was hoping to see if you missed any opens and closes.. And it's not a 'true' live preview. You have to save the last edit you do before anything shows in the preview window - and the preview window requires a keystroke to refresh it that doesn't even have a Mac Command key assigned to it. YOu have to choose the refresh from a pop down menu.. TacoHTMLEdit is a lot better in that regard. When you first ask for the Live Preview from a .js or .css doc it asks for the 'associated html doc' to preview.. And thereafter every single character you change in the js or css doc auto-refreshes the live review.. And all that 'for FREE' with TacoHTMLEdit.. Unless I'm missing the functionality of BBEdit - I sorta feel like I wasted $50..
    It's live when you are editing the main html file. Any other file and I think you have to press save first for it to auto update itself. It does have red color for code as far as I remember, might just be for javascript though. Haven't really played with the settings too much myself, I actually didn't even know it had live preview before I checked it the other day before posting it here. I don't really have use for live preview for most of what I have been doing lately, can't preview gyroscope motion unless it is actually on the device. Might want to read up on it a bit more, maybe find a manual on their site or something. I have a feeling it has a lot more settings and customisations than are visible on the surface.

  30. #60
    The BatGirl MamaJaay's Avatar
    Join Date
    Mar 2012
    Location
    @TheMamaJaay
    Posts
    5,120
    Thanks
    4,026
    Thanked 16,483 Times in 3,956 Posts

    I'm here.

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts