Any programmer geeks to help?

Archived from the original Sajha.com — preserved as posted, replies can no longer be added here.
Start a New Discussion
Archived Post

Any geek programmer around here to help. Either in java or C#? Will post the problem statement if any programmer responds to the thread. This is a take home interview question. Last edited: 15-Apr-14 08:53 AM

donald_duck · Apr 15, 2014 8:45 AM · 26,829 views

26 Replies · Showing 21 - 26
Page 2 of 2

Sorry guys. Hit submit multiple times thinking that the button didn't work. So are there multiple entries. Coudn't delete the duplicates from mobile version.

Shere · May 2, 2014 7:30 PM

"oiee Nas(ey), tero jagir khatrama xa hai keta." - सोजोकटो ब्रो "नाश ब्रो ले त सबै आएको कार जोडेर भाग मात्र गर्या छ त कोडमा | यान्सर औछ त ?" -  गाइरमाइलो ब्रो थुक्क मेरो फर्स्ट सलिउसन ! मैले प्रश्ननै राम्रो संग बुझेको थिएँन रहेछ ! तेही भएर गांडू जस्तो एन्सर दिएछु मैले ! अनि आज सोजोकटो ब्रोले मेरो जागिर खतरामा छ भन्ने कुरो याद आकोले फेरी यो धागो खोलि हेरी प्रब्लमलाइ राम्रो संग पढे ! अनि मैले एसको सलुसन निकालिदिए ! तर मैले कोडिंग चै जाभा स्क्रिप्टमा गरेको छु ! अनि एःछ.टि.एम.एल र जे.क्वेरी इउज गरि यो वेब एपलिकेसन बनाए आज, बोरिङ्ग लागेर ! लु साझाका किउ.ए मित्रगणहरु, मेरो एप लाइ ब्रेक गर्ने कोशिश गर्नुस त् ! मैले यो पालि रोबस्ट कोडिंग गर्या छु जस्तो लाग्यो ! फेल खाँदैन यो पालि ! http://nas.site90.net/ कोडको लागि प्लिज पेजको सोर्समा हेर्नु ल !

Nas · May 23, 2014 7:44 PM

Somehow the jQuery modal dialog does not pop up in mobile (iPhone). Does anyone know why it is behaving like that? It works fine on PC though. Help me debug please, Sajha Dev Gurus.

Nas · May 27, 2014 9:52 AM

cant figure out until u paste the code..

helpjava11 · May 27, 2014 4:11 PM

helpjava11 bro, The application is on this page http://nas.site90.net/ Only in mobile, the modal dialog does not open. The soruce code is here. I have highlighted all the references to the modal dialog calls. Thank you for your time and consideration. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DT... <html xmlns="http://www.w3.org/1999/xhtml&q... <!--<!DOCTYPE html> <html>--> <head> <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/cs... > <script src="http://ajax.googleapis.com/aja... type="text/javascript"></script> <script src="http://ajax.googleapis.com/aja... <link rel="stylesheet" href="http://ajax.googleapis.com/aja... /> </head> <body style="background-color:#444">  <div class="logo" style="text-align:center; margin-top:60px;">         <span class="schedule">Sajha Auto</span><span class="now"> Center</span>  </div> </br> <div class="content" style="background-color: #fff;width: 320px;margin: 0 auto;margin-bottom:0px;padding:40px;padding-top:10px;padding-bottom:75px;">  <div><label style="font-size:24px; color:#303030">Vehicles repaired per day  </label>             <br>             <br>                 <input type="text" name="countPerDay" id="countPerDay" style="Height:35px; Width:300px; border:1px solid #c0c0c0; font-size:22px; font-weight:bold;margin-bottom:20px;"><br>  </div>   <form id="frmMain" class="form-vertical login-form" action="" method="post" runat="server" font-style:normal">          <div>             <div id="container"></div>             <br>                          <a href="javascript:addFields()" title="" class="btnblue" id="A1" style="background-color: #00b8e6; float:left;width:300px; height:35px; text-align:center;             color:white;border-radius:3px; text-decoration:none;padding-top:12px; text-align:center; font-size:22px; font-weight:bold">Enter Incoming Cars</a>             <br />             <br />             <br>              <a href="javascript:GetValues()" title="" class="btnblue" id="btnSignIn" style="background-color: #00b8e6; float:left;width:300px; height:35px; text-align:center;             color:white;border-radius:3px; text-decoration:none;padding-top:12px; text-align:center; font-size:22px; font-weight:bold">Get Total Operation Days</a>                       <br />                     <br />                      <br>                          <a href="javascript:ClearFields()" title="" class="btnblue" id="A2" style="background-color: #00b8e6; float:left;width:300px; height:35px; text-align:center;             color:white;border-radius:3px; text-decoration:none;padding-top:12px; text-align:center; font-size:22px; font-weight:bold">Reset Form</a>             <br />             <br />              </div>                             </form>   <div id = "copyright" style="text-align:center; margin-top:30px; font-size:12px;font-face:verdana;">Nasty App by Nas<br></br>No Copyrights !</div>     <div id="dialog" title="Sajha Auto Center"></div>   <div id="overlay" style="display: none;"></div> </div> <style type="text/css">  #overlay {     height: 100%;     width: 100%;     position: fixed;     left: 0;     top: 0;     z-index: 1 !important;     background-color: black;     filter: alpha(opacity=75); /* internet explorer */     -khtml-opacity: 0.75; /* khtml, old safari */     -moz-opacity: 0.75; /* mozilla, netscape */     opacity: 0.75; /* fx, safari, opera */ } .validation {     border: #FF0000 1px solid;     background-color: #83DBE0; } .schedule {     font-family:'Kelly Slab', cursive;     font-size: 50px;     color: white;     } .now {     font-family: 'Kelly Slab' !important;     font-size: 50px;     color: white;       } @font-face {   font-family: 'Kelly Slab';   font-style: normal;   font-weight: 400; } </style> <script type="text/javascript">     var days = 0;     var workingDay = [];     var CountPerDay = 0;     var remainingCars = 0;     function HideModalMsg() {         $("#overlay").fadeOut();           }     function ShowModalMsg() {         $("#overlay").fadeIn();                $("#dialog").dialog("open").fadeIn();     }     function addFields() {                 var container = document.getElementById("container");                 if (days <= 19) {             container.appendChild(document.createTextNode("Incoming Cars for Day " + (days + 1) + " (Max 100 cars)"));             var input = document.createElement("input");             input.type = "text";             input.style.height = "35px";             input.style.width = "300px";             input.style.border = "1px solid #c0c0c0";             input.style.fontSize = "18px";             container.appendChild(input);             container.appendChild(document.createElement("br"));             days++;         }                        }         function GetValues() {             workingDay = [];             CountPerDay = parseInt(document.getElementById("countPerDay").value);             if (CountPerDay < 1 || CountPerDay > 50) {                 $("#dialog").html("Vehicles repaired per day should be between 1 and 50, inclusive");                 ShowModalMsg();                 $("#countPerDay").addClass("validation");                 $("#dialog").dialog("open");                 return;             }             var InComingCars = [];             var elem = document.getElementById('frmMain').elements;             for (var i = 0; i < elem.length; i++) {                 var num = elem[i].value;                 numOfCar = parseInt(num);                 if (numOfCar > 100) {                     $("#dialog").html("Please enter between 0 to 100 inclusive");                     ShowModalMsg();                     elem[i].style.color = "red";                     return;                 }                 else {                     elem[i].style.color = "black";                 }                 if (!isNaN(numOfCar)) {                     InComingCars.push(numOfCar);                 }                 document.getElementById("container");             }             if (isNaN(CountPerDay)) {                 $("#dialog").html("Please enter vehicles to be repaired per day");                 ShowModalMsg();                 $("#countPerDay").addClass("validation");                                return;             }             if (InComingCars.length != 0) {                 GetDays(InComingCars, CountPerDay);             }             else {                 $("#dialog").html("Please enter incoming cars");                 ShowModalMsg();             }         }         function GetDays(InComingCars, CountPerDay) {             remainingCars = 0;                        var str = 0;             for (i = 0; i < InComingCars.length; i++) {                 var incomingCarVal = InComingCars[i];                 var totalCarsToRepair = incomingCarVal + remainingCars;                 if (totalCarsToRepair == 0) {                     workingDay.push(0);                     remainingCars = 0;                 }                 else {                     if (totalCarsToRepair > CountPerDay) {                         remainingCars = Getthis(totalCarsToRepair, CountPerDay);                     }                     else {                         workingDay.push(1);                         remainingCars = 0;                     }                                  }             }             if (remainingCars == 0) {                 workingDay.push(0);             }             else if (remainingCars < CountPerDay) {                 workingDay.push(1);             }             else {                 workingDay.push(Math.floor(remainingCars / CountPerDay));                 remainingCars = remainingCars % CountPerDay;                 if (remainingCars == 0) {                     remainingCars = 0;                 }                 else if (remainingCars < CountPerDay) {                     workingDay.push(1);                 }                 else                     remainingCars = 0;             }             for(var i=0; i<workingDay.length; i++)             {                 str += workingDay[i];             }             $("#dialog").html("Days required to repair all cars :" + " " + str);             ShowModalMsg();         }         function Getthis(totalCarsToRepair, CountPerDay) {             if (totalCarsToRepair > CountPerDay) {                 workingDay.push(1);                 return remainingCars = totalCarsToRepair - CountPerDay;                             }             else {                 remainingCars = totalCarsToRepair;                             }         }         function ClearFields() {             $("#countPerDay").val("");             workingDay = [];             days  = 0;             var container = document.getElementById("container");                     while (container.hasChildNodes()) {                         container.removeChild(container.lastChild);                     }                                    }                 $(document).ready(function () {                     $("#countPerDay").click(function () {                         $("#countPerDay").removeClass("validation");                     });                 });                 $("#dialog").dialog({ autoOpen: false, close: function (event, ui) { HideModalMsg(); } });                                               </script> </body> </html> Last edited: 27-May-14 05:37 PM

Nas · May 27, 2014 5:29 PM

Ok helpjava11 bro, I debugged it and found out the cause. There was nothing wrong with my code. I noticed that the free host that I am using is inserting their own modal pop up with their advertisement when we access the page in mobile. This is messing up my code. I uploaded the same code in my other site and tested the page in my mobile. The jQuery dialog is opening smoothly. So there is not the bug in the code. Thank you again for reply bro.

Nas · May 27, 2014 5:56 PM

This conversation is preserved exactly as it was on the original Sajha.com and can't accept new replies.

Start a New Discussion

You might be interested in...

Recent Classifieds View all
Upcoming Events View all
Service Providers View all