Web Dev Questions That Don't Need Their Own Thread v4
5,001 replies, posted
[QUOTE=wauterboi;45992357]How do I solve this?
[t]https://dl.dropboxusercontent.com/u/965202/ShareX/2014-09/2014-09-15_22-48-38.png[/t]
I've removed all the CSS from Facepunch and injected my own. Large images and long strands of code causes all contents of posts to stretch past the parent div's. I don't know how to restrict the contents to not do that.[/QUOTE]
parent: "position: relative; overflow: hiddden;"
text: "width: 100%; word-wrap: break-word; white-space: normal;"
What's a good program to build HTML sites with? I looked at adobe dreamweaver but that's insanely expensive. I know basically nothing besides that at the moment.
[QUOTE=scratch (nl);45995161]What's a good program to build HTML sites with? I looked at adobe dreamweaver but that's insanely expensive. I know basically nothing besides that at the moment.[/QUOTE]
99% of people here will recommend not using a WYSIWYG (What You See Is What You Get) editor and using something else like Brackets, Atom, or Sublime Text.
[QUOTE=scratch (nl);45995161]What's a good program to build HTML sites with? I looked at adobe dreamweaver but that's insanely expensive. I know basically nothing besides that at the moment.[/QUOTE]
You definitely don't need dreamweaver, it's such an inbetween tool.
I can't make any sense of this...
I'm trying to port over a database to another place. Tables OK, funcs and procedures not so much (will change them to use php, whatever), then events, which are giving me a hard time.
I got this on the origin db (which is active and working, doesn't give any kind of error):
[IMG]http://i.imgur.com/L3Vj0qi.png[/IMG]
Now, creating it on the target server would just be a matter of setting up the definer, and some things that heidisql already takes care of. Yet, it says that
[IMG]http://i.imgur.com/sPPM1YK.png[/IMG]
[URL="http://pastebin.com/1QCdgM3r"](Full code)[/URL]
It has (to all effects) the same code as the working version (in fact I tried the unmodified CREATE code first, to no avail), so I can't think of anything
What's the MySQL versions on the two servers?
Might be a stupid question, but I'm trying to create a table with 3 columns. in the first column is just headers like interests/hobbies, favorite book, favorite video, and music. In the second column I need two of each. I used nested table rows and it looks like exactly what I need. However, when I validate it, it comes back with stray tr tags for each nested tr.
What is a better way to accomplish this? Im having trouble
Here's what I have:
[code]
<table>
<colgroup>
<col span="1" style="background-color:#2EFEF7" />
<col style="background-color:#BDBDBD" />
<col style="background-color:#FFFFFF" />
</colgroup>
<tr>
<th scope="row" rowspan="2">Interests/Hobbies</th>
<td>Animals</td>
<td>image</td>
<tr>
<td>Paintball</td>
<td>image</td>
</tr>
</tr>
<tr>
<th scope="row" rowspan="2">Favorite Music</th>
<td>Music 1</td>
<td>music</td>
<tr>
<td>Music 2</td>
<td>music</td>
</tr>
</tr>
<tr>
<th scope="row" rowspan="2">Favorite Videos</th>
<td>Vid Title</td>
<td>video</td>
<tr>
<td>Vid Title</td>
<td>video</td>
</tr>
</tr>
<tr>
<th scope="row" rowspan="2">Favorite Books</th>
<td>Book Title</td>
<td>image</td>
<tr>
<td>Book Title</td>
<td>image</td>
</tr>
</tr>
</table>
[/code]
[QUOTE=DrTaxi;45995838]What's the MySQL versions on the two servers?[/QUOTE]
I don't think it really matters since it happens on the same server, inserting the same event with a different name. Anyways, 5.6.12 in localhost
[QUOTE=brianosaur;45995879]Might be a stupid question, but I'm trying to create a table with 3 columns. in the first column is just headers like interests/hobbies, favorite book, favorite video, and music. In the second column I need two of each. I used nested table rows and it looks like exactly what I need. However, when I validate it, it comes back with stray tr tags for each nested tr.
What is a better way to accomplish this? Im having trouble
Here's what I have:
[code]
<table>
<colgroup>
<col span="1" style="background-color:#2EFEF7" />
<col style="background-color:#BDBDBD" />
<col style="background-color:#FFFFFF" />
</colgroup>
<tr>
<th scope="row" rowspan="2">Interests/Hobbies</th>
<td>Animals</td>
<td>image</td>
<tr>
<td>Paintball</td>
<td>image</td>
</tr>
</tr>
<tr>
<th scope="row" rowspan="2">Favorite Music</th>
<td>Music 1</td>
<td>music</td>
<tr>
<td>Music 2</td>
<td>music</td>
</tr>
</tr>
<tr>
<th scope="row" rowspan="2">Favorite Videos</th>
<td>Vid Title</td>
<td>video</td>
<tr>
<td>Vid Title</td>
<td>video</td>
</tr>
</tr>
<tr>
<th scope="row" rowspan="2">Favorite Books</th>
<td>Book Title</td>
<td>image</td>
<tr>
<td>Book Title</td>
<td>image</td>
</tr>
</tr>
</table>
[/code][/QUOTE]
Wrap the "inner" <tr> ones in another <table>. You can't use it like that.
[QUOTE=Cyberuben;45995935]Wrap the "inner" <tr> ones in another <table>. You can't use it like that.[/QUOTE]
Thank you! I was confused, I had to re-read the instructions again and I thought my teacher said we could only use one table. I was mistaken by another page that needed to be only 1 table.
[QUOTE=scratch (nl);45995161]What's a good program to build HTML sites with? I looked at adobe dreamweaver but that's insanely expensive. I know basically nothing besides that at the moment.[/QUOTE]
Notepad++, Sublime Text 2 ("free" as in "winrar", nags about license every 50 to 100 saves) and Brackets ( has some nifty features like refresh on save and direct CSS editing by double clicking element ID.)
All of the above are great for HTML and they have plug-ins and add-ons.
would anyone here know if using a font that isn't licensed/purchased legally safe to use for a resume?
With JQuery, do you use links to other parts of a webpage etc if you just want elements to slide in and out or fade in and out on the one page?
Say I have an About section, I just make a <div> with all the information in it and then I use Jquery to make it appear on screen?
Also, I'm trying to make a slide on email thing, heres the Jquery:
[code]$(document).ready(function () {
$email_clicked = false;
$('.flaticon-close13').click(function(e){
$('.email_form').animate({'bottom': '5%'}, 300);
email_clicked = true;
});
$('.flaticon-close13').click(function(){
if(email_clicked){
$('.email_form').animate({'bottom': '-60%'}, 300);
email_clicked = false;
}
});
$('.send_button').click(function(){
$('.email_form').animate({'bottom': '-60%'}, 300);
email_clicked = false;
});
});
[/code]
So basically I want it so if you press the email button, the form pops up, and if you press send, or the email button again, it closes the form. However right now the form just slides up and straight back down. Not sure how to solve it.
[QUOTE=scratch (nl);45995161]What's a good program to build HTML sites with? I looked at adobe dreamweaver but that's insanely expensive. I know basically nothing besides that at the moment.[/QUOTE]
I use the code editor in cPanel.
[QUOTE=Banana Lord.;45995384]99% of people here will recommend not using a WYSIWYG (What You See Is What You Get) editor and using something else like Brackets, Atom, or Sublime Text.[/QUOTE]
However, if one must, let it be [URL="http://macaw.co"]Macaw[/URL].
[QUOTE=Over-Run;46000199]With JQuery, do you use links to other parts of a webpage etc if you just want elements to slide in and out or fade in and out on the one page?
Say I have an About section, I just make a <div> with all the information in it and then I use Jquery to make it appear on screen?
Also, I'm trying to make a slide on email thing, heres the Jquery:
=== snip code to make the post a bit smaller ==
So basically I want it so if you press the email button, the form pops up, and if you press send, or the email button again, it closes the form. However right now the form just slides up and straight back down. Not sure how to solve it.[/QUOTE]
First of all, why create 2 functions that literally do the same?
[code]
$('.flaticon-close13').click(function(e){
$('.email_form').animate({'bottom': '5%'}, 300);
email_clicked = true;
});
$('.flaticon-close13').click(function(){
if(email_clicked){
$('.email_form').animate({'bottom': '-60%'}, 300);
email_clicked = false;
}
});
[/code]
Could be merged to
[code]
$('.flaticon-close13').click(function(e) {
if(email_clicked) {
$('.email_form').animate({'bottom': '-60%'}, 300);
email_clicked = false;
}
else {
$('.email_form').animate({'bottom': '5%'}, 300);
email_clicked = true;
}
});
[/code]
Although I don't have a lot of experience with animation, maybe you want the animate function in the else statement outside of the if.
Anyway, more ~ontopic~, you are defining the variable $email_clicked with a $, so it's only accessible if you refer to it with the same $.
For instance (with jquery included)
[code]
$email_clicked = true;
console.log(email_clicked); // Uncaught ReferenceError: email_clicked is not defined
console.log($email_clicked); // true
var test = true;
console.log(test); // true
console.log($test); // Uncaught ReferenceError: $test is not defined
[/code]
So basically the if statements you set up probably won't do anything. Also I feel unsure about which click function it calls (or in what order) on the .flaticon-close13.
[QUOTE=eternalflamez;46003865]First of all, why create 2 functions that literally do the same?
[code]
$('.flaticon-close13').click(function(e){
$('.email_form').animate({'bottom': '5%'}, 300);
email_clicked = true;
});
$('.flaticon-close13').click(function(){
if(email_clicked){
$('.email_form').animate({'bottom': '-60%'}, 300);
email_clicked = false;
}
});
[/code]
Could be merged to
[code]
$('.flaticon-close13').click(function(e) {
if(email_clicked) {
$('.email_form').animate({'bottom': '-60%'}, 300);
email_clicked = false;
}
else {
$('.email_form').animate({'bottom': '5%'}, 300);
email_clicked = true;
}
});
[/code]
Although I don't have a lot of experience with animation, maybe you want the animate function in the else statement outside of the if.
Anyway, more ~ontopic~, you are defining the variable $email_clicked with a $, so it's only accessible if you refer to it with the same $.
For instance (with jquery included)
[code]
$email_clicked = true;
console.log(email_clicked); // Uncaught ReferenceError: email_clicked is not defined
console.log($email_clicked); // true
var test = true;
console.log(test); // true
console.log($test); // Uncaught ReferenceError: $test is not defined
[/code]
So basically the if statements you set up probably won't do anything. Also I feel unsure about which click function it calls (or in what order) on the .flaticon-close13.[/QUOTE]
I caught the click functions but not the $var declaration. Good eye.
afaik in Javascript only the last function with the same name will be called. However all that does is confuse me even more about how your email window was opening at all.
Anyway eternalflamez's changes should do the trick.
I've been considering buying a server to host a basic website on which will include (but isn't limited to) Arduino interaction, in the form of data logging and being able to controll if from the website.
Are there any things I should look out for when searching a host? I found one which costs just 8,30 euro/year and it seems to allow the stuff I'll need (PHP, mySQL,Zend)
How do I change this code:
[CODE]function SearchCtrl($scope, $http) {
$scope.url = 'search.php'; // The url of our search
// The function that will be executed on button click (ng-click="search()")
$scope.search = function($sce) {
// Create the http post request
// the data holds the keywords
// The request is a JSON request.
$http.post($scope.url, { "data" : $scope.keywords}).
success(function(data, status) {
$scope.status = status;
$scope.data = data;
$scope.result = data; // Show result from server in our <pre></pre> element
})
};
}[/CODE]
So I can return it using ng-bind-html????
Does someone have a good tutorial on how to get into html? I've made basic websites with it, but I've not used scripts or anything before. I want to be able to create a nice site while being functional.
[QUOTE=scratch (nl);46021332]Does someone have a good tutorial on how to get into html? I've made basic websites with it, but I've not used scripts or anything before. I want to be able to create a nice site while being functional.[/QUOTE]
HTML has nothing to do with "functional". HTML is literally just a markup language, it's nothing different than BB code on Facepunch / other forums. With CSS3 you can do SOME functional things, such as animations (fades, movement, change of style on mouse hover, etc) and responsiveness, but if you want to get really functional you need to look into either JavaScript or a serverside language.
I used Codeacademy a while ago to see how long it would take me to finish the course, and I must say that it does teach you the very basics, but you'll not learn programming until you have a goal set for yourself.
If you know what you want to be able to do, you can set goals and try to achieve your goals, ask more precise questions.
Languages I'd suggest you learning are either PHP because it's still widely used, or NodeJS because it's starting to be more and more common.
I'm messing around with TXT records:
[img]http://i.imgur.com/NvU5Ek4.png[/img]
[code]
goz3rr@newton:~$ dig txt txttest.kuubstudios.com
; <<>> DiG 9.8.4-rpz2+rl005.12-P1 <<>> txt txttest.kuubstudios.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 43194
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;txttest.kuubstudios.com. IN TXT
;; ANSWER SECTION:
txttest.kuubstudios.com. 59 IN TXT "goddamn txt record test"
;; Query time: 328 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Fri Sep 19 13:49:38 2014
;; MSG SIZE rcvd: 77
goz3rr@newton:~$ dig txt txttest2.kuubstudios.com
; <<>> DiG 9.8.4-rpz2+rl005.12-P1 <<>> txt txttest2.kuubstudios.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 22289
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION:
;txttest2.kuubstudios.com. IN TXT
;; AUTHORITY SECTION:
kuubstudios.com. 860 IN SOA dns1.registrar-servers.com. hostmaster.registrar-servers.com. 2014091900 3600 1801 604800 3601
;; Query time: 15 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Fri Sep 19 13:49:40 2014
;; MSG SIZE rcvd: 112
[/code]
Domain is with namecheap and i'm using their DNS servers too, anyone have a clue why the second one doesn't work?
Thanks for the help it worked great :)
I am doing javascript, I want to make this code more efficient:
[code]
function text_replacements(str) {
text = 'hello world'
str = str.replace('{hw}', text);
while (str.indexOf('{cap}') !== -1) {
cpos = str.indexOf('{cap}');
str = str.slice(0, cpos) + str.slice(cpos + 5);
str = str.slice(0, cpos) + str.charAt((cpos)).toUpperCase() + str.slice(cpos + 1);
} //TODO THIS NEEDS TO BE MORE EFFICIENT. REGEX?
return str;
}
'{cap}{hw}, they heard me say! I was born. It took over a week for me to say {hw}.'
[/code]
It replaces
text_replacements('{cap}{hw}, they heard me say! I was born. It took over a week for me to say {hw}.');
with
'Hello world, they heard me say! I was born. It took over a week for me to say hello world.'
I made a complicated system that joins strings together and capitalizes things to make it work, is there anything simpler that I can save in a string?
[img]http://i.imgur.com/aMBzrso.png[/img]
great job jumping on the bandwagon Sc00by22, Moofy and two friends rate it for a joke and you just decide its necessary to rate something dumb in goddamn question thread
[QUOTE=Goz3rr;46021578]
Domain is with namecheap and i'm using their DNS servers too, anyone have a clue why the second one doesn't work?[/QUOTE]
It's possible that they censor records with content like that. Just a guess.
[QUOTE=jetboy;46026175]It's possible that they censor records with content like that. Just a guess.[/QUOTE]
[code]fauxpark@tatiana:~$ dig txt txttest2.fauxpark.net @dns1.registrar-servers.com
; <<>> DiG 9.8.4-rpz2+rl005.12-P1 <<>> txt txttest2.fauxpark.net @dns1.registrar-servers.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18667
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available
;; QUESTION SECTION:
;txttest2.fauxpark.net. IN TXT
;; ANSWER SECTION:
txttest2.fauxpark.net. 14400 IN TXT "bitch ass test"
;; Query time: 163 msec
;; SERVER: 208.64.122.242#53(208.64.122.242)
;; WHEN: Sat Sep 20 12:25:39 2014
;; MSG SIZE rcvd: 66[/code]
Works fine for me.
[QUOTE=jetboy;46026175]It's possible that they censor records with content like that. Just a guess.[/QUOTE]
For some reason it started working now, so i have no idea. I added them both at the same time and the first one worked near instantly
[QUOTE=Goz3rr;46029892]For some reason it started working now, so i have no idea. I added them both at the same time and the first one worked near instantly[/QUOTE]
You fixed it the traditional software way and just stared at the problem until it went away
[QUOTE=Coment;45995667]I can't make any sense of this...
I'm trying to port over a database to another place. Tables OK, funcs and procedures not so much (will change them to use php, whatever), then events, which are giving me a hard time.
I got this on the origin db (which is active and working, doesn't give any kind of error):
[IMG]http://i.imgur.com/L3Vj0qi.png[/IMG]
Now, creating it on the target server would just be a matter of setting up the definer, and some things that heidisql already takes care of. Yet, it says that
[IMG]http://i.imgur.com/sPPM1YK.png[/IMG]
[URL="http://pastebin.com/1QCdgM3r"](Full code)[/URL]
It has (to all effects) the same code as the working version (in fact I tried the unmodified CREATE code first, to no avail), so I can't think of anything[/QUOTE]
For the next guy that stumbles on this: when doing a function/event/anything you store code with the ; delimiter, change the 'outer' delimiter to something else so that it doesn't get confused.
By example,
[code]
DELIMITER !
BEGIN
SELECT asdf FROM databases WHERE lorem = 'ipsum' LIMIT 10;
UPDATE databases SET lorem = 'this would have stopped in the previous line, but as it's no longer parsing ;...' WHERE id = 2;
END! -- since this is where it really ends
DELIMITER ; -- for future operations
[/code]
Sorry, you need to Log In to post a reply to this thread.