Programming › Re: What Is Your Most Valuable Asset As A Developer? by stack1(m): 8:48pm On Dec 26, 2016 |
Your Brain. |
Programming › Re: A Little Javascript Problem by stack1(m): 4:46pm On Dec 26, 2016 |
any more?? |
Programming › Re: A Little Javascript Problem by stack1(m): 4:43pm On Dec 26, 2016 |
Kodejuice: LoL, u try sha, anyway heres my solution
// helper functions function cons(x, y) { return function(f) { return f(x, y) }; }
function car(pair) { return pair(function(x, y){ return x }); }
function cdr(pair) { return pair(function(x, y){ return y }); }
function nil(f) { return f(nil, nil); }
// .... function range(start, stop) { return start <= stop ? cons(start, range(start + 1, stop)) : nil; }
function map(list, func) { return list === nil ? nil : cons(func(car(list)), map(cdr(list), func)); }
function foreach(list, func) { if (list !== nil) { func(car(list)); foreach(cdr(list), func); } }
function reverse(list) { return (function rev(list, ret){ return list === nil ? ret : rev(cdr(list), cons(car(list), ret)); })(list, nil); }
Nice tho, lots of closures, guess i was too lazy to write any extra helpers-functions , but cool  |
Programming › Re: Build A Video Converting Site/ FB Autoliker Site by stack1(m): 1:04pm On Dec 26, 2016 |
Yeah i can build you a video converter website, lets talk on whatsapp bout the details 09024753839 |
Programming › Re: A Little Javascript Problem by stack1(m): 2:05am On Dec 26, 2016 |
...So this is version 2, i removed all but one dot operator, i couldn't find an alternative for the last dot operator in the foreach function so.. (and i know, the with operator feels like a cheat) function range(start, end) {
var result = String(start); while (start < end) result += "," + String(++start);
with (result) { return split("," ); }
} function map(arr, func) { var l, m, n, o;
with (arr) { l = length; var temp = slice(0, l);//make a local copy
//clear out the original array while (length) shift(); }
m = 0; while ((m++) !== l) { with (temp) { n = shift(); } o = func(n); with (arr) { push(o); } } return arr; } function reverse(arr) { with(arr) return reverse(); } function foreach(arr, func) { var current, i=0,l; with(arr){ l = length; } while ( (i++) !== l){ with(arr){ current = shift(); } func.bind(console)(current); } }
|
Computers › Re: Needs A Specification by stack1(m): 1:15am On Dec 26, 2016 |
sidvinci: I need buy a computer. It will be in use like ten hours a day heavy work(office). Can someone help me with specification. Desktop Well you saidheavy work but didn't specify, what kind, is it graphics/3d modelling, emailing/office applications etc. But generally this would do At least a core i3, (an i5 would be better) Minimum of 6GB of Ram 500 to 1TB hard-drive U might need a graphics card (depending on your type of work) i'll recommend a card with at least 2GB DDR3/4 memory Bigger screens are always better A cd multi-recorder Yeah that's about it for the the basics |
Programming › Re: A Little Javascript Problem by stack1(m): 12:53am On Dec 26, 2016*. Modified: 2:12am On Dec 26, 2016 |
function range(start, end) {
var result = start.toString(); while (start < end) result += "," + ((++start).toString());
return result.split("," );
} function map(arr, func) { var temp = arr.slice(0, arr.length);//make a local copy
//clear out the original array while (arr.length) arr.shift();
while (temp.length) arr.push(func(temp.shift())); //send each element in temp to the callback and add the result back to arr return arr; } function reverse(arr) {
return arr.reverse(); }
function foreach(arr, func) { while(arr.length )func.bind(console)(arr.shift()); }
Ok, you are probably going to say i used the dot operator... working on a version 2 |
Programming › Re: How Are You Guys Coping With International Ban On Cards by stack1(m): 11:15pm On Oct 22, 2016 |
This is worrisome |
Programming › Re: I Want To Learn Programming. Which Language Should I Start With? by stack1(m): 11:13pm On Oct 22, 2016 |
Does anyone remember QBasic/Turbo Basic, Pascal, well those where my firsts, but wouldn't really advise you going that that road, however you could try scheme |
Programming › Re: Are There Nigerian Companies Using These Languages? by stack1(m): 11:08pm On Oct 22, 2016 |
Mehn , all this post making me rethink this whole programming thing...  |
Programming › Re: Reasons Why Programming Is A Dangerous Profession In Nigeria. by stack1(m): 11:05pm On Oct 22, 2016 |
asalimpo: Then ... when you're chased by (a) lion(s), you'll have a race condition ! - maybe u'll understand the concept deeper after that. Lol |
NYSC › Re: UNIBEN Prospective Corps Members! UPDATE!! by stack1(m): 5:55pm On Oct 22, 2016 |
heard ysterday that the skul (Uniben)is billling 30k, to get uploaded for this years batch, is that true? |
Programming › Re: Lets Learn C by stack1(op): 3:17pm On Oct 18, 2016 |
Hey guyz , hope Una never vex, d recession has being biting hard o, I just dey recover  , would be resuming posts in a few days |
Programming › Re: Lets Start A Real Web-deveopment Course Here Html+css+javascript+php+mysql by stack1(op): 3:15pm On Oct 18, 2016 |
Hey guyz , so so sorry, d recession has being biting hard o, I just dey recover, would be resuming posts in a few days |
Programming › Re: Ambitious Programmers Lets Talk by stack1(m): 3:13pm On Oct 18, 2016 |
09024753839  |
Webmasters › Re: Who Can Configure Install Cpanel On Linux VPS by stack1(m): 3:09pm On Oct 18, 2016 |
if you still have problem with this let's talk, I have co figured quite a number of vpses and dedicated via ssh and for the cpanel I always use webmin its open source and very advanced |
Programming › Re: Pls Pal I Need Help With Dis Php Server Problem by stack1(m): 3:05pm On Oct 18, 2016 |
you shouldn't be using php4 when php7 is out, so pls get the installer, as for the installation process you could email me i"'llwalk you through it |
Tech Jobs › Re: Programmer You Are Needed by stack1(m): 3:03pm On Oct 18, 2016 |
s.stackng@gmail.com |
Programming › Re: ARM Processor Programming Tutorial by stack1(m): 3:02pm On Oct 18, 2016 |
This would be cool, as I have keen interest in embedded/microprocessor stuff.. |
Programming › Re: Hello PHP Dev, If You're To Dump PHP What Language Will You Adopt? by stack1(m): 3:01pm On Oct 18, 2016 |
Wow, been a while, this recession hard o, anyway I would go back to just C/C++ CGI scripts, am not too down with nodejs cuz even on the client I have performance issues with JS, python/Csharp I no know den at all |
Programming › Re: Lets Start A Real Web-deveopment Course Here Html+css+javascript+php+mysql by stack1(op): 1:12pm On Sep 01, 2016 |
@Patoskid i dey here baba, facing some hard-ware ish on ma system's pls give me a while |
Programming › Re: Lets Start A Real Web-deveopment Course Here Html+css+javascript+php+mysql by stack1(op): 11:40am On Aug 24, 2016 |
basil123: Pls, I am confronted a problem. I am trying to select from database using any of the selection parameters. But records are returned until all the conditions are met. I want to return records from the database when any of the conditions are met as well. Here is my php code below:
<?php
if(isset($_POST['submit'])){ $selecttype = $_POST['selecttype']; $bed = $_POST['bed']; $transaction = $_POST['transaction']; $state = $_POST['state']; $location = $_POST['location']; $minprice = $_POST['minprice']; $maxprice = $_POST['maxprice'];
$query = $pdo->prepare("SELECT * FROM property WHERE propertytype = ? AND bed = ? AND transaction = ? AND state = ? AND location = ? AND minprice = ? AND maxprice = ? " ; $query->bindValue(1, $selecttype); $query->bindValue(2, $bed); $query->bindValue(3, $transaction); $query->bindValue(4, $state); $query->bindValue(5, $location); $query->bindValue(6, $minprice); $query->bindValue(7, $maxprice);
$query->execute(); $propertydisplay = $query->fetchall(); $query->setFetchMode(PDO::FETCH_ASSOC);
$num = $query->rowcount();
if (empty($num)){ $error = 'No record found!';
} else{ foreach($propertydisplay as $display){
$disprefno = $display['refno']; $dispfullname = $display['fullname']; $dispphone = $display['phone']; $disppropertytype = $display['propertytype']; $dispbed = $display['bed']; $disptransaction = $display['transaction']; $dispstate = $display['state']; $displocation = $display['location']; $dispminprice = $display['minprice']; $dispmaxprice = $display['maxprice'];
} } } ?>
<form class="item-add" action="index.php" method="post" autocomplete="off"> <input type="submit" name="submit" value="Search" class="submit">
<?php if(!empty($propertydisplay)){
echo '<table>'; echo '<thead>'; echo '<tr valign="top">'; echo '<th>Property Type</th>'; echo '<th>Agent Name</th>'; echo '<th>Agent Phone Number</th>'; echo '<th>Bed</th>'; echo '<th>Transaction</th>'; echo '<th>State</th>'; echo '<th>Location</th>'; echo '<th>Min Price</th>'; echo '<th>Max Price</th>'; echo '</tr>'; echo '</thead>'; echo '<tbody>';
foreach($propertydisplay as $display){ echo '<tr valign="top">'; echo '<td>'.$disppropertytype.'</td>'. '<td>'.$dispfullname.'</td>'. '<td>'.$dispphone.'</td>'. '<td>'.$dispbed.'</td>'. '<td>'.$disptransaction.'</td>'. '<td>'.$dispstate.'</td>'. '<td>'.$displocation.'</td>'. '<td>'.$dispminprice.'</td>'. '<td>'.$dispmaxprice.'</td>'; echo '</tr>';
} echo '</tbody>'; echo '</table>'; } ?> </form> hi sorry for the late response, i hav been offliine, you didn't say what errors you are getting and its not really possible for me to run your code since i do not have access to the database, so may be state/post the exact error messages u re getting or if i can get a dump of the db table u're accessing data from so i can test with d code. Also you said u want to return records from the database when any of the conditions are met as well. i can see u used perepared statements to bind to values coming in from Post which means those POST values must exist, maybe use isset to know whih POST value came in a nd construct your SQL statement based on the available POST data |
Programming › Re: Lets Learn C by stack1(op): 12:00am On Aug 18, 2016 |
might not post for a few day's, almost out if data here, but by or b4 weekend would be back |
Programming › Re: Lets Start A Real Web-deveopment Course Here Html+css+javascript+php+mysql by stack1(op): 11:59pm On Aug 17, 2016 |
might not post for a few day's, almost out if data here, but by or b4 weekend would be back |
Programming › Re: Lets Start A Real Web-deveopment Course Here Html+css+javascript+php+mysql by stack1(op): 10:48pm On Aug 17, 2016 |
Next we change the menu items to links, we have covered links already so you should know links are created with the <a> tag (anchor) what we would do is that on each <li> element that holds each menu text we would surround each of the list's text with link tags like this: ..open index.html for editing <ul id="top-menu"> <li> <a href="rooms.html"> Rooms & Suites </a> </li> <li> <a href="bars.html"> Resuturant & Bars </a> </li> <li> <a href="conference.html"> Meetings </a> </li> <li> <a href="gallery.html" > Gallery </a> </li> <li> <a href="signin.html"> Login </a> </li> </ul>
so you see all we did was to surround the the text contents of the list with <a> tags, now in the href attributes for each link we put the names of other html files there, we haven't created those html files yet so when you click the link it would tell you file not found or something similar You'll also notice the color of the links are no longer white (which was the previous color of the text) links have their own style definitions, so we are going to edit our CSS file now: Add #top-menu > li > a{ color :#fff }
the line #top-menu > li > a means we are targeting a elements i.e links that are child elements of list elements li, and the list elements are also child elements of the element with id top-menu which is the parent ul element, so we then give the links a white color, save and refresh all your links should be white again, the links would also be underlined as that is the default style applied to links, I'll later show how to remove the 'underline |
Programming › Re: Lets Learn C by stack1(op): 9:28pm On Aug 17, 2016*. Modified: 10:34pm On Aug 17, 2016 |
isidollarboy: extracted already with two folders in it but in those folders, the files in it has an extension of ".cpp" so which app can solve it. Thanks not so sure u downloaded d right thing, ok here's the link for volume 1 of the book you can start with that.. https://drive.google.com/open?id=0B_OBMh7vaCg0aTE4dmV0ei03YzQi put it up on my Google drive.. so download and enjoy |
Programming › Re: Lets Start A Real Web-deveopment Course Here Html+css+javascript+php+mysql by stack1(op): 8:04pm On Aug 17, 2016 |
MULLAH123: How do i create a logo like that, perfect hotel dats graphics design stuff bro, but the logo is easy,u could use may be Corel Draw of Photoshop,there's not muh to it just select the right Font add somme effects and u're good, anyway dat logo was don in Photoshop just normal text with Bevel and outer-glow effects applied |
Programming › Re: Lets Learn C by stack1(op): 8:00pm On Aug 17, 2016 |
isidollarboy: Thanks for your prompt response, if we have more people like you, i think our dear country would have been transformed already with technologies.. I have downloaded it, what kind of file extension is it as i didn't see app that could open it. Thanks y hmm i thought it was a zip file so windows explorer should be able to open it , well try WinRar or 7-zip they open a whole lot of archive file formats.. good luck |
Programming › Re: Lets Learn C by stack1(op): 5:43pm On Aug 17, 2016 |
isidollarboy: Oga stack1, i see u mentioned a book "how to program by deitel" do u know where i can get the book in lagos? Nope but you can get the PDF online, the 7th edition is available online, however while i think the Deitel series are great they're not my recommended book for C++ try Bruce Eckel's Thinking in C++, they would give you a very thorough grounding and Bashing in C++ http://www.cs.ust.hk/~dekai/library/ECKEL_Bruce/You'll get the vol1 & vol2 for the 2nd edition there |
Programming › Re: Lets Start A Real Web-deveopment Course Here Html+css+javascript+php+mysql by stack1(op): 5:33pm On Aug 17, 2016 |
The list or menu inst exactly clickable yet, we'll get to that shortly, any questions for now.. |
Programming › Re: Lets Start A Real Web-deveopment Course Here Html+css+javascript+php+mysql by stack1(op): 5:32pm On Aug 17, 2016 |
Images sometimes cause text around them to be aligned to the bottom line, and in our example the list is seen to be aligned to the bottom of the image, we can change this using the vertical-align CSS property to the image which causes the text around it to align somewhere around the middle, so add to the CSS for the image
vertical-align:middle
Your Menu should now be moved up to the middle
|
Programming › Re: Lets Start A Real Web-deveopment Course Here Html+css+javascript+php+mysql by stack1(op): 5:23pm On Aug 17, 2016 |
The image would initally be bigger than its container and might even force the list down the page so lets resize the image. Open your index.css file and add the ff, remember the image element has an id of site-logo
#site-logo{ width:15%; margin-top: .5em; margin-left:1em;
}
the margins are there to give some space at the top and left-hand side of the image.. you could remove the margin rules to see the effect Your page should now be looking like...
|