Web Dev Questions That Don't Need Their Own Thread v4
5,001 replies, posted
[QUOTE=Shadaez;44387666]you can use the :checked selector to grab checked items. if the length is more than 0, then one or more is selected, if all the separate question's have a different class or something you can do
$(class/selector of some kind):checked).length >= 1
on all the questions and if all the conditions are satisfied, then submit the form or whatever you'd like to do[/QUOTE]
Should I just be able to throw that code in?
no, the code depends a lot on how the html is formatted
[QUOTE=Shadaez;44387776]no, the code depends a lot on how the html is formatted[/QUOTE]
Then how do I work out how to write it?
What's the most comfortable way (for the user) to recover password?
Introduce username and email (risking him forgetting one of them due to inactivity)?
Introduce email (risking it being forgotten/its password not being known either, which happens more than I'd like it to)?
Introduce username only (risking someone with bad intentions to spam people with forgotten password emails, if a quota is not added) ?
[QUOTE=Coment;44389886]What's the most comfortable way (for the user) to recover password?[/QUOTE]
On registration, i would make the user enter an e-mail and a backup e-mail, in case the default e-mail is compromised.
When restoring password, make the user either enter his username or his e-mail to recover password. Notify the user if the e-mail or username is not in the system.
[QUOTE=TrinityX;44390265]When restoring password, make the user either enter his username or his e-mail to recover password. Notify the user if the e-mail or username is not in the system.[/QUOTE]
Add a CAPTCHA as well in order to curb automated abuse.
[QUOTE=Ac!dL3ak;44386410]Is it possible to add metadata to HABTM relations in rails?[/QUOTE]
No, you need to use has many through.
[editline]29th March 2014[/editline]
[QUOTE=Coment;44389886]What's the most comfortable way (for the user) to recover password?
Introduce username and email (risking him forgetting one of them due to inactivity)?
Introduce email (risking it being forgotten/its password not being known either, which happens more than I'd like it to)?
Introduce username only (risking someone with bad intentions to spam people with forgotten password emails, if a quota is not added) ?[/QUOTE]
Whatever you do, DO NOT make it only take usernames to send the password reset email. Users are way more likely to forget a username that might be specific to your site than the email that they probably use for everything else.
I am having so many weird problem with JCanvas.createPattern. Consider the code right here:
[code]
var canvas = $('#Canvas');
var data = {source: "images\main.png", repeat: "repeat"} ;
var pattern = canvas.createPattern(data);
[/code]
For whatever reason this seems to break every six to ten refreshes. It will return the pattern perfectly fine for for a while and then decide to returns 'Null' instead of the actual pattern without any change in data, loading order, display time or whatsoever. It just seems to have a mind of its own. I can't find [b]anything[/b] about this on Google so this is my last resort for help. Why in the fuck is createPattern randomly returning 'Null' values?
-snip-
[QUOTE=Anthophobian;44394501]I am having so many weird problem with JCanvas.createPattern. Consider the code right here:
[code]
var canvas = $('#Canvas');
var data = {source: "images\main.png", repeat: "repeat"} ;
var pattern = canvas.createPattern(data);
[/code]
For whatever reason this seems to break every six to ten refreshes. It will return the pattern perfectly fine for for a while and then decide to returns 'Null' instead of the actual pattern without any change in data, loading order, display time or whatsoever. It just seems to have a mind of its own. I can't find [b]anything[/b] about this on Google so this is my last resort for help. Why in the fuck is createPattern randomly returning 'Null' values?[/QUOTE]
Are you running this when the DOM is fully loaded? You may need to wrap your code as such:
[cpp]
$(function () {
var canvas = $('#Canvas');
var data = {source: "images\main.png", repeat: "repeat"} ;
var pattern = canvas.createPattern(data);
});
[/cpp]
It's there a way of get rid of that line jump?
[IMG]http://i.imgur.com/OUecvYG.jpg[/IMG]
PHP:
[lua]
echo "<br><h2>Team Score: </h2>";
echo "<h3>".htmlspecialchars($row['score'])."</h3> "; //Prints 122
[/lua]
Style:
[lua]
h2 {
font-family: coolvetica;
font-size: 32px;
font-variant: small-caps;
text-align: left;
font-weight: bold;
line-height: 40%;
color: #2980b9;
}
h3 {
font-family: Arial;
font-size: 16px;
color: #95a5a6;
}
[/lua]
[QUOTE=gonzalolog;44397760]It's there a way of get rid of that line jump?
[IMG]http://i.imgur.com/OUecvYG.jpg[/IMG]
PHP:
[lua]
echo "<br><h2>Team Score: </h2>";
echo "<h3>".htmlspecialchars($row['score'])."</h3>•"; //Prints 122
[/lua]
Style:
[lua]
h2 {
font-family: coolvetica;
font-size: 32px;
font-variant: small-caps;
text-align: left;
font-weight: bold;
line-height: 40%;
color: #2980b9;
}
h3 {
font-family: Arial;
font-size: 16px;
color: #95a5a6;
}
[/lua][/QUOTE]
They are both block elements.
[code]display:inline-block[/code]
That should fix it if you apply it to both.
[QUOTE=commander204;44397838]They are both block elements.
[code]display:inline-block[/code]
That should fix it if you apply it to both.[/QUOTE]
Thanks so much!
What exactly is it that the "clearfix hack" does apart from:
[code]
clear: both;
/*
Alternatively:
clear: left;
clear: right;
*/
[/code]
Really never used it, clearing like this works for me.
You don't need extra markup such as an empty element to clear your floats, you only need to apply the clearfix class to the parent element. Apart from this it's basically the same.
[QUOTE=dastiii;44409290]You don't need extra markup such as an empty element to clear your floats, you only need to apply the clearfix class to the parent element. Apart from this it's basically the same.[/QUOTE]
Yes, but I mean:
[code]
.clearfix {
clear: both;
}
[/code]
is normally what I use, apart from I don't make a class for it.
But then when I look in for example HTML5-boilerplate I see tons of stuff.
[code]
.clearfix:before,
.clearfix:after {
content: " "; /* 1 */
display: table; /* 2 */
}
.clearfix:after {
clear: both;
}
/*
* For IE 6/7 only
* Include this rule to trigger hasLayout and contain floats.
*/
.clearfix {
*zoom: 1;
}
[/code]
What's the big difference, just forcing the clear and cross-browser support?
Maybe this can help you: [url]http://nicolasgallagher.com/micro-clearfix-hack/[/url]
[QUOTE=Moofy;44409393]Yes, but I mean:
[code]
.clearfix {
clear: both;
}
[/code]
is normally what I use, apart from I don't make a class for it.
But then when I look in for example HTML5-boilerplate I see tons of stuff.
[code]
.clearfix:before,
.clearfix:after {
content: " "; /* 1 */
display: table; /* 2 */
}
.clearfix:after {
clear: both;
}
/*
* For IE 6/7 only
* Include this rule to trigger hasLayout and contain floats.
*/
.clearfix {
*zoom: 1;
}
[/code]
What's the big difference, just forcing the clear and cross-browser support?[/QUOTE]
The first one goes on an element placed after the floated elements.
The second one goes on the element that [I]contains[/I] the floated elements, meaning you don't need extra markup to clear your floats.
I play with graphics alot, hand off .fla, .psd, animated.gif, .swf, .png, and .svg files all the time to different people for different designs or concepts/demonstrations of ideas.
I also have people make edits and changes to these files, and I get them passed back to me etc.
Is there a system like git that can version track these files the same way without it being weird the way it is when you use git to do this?
[QUOTE=lkymky;44413047]Is there a system like git that can version track these files the same way without it being weird the way it is when you use git to do this?[/QUOTE]
Use any version control system? SVN should work just fine.
[QUOTE=TrinityX;44413245]Use any version control system? SVN should work just fine.[/QUOTE]
Version control systems don't handle binary files that well. A quick google search says Perforce handles binary files well, but I don't have experience with it.
Been developing this site, [url]http://weareveil.co.uk/[/url] (temp url / logo)
Struggling utilising the full screen header image, I want to use it as advertising space for musicians.
Trouble is, having the menu items / logo over the image wasn't always working so I added that black low opacity background so it was easier to see. Not too keen on it though and not sure of a work around.
[QUOTE=lkymky;44413047]I play with graphics alot, hand off .fla, .psd, animated.gif, .swf, .png, and .svg files all the time to different people for different designs or concepts/demonstrations of ideas.
I also have people make edits and changes to these files, and I get them passed back to me etc.
Is there a system like git that can version track these files the same way without it being weird the way it is when you use git to do this?[/QUOTE]
[url=https://layervault.com]Layervault[/url] does this.
If looking for a grid system, just for the grid. What would you guys recommend?
I see lots liking skeleton, though isn't that quite old by now?
Or are we in the "make your own personal grid system" time now? :v:
[QUOTE=Moofy;44419869]Or are we in the "make your own personal grid system" time now? :v:[/QUOTE]
Many people make their own grid systems nowadays, yes. Both Bootstrap and Foundation have their own grid systems.
Also: [url]http://designinstruct.com/web-design/responsive-css-grid/[/url]
[QUOTE=TrinityX;44420105]Many people make their own grid systems nowadays, yes. Both Bootstrap and Foundation have their own grid systems.
Also: [url]http://designinstruct.com/web-design/responsive-css-grid/[/url][/QUOTE]
Yea I looked at that, just wanted to hear FP's favourite selections to get a overview.
Also tried to make my own, it goes well until I have to do the columns and make it respond to different sizes and not just be fluid. But I'll take a look at it again sometime.
Quick 2 questions:
1) I know PHP, but between RoR, Python, and Node.js, which do you think add more value to your resume? Which are currently more in-demand for jobs?
2) My knowledge in PHP is decent. But I'm wondering would it be better to just focus on PHP and try and master it as much as possible, or is it better to be more well-rounded with more languages (jack of all trades, master of none)?
you can't be a master of one because you can't know just one language to do everything - round yourself out
python and node
[QUOTE=Gerkin;44424408]Quick 2 questions:
1) I know PHP, but between RoR, Python, and Node.js, which do you think add more value to your resume? Which are currently more in-demand for jobs?
2) My knowledge in PHP is decent. But I'm wondering would it be better to just focus on PHP and try and master it as much as possible, or is it better to be more well-rounded with more languages (jack of all trades, master of none)?[/QUOTE]
Learning lots of languages doesn't make you master of none, because you will learn things in one language that you can take back and apply to the others you know.
Rails is always a good bet to learn, Ruby is an awesome language. Node would serve you well too though. I would for sure pick one of those two. Python is cool too but I think right now there's more jobs for Rails and Node if you're looking for web work.
i am trying to save a MEDIUMTEXT in MySQL database, it IS connected.
when i view my database the MEDIUMTEXT somehow din't pass..
here is my html..
[html]
<form action="insert.php" method="post">
Num: <input type="text" name="Num">
Name: <input type="text" name="Name">
Content: <TEXTAREA name="Content" ROWS=4 COLS=40></TEXTAREA>
<input type="submit">
</form>
[/html]
and here is my PHP
[php]
<?php
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$sql="INSERT INTO articles (Num, Name, Content) VALUES ('$_POST[Num]','$_POST[Name]','$_POST[Content]')";
if (!mysqli_query($con,$sql))
{
die('Error: ' . mysqli_error($con));
}
echo "1 record added";
mysqli_close($con);
?>
[/php]
Sorry, you need to Log In to post a reply to this thread.