Find Jobs
Hire Freelancers

PHP to Javascript - Convert 2 functions and small piece of code.

$10-30 USD

ที่ทำเสร็จแล้ว
โพสต์ มากกว่า 6 ปีที่ผ่านมา

$10-30 USD

ชำระเงินเมื่อส่งงาน
I have a function for standard deviation and one for simple moving average, doing calculations in php. I need the javascript equivalent. Obviously function need to be written differently. My desire is for the same output in Javascript, like php gives. This is the PHP Code, along with a Javascript function to Display calculated values. The project task is to produce code that will the calculations. Doesn't matter to me how (with how many function ect.), need same result. Please note, in the example, php is marked with ///CODE TO MAKE IN JS BEGIN, ///CODE TO MAKE IN JS END. Bid only if you are able to do it, and do not require any more explanations. Should be straight forward for somebody with experience in JS. <?php $period = 7; $recent = array(13755,13720.9,13738.5,13792.7,13828,13813.1,13854.4); ///CODE TO MAKE IN JS BEGIN function sd_square($x, $mean) { return pow($x - $mean,2); } function sma($data, $range) { $sum = array_sum(array_slice($data, 0, $range)); $result = array($range - 1 => $sum / $range); for ($i = $range, $n = count($data); $i != $n; ++$i) { $result[$i] = $result[$i - 1] + ($data[$i] - $data[$i - $range]) / $range; } return $result; } $stdev = sqrt(array_sum(array_map("sd_square", $recent, array_fill(0,count($recent), (array_sum($recent) / count($recent)) ) ) ) / (count($recent)-1));$sma = sma($recent,$period); ///CODE TO MAKE IN JS END ?> <!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> <script type="text/javascript"> var recent = [login to view URL]('<?php echo json_encode($recent); ?>'); ///CODE TO MADE IN JS BEGIN ///////PROJECT TASK HERE ///CODE TO MAKE IN JS END var stdev = 13786.085714286;//HARDCODED FOR DEMO , EXPECTING YOUR CODE TO CALCULATE var sma = 49.458852546719; //HARDCODED FOR DEMO , EXPECTING YOUR CODE TO CALCULATE function PopulateJs() { [login to view URL]("jsstdev").innerHTML = stdev; [login to view URL]("jssma").innerHTML = sma; } </script> </head> <body> <table> <tr><th colspan="2">PHP</th><th colspan="2">JS</th></tr> <tr><td>Dev:</td><td><?php echo $sma[($period-1)];?></td><td>Dev:</td><td id="jsstdev"></td></tr> <tr><td>Sma:</td><td><?php echo $stdev;?></td><td>Sma:</td><td id="jssma"></td></tr> </table> <button onclick="PopulateJs();">PopulateJS</button> </body> </html>
รหัสโปรเจกต์: 16082677

เกี่ยวกับโปรเจกต์

11 ข้อเสนอ
โปรเจกต์ระยะไกล
ใช้งานอยู่ 6 ปีที่ผ่านมา

กำลังมองหาการสร้างรายได้ใช่ไหม?

ประโยชน์ของการประมูลกับ Freelancer

กำหนดงบประมาณและกรอบเวลาของคุณ
รับเงินจากการงานของคุณ
อธิบายข้อเสนอของคุณในภาพรวม
ลงทะเบียนและเสนอราคาฟรี
หมอบหมายให้:
รูปอวาตาร์ของผู้ใช้
hi sir, i have read the code where php is calculating the standard deviation and moving average, i will write the exace same implementation in javascrit within 2 hrs and will not need any explanation Relevant Skills and Experience javascript, php Proposed Milestones $25 USD - completion
$25 USD ใน 1 วัน
5.0 (114 รีวิว)
5.9
5.9
11 ฟรีแลนซ์กำลังเสนอราคาโดยเฉลี่ย $29 USD สำหรับงานนี้
รูปอวาตาร์ของผู้ใช้
Hi, I would like to change the function sd_square and sma into javascript. available to start right now. Regards, Manish Relevant Skills and Experience I have good proficiency in PHP, mysql, html, js, jquery, css, bootstrap. Please go through my profile. Proposed Milestones $20 USD - completion
$20 USD ใน 1 วัน
4.8 (36 รีวิว)
5.1
5.1
รูปอวาตาร์ของผู้ใช้
I have experience in JavaScript and php and can do this task within less time. Relevant Skills and Experience Php, javascript
$15 USD ใน 1 วัน
5.0 (3 รีวิว)
4.7
4.7
รูปอวาตาร์ของผู้ใช้
PHP to Javascript - Convert 2 functions and small piece of code. Stay tuned, I'm still working on this proposal.
$25 USD ใน 1 วัน
5.0 (30 รีวิว)
4.7
4.7
รูปอวาตาร์ของผู้ใช้
Php Javascript Relevant Skills and Experience Php Java script
$25 USD ใน 1 วัน
5.0 (1 รีวิว)
1.1
1.1
รูปอวาตาร์ของผู้ใช้
i will convert two function from php to javascript and part of code through two days and i will Relevant Skills and Experience i work with javascript ,php,laravel,jquery ,laravel With myself abd also in training in a company And make simple project with it Also i have experience in object oriented and databases
$30 USD ใน 2 วัน
0.0 (0 รีวิว)
0.0
0.0
รูปอวาตาร์ของผู้ใช้
Many can provide javascript solutions, but when you're talking JS, Performance has to be taken in consideration, I can offer you that, with a well structured and commented code that explains it all. Relevant Skills and Experience I am senior Front-end developer, with professional experience. Stay tuned, I'm still working on this proposal.
$45 USD ใน 1 วัน
0.0 (0 รีวิว)
0.0
0.0

เกี่ยวกับลูกค้า

ปักธงของ BULGARIA
Sofia, Bulgaria
5.0
21
ยืนยันวิธีการชำระเงินแล้ว
เป็นสมาชิกตั้งแต่ มี.ค. 17, 2009

การยืนยันลูกค้า

ขอบคุณ! เราได้ส่งลิงก์สำหรับเครดิตฟรีให้คุณทางอีเมลแล้ว
เกิดข้อผิดพลาดขณะส่งอีเมลของคุณ กรุณาลองอีกครั้ง
โลโก้ Freelancer Thailand / ภาษาไทย ช่วยเหลือและสนับสนุน FreelancerประเภทโปรเจคการประกวดFreelancerองค์กรแพ็กเกจสมาชิกโครงการ Freelancer ชั้นแนวหน้าการจัดการโปรเจคงานในพื้นที่Photo Anywhereหน้าจัดแสดงผลงานAPI สำหรับนักพัฒนาได้รับการยืนยันDesktop App เกี่ยวกับเกี่ยวกับเราวิธีใช้งานความปลอดภัยนักลงทุนแผนผังเว็บไซต์เรื่องราวข่าวออกสื่อทีมรางวัลข่าวประชาสัมพันธ์ร่วมงานกับเรา ข้อกำหนดนโยบายความเป็นส่วนตัวข้อกำหนดและเงื่อนไขนโยบายลิขสิทธิ์ข้อพึงปฏิบัติค่าธรรมเนียมและค่าบริการหุ้นส่วนEscrow.comLoadshiftWarrior Forum แอปโลโก้ Apple App Store โลโก้ Google Play
ไม่สามารถคัดลอกไปยังคลิปบอร์ดได้ โปรดลองอีกครั้งหลังปรับเปลี่ยนการอนุญาต
คัดลอกไปยังคลิปบอร์ดแล้ว
ผู้ใช้ที่ลงทะเบียน งานที่มีการโพสต์ทั้งหมด
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
กำลังโหลดตัวอย่าง
ได้รับอนุญาตสำหรับตำแหน่งทางภูมิศาสตร์
เซสชั่นการเข้าสู่ระบบของคุณหมดอายุและคุณได้ออกจากระบบแล้ว กรุณาเข้าสู่ระบบอีกครั้ง