Web Dev Questions That Don't Need Their Own Thread v4
5,001 replies, posted
[QUOTE=Cyberuben;45108859]Because people will have to download andupload all their files from home on FTP while webservers have a faster speed in general. Saves a lot of time.[/QUOTE]
I don't know why you're asking the question then if you're not going to do anything else.
[QUOTE=supersnail11;45114086]I don't know why you're asking the question then if you're not going to do anything else.[/QUOTE]
I'm more wondering if it's a good idea? I'm not asking if there are better methods, at all. I just noticed that there are too many people who have problems with FastDL, and I usually link them to SourceRSC, and they tell me it takes a shitload of time and is hard to configure.
I've also heard of people who spend a good 5-6 hours on uploading all their FastDL content. Regardless of the fact that it is retarded that people have 2 GB of downloads on their server, I still want to make things easier for the people who want it.
[QUOTE=Cyberuben;45114937]I'm more wondering if it's a good idea? I'm not asking if there are better methods, at all. I just noticed that there are too many people who have problems with FastDL, and I usually link them to SourceRSC, and they tell me it takes a shitload of time and is hard to configure.
I've also heard of people who spend a good 5-6 hours on uploading all their FastDL content. Regardless of the fact that it is retarded that people have 2 GB of downloads on their server, I still want to make things easier for the people who want it.[/QUOTE]
It's not a good idea but it's the only way to do it with your requirements.
[QUOTE=Cyberuben;45114937]I'm more wondering if it's a good idea? I'm not asking if there are better methods, at all. I just noticed that there are too many people who have problems with FastDL, and I usually link them to SourceRSC, and they tell me it takes a shitload of time and is hard to configure.
I've also heard of people who spend a good 5-6 hours on uploading all their FastDL content. Regardless of the fact that it is retarded that people have 2 GB of downloads on their server, I still want to make things easier for the people who want it.[/QUOTE]
Agreeing with supernail and Flapadar, this is something that will be extremely resource hungry for a server, and is better off consuming the resources of the client. If you want to make a GUI client that is a simplier replacement to SourceRSC using familiar tool/languages, try looking into [URL="https://github.com/rogerwang/node-webkit"]node-webkit[/URL].
[QUOTE=deadeye536;45116107]Agreeing with supernail and Flapadar, this is something that will be extremely resource hungry for a server, and is better off consuming the resources of the client. If you want to make a GUI client that is a simplier replacement to SourceRSC using familiar tool/languages, try looking into [URL="https://github.com/rogerwang/node-webkit"]node-webkit[/URL].[/QUOTE]
Expanding on the Node.js idea, you could use [URL="https://github.com/mscdex/node-ftp"]node-ftp[/URL] and [URL="https://github.com/cscott/compressjs"]compressjs[/URL] to stream the files from FTP to the client, bzip them in memory, and stream them back to FTP, so you never even touch the client's hard drive. Super easy to do and should be pretty fast.
Kind of an odd question, but I don't know where else to ask this. How can I use google to search for an image by the filename? Like, I know the filename of the image, what exactly do I type in to google to show only images with that name?
[QUOTE=Ardosos;45117761]Kind of an odd question, but I don't know where else to ask this. How can I use google to search for an image by the filename? Like, I know the filename of the image, what exactly do I type in to google to show only images with that name?[/QUOTE]
This isn't the place to ask, but you'd use the filename search operator. For example:
[code]
filename:example.jpg
[/code]
I am for looping through a MySQL database, then in HTML adding the details to a table, with a button in the table for each array of info, so for each array there is a button, how do I activate a function when that button is called, hard to explain, here is what I am doing
[CODE]
echo "<table border=\"1\" align=\"center\">";
echo "<tr><th>Name</th>";
echo "<th>IP</th>";
echo "<th>Forge version</th>";
echo "<th>Mods</th>";
echo "<th>Save</th></tr>";
foreach ( $servers as $server) {
$name = str_replace(" ","_",$server[0]);
echo "<tr><td>";
echo "<input type=\"text\" size=\"25\" value=" . $name . ">";
echo "</td><td>";
echo "<input type=\"text\" size=\"25\" value=" . $server[1] . ">";
echo "</td><td>";
echo "<input type=\"text\" size=\"25\" value=" . $server[2] . ">";
echo "</td><td>";
echo "<input type=\"submit\" name=\"EditMods" . $server[5] . "\" value=\"Edit\">";
echo "</td><td>";
echo "<input type=\"checkbox\" name=\"" . $server[5] . "\">";
echo "</td></tr>";
if (isset($_POST['EditMods'. $server[5]])) {
echo "Hey";
}
}
echo "</table>";
[/CODE]
How do I do a function when the EditMods is pressed, the if statement has to be in the for loop because I'm adding the server's unique ID to the end of the name.
Snip, I didn't realise there was another page that somebody had already answered the question I was answering.
what do you mean by "do a function"?
[editline]16th June 2014[/editline]
also you might want to wrap that with form if you want that to pass through as post
and you dont have to do echo "" every newline
[QUOTE=jung3o;45120182]
and you dont have to do echo "" every newline[/QUOTE]
@AnonTakesOver when mixing PHP and HTML like this use the [URL="http://www.php.net//manual/en/control-structures.alternative-syntax.php"]Alternative syntax[/URL], it's far more readable and there is less room for errors.
[code]
<table border="1" align="center">
<tr>
<th>Name</th>
<th>IP</th>
<th>Forge version</th>
<th>Mods</th>
<th>Save</th>
</tr>
<?php foreach ($servers as $server): ?>
<tr>
<td><input type="text" size="25" value="<?php echo str_replace(' ','_',$server[0]) ?> "></td>
<td><input type="text" size="25" value="<?php echo $server[1]?>"></td>
<td><input type="text" size="25" value="<?php echo $server[2]?>"></td>
<td><input type="submit" name="EditMods<?php echo $server[5]?>" value="Edit"></td>
<td><input type="checkbox" name="<?php echo $server[5] ?>"></td>
</tr>
<?php if(isset($_POST['EditMods'. $server[5]])) echo 'Hey' ?>
<?php endforeach; ?>
</table>
[/code]
[QUOTE=supersnail11;45118073]This isn't the place to ask, but you'd use the filename search operator. For example:
[code]
filename:example.jpg
[/code][/QUOTE]
Oh, for some reason I thought that would be too obvious. Thanks!
[QUOTE=CBastard;45120321]@AnonTakesOver when mixing PHP and HTML like this use the [URL="http://www.php.net//manual/en/control-structures.alternative-syntax.php"]Alternative syntax[/URL], it's far more readable and there is less room for errors.
[code]
<table border="1" align="center">
<tr>
<th>Name</th>
<th>IP</th>
<th>Forge version</th>
<th>Mods</th>
<th>Save</th>
</tr>
<?php foreach ($servers as $server): ?>
<tr>
<td><input type="text" size="25" value="<?php echo str_replace(' ','_',$server[0]) ?> "></td>
<td><input type="text" size="25" value="<?php echo $server[1]?>"></td>
<td><input type="text" size="25" value="<?php echo $server[2]?>"></td>
<td><input type="submit" name="EditMods<?php echo $server[5]?>" value="Edit"></td>
<td><input type="checkbox" name="<?php echo $server[5] ?>"></td>
</tr>
<?php if(isset($_POST['EditMods'. $server[5]])) echo 'Hey' ?>
<?php endforeach; ?>
</table>
[/code][/QUOTE]
Okay, thanks! I'm still new to web development so the help is appreciated, what I am trying to do is so when one of the submit buttons is pressed, it does a php function.
The if statement does nothing, it doesn't echo hey.
[QUOTE=AnonTakesOver;45124639]Okay, thanks! I'm still new to web development so the help is appreciated, what I am trying to do is so when one of the submit buttons is pressed, it does a php function.
The if statement does nothing, it doesn't echo hey.[/QUOTE]
[QUOTE=jung3o;45120182]also you might want to wrap that with form if you want that to pass through as post[/QUOTE]
[html]<form action="" method="POST">
<!-- ... -->
</form>[/html]
[QUOTE=jung3o;45124715][html]<form action="" method="POST">
<!-- ... -->
</form>[/html][/QUOTE]
Yes! Thanks everyone that helped so much, I'm gonna try to learn more web development, it's just a bit confusing since I am used to doing one language and everything is allot easier, crossing languages and client to server at the same time is confusing.
Anyone know how I would get an SVG rectangle to follow the mouse location? I'm using raphael and the mousemove bind right now, but the pageX and pageY coordinates being fed into the raphael animate method are putting the rectangle way off of the mouse coordinates.
Got me thinking it might be animating the rectangle relative to the mouse position, rather than within the browser window.
[URL="http://fatslug.ca/"]Any ideas on how to fix this mousemove rectangle?[/URL]
[QUOTE=Poo Monst3r;45132589]Anyone know how I would get an SVG rectangle to follow the mouse location? I'm using raphael and the mousemove bind right now, but the pageX and pageY coordinates being fed into the raphael animate method are putting the rectangle way off of the mouse coordinates.
Got me thinking it might be animating the rectangle relative to the mouse position, rather than within the browser window.
[URL="http://fatslug.ca/"]Any ideas on how to fix this mousemove rectangle?[/URL][/QUOTE]
The whole thing resizes so the svg is gonna be relative to that. If the rectangle wasn't inside the rest, it'd work.
[QUOTE=djjkxbox360;45133260]The whole thing resizes so the svg is gonna be relative to that. If the rectangle wasn't inside the rest, it'd work.[/QUOTE]
Not sure what you mean by "inside the rest"?
[editline]17th June 2014[/editline]
It is an SVG rectangle, drawn separately from all other elements. It is not nested inside of anything except for the Raphael paper element.
[QUOTE=Poo Monst3r;45134646]Not sure what you mean by "inside the rest"?
[editline]17th June 2014[/editline]
It is an SVG rectangle, drawn separately from all other elements. It is not nested inside of anything except for the Raphael paper element.[/QUOTE]
[img]http://dl.dropboxusercontent.com/u/277960740/Screen%20Shot%202014-06-17%20at%2022.34.26.png[/img]
The rect at the bottom is the one that moves, looks pretty nested to me :v: If it was in its own svg tag then it'd be separate
yeah i think you need to for x subtract about 120 and add 4, and add 4 to y, then multiply both the mouse coords by .5
[editline]17th June 2014[/editline]
it seems i was wrong, you should be multiplying it by 2/3 or something
[QUOTE=Shadaez;45138309]yeah i think you need to for x subtract about 120 and add 4, and add 4 to y, then multiply both the mouse coords by .5
[editline]17th June 2014[/editline]
it seems i was wrong, you should be multiplying it by 2/3 or something[/QUOTE]
I tried all of these:
[code]
(pageX-120+4)*0.66
and
(pageX-240+4)*0.66
and
pageX-240+4
and
pageX-120+4
[/code]
none of them work
[editline]18th June 2014[/editline]
[QUOTE=djjkxbox360;45135575][img]http://dl.dropboxusercontent.com/u/277960740/Screen%20Shot%202014-06-17%20at%2022.34.26.png[/img]
The rect at the bottom is the one that moves, looks pretty nested to me :v: If it was in its own svg tag then it'd be separate[/QUOTE]
I don't see how this would fix it since an SVG shape has to be nested inside of an SVG tag. The rectangle is inside of a 100% by 100% area with a shifted x value of -120. I tried this solution anyways, creating a new paper element just for the mousemover and it did not work. Exact same result.
I've updated fatslug.ca to with the coordinate calculation changes I made.
someone help [url]http://stackoverflow.com/questions/24287767/er-parse-error-on-node-mysql-when-inserting-multiple-values[/url]
I've been trying for fix for the last few hours and can't figure out what's wrong
? is only for a single value. You are trying to insert a single value on three different columns; this makes mysql angry.
Try changing it to [B][I]VALUES (?,?,?)[/I][/B] , and binding every parameter separately.
I ended up just doing
[code] app.mysql.query('INSERT INTO `files` (`torrentid`, `filename`, `filesize`) VALUES '+app.mysql.escape(torrentFiles), function(err, result) {[/code]
and it works.
What are simple things I could do to get into node.js? I'm able to make basic servers and webservers, but most tutorials end after that.
[QUOTE=wauterboi;45162566]What are simple things I could do to get into node.js? I'm able to make basic servers and webservers, but most tutorials end after that.[/QUOTE]
You need to get an idea for a project. I've found it ten times harder to learn something new when I don't have any project in mind that I want to create. I'm learning it aswell as you, and my project is a "e-invoice" service which covers a wide range of things that is commonly used in web applications. To get a printable/emailable version of the invoice I use a HTML to PDF "converter" called [URL="https://www.npmjs.org/package/wkhtmltopdf"]wkhtmltopdf[/URL]. This has teached me alot of things already, and I just started learning yesterday.
So my advice is that you try as hard as you can to come up with an idea for a project, start googling resources and review the code, write your own code, review again and you will notice how fast you learn it. Node is amazing.
I'd like to make a forum but I have a feeling that is a bit unrealistic and really difficult. :<
[QUOTE=wauterboi;45162732]I'd like to make a forum but I have a feeling that is a bit unrealistic and really difficult. :<[/QUOTE]
Not at all fella! That is a great idea. Forums uses lots of I/O and that's where Node is far better than any other web development language. You can cover a wide range of things to learn with external API's like Facebook or Steam to login with, chat rooms, image/file upload, database queries, etc. I would say go for it!
Also, use [URL="http://expressjs.com/"]Express[/URL]!
The bigger concern I have with that is the idea of security and handling other people's login information. Egueghueghh. That terrifies me.
[QUOTE=wauterboi;45163809]The bigger concern I have with that is the idea of security and handling other people's login information. Egueghueghh. That terrifies me.[/QUOTE]
You can always go with external authentication providers that use OAuth or OpenID something like that.
For a site like SteamDB it works fine as all our users are on Steam, so we use [url=http://steamcommunity.com/dev]Steam's OpenID[/url] for authentication.
It's somewhat harder for a general purpose forum, though. I guess you could go for "[url=https://developers.google.com/accounts/docs/OAuth2Login]Login with Google[/url]" if you [b]really[/b] don't want to deal with saving login details.
Sorry, you need to Log In to post a reply to this thread.