-
Posts
109 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by Truman
-
-
I have a test to solve and one of the tasks is to convert an image to html and css.
I did all other tasks but never faced with this before. I'm not looking for you to write me a code, just to direct me where I can learn this. Take a look at the attached file, that's a work I have to do.
I ran through html and css tutorials on w3school but didn't see anything similar.
- 1
-
PHP problems
in PHP
I have a question - when I make two or more instances in a class do I use one function construct_ or one for each instances?
-
PHP problems
in PHP
Yup, thank you!
-
PHP problems
in PHP
I did what you asked me to but again it says "Oops, try again. The random output you printed from your name should be a letter."
so the problem is not in character position, it's about content of output.
-
PHP problems
in PHP
I wrote this code:
$name = "milos";
$length = strlen($name);
print rand(0, $length);
$subs = substr($name, rand(0, $length), 1);
echo $subs;from some reason it doesn't work.
-
PHP problems
in PHP
In one of my previous efforts this is what I wrote:
$name = "milos";
$length = strlen($name);
print rand(0, $length);I don't know how and why should I use a random number with substring. For previous code I receive a message "The random output you printed from your name should be a letter."
-
PHP problems
in PHP
Yes, I know how those functions work but I hit a snag.
This is one of the solutions that I've tried but it doesn't work:
$name = "milos";
$sub0 = substr($name, 0);
$sub1 = substr($name, 1);
$sub2 = substr($name, 2);
$sub3 = substr($name, 3);
$sub4 = substr($name, 4);
print rand($sub0, $sub4); -
PHP problems
in PHP
Hi, I was hoping that you could help we with this problem.
First, I need to make $name variable with my name. After that, using knowledge of strlen(string), rand(min, max), and substr(string, start, length) I need to print a random character from my name. It's a codeacademy problem. So it shouldn't be a number, only one of letters of my name.
-
Hi guys,
I practised building site in WordPress by doing it on virtual WAMP server. Now, I want to tranfer that site to byet.host but I have a problem. Before this I already built one site on byet server so I already have an account and url.
This is what I did: I used FileZilla to transfer those WordPress files to old byethost account. But url now does not work, I guess because I need also a database that I used building a site on WAMP server.
Can you please give me a hand, how to transfer my WordPress site from wamp to real server?
-
All i did was add value to if condition calling function, that's it, and it worked fine!
if (quarter(12) % 3 === 0 )
but since you are using function again somewhere else i added value to another variable so i only need to adjust once, again it worked fine as it should.
var value_to_mod = 12; if (quarter(value_to_mod) % 3 == 0) {console.log("The statement is true");} else {console.log("The statement is false");quarter(value_to_mod)}
I suppose you are looking at the current console.log and not older previous logs?
This code is correct, says codeacademy, but the thing is that in previous problems we first defined functions which is not a case here. That's why this surprises me because I used different syntax. I didn't even know that this is possibly. I have a lot more to learn...or I simply don't get the methodology that this site uses...
by the way, you didn't define quarter here. It's supposed to be n / 4. The way you did it divides 12 with 3 and the remaining is 0. Setting of this problem demands that we define quarter as n that is divided by 4. Or quarter is already a javascript method so I don't have to write formula n / 4?
-
davej, keep in mind that I am supposed to solve codeacademy.com problem ( try yourself: https://www.codecademy.com/courses/javascript-beginner-en-6LzGd/1/3?curriculum_id=506324b3a7dffd00020bf661) and that I'm taking their course. So when I paste your complex code it says that's it is incorrect.
-
Well, now I'm completely lost. When I use value 12 it gives me false. Would you be so kind to just show me the whole code?
-
Are you saying this is wrong or right on what you expect?
8/4 = 2 correct , now 2 % 3 is not equal to 0 so it is false.
If you mean include in console log
console.log("The statement is false "+quarter(8));
When I put quarter(12) it gives me:
The statement is false3
I don't know why is that so because 12/4 = 3 and 3%3 is 0. The statement should be true...
Also, I receive a note: ''Oops, try again. Did you remember to call quarter() inside the if statement with a value that would cause it to print 'The statement is true'?''
-
Just to make sure that I understand this - templates for web sites are built in php?
-
OK, so I should put for example number(4), but where should I place it?
By the way, quarter(8) brings "The statement is false 2"
-
Here I come again with another one:Define a function called quarter which has a parameter called number.This function returns a value equal to one quarter of the parameter. (i.e. number / 4;)Call the function inside the if statement's condition (and put in a parameter value!) such that "The statement is true" is printed to the console.and my code is:
var quarter = function(number) {return number/4;}if (quarter() % 3 === 0 ) {console.log("The statement is true");} else {console.log("The statement is false");quarter(8)}
when I call my function with parametar 8 it ejects 2. I don't know how to activate this part:
if (quarter() % 3 === 0 )
-
Thank you both, this was useful. After finishing my WP course I will go to php, and maybe keep learning some js by myself.
-
Thank you! Now I get it, I thought that the problem might be in the first or second line of my code but it's actually only the last one.
-
I month ago I started learning javascript. A couple of days ago I started attending WordPress course ( I want to become a freelancer - WP developer).A lecturer on this course told me that if I want to be WP expert it is better for me to learn PHP because templates are made with that language.Now, I'm a bit confused. Should my priority be javascript or php?I would appreciate opinions...
- 1
-
Thank you, this works...though I still don't understand why my solution was not accepted. This is a codeacademy problem.Your function is correct however instead of passing arguments into your method call you are initializing a void function.function orangeCost(price) {var val = price * 5;console.log(val);};orangeCost(5);
-
I'm practising js on an another site and I do not know how to solve this problem. It's simple and I wrote a code, but it doesn't work.-You are a creature of habit. Every week you buy 5 oranges. But orange prices keep changing!You want to declare a function that calculates the cost of buying 5 oranges.You then want to calculate the cost of the 5 all together.Write a function that does this called orangeCost().It should take a parameter that is the cost of an orange, and multiply it by 5.It should log the result of the multiplication to the console.Call the function where oranges each cost 5 dollars.-and this is a code that I wrote:var orangeCost = function(price) {var val = price * 5;console.log(val);};orangeCost = (5);I could use some help...
-
Thanks a lot! You're right. <img> is one-side tag, this was my shame...You don't need </img>, you just need to put the closing angle bracket: <a href="about.htm"><img src="button.jpg"style="border:none"></a><a href="contact.htm"><img src="button.jpg"style="border:none"></a>
-
It didn't work, but thanks anyhow. I tried with </img>...
-
I tried to attach file, but for some reason it didn't work. I'm pasting code for the whole page:<!DOCTYPE HTML><html><head><title>Sign-up for e-mail specials</title><style>#header {background-image: url(greenleaves.jpg); padding: 10px; color: white}</style></head><body><div id="header"><h1 class="pagetitle">The Garden Company</h1><h5 class="tagline"><i>Helping your garden grow since 1975<i></h5></div><nav><hr><p style="font-family: Arial, Helvetica, sans-serif; color: black; font-style: normal; margin:0px"><a class="buttonlink" href="index.htm"><img src="button.jpg" alt="">Home</a><a href="tips.htm"><img src="button.jpg" style="border:none"></a><a href="problems.htm"><img src="button.jpg" style="border:none"></a><a href="products.htm"><img src="button.jpg" style="border:none"></a><a href="about.htm"><img src="button.jpg"style="border:none"</a><a href="contact.htm"><img src="button.jpg"style="border:none"</a></p><hr></nav><h3 font-style="normal">Sign-up for E-mail Specials</h3><table><form method="post" action="mailto:miloshman2004@yahoo.com" enctype="text/plain"><tr><td>Name</td><td><input type="text" name="Name" size="30" maxlength="50" requierd></td><tr><td>E-mail address</td><td><input type="email" name="E-mail address"></td></tr><tr><td>State:</td><td><select name="state"><optgroup label="Europe"><option>Spain</option><option>Slovakia</option><option>France</option></optgroup><optgroup label="America"><option>SAD</option><option>Canada</option></optgroup></select></td></tr><tr><td>Level of gardening expertise:</td><td><input type="radio" name="level" value="Beginner">Beginner<br><input type="radio" name="level" value="Intermediate">Intermediate<br><input type="radio" name="level" value="Expert">Expert<br><input type="radio" name="level" value="Pro">Professional<br></td></tr><tr><td></td><td><input type=checkbox" name="partner" value="Yes" checked="checked">Yes, I would also like to receive coupons and offers from other gardening-related companies.</td></tr><tr><textarea name="comments" rows="5" cols="60"></textarea></tr><tr><input type="submit"><input type="reset" value="clear"></tr></form></table><hr><p class="copyright">Copyright ©2012 The Garden ™<br>No material may be reproduced without written permission<br><a href="mailto:webmaster@contoso.com?subject=Question/Comment" title="webmaster@contoso.com" style="color: black; text-decoration:none">Contact the <del>Webmaster</del><b>Master Gardener<b></a></p></body></html>Can you post some code?
Converting images to HTML and CSS
in HTML/XHTML
Posted · Edited by Truman
Actually, I did the test today. The thing is that I thought that " converting" means something else and it is actually only describing what I see on picture.
So you can lock this theme because there was a conceptual misunderstanding. It's my fault.