Jump to content


  • Posts

  • Joined

  • Last visited

Recent Profile Visitors

5,533 profile views

ameliabob's Achievements


Member (2/7)



  1. I cannot find an example of how to process multiple selections from an option [code] <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <head> <meta charset="UTF-8"> <link rel="stylesheet" type="text/css" href="/dunes.css" media="screen" /> </head> <script type="text/javascript"> function DoCustomSearch(){ n = document.getElementById("fieldNames").value; alert("selected fieldNames are "+n); alert(s); } function ShowAdvancedQueryWindow(){ s += "<select id='fieldNames' name='fieldNames' size='10' multiple >"; s += "<option value='recNo'>Record Number</option>"; s += "<option value='oName'>Listing Name</option>"; s += "<option value='stNumber'>Street Number</option>"; s += "<option value='stName'>Street Name</option>"; s += "<option value='telno'>Telephone number</option>"; s += "<option value='email'>email</option>"; s += "<option value='showTel'>Show Telno</option>"; s += "<option value='showEmail'>Show email</option>"; s += "<option value='blastEmail'>BlastEmail</option>"; s += "<option value='password'>Password</option>"; s += "</select>" s += "<button type=button onclick='DoCustomSearch()'>Do Search</button>"; document.getElementById('mainBody').innerHTML = s; } </script> <body onload="ShowAdvancedQueryWindow()"> <div id="mainBody" > </div> </body> </html> [\code] If I select multiple options how do I know which of these are selected when I go to "DoCustomSearch()"?
  2. Is there a way to force the file path before clicking n the browse button for file input?
  3. I would like to know how I could see the calling sequence so I could determine how to precede. in the first instance the calling sequence goes to the w3schools home; but the second sequence goes to the java script and doesnt' go to the home. Both of these are called from the address bar.
  4. Sorry the two items are w3schools.com and w3schools.com/js
  5. How does w3schools differentiate between s3schools.com and w3schoiols.com/js?
  6. Just to close the loop and in case others are looking for the same solution. I put in the line "echo 'Curl error: '.curl_error($ch);" and found that the error was SSL Then since putting the url in the browser didn't ask for any user name and password I added the following line to the curl options curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); The false parameter says something to the effect 'don't care about verifying' and allows it to do its thing. and it works!! Thanks for getting me on the right path.
  7. OK, My error moving from Javascript to PHP. Fixed that and now get but still nothing back Array ( [url] => https://api.iextrading.com/1.0/stock/market/batch?types=quote&filter=symbol,latestPrice,&symbols=T,IBM [content_type] => [http_code] => 0 [header_size] => 0 [request_size] => 0 [filetime] => -1 [ssl_verify_result] => 20 [redirect_count] => 0 [total_time] => 0.156 [namelookup_time] => 0.047 [connect_time] => 0.11 [pretransfer_time] => 0 [size_upload] => 0 [size_download] => 0 [speed_download] => 0 [speed_upload] => 0 [download_content_length] => -1 [upload_content_length] => -1 [starttransfer_time] => 0 [redirect_time] => 0 [redirect_url] => [primary_ip] => [certinfo] => Array ( ) [primary_port] => 443 [local_ip] => [local_port] => 53785 ) 1alertjresult is alertresult is putting the url into a browser gives the answer result as {"T":{"quote":{"symbol":"T","latestPrice":32.97}},"IBM":{"quote":{"symbol":"IBM","latestPrice":145.23}}} Now what is missing??
  8. I am trying to get to a site with the following code: $syms ="T,IBM"; $closeDict = array(); $url = "https://api.iextrading.com/1.0/stock/market/batch?types=quote&filter=symbol,latestPrice,&symbols="+$syms; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $jresult = curl_exec($ch); $info = curl_getinfo($ch); echo(print_r($info)); echo("alertjresult is ".$jresult); and several things are or are not happening. 1) the url doesn't get put into the header 2) There is no response Notice the alerts at the end. I seem to recall reading that there is an option to set when accessing a https site. However there is no password or other sign in function. If you cut and paste the url into a browser it operates just fine. What I have I overlooked?? [code}] Array ( => http://0/ [content_type] => [http_code] => 0 [header_size] => 0 [request_size] => 0 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 1.594 [namelookup_time] => 0 [connect_time] => 0 [pretransfer_time] => 0 [size_upload] => 0 [size_download] => 0 [speed_download] => 0 [speed_upload] => 0 [download_content_length] => -1 [upload_content_length] => -1 [starttransfer_time] => 0 [redirect_time] => 0 [redirect_url] => [primary_ip] => [certinfo] => Array ( ) [primary_port] => 0 [local_ip] => [local_port] => 0 ) 1alertjresult is alertresult is [/code]
  9. I have the following code cur.execute("select symbol,stopPrice from holdings order by symbol" ) for row in cur: newSym =str(row[0]) if(syms==""): syms = newSym else: syms += ","+newSym holdingStops = BuildMyDict(cur) def BuildMyDict(response): myDict = dict() print(str(response)) for r in response: myDict[r[0]] = float(r[1]) return myDict When I get to the BuldMyDict it believes the cur has already completed. Is there a command that will reset the iterator counter?
  10. I see many examples o dictionary used but I cannot find any that adds to an existing dictionary a = dict() a['fgh']=123 a['ghi'] = 345 Yields the error a['ghi']=345 TypeError: 'str' object does not support item assignment Is it only possible to build it once and not add to it??
  11. I can see functions allowing the calculations of the difference between two dates but I cannot locate how to find the addition or subtraction of x number of days from a given date. Is there such a thing in python?
  12. I have downloaded some routines that need to be "imported" into a python module. Where do I put them so that import finds them?
  13. Actually I am executing this from within the sqlite "idle" shell
  14. ameliabob

    Dropping a table

    In all the examples they all seem to create a table before accessing it. How would I go about accessing one that has already been created the following code import sqlite3 conn = sqlite3.connect('earnings.db') cur = conn.cursor() DROP TABLE closed cur.execute('CREATE TABLE closed (rowId INTEGER PRIMARY KEY AUTOINCREMENT, nature TEXT) This generates a Syntax Error with TABLE highlighted in Red. If I remove the DROP line then I get the error that the table already exists ?????
  15. ameliabob

    sqlite startup

    I have been a user of SQL and am now trying to start up a private database using sqlite. There does not appear to be a corresponding tool like phpmyadmin that I can find. How can I display columns and contents. There is a reference to ./tables and ./columns. but I cannot find what these a part of. Are the usages the same whether I am using the python shell or the command line? That should get me started. Thanks
  • Create New...