php-general Digest 11 Feb 2001 19:36:44 -0000 Issue 506 Topics (messages 39109 through 39136): imagecolorallocate / imagesetpixel / palette size? 39109 by: Dan Harrington Re: mod_rewrite starts driving me crazy ... 39110 by: Richard Lynch Re: Parsing XML 39111 by: Richard Lynch Re: newline processing problem? 39112 by: Richard Lynch Re: passthru environment variables 39113 by: Richard Lynch 39126 by: Rich Puchalsky 39128 by: Rich Puchalsky XML Parsing The Sequel II 39114 by: Steve Haemelinck 39120 by: Dave 39123 by: Steve Haemelinck Code repositery 39115 by: Michel 'ZioBudda' Morelli 39119 by: Dave 39121 by: Dave [newbie] Can I use regular expressions? 39116 by: zbynek 39117 by: Christian Reiniger 39118 by: PHPBeginner.com Re: my bugaboo. 39122 by: PHPBeginner.com 39125 by: Floyd Baker cgi execution w/php failing 39124 by: Clif Wieden regex : Extracting parts of a string :-??? 39127 by: akio 39129 by: Christian Reiniger building binary data structures 39130 by: Phil Driscoll comparisons 39131 by: Curtis Maurand 39135 by: Phil Driscoll checkbocks, arrays and more 39132 by: Christian Dechery afraid ! 39133 by: php php 39134 by: Christian Dechery 39136 by: Carsten Gehling Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] ----------------------------------------------------------------------
Here is something weird going on. Why is it that imagecolorallocate dies after 256 colors have been allocated? Note, this doesn't matter if you write a jpg or png, it all produces the same result (see attached graphic). Yes, the colors are randomly made, and they all go in a straight, diagonal line (315 degrees to be precise), and on the 256'th pixel (I HAVE COUNTED EVERY PIXEL TO MAKE SURE) it gets stuck on the last color and then continues painting pixels at that last color until the end of the line. I've tried to use imagecolordeallocate right after the pixel is drawn, but that only makes all the pixels come out in one color (white). Its like the "palette" only holds 256 pixels or something, what's the deal with that? Anyone experienced this before? I've looked through the GD library documentation at boutell.com, i've looked through php.net, and every search engine on the internet, and I can't seem to find out what is going on. Thanks Dan ====================================================================== <? $im = imagecreate(400,400); //sets background to black imagecolorallocate($im,0,0,0); $x=0; $y=0; while ($x <=400 ){ $color=imagecolorallocate($im,rand(0,255),rand(0,255),rand(0,255)); imagesetpixel($im,$x,$y,$color); ++$x; ++$y; } header("Content-type: image/png"); Imagepng($im); ImageDestroy($im); ?>
> This works perfectly, however what I really need to do is to make it work > not only with /index.html but with everything typed in your browser... > (index.html was only a test to let me know I am in a right direction) > > I tried: > > RewriteRule ^(.*) /start.php?go=$1 > RewriteRule ^(.*)$ /start.php?go=$1 > RewriteRule ^(.+) /start.php?go=$1 > RewriteRule ^(.+)$ /start.php?go=$1 > > RewriteRule ^(/.*) /start.php?go=$1 > RewriteRule ^(/.*)$ /start.php?go=$1 > RewriteRule ^(/.+) /start.php?go=$1 > RewriteRule ^(/.+)$ /start.php?go=$1 Having just spent about 16 hours fighting with mod_rewrite to try and replace broken DefaultType on FreeBSD, I feel your pain :-) My thinking in this case is: It really doesn't make sense to have either ^ or $ here, since you really don't care what you start or end with. So, you probably just want: RewriteRule (.*) /start.php?go=$1 Except, of course, that will be an infinite loop, since that matches start.php?go=index.html as well. So, what I think you *really* want is: RewriteRule ^/start\.php.* - [L] RewriteRule (.*) /start.php?go=$1 Translation: #1 If we are surfing to "/start.php?blahblahblah", then use the URL as-is "-" and stop playing these silly rewrite games "[L]" #2 Any URL that reaches this rule, wasn't one of our start.php hacks, so redirect to start.php You may need or want a [R] on the end of that second rule... -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
> I want to parse an XML from nasdaq, but I allways get a blank page when > doing so. You're gonna have to provide more info than that... > I also get the notice: undefined index when parsing. What does this mean? If error_reporting is set to include E_NOTICE, and if you attempt to access an array element that has never been set (or has been unset) you will get this message. -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
> I have some code which generates a large string to be used by the mail() > function. At the same point in the string each time, PHP stops processing > "\n" correctly and instead of a newline outputs nothing, so the text starts to > get run together.. but it doesn't seem to happen on every "\n". Has anyone > else run into this problem? It used to work correctly but I made a few > changes to portions of the code that were totally uninvolved, and it started > behaving this way. Unfortunately, I didn't notice the problem until I'd made > a number of small changes to unrelated things and didn't remember what they > were. To really be RFC-compliant, you should use "\r\n" instead of just "\n" -- Un*x mail-handling mostly fixes it for you, but... My guess would be that you lost a \n somewhere or that you have \\n somewhere... -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
> I'm trying to use passthru in a PHP program to have an external program > display some data. The problem is that I was trying to have the external > program's environment pick up the form field variables automatically passed > into the PHP program as shell environment variables. > > In other words, if a user typed "Smith" into the last_name field in a form, > the PHP program called by that form starts out with $last_name = "Smith", > and I would like the external program called by passthru within the PHP > program to have a shell environment variable last_name = "Smith". > > Does anyone know an easy way to do this? http://php.net/setenv <?php SetEnv("last_name='$last_name'"); ?> Since you probably want to do this for all your POST vars, check out http://php.net/FAQ.php#7.1 <?php reset($HTTP_POST_VARS); while (list($var, $val) = each($HTTP_POST_VARS)){ SetEnv("$var='$val'"); } ?> -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm
"Richard Lynch" <[EMAIL PROTECTED]> wrote: > http://php.net/setenv Thanks! But when I try this link, or the "Quick Ref" button on the PHP home page, I can't find anything about setenv. And the manual doesn't have anything about it under Program Execution Functions. Is it undocumented?
"Rich Puchalsky" <[EMAIL PROTECTED]> wrote in message 966dad$pkm$[EMAIL PROTECTED]">news:966dad$pkm$[EMAIL PROTECTED]... > "Richard Lynch" <[EMAIL PROTECTED]> wrote: > > http://php.net/setenv > > Thanks! But when I try this link, or the "Quick Ref" button on the PHP home > page, I can't find anything about setenv. And the manual doesn't have > anything about it under Program Execution Functions. Is it undocumented? And once I actaully tried it, I got an undefined function message.
Ok, yesterday I had problems parsing an XML from Nasdaq. Thx to Matt these problems have been solved and I am know able to parse any XML without problems (I hope). But I have one question: In order to parse an XML you have to tell your parser where to find the document: $xml_file = ''test.xml'; This works perfectly, but If you want to get the XML files from Nasdaq you have to say $xml_file = http://quotes.nasdaq.com/quote.dll?page=xml&mode=stock&symbol=NETA; This however doe not work !!! Why? How can I overcome this problem?
here is some logic, I'm sure you can flesh out the code. fopen -r the URL read the results into a variable, fopen -w to write a local temp file (if the parser you build actially requires a "file") save it locally and pass the filename variable to your XML parser function if your parser can work from a variable, then just pass the read variable to your parser. Dave -----Original Message----- From: Steve Haemelinck [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 11, 2001 5:13 AM To: PHP Mailing Listl (E-mail) Subject: [PHP] XML Parsing The Sequel II Ok, yesterday I had problems parsing an XML from Nasdaq. Thx to Matt these problems have been solved and I am know able to parse any XML without problems (I hope). But I have one question: In order to parse an XML you have to tell your parser where to find the document: $xml_file = ''test.xml'; This works perfectly, but If you want to get the XML files from Nasdaq you have to say $xml_file = http://quotes.nasdaq.com/quote.dll?page=xml&mode=stock&symbol=NETA; This however doe not work !!! Why? How can I overcome this problem? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
But how can I automate the saving locally of the file !!! -----Original Message----- From: Dave [mailto:[EMAIL PROTECTED]] Sent: zondag 11 februari 2001 14:44 To: PHP Mailing Listl (E-mail) Subject: RE: [PHP] XML Parsing The Sequel II here is some logic, I'm sure you can flesh out the code. fopen -r the URL read the results into a variable, fopen -w to write a local temp file (if the parser you build actially requires a "file") save it locally and pass the filename variable to your XML parser function if your parser can work from a variable, then just pass the read variable to your parser. Dave -----Original Message----- From: Steve Haemelinck [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 11, 2001 5:13 AM To: PHP Mailing Listl (E-mail) Subject: [PHP] XML Parsing The Sequel II Ok, yesterday I had problems parsing an XML from Nasdaq. Thx to Matt these problems have been solved and I am know able to parse any XML without problems (I hope). But I have one question: In order to parse an XML you have to tell your parser where to find the document: $xml_file = ''test.xml'; This works perfectly, but If you want to get the XML files from Nasdaq you have to say $xml_file = http://quotes.nasdaq.com/quote.dll?page=xml&mode=stock&symbol=NETA; This however doe not work !!! Why? How can I overcome this problem? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Hi, does someone know some class/script for setup a code repositery? I have tried to find it on hotscripts.com or php.resourceindex.com but I have not find nothing. Tnx in advance. -- Il tuo programma più importante prende più memoria di quella che hai. Se hai abbastanza memoria, non hai abbastanza spazio su disco Se un programma sta in memoria ed ha abbastanza spazio su disco, si bloccherà. Se il programma va a gonfie vele, sta aspettando il momento peggiore per bloccarsi. -- Michel <ZioBudda> Morelli [EMAIL PROTECTED] ICQ UIN: 58351764 PR of Linux in Italy http://www.ziobudda.net http://www.linuxlab.it
here is some logic, I'm sure you can flesh out the code. fopen -r the URL read the results into a variable, fopen -w to write a local temp file (if the parser you build actially requires a "file") save it locally and pass the filename variable to your XML parser function if your parser can work from a variable, then just pass the read variable to your parser. Dave -----Original Message----- From: Michel 'ZioBudda' Morelli [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 11, 2001 7:35 AM To: [EMAIL PROTECTED] Subject: [PHP] Code repositery Hi, does someone know some class/script for setup a code repositery? I have tried to find it on hotscripts.com or php.resourceindex.com but I have not find nothing. Tnx in advance. -- Il tuo programma più importante prende più memoria di quella che hai. Se hai abbastanza memoria, non hai abbastanza spazio su disco Se un programma sta in memoria ed ha abbastanza spazio su disco, si bloccherà. Se il programma va a gonfie vele, sta aspettando il momento peggiore per bloccarsi. -- Michel <ZioBudda> Morelli [EMAIL PROTECTED] ICQ UIN: 58351764 PR of Linux in Italy http://www.ziobudda.net http://www.linuxlab.it -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
sorry, ignore that last hit reply to the wrong friggin message (late night last night) cheers, Dave
Hi there! I want to check if given username consists only of letters of English alphabet, numbers, or "_". I can go through the string and check every character. Wouldn't it be simpler to use regular expressions? How would I do it? These usernames are OK: _john_, 0123bla, foo These are wrong: x#y, t&boo, 100% Thanks for your advice. zbynek
On Sunday 11 February 2001 13:09, zbynek wrote: > I want to check if given username consists only of letters of English > alphabet, numbers, or "_". > Wouldn't it be simpler to use regular expressions? How would I do it? if (preg_match ('/^\w+$/', $Username)) echo "'$Username' is ok<br>"; else echo "'$Username' contains invalid chars" -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "use the source, luke." (obi-wan gnuobi)
or ... if(ereg("[[:alnum:]_ ]", $name)) result = 1; Sincerely, Maxim Maletsky Founder, Chief Developer PHPBeginner.com (Where PHP Begins) [EMAIL PROTECTED] www.phpbeginner.com -----Original Message----- From: zbynek [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 11, 2001 9:09 PM To: [EMAIL PROTECTED] Subject: [PHP] [newbie] Can I use regular expressions? Hi there! I want to check if given username consists only of letters of English alphabet, numbers, or "_". I can go through the string and check every character. Wouldn't it be simpler to use regular expressions? How would I do it? These usernames are OK: _john_, 0123bla, foo These are wrong: x#y, t&boo, 100% Thanks for your advice. zbynek -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
What I think you should do is to use php's build-in function addslashes() It helps . Sincerely, Maxim Maletsky Founder, Chief Developer PHPBeginner.com (Where PHP Begins) [EMAIL PROTECTED] www.phpbeginner.com -----Original Message----- From: Anna [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 11, 2001 9:37 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] my bugaboo. ----- Original Message ----- From: "Floyd Baker" <[EMAIL PROTECTED]> > > Hello and thanks to all for the help on the magic quotes, etc. > It gives me a better handle on what I'm dealing with. > > Except for one more thing. > > When I bring back text from a field which contains a ', and try to apply it as > the value of an input box, it still truncates in the box. > > When I simply print $text, it prints out correctly as *Don't do this* . > When I make $text the default value of an input box, it shows as *Don*. > > If the slash is still in place, it reads *Don\'t* above the box and *Don\* in > the box. > > My bugaboo continues.. :-> > > Thanks again for any further advice. > > Floyd > That's a problem with HTML. example: <input type='text' name='textName' value='Don't do this'> Sees the ' in Don't as the signal for the end of the value string. I haven't come up with an automatic way to deal with this, but what I have done is in these lines (where there might be an apostrophe) make sure I use double quotes: <input type="text" name="textName" value="Don't do this"> or print "<input type=\"text\" name=\"textName\" value=\"Don't do this\">"; Of course, then you may have the same trouble with double quotes. To avoid that you can do ereg_replace("\"", "''", $text) -- that is, replace a double quote with two single quotes? I think, I've never bothered. Hope this helps somehow. Anna -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
The problem seems to be solved. Some suggestions didn't work, in my application at least, but what I found from a combination of them was that I can eliminate the problem using a character entity for the apostrophe. It prints a single quote but does not parse as a single quote. $text = (stripslashes($text)); $text = ereg_replace("'","'",$text); It doesn't work in one shot (ie \' to `). Further; I originally placed the apostrophes into the database field as they were, without escaping them with slashes. I have since added slashes. However converting ' to ' may eliminate the need for add/strip slashes? I have to try that. Many tnx to Anne and all. Floyd On Sat, 10 Feb 2001 18:36:36 -0600, you wrote: >----- Original Message ----- >From: "Floyd Baker" <[EMAIL PROTECTED]> > > >> >> Hello and thanks to all for the help on the magic quotes, etc. >> It gives me a better handle on what I'm dealing with. >> >> Except for one more thing. >> >> When I bring back text from a field which contains a ', and try to apply >it as >> the value of an input box, it still truncates in the box. >> >> When I simply print $text, it prints out correctly as *Don't do this* . >> When I make $text the default value of an input box, it shows as *Don*. >> >> If the slash is still in place, it reads *Don\'t* above the box and *Don\* >in >> the box. >> >> My bugaboo continues.. :-> >> >> Thanks again for any further advice. >> >> Floyd >> > >That's a problem with HTML. >example: ><input type='text' name='textName' value='Don't do this'> >Sees the ' in Don't as the signal for the end of the value string. >I haven't come up with an automatic way to deal with this, >but what I have done is in these lines (where there might be an apostrophe) >make sure I use double quotes: ><input type="text" name="textName" value="Don't do this"> >or >print "<input type=\"text\" name=\"textName\" value=\"Don't do this\">"; > >Of course, then you may have the same trouble with double quotes. To avoid >that you can do ereg_replace("\"", "''", $text) -- that is, replace a double >quote with two single quotes? I think, I've never bothered. > >Hope this helps somehow. > >Anna --
Hi, I've read through the archives and still must be missing something. I need to execute a cgi script from php. This seems fairly trivial, but I can't get it to work. the cgi script is clean -- executes from the command line without issue and is 755 from php the follwing is used: chdir("../../cgibin"); if(is_executable("some.cgi")) virtual("some.cgi"); else echo "Not executable"; some.cgi is found and is executable but the following occurs when attemping to execute via virtual(): Warning: Unable to include 'some.cgi' - request execution failed in [path to php page] Any help would be greatly appreciated, clif
Hello everyone, I have a string like $thestring = "\"Hello everyone\" bye"; What I want to extract is: Hello everyone. Instead I get: bye. I use this command ereg("([^\"\"]*)$",$thestring,$regs) and echo $regs[1]. How can I extract what's within double quotes? TIA Regards
On Sunday 11 February 2001 17:21, akio wrote: > $thestring = "\"Hello everyone\" bye"; > > What I want to extract is: Hello everyone. Instead I get: bye. > I use this command > > ereg("([^\"\"]*)$",$thestring,$regs) > > and echo $regs[1]. > > How can I extract what's within double quotes? Hmm, I only know the preg syntax. With that it's preg_match ('/"([^"]*?)"/', $thestring, $matches); $InQuotes = $matches [1]; -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "use the source, luke." (obi-wan gnuobi)
Having written loads of stuff in PHP, I find myself having for the first time to generate binary data in memory - I actually need to build a native file for a drawing program in memory. The data consists mainly of lists of 32bit little endian integers - some signed and some unsigned. I've started the work, and am building the data up in a string variable. I know however that I am about to get bitten by numeric overflows. For example if I have a function create_thingy($param1,$param2) where param1 is an unsigned 32 bit int, and the top bit is set, then I suspect that php will probably represent the number as floating point, and I'll probably lose some precision. Has anybody been here before and found a good mode of working in the unsigned 32bit arena? Cheers -- Phil Driscoll Dial Solutions +44 (0)113 294 5112 http://www.dialsolutions.com http://www.dtonline.org
Hello, I'm having a rather strange problem. I'm trying to compare two values. "01" and "1". The variables names that they are submitted under are pick1 and pick2. i use the following code $mypick1 = strval($pick1); $mypick2 = strval($pick2); I then perform the following comparison: if ($mypick1 == $mypick2) { $error = 1; $errorstring[1] = "Your first pick and second pick are the same."; } However, I get the error that they are equal. If I call the comparison as foloows: if(strval($mypick1) == strval($mypick2) { $error = 1; $errorstring[1] = "Your first pick and second pick are the same."; } I still get the error. Anyone have any ideas? These two valuse mustbe evaluated as different. Thanks in advance Curtis
In spite of yor best efforts here, PHP converts the string values to numbers (because the strings look like numbers) before doing the comparison. Force a string comparison by using strcmp and everything will work fine - remember that strcmp returns true if the strings are not equal and false if equal. Cheers ________________ Reply Header ________________ Subject: [PHP] comparisons Author: "Curtis Maurand" <[EMAIL PROTECTED]> Date: Sun, 11 Feb 2001 18:47:31 +0000 Hello, I'm having a rather strange problem. I'm trying to compare two values. "01" and "1". The variables names that they are submitted under are pick1 and pick2. i use the following code $mypick1 = strval($pick1); $mypick2 = strval($pick2); I then perform the following comparison: if ($mypick1 == $mypick2) { $error = 1; $errorstring[1] = "Your first pick and second pick are the same."; } However, I get the error that they are equal. If I call the comparison as foloows: if(strval($mypick1) == strval($mypick2) { $error = 1; $errorstring[1] = "Your first pick and second pick are the same."; } I still get the error. Anyone have any ideas? These two valuse mustbe evaluated as different. Thanks in advance Curtis
PLease... I need some help from u gurus on this. I have a table of gas stations (and a whole lot other tables, for stuff connected to them), and I have a table with 'assets' of each of these gas stations (or other stuff)... so I have to make a form so when inserting the user can select with of these assets it has, but also, he may add a comment to each of the assets, example: my table of assets contains: coke machine vending machine atm dinner public phone and someone is inserting a gas station there... and it has two dinners and 3 public phones, so he would check the checkboxes referring to these and add a little comment to show the number... right? but how can I pass this to the next page so I can insert in the tables? if I only had the checkboxes, it'd be easy like: <input type=checkbox name="assets[]"> <== for each of them... but how can I add the input type text next to each of the checkboxes and make them referrable? ____________________________ . Christian Dechery (lemming) . http://www.tanamesa.com.br . Gaita-L Owner / Web Developer
Hi! i've just joined ur mailing list! i used to work on asp with oracle and access! i'm working on windont NT but i want to publish my site at a provider that has linux? do i have to change my code for that ? do u know any provider that accepts acces and mysql with php4? i'm afraid of using mysql with php cause i'm in hurry and that i discovered that mysql interface is not as good and easy as of oracle and access! is it true that if i want to insert data to a table i have to do it from the commend line? Thanks a lot _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
At 19:17 11/2/2001 +0000, you wrote: >Hi! >i've just joined ur mailing list! >i used to work on asp with oracle and access! >i'm working on windont NT but i want to publish my site at a provider that >has linux? do i have to change my code for that ? >do u know any provider that accepts acces and mysql with php4? >i'm afraid of using mysql with php cause i'm in hurry and that i >discovered that mysql interface is not as good and easy as of oracle and >access! is it true that if i want to insert data to a table i have to do >it from the commend line? not really... there are many very nice Mysql clients avaliable... Mascon for once is very nice.... and u can also put together or own PHP form to populate the tables... :) ____________________________ . Christian Dechery (lemming) . http://www.tanamesa.com.br . Gaita-L Owner / Web Developer
From: "php php" <[EMAIL PROTECTED]> Sent: Sunday, February 11, 2001 8:17 PM > i'm afraid of using mysql with php cause i'm in hurry and that i discovered > that mysql interface is not as good and easy as of oracle and access! is it > true that if i want to insert data to a table i have to do it from the > commend line? Try to use the PhpMyAdmin - download it from http://www.phpwizard.com/ It is a very good MySql web client toolkit, that is built with PHP. - Carsten ~~~~~~~~~~~~~~~~