PHP - Help How To Balance The Chemical Equations Via Php
hello I am a chemical teacher in the middle school
I hope Balancing Chemical Equations via PHP I google some thing perhaps the CML( http://en.wikipedia.org/wiki/Chemical_Markup_Language) may give me a hand. and this one the http://shinkirou.org/blog/2010/11/balancing-chemical-equations-with-linear-algebra/ tells me using the Linear Algebra is a good way how can I Balancing Chemical Equations via PHP( by CML )? is their a demo ? thank you very much~! Similar TutorialsHello I would like to know how to parser chemical and mathematical formulas into images or html-based layout. Please advise me. Thank you. Hi I have a user inputted value (e.g. "$value = "5x^2 - 6x - 5x + 9 = 72 - 5";") which is a Quadratic equation that needs balancing (for the example above I want to rearrange it so that the 72-5=67 and the 67 goes across the formula to make 5^x -11x -57 = 0). Does anyone have any ideas how I should go about doing this? I was going to use string functions to try and split the values apart and then add them to seperate variables to create the quadratic equation. Does anyone have any other / better ideas for this? Thanks Rhys I am trying to create a math equation inside a variable but I am struggling to achieve the desired result. On one php page I have this:
$x = "date('Y')"; On my main page I have linked to the above and also $description but the result I am getting is: In this classic lecture which was delivered over date('Y') - 1989 years ago,
I want to create a variable so I don't need to go back every year and change the description. Is this possible? Robert
I have a custom finance management site and within it I can see amount owed paid and total account balance. I have a table called `Transactions` with 8 fields ID - unique post ID UID - User ID name - Name of the person or business amount - amount of the transaction, in the format of -100.00 or +100.00 date category comment delete - default 0 What I want is to check every unique name and add up the totals and if it totals up to a negative send out a email. I already have a PHP script for the user to see this list, I just want to know if there is some way possible to automate this weekly via cron job. Is it possible? Thanks in advanced! I am trying to generate data similar to a running balance for a checkbook. My approach (correct me if there is a better method) is to get the balance from the previous record ID and then add/subtract the new value and create a new total balance. However, I am not havig succes with MAX(id) or last_insert_id -- is one preferable over the other?? if($result = mysqli_query($link, $sql)){ if(mysqli_num_rows($result) > 0){ $sql = "SELECT MAX(id) FROM persons"; echo "<br /<br />"; echo $sql; Please assist. Hello, Im making a little script to keep track on how much people have currently earnt on my site. I have everything work but i can't figure out how to work out the current balance At the moment ive got: Code: [Select] $currentbalance = $row['totalpaid'] - $row['points']; Which works untill the points becomes more then the total paid then it starts going in minus. Im sure there's a simple fix but i just can't think of a way. Any help would be great. Thanks Hi friends, I am creating a site where users can add credit to their account via Liberty Reserve, and after that their account will automatically be updated with the amount they added so that they can use it to purchase products.. And after any purchase, the amount will be subtracted from their account.. I cant really find a php code to do that... i have done a search on here but still cant find anything close to it.. Can someone kindly help? Thank you I am using a php web video script which allows Users to purchase videos successfully. The purchases are made from the amount available in the Users’ “wallet” (the User can also earn compensation, which gets added to his “balance”.). When there’s not enough available in the “wallet” for the purchase, the script checks and displays a message “not enough money”. I’d like help adding the ability where the script first checks the “wallet” amount, and if empty will then check the “balance” amount, and use a required amount from the balance, and if both are empty, then the “not enough money” appears. Here’s the portion of the code that I believe needs the modification: // get cost video $db->where('name', 'video_play_price'); $db_cost = $db->getOne('config'); $video_cost = (float)$db_cost->value; $count_video = count($id_array); $user_id = $user->id; $wallet = (float)str_replace(',', '', $user->wallet); $amout = 0; foreach ($id_array as $id) { $video_id = (int)PT_Secure($id); // get video data $video = $db->where('id', $id)->getOne(T_VIDEOS); $amout += $video->video_play_price?$video->video_play_price:$video_cost; } // $amout = $video_cost * $count_video; $charge = ( $video_cost *0.50 ); if ($wallet >= $amout) { //$new_wallet = (string)($wallet - $amout); $wallet = (string)($wallet - $amout); $db->startTransaction(); $inserted_records = 0; foreach ($id_array as $id) { $video_id = (int)PT_Secure($id); // $uploader_amount = $video_cost - $charge; //100 - 20% = 80 // get video data $video = $db->where('id', $id)->getOne(T_VIDEOS); $video_cost_new = $video->video_play_price?$video->video_play_price:$video_cost; $uploader_amount = ( $video_cost_new *0.50 ); // add data to paid table $insert_buy = $db->insert('u_paid_videos', [ 'id_user' => $user_id, 'id_video' => $video_id, 'session_key' => $_SESSION['session_key'], 'video_play_price' => (string)$video_cost, 'video_title' => $video->title, 'user_id_uploaded' => $video->user_id, ]); if ($insert_buy) { $inserted_records++; } //add wallet users' video $userwallet = $db->where('id', $video->user_id)->getOne(T_USERS); //$videouserwallet = $userwallet->balance+$video_cost; $videouserwallet = $userwallet->balance+$uploader_amount; $db->where('id', $video->user_id); $update_balance = $db->update(T_USERS, [ // 'wallet' => $videouserwallet, 'balance' => number_format($videouserwallet, 1, '.', ''), ]); } $db->where('id', $user_id); //$update_wallet = $db->update(T_USERS, [ $update_wallet = $db->update(T_USERS, [ 'wallet' => $wallet, ]); if (($inserted_records == $count_video) && $update_wallet) { $db->commit(); echo json_encode([ 'status' => 200 ]); exit(); } else { $db->rollback(); echo json_encode([ 'status' => 400, 'error' => 'Buy process error' ]); exit(); } } else { echo json_encode([ 'status' => 400, 'error_num' => 1, 'error' => 'Not enough money' ]); exit(); } } else { echo json_encode([ 'status' => 400, 'error' => 'Bad Request, Invalid or missing parameter' ]); exit();
Does anybody have links or scripst on a script where the user has an account with money which decreases as one purchases items. Regards Hello,
I designed (not coded) a finance application for windows phone 8.1 and one of the features that would be ideal is to copy your login steps in order to access your bank account automatically. Yes this does not sound safe or sane. How do I convince app users to use it?
Anyway, I want this access. My rationale is that, the login information would be stored locally and if my phone was hacked then what's the loss in my login steps being hacked... they would probably be encrypted anyway but...
The goal is to be able to open up a clone browser (eg. within the app) and then every step that you take, enter url, login credentials, security questions, pages accessed... the clone browser remembers and then later on as part of the app's function, it would automatically update your balances. I mean I suppose you could come up with the formulas, cash advance fees, interest rates, etc... but at the same time this doesn't seem to be a fixed thing... eg. hard to keep track and get the exact cent amount... or maybe I'm just bad at math
Some things in mind bitmapping, key strokes, string search, number search...
Anyway scripting came to mind, not sure if php or python but
Any thoughts?
|