topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • October 18, 2019, 05:09 PM
  • Proudly celebrating 13 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - RedPillow [ switch to compact view ]

Pages: [1] 2next
1
Developer's Corner / [CSS] Problem with div height
« on: June 15, 2011, 01:05 AM »
I got this picture here: http://imageshack.us...mages/17/probmb.png/

What I need to do is to make that blue bordered div stretch in height so it fills the cyan bordered area, depending how long the red bordered area is.

So if there's lots of text in the red bordered area, the cyan-area will get a lot longer and therefore the blue area must stretch so it reaches the bottom of the wide area.

Lol do you get me  :huh:

The blue bordered area should be kind of 'anchored' into the bottom of the big white area so it stretches.

2
Developer's Corner / [JS] How to make this loop?
« on: March 30, 2011, 08:29 AM »
Code: Javascript [Select]
  1. $(document).ready(function(){
  2.  
  3.    var modTime = 0;
  4. setInterval(function(){
  5.   $.post("ChatClient.php", {"file":"chat.cht", "time":modTime}, function(rst) {
  6.     if (rst.time != modTime) {
  7.       modTime = rst.time;
  8.                 window.location.reload();
  9.         else {
  10.                        
  11.         }
  12.     }
  13.   });
  14. }, 1000);
  15. });

So that is my code, and I need to make it do the whole check again on the else-statemen.
This is supposed to check a file modification time and if it's changed - it should reload the page and if it's not changed, it should just keep checking infinitely again until it is.
It works nice, if I remove the else-statement but then it refreshes every seconds - no matter if the file is modified or not.

I tried this by myself:

Code: Javascript [Select]
  1. $(document).ready(function(){
  2. loopIt();
  3. function loopIt() {
  4.    var modTime = 0;
  5. setInterval(function(){
  6.   $.post("ChatClient.php", {"file":"chat.cht", "time":modTime}, function(rst) {
  7.     if (rst.time != modTime) {
  8.       modTime = rst.time;
  9.                 window.location.reload();
  10.         else {
  11.                 loopIt();      
  12.         }
  13.     }
  14.   });
  15. }, 1000);
  16. }
  17. });

3
Developer's Corner / [PHP] str_replace - is this even possible?
« on: March 28, 2011, 05:15 AM »
Hi again.
I'd like to make simple crypter by myself, this is what I've done so far:

Code: PHP [Select]
  1. //This is the key-table for crypter.
  2. $cryptkey = array('0' => 286, '1' => 949, '2' => 695, '3' => 348, '4' => 438, '5' => 977,
  3.         '6' => 320, '7' => 418, '8' => 970, '9' => 482, '[' => 466, ']' => 770, '.' => 569,
  4.         ' ' => 242, '-' => 166, 'A' => 583, 'B' => 575,  'C' => 247,  'D' => 564, 'E' => 192,
  5.          'F' => 513,  'G' => 653,  'H' => 605,  'I' => 450,  'J' => 404,  'K' => 831,  'L' => 315,  'M' => 953,
  6.           'N' => 439,  'O' => 266,  'P' => 231,  'Q' => 633,  'R' => 881,  'S' => 113,  'T' => 935,  'U' => 559,
  7.            'V' => 318,  'W' => 927,  'X' => 906,  'Y' => 463,  'Z' => 184, 'a' => 263,  'b' => 453,  'c' => 208,
  8.            'd' => 591,  'e' => 511, 'f' => 343,  'g' => 969,  'h' => 415,  'i' => 420,  'j' => 175,  'k' => 410,
  9.            'l' => 295,  'm' => 265, 'n' => 877,  'o' => 200,  'p' => 837,  'q' => 913,  'r' => 515,  's' => 262,
  10.            't' => 524,  'u' => 874, 'v' => 525,  'w' => 700,  'x' => 670,  'y' => 918,  'z' => 290, '<' => 331,
  11.            '>' => 533, "'" => 425, ',' => 101, ':' => 495, '$' => 114, '\\' => 268, '/' => 721, '=' => 454);
  12. //Don't mind about some fails in the table ... solving them later.
  13.  
  14. //This is the string we're going to crypt.
  15. $notcrypted1 = "[$curdate] - Rotation was <font color = '$color'><b>$rotation</b></font> degrees, done by <b>$ip</b>, who says: ''<b>$msg</b>''\r\n";
  16.  
  17. //Splitting the string here. (is this even needed?)
  18. $split1 = str_split($notcrypted1);
  19.  
  20. //And this is the problem area
  21. foreach ($split1 as $char) {
  22.         foreach ($cryptkey as $char2 => $key2) {
  23.                 $crypted1 = str_replace($char, $key2, $notcrypted1);
  24.                 }
  25.         }
  26.  
  27. //Im using this PHP.net's example
  28.  
  29. // Provides: Hll Wrld f PHP
  30. $vowels = array("a", "e", "i", "o", "u", "A", "E", "I", "O", "U");
  31. $onlyconsonants = str_replace($vowels, "", "Hello World of PHP");

So basically, it is supposed to replace the characters in the $notcrypted1 with the key-table's corresponding int value.
But the problem is, that I'd like to know if there's any way to tell the program to switch the character it is going trought with the key-table's corresponding int value ... And like without doing 3000 if's.

Since it can replace the vowels with blank in the example - is it possible to switch the characters with the ints in my code?
My brains are jamming with this one ... I know it will not work like this and I even know why it isn't working - I just can't find a way to solve it ...


I wouldn't want to do it like so:

Code: PHP [Select]
  1. foreach ($split1 as $char) {
  2.         foreach ($cryptkey as $char2 => $key2) {
  3.                 if ($char == "A") {
  4.                         $crypted1 = str_replace($char, "A", $notcrypted1);
  5.                 }
  6.         }


4
Developer's Corner / [PHP] Confused with functions
« on: February 05, 2011, 05:18 PM »
This has nothing to do with the thread I made few minutes ago.

Anyways ... I need help with these thing related to PHP-functions:

- How do I set what the function needs to work?

Like ...

Code: PHP [Select]
  1. function countNumbers() {
  2. echo ($x + $y);
  3. }

Now, how do I declare, that the function I made needs parameters $x and $y to count like so:
countNumber(1, 2);


Second question is, can function return multiple values, like with a loop?

Code: PHP [Select]
  1. function countNumbers() {
  2. $rtnval = $x + $y;
  3.  
  4. for ($i = 0; $i <= 5; $i++) {
  5. return $rtnval;
  6. }
  7. }


Third is, can I use function directly to output something like so:

Code: PHP [Select]
  1. echo countNumbers();

or

Code: PHP [Select]
  1. $numbers = countNumbers();
  2. echo Numbers;

5
Developer's Corner / [PHP] 'Dynamic variable name' ?
« on: February 05, 2011, 03:53 PM »
This is something I've managed to do so far:
Code: PHP [Select]
  1. function generateMap {
  2.         $i = 0;
  3.                 $openMap = fopen("map/map_1-1.txt", "r");
  4.                         while (!feof($openMap)) {
  5.                                 $line = fgets($openMap, 1024);
  6.                                         $map = str_split($line);

The problem is, that I want to name the array $map like $map$i  or $map + $i...
So that it's like $map1 = blah, $map2 = blah, $map3 = blah ...

Do you get me?
How do I do that?

6
I found something like this:

Code: ActionScript [Select]
  1. var snd:MySound1= new MySound1();
  2.  
  3. soundbutton_MC.addEventListener (MouseEvent.CLICK, soundbutton_Handler);
  4.  
  5. function soundbutton_Handler (e:MouseEvent):void {
  6. snd.play();
  7. }

I have the sound-effect in my Adobe Flash's library ... where should I put it and how to make the script know to play that one?

7
Developer's Corner / Rock physics math-thing [PHP]
« on: January 19, 2011, 05:52 AM »
Yes, this is part of a homework which I've tried to do 2 days now...
I tried to translate it as good as I can


"if rock is thrown directly up from the ground with starting speed of 20 meters/second, rock's height s (meters) after t (seconds) can be count with this formula:
s = -5t2 + 20t

Make a program, which counts and prints rock's height on each second."

I've tried this with different changes but none of them have worked so far:

Code: PHP [Select]
  1. $time = 1;
  2. $height = 1;
  3.  
  4. while ($height > 0) {
  5. $height = ((-5*$time*2)+(20*$time));
  6. $time++;
  7. echo "Rock's height is " . $height . " when " . $aika . " -seconds has passed.<br />";
  8. }

And this prints out infinite lines of this:

Rock's height is 10 when -seconds has passed.
Rock's height is 20 when -seconds has passed.
Rock's height is 30 when -seconds has passed.
Rock's height is 40 when -seconds has passed.
Rock's height is 50 when -seconds has passed.
Rock's height is 60 when -seconds has passed.
Rock's height is 70 when -seconds has passed.
Rock's height is 80 when -seconds has passed.
Rock's height is 90 when -seconds has passed.
Rock's height is 100 when -seconds has passed.

It goes on and on.


So ... what am I doing wrong / not getting?

-RedPillow

8
Developer's Corner / [PHP] Variables in array to int ?
« on: December 09, 2010, 12:19 AM »
I got this IF - FOREACH - THING here (I know that's a bit stupidly done ... adding "," to $num and removing it ...
My excuse is, that Im just a poor student with goal to someday become good at this kind of stuff and currently I don't care if there's something done stupidly ... cause if I ever try to fix that, it will not work):

Code: PHP [Select]
  1. if (isset($_GET["num"])) { foreach
  2. ($_GET["num"] as $arvo) $num = $num . $arvo . ",";
  3. $numchk[] = $num;}
  4. $numchktostring = $numchk[0];
  5. $num2 = explode(",", $numchktostring);
  6.  
  7. unset($num2[7]);
  8. $validchk = count($num2);

Now, it somewhy gives me output like this (By var_dumping $num2):
Code: PHP [Select]
  1. array(7) { [0]=>  string(1) "1" [1]=>  string(1) "2" [2]=>  string(1) "3" [3]=>  string(1) "4" [4]=>  string(1) "5" [5]=>  string(1) "6" [6]=>  string(1) "7" }

As you can see, every single key is a string.
My guestion is plain simple; how to make those strings int?

I have this example-snippet here, but how do I use it to array? (loop preferred):
Code: PHP [Select]
  1. $str = "10";
  2.       $num = (int)$str;

-- EDIT --

This seems to turn the variables to int, but it loses the avlue given to them before:

Code: PHP [Select]
  1. $i = 0;
  2. $a = 0;
  3. While ($i < 7) {
  4. $num2[$a] = (int)$num2[$a];
  5. $i++;
  6. $a++;
  7. }

var_dump($num2) outputs now:
Code: PHP [Select]
  1. array(7) { [0]=>  int(1) [1]=>  int(2) [2]=>  int(3) [3]=>  int(4) [4]=>  int(5) [5]=>  int(6) [6]=>  int(7) }

9
Developer's Corner / What is wrong with this php-snippet?
« on: December 08, 2010, 01:51 AM »
Here, it comes up with this error "Invalid argument supplied for foreach() in J:\Xampp\xampp\htdocs\forms-1\next.php  on line 28
I read somewhere that the variable it's checking isn't array ... it gets the $_POST vehicle from listbox with multiple selections.

Code: PHP [Select]
  1. $vehicles=""; //line25
  2. if (isset($_POST["vehicle"])) //line26
  3. {$vehicles = "You chose: <br />"; //line27
  4. foreach ($_POST["vehicle"] as $value) //line28
  5. {$vehicles = $vehicles. $value . "<br />";} //line29
  6. print $vehicles;} //line230

10
General Software Discussion / Windows 7, weird picture
« on: July 04, 2010, 04:15 AM »
I've got 64bit Windows 7.
Now, I go this picture and a part of it is edited.

The problem is, that you have those preview-icons for your pictures and this certain edited picture shows how it was originally, but when I open the picture, it shows the edited version.
How can this be possible?

Also, since I've got this problem, is it possible to get that preview-picture as big as the edited one?

11
Living Room / Databases in modern companies
« on: March 19, 2010, 01:33 AM »
This really interests me, because Im on-the-job learning and these guys here use databases daily, hourly and minutely.
Every single PC has a tiny client running, to retrieve data from a sector they want, with any PC they want and from any PC they want.
Every log and everything they do is saved automatically to a database, they use databases to list files and a handly program called ORACLE.

Why I am so interested then ?
Because they told us on school, that you`re really gonna need databases daily when you get your job.
I didn`t believe this, but they are actually more than needed !

So.
What do you think of this, is it handy and fast - or maybe complicated and stupid ?
What would be your choise to share and save data ?

12
General Software Discussion / Trying to remember an old game
« on: March 15, 2010, 04:38 AM »
Good morning forum!

Im trying to remember this old, 2D, pretty much sidescrolling game.
I played it when I was very young ~ year 1995+ maybe.

When you started the game, first thing you saw was some kind of medusa or octopus but it looked scary and it was one of the games enemies - there was lots of other enemies in that picture too, if im right.
The player had some kind of jetpacks and maybe blue clothes.
@ first level / demo level or @ some level, there were computers and stuff if you went up, almost like a facility..
I think it was somewhat puzzle game to get out or something.
i think..there was a pistol, but jetpack there was for 80% sure.

Lots of buttons.. you had to go up in one level and there was computers.. buttons?
Cokemachines?

I think the game used level codes, not sure thou..

Please help me remember this!

13
Finished Programs / DONE: Line-Numbered textfile
« on: March 10, 2010, 10:05 AM »
I have decided to start this little youtube-game bymyself, where I seek for videos from 1 viewers to 100 000 000 viewers.
And for that, I need a checklist from 1 to 100 000 000.

So, i need someone to make me a program, which creates textfile with lines "from" "to" and user can choose where to start and where to quit, and the max number should be 100 000 000.
And if possible + bonus for you, make it so that in every line there is space after number.

14
Post New Requests Here / IDEA: Binding 2 windows to each other?
« on: March 10, 2010, 06:17 AM »
Im in need of a program, which could "bind" or "merge" 2 windows together.
Now, I suck at explaining but lets say that I got 2 tiny windows and I want to minimize both of them just by clicking other ones minimize button - but this would happend only if the windows are bind together.

Another feature could be like in WinAmp, there is lots of tiny windows and they are like glued together or something, you can drag 2 windows bind together and release them too.

And lets not forget transparency, you could change transparency of both of the windows just by changing it from one of them.

Is this even possible to make?

I don`t know how the binding would exactly happend - possibly writing the window-names on a command prompt ??

15
Living Room / Speaking Of: Torrent Sites
« on: March 09, 2010, 03:32 PM »
First thing to say, is that I don`t want anything illegal here - as the torrent-sites are not illegal.

I actually made this topic up, because I wanted to ask you, that what do you think about sharing programs, videos, music and other stuff MADE BY YOURSELF on the torrent-sites?
I think those sites should really be used more to ship legal stuff since they have easy search-method and lots of stuff gathered to one place - and lets not remember user-supported dl/ul`s.

It would be hell of a lot easier to find that album made by your neightbor by searching it from these sites that surfing on google and stuff and not finding anything at all.

So, post your thoughts and so on..

16
I found this cool, lighty runnin' TankFighting -game called TankIonline.

It requires no downloads, is f2p and is very light --> when I got to the site, I wasready and playing after 3 minutes.

The idea of the game is simple - build your own tank, buy new parts and colors and stuff and upgrade em, get more cash and stuff from online battles!

So, here`s my link - Join!

Click This To Get To The Site

17
General Software Discussion / Virtual Desktops For Windows 7
« on: March 08, 2010, 11:23 AM »
Are there any other Virtual Desktops like BumpTop?

18
Living Room / New Generation Game Demos
« on: March 08, 2010, 01:07 AM »
I just heard, that something like "New Generation Game Demos" are coming - first to Playstation 3, then to Xbox and then to PC.

These new game demos are quite easily explained:

The "Demo" would actually be pretty much full-game BUT - the longer / further the player plays it, the more gameplay and stuff the player will miss.
For example Final Fantasy demo would work as the full game and it would be full game but your weapons would get weaker the further you play it.
Another example would be GTA, the longer you play it - the crappier the cars would get.

This new demo-system is in development because the companies want to give players the power to choose what they want to test in the game, before it comes nearly unplayable.

Now, I don`t know how this would take effect against pirates - will they just crack the demo, or actually buy the game after the exclusive demo?

Either way, I think this is a creat idea!

19
Living Room / Fixed my network - The Hard Way
« on: February 28, 2010, 07:51 AM »
At last!

Gawd how hard can network-fixing be.
I had a pack of tiny problems which eventually created a big problem - my latency went up to 600 for no reason, dl and ul were aprox 60% lower than they should be, random people could access my network and i pissed me off.

Today I fixed it thou - Couldn`t access my routers setting cause my ip was made by my computer and wasn`t  starting with 192.168.
Solved that part by going to other computer and accessing to the setting from there.

Next thing was that DHCP was off, I tried to find some guides but find none which would work for me.
Solved that by going to routers settings and setting it on - after that I had massive connection problems and my pc said that there was 160 cables connected to my router somewhy.

Solved the new connection problems by rebooting the modem and executing some fixing programs and using tcp-optimizer ( no idea how it finally got fixed)

Then there was even more problems, weird pc`s were connected to my home-network, I removed the antenna from the router cause i thoguht they were using my wlan but they weren`t.
I tried to find some guides again with no success so I decided to find out by myself how can i kick them from my network
Solved that by going again to the setting of the router and blocking their MAC adresses - after that, the 160 cables connected happened again along with message that my ports are overloaded.

So I used that fixing method for the 160 cables like before and still pc spammed tens of ports overloaded -messages.
Solved the messages by releasing and renewing my ip (idk why i thought that would work but it did).

Next thing was that my modem could not connect to internet anymore, I spent hours thinking how to fix it since no guides were found...again.
Finally solved that by flushing dns.

After all those things, I had to do some minor fixes and set-ups and now my connection is perfect, latency 28 and wlan secured!!!

Send in your thoughts, lol :]

20
General Software Discussion / MultiPlayer Sandobx Games
« on: February 28, 2010, 07:29 AM »
Yo, add some names here, but only if there`s multiplayer - so far I know these:


-ADDED LINKS-

Minecraft - HERE
Garry`s Mod - HERE
Roblox - HERE
Little Big Planet - HERE
PlatinumArtsSandbox - HERE
Owen Piette`s WXsand - HERE

21
Just a phunny topic for you to answer  :-*

My Entry:

When Im getting pissed off when coding, I use these methods to stop raging  :Thmbsup::

- Ctrl+X the whole part of the code to notepad and after that, I start coding something very different to the same project and after cooldown, I just     paste the cutted code back and try again.

- I`ll take a long breath and stretch a little and after that, I open my Sony Vegas and start editing random vid for while.

- Seeking inspiration from YouTube.

- Etc.

22
Developer's Corner / Fixing user-sent coding-bugs as "challenges"?
« on: February 26, 2010, 12:27 AM »
So I thought, that we have lots of people here who code and have sometimes problems with the code and stuff, that helping people with their bugs should consider as "challenges" where the fixer will get something to show up and the user who sent the buggy code would get their code fixed.

So, post in your thoughts  :Thmbsup:

23
Developer's Corner / Parsing / Filtering text
« on: February 25, 2010, 04:27 AM »
Yo again, another topic I need help with.

I have this big list in a txt-file which contains paths.

Example paths:

Motorcycle\crap\morecrap
Car\crap\morecrap
Truck\crap\morecrap
Bike\crap\morecrap

And now, I want to delete everything after the first "\" so the lines will look like this:

Motorcycle
Car
Truck
Bike

How do I do this?
What program to use?
Possibly a script?
It can`t be done with notepad`s search & replace command like this:

Search: \*
Replace: -empty-

Cause it tries to find "\*" and not "\anything".

Suggestions?

24
Developer's Corner / C++ - Saving / Loading data
« on: February 25, 2010, 12:30 AM »
Hi, first of all - I want someone to do exactly as I want and not to make any external ideas up or ask why i want it like so etc...

So, sorry bout that - to the topic:

I want a simple C++ example (with includings and stuff - a fully working program) which asks user a number and saves it TO THE EXE, TO A INI-FILE or TO A TXT FILE - or all 3.
But inorder to test this data-reading, I want it so - that when the program starts, it prints a list where user can read the saved numbers and after press of an enter, it will ask new number, saves that and again on startup it creates the list an so on...

I don`t need encryption, or security - I`ll do it later if I want, just give me example of that.

I would mostly want example of saving to exe and txt-file, ini is not so important.
Remember to test it, lol - so i dont have to reply with bugreport.


Thanks!

25
Hi, I was wondering, if there is program like Glass2K (you can click a window and a menu opens) - which allows you to set-up for example "hold down ctrl and right click a window to open a menu where you can taskkill the process the window is running on"

Lol, I suck at explaining thing but you get the idea.

Pages: [1] 2next