Gavin Shaw
Oct 15 2006, 01:05 PM
If the float is beyond the boundaries of integer (usually +/- 2.15e+9 = 2^31), the result of converting to integer is undefined? CODE unction StrToNum($Str, $Check, $Magic) { $Int32Unit = 4294967296; // 2^32
$length = strlen($Str); for ($i = 0; $i < $length; $i++) { $Check *= $Magic; if (is_float($Check)) { $Check = ($Check - $Int32Unit * (int) ($Check / $Int32Unit)); $Check = ($Check < -2147483648) ? ($Check + $Int32Unit) : $Check; } $Check += ord($Str{$i}); } return $Check; }
refer to http://www.php.net/manual/en/language.types.integer.php
Reply
Recent Queries:--
convertion - 43.17 hr back. (1)
Similar Topics
Keywords : data, convertion, result, converting, integer, undefined
- Hard Drive Data Recovery Review
(7)
Reading Xml Data
Within PHP (2) So I was idly pondering my next PHP venture today - more on that if/when I get it done - when I
realised I needed to be able to read some data in from files. Sure, I could use simple binary files
(each line having the relevant data on it, etc. etc.), but I figured I'd might as well learn how
to use this snazzy XML stuff I keep hearing about. So, after looking at W3Schools for a bit I
couldn't find an obvious way of reading XML files in PHP . There was plenty of information of
how to do it in JavaScript, but as I want to read the files in on the server rather th....
Skydrive
5 gigs for saving your data (9) I just received a mail from the Messenger team, talking about skydrive. Seems very interesting,
it's supposed to be a krypted area where you store important things (a copy of your passport
before traveling, who knows). It's a great idea having copy of your important things. And, of
course, 5 gigs storage is always someting interesting. Have a look, it's here :
http://skydrive.live.com ....
Java And Sql: Data Mismatch
(6) Alright, I'm having some really funky issue with this. I know it's a mismatch (obviously)
and I want to know if the Astahost community members can help me solve this issue. It's been
annoying me a lot of late. CODE try{ libSQL myAddNewData = new libSQL(); String
strRownum =(String.valueOf(jComboBoxLName.getSelectedItem())); if (intChoice == 1){
myAddNewData.AddNewData("INSERT INTO CUSDATA (FIRSTNAME, LASTNAME, PHONE, SIN) VALUES
('"+ strUserData +"','" + strUserData + "','" + strUserData + "&....
Rss And Xhtml From The Same Data
A simple way (0) You may have heard of methods to transform RSS feeds into XHTML by the means of an XSLT stylesheet,
but there are a few problems with that method that I've found. I've encountered that if you
choose to publish RSS, it won't read the XSLT stylesheet for some strange reason, and if you get
it to output XHTML, it doesn't detect the RSS. So therefore, it is a complicated way to get
that to work. Instead, this is a simpler way. What you will need: An PHP/XML file An XSLT
stylesheet It isn't that hard and I will go through both of these with you thro....
Letting Users Add Mysql Data With Php
(1) I'm curious as to the best methods of letting users submit data to a MySQL database, displaying
that data, and removing any unwanted tags etc. from it. Currently, there's a handful of PHP
functions that I know of to help with this: mysql_real_escape_string() - perhaps the best known
and most commonly used function, it should be used in pretty much any MySQL query. It escapes
characters that have SQL significance. QUOTE(php.net) ...which prepends backslashes to the
following characters: \x00, \n, \r, \, ', " and \x1a I like to think I made a pretty....
Was My Site Data Copied By Someone?
Same index page (6) I just found this site: asta-killer dot com and as you can see, it's a copy of mine index on
astahost: http://qzone.astahost.com the strange thing is that when you enter something like:
asta-killer dot .com/list/ a directory or file which doesn't exist, you get an error, but the
error is from my php script on astahost.. So that means that that index file isn't only copied
html, but also somehow they got my php source? what a hell is that? then OK I thought it is a remote
thing, but it's impossible on my account to get such an error at all, because th....
Warning: Mysql_result(): Supplied Argument Is Not A Valid Mysql Result Resource In ...
This Is for My attack Script. (4) Hey. I am making a "Version 2.0" For my attack script, but I can't make it work. This is the
error I am gettin: Warning: mysql_result(): supplied argument is not a valid MySQL result resource
in And here is the code: CODE $dbQueryHealth = mysql_query("SELECT temphealth FROM
characters WHERE user =". $_POST .""); $currentHealth = mysql_result($dbQueryHealth, 0);
$dbQueryExp = mysql_query("SELECT exp FROM characters WHERE user = ".$_POST ."");
$currentExp = mysql_result($dbQueryExp, 0); I have checked the PHP Manual,....
Generator
An online data generator script (2) Generator is an online tool written in Javascript, PHP and MySql for use in testing software,
populating databases, etc. that generate very quickly custom data in various formats like HTML, SQL,
or XLS. It's free, open source and very easy to use. About Generator Generator Online
Download and Installation instructions of the Data Generator Script Best regards,....
Getting Certain Parts Of A Record
The character data (17) Ok I need help on this puzzling problem. At first I thought that this person stored the dates in the
MySQL database like this: August 27, 2007 That kinda freaked me out a little, because string dates
are hard to manipulate. Then I found out that he stored both th string data and numerical date,
which I found a little bit odd, but it was like this: 2007-08-27 I need to build a PHP program to
manipulate the data, but I need to access the year, month and day respectively by themselves. I
think that isolating the first 4 characters for the year, last 2 characters for da....
Unexpected Error
Undefined variable??? (2) Is this script correct? index.php : CODE if (isset($_COOKIE )) $_GET =
$_COOKIE ; else setcookie("disp_name", Anonymous, date()+99); ?>
Display Name - DZN
Dislpay Name: name="name" />
proccess.php : CODE Proccessing Request... Please wait...
setcookie("disp_name", $_GET , date()+99); ?> main.php : CODE function customErr....
Converting Alphanumeric Strings Into Numerical Values
(4) Hi, I am trying to find some simple code that can get the numerical values from a string of letters
and numbers. Say the string was 'a296g064j17r', how would I get the 29606417 out to use
somewhere else? Thanks, -jimmy....
The Battle For Your Online Data
(0) This an article entitled "Google, Microsoft and Apple building online storage havens: you win" I
just found on digg. http://arstechnica.com/news.ars/post/20070...ns-you-win.html My comments: -
Yes, I suspected that ever-growing gmail storage space wouldn't last forever. Caveat: check this
out: "Gmail Going Huge: 9000MB+" http://mashable.com/2007/08/09/gmail-going-huge-9000mb/ - They
can promise you 50 GB of online storage, but if they are going to impose limits on the file size,
that's going to make the whole thing worthless. - I'll be sticking with m....
Reformatted Hard Disk
need to get old data back (5) I have a hard disk that had been running XP Pro and I accidentaly mixed it up with an empty disk,
reformatted it, and installed Windows XP over. But I now realize I had tons of important information
on it, and aside from kicking myself for my stupidity, I'd like to recover the files, if at all
possible. What software would be recommended to start with? something that can read from a
reformatted disk, but that isn't too expensive -- even freeware, if there is such a robust free
product -- with a decent chance of recovery. The files were NTFS, with simple Admin sec....
Data Recovery
what should i use? (15) I sent a computer in for a motherboard replacement. I could have done it myself, but i figured why
not save some time. The computer came back from the shop with not only the motherboard replaced, but
the hard drive reformatted and windows reinstalled as well. After yelling at the guy for his
stupidity, I've now settled down to try to recover the lost data. The problem with what i'm
using (R-studio) is that it will recover a formatted partition, but because windows has been
installed again on top it only sees that one. What are my chances of recovering the data, a....
Problems With Php Saving Data Into Mysql
HELP! I can't get my php documents to work with the mySQL (6) i have a server that says it allows php and mysql and in the control panel i can access mysqladmin
and phpmyadmin but i cant get the php to save data into the mysql, i am trying to make a text-based
MMOG so i need to save my users/passwords into a database(i thought) and it won't do it, can
anyone help me....
Games For Samsung D900
Install games with data cable (3) Hello everyone. I have a problem and perhaps you can help me out? I have a samsung d900 and I want
to install games using a data cable. Does anyone know how to do it? Thanks in advance!....
Converting PSD To HTML
(11) Hi I m new to this site. I have designed a layout in PSD. What i want is to know how can I slice
the PSD to build a Cross-Browser Compatible HTML file. Thank U.....
Using Leading Zeros And Sorting Data
Sort data correctly (2) The Importance Of Using Leading Zeros Leading zeros are a very important tool for
sorting and comparing data on computers. What is a leading zero? A leading zero does just what it
sounds like, it leads the value. For example, lets convert a few numbers to leading zero numbers to
make the new number 5 digits long. 234 => 00234 456 => 00456 6456 => 06456 12 => 00012 4 => 00004
677 => 00677 That's great right but why would you do that? This is done for 2 reasons
actually. The first is to display numbers in a more uniform and easier to read form....
Internet Through Data Cable
(8) hi guys, I use internet a lot. I am currently using internet via dial-up connection. I am planning
to activate internet on my mobile phone. What shall i be needing to use internet on my computer
using the mobile connection. I have seen that some people access internet using bluetooth. Does the
use of data cable reduces the speed of internet. Kindly supply your valuable comments on how should
i go about accessing internet using a mobile phone. Waiting for reply. ....
MS Excel -- Automatic Update Of Data
(3) I've got a cell that contains a number, and it is likely for hat number to increment or
decrement itself on a ragular basis. Could someone briefly explain how it would be made for the
number to adjust automatically? For example, lets say that that cell is driven by a database, if I
import data from a database, and then the information in the db changes, will Excel adjust
accordingly? Please help -- I'm really stuck on this. It's part of some coursework I'm
doing and I'm desperate for an answer.....
[PHP + MySQL] Encrypting Data
To protect the password of your DB, for example. (11) Hi! This is my 2nd code of PHP + MySQL. This code is VERY simple: it encript the data in the MySQL
DB. Here we go! ------------------------------------------------------------------------ CODE
$password = "abc"; $new_password = md5($password); echo $new_password; ?> The password "abc"
was codfied using md5() This will be: 900150983cd24fb0d6963f7d28e17f72 CODE $normal_pass =
"abc"; $encripted_pass = "900150983cd24fb0d6963f7d28e17f72"; if(md5($normal_pass) ==
$encripted_pass) echo "Login Sucessful!"; else echo "Incorrect password."; ?> This c....
Convert Fat32 To Ntfs Without Data Loss (dos-mode)
(8) Some computer's are sold with windows XP pre installed and with FAT32 FORMAT, so there is a way
to change it without data loss. Go do MS-DOS and type convert c: /fs:ntfs, dont forget to change
the drive c:\, d:\ , e:\ for the one that you wanna convert . PS : This process is impossible
to return to FAT32, once you convert you can't turn back , unless you format your pc
/biggrin.gif' border='0' style='vertical-align:middle' alt='biggrin.gif' /> cheers m8's
/biggrin.gif' border='0' style='vertical-align:middle' alt='biggrin.gif' /> ....
10 Gb Data Storage For Free!
Amazing site for online data storage (54) Here is a cool site i could found which has amazing facility to store upto 10 GB data online! I can
also send any file through email to any person for free! Isnt sounds coooool?? here is the url
http://www.streamload.com Enjoy... /smile.gif' border='0' style='vertical-align:middle'
alt='smile.gif' /> ....
Converting From SMF To phpBB
(7) I have found (and used, to much delight) a tool to convert my phpBB database to an SMF database. The
results were amazing--I could literally give my users a new URL to use and the forum banter would
not skip a beat. From what little I've seen of SMF, I really like it. The feature set is much
more complete, and the default theme is XHTML and CSS valid to boot. And the board is fast-- very
fast. I see little reason to switch back to phpBB. However, my users are very familiar with phpBB.
The entire lifespan of my forums were conducted on phpBB. A migration would like....
Disaster Recovery
How not to lose important data. (14) To begin with I was a Boy Scout. The Boy Scout motto is: "Always Be Prepared." That being said,
most of this article is about how to prevent data loss. The very first thing I do is partition the
primary hard drive into at least two partitions. 10 to 15 GB for the operating system (C:\) and the
remainder for personal data (D:\) If possible, use two hard drives instead of two partitions. Most
computer problems come about from corrupt data, conflicting settings, or misconfigurations in the
operating system. As a result, most problems can be fixed by simply reformating....
Php, Sql Lite: Storing Session's Data?
how so store session in SQLITE? (1) normally, in windows, session data is saved in the location as directed by the "session.save_path"
directives. they only show how to store session data in file. is it possible to store it inside the
SQLite? anyone?....
Converting Flash Files To Gif
how to convert flash files to anim gif (7) i used swishmax to make simple flash animation. but then, i figured out for simple animations we
should use gif instead. this is to ensure wider compatibility with older browser or those who didnot
have flash installed (for security reasons, etc). so, anyone have a simple solution of coverting SWF
files to GIF files without compromising its quality?. thanks....
Embedded Database
Embedded Data base at client side, (7) Hi, Now its the era of Embedded databases, no more db servers, no more host,Because with embedded
db you can get all those options, what you are used to get with DB Servers. Some of Embedded DB Are
1) Cloudscape From IBM (NOW Derby from ASF) 2) HSQLDB (OpenSource) and many more Feel the power of
EDB Cheers Arunkumar.H.G....
Converting HTML over to XHTML
Crossing over to the darkside (13) Allow for alterations Well, I've just had to convert another HTML 4.01 Transitional website
over to XHTML (eXtensible HyperText Markup Language) 1.0 Transitional, I will later on convert over
to XHTML 1.0 Strict as soon as I write the CSS (cascading stylesheet) file for it but it had to be a
quick update and removing all presentational elements and placing them in a CSS file is not quicker
than just altering some tags. So this is where I got the idea to write a How to Convert HTML over
to XHTML . Let's begin I'm having trouble knowing where to start ....
Looking for data, convertion, result, converting, integer, undefined
|
*SIMILAR VIDEOS*
Searching Video's for data, convertion, result, converting, integer, undefined
|
advertisement
|
|