topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • Tuesday March 19, 2024, 6:35 am
  • Proudly celebrating 15+ 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.


Messages - RedPillow [ switch to compact view ]

Pages: [1] 2 3 4 5 6next
1
Hello there!

Oh I remember the donationcoder forums. I got in here via Cortex Command somehow. (I think this guy named Nahuel, who was Cortex Command's anti-piracy / anti-crack guy with this weird polar bear fetish (Might even have him added on Facebook), lead me here) (Edit: scancode was his nick!)

I was in ... maybe 9nth grade then, so somewhere between 14 and 16 years old. I am now 21 years old, however.

I was kind of a beginner with programming back then, but I knew decent amount of stuff still, so not a complete beginner. I think I even tried solving some of the programming puzzles found somewhere on this site and I remember doing some C++ puzzle that was related to banking (never got that one done).

Well I've continued and gotten a lot better since then. I've never wanted to do anything else than computer stuff / programming and to this day I still do not.
I will graduate with my B.Eng. degree of Software Engineering in 2 months and I will be continuing with a master's degree of software engineering after summer.
I work whilst studying in an engineering / consulting company with around 1200 emplyees. I am a system's developer / analyst and I make around 20% more than the average just graduated fella.

Recently, I've been getting into wines, cheese and coffee made from fresh ground coffee beans. I haven't gotten to actually try the coffee yet as I don't have a bean grinder yet, but I am obtaining this cool antique bean grinder from my grandma at the end of this month. Wine is costing me a lot of money, as I tend to drink quite lot of it whilst programming. I am thinking about switching to cheaper ones when I am alone.

I am looking to buy a new jacket, but I have absolutely no taste. This and this are the candidates so far.

As for what exactly I do with computers as of now; I have gotten into web stuff mostly, so Node.js, express, socket.io, HTML 5, JavaScript, jQuery, Transit, Redis, AppFrameWork, Phonegap, grunt, gulp, PHP and so on are the main things I am working with on a daily basis. I do a decent amount of C# and C++ as well, especially if I want to make games or something with proper OOP. I use SFML.NET for all my desktop games.

Pixi.js and some other WebGL frameworks are also something I make games with, when I feel like I am ready to get annoyed by JavaScript, although JavaScript is one of my favorite languages.

There has been a lot of talk around the internet about the new Raspberry PI, Unity going free and Unreal Engine going free. I am honestly not too amused. Sure that stuff is great and all and Raspberry PI is amazing feat of hardware technology, but all of those just kind of dodge my interests. I always liked making games from absolute nothing because it was challenging and I'd learn a lot. I also LOVED implementing all the required algorithms by mysel, be that a simple projection or a path tracer or something more difficult. These tools take everything I love about making games away from me as they have all the "good stuff" already built in. Besides, 3D games are boring and damn near impossible to be made by a single person with the models and all.

As for the Raspberry PI, I don't do a lot of electronics. I am 95% software guy, so that does not really interest me that much.

Hmm what else, what else... Oh I make gamehacks as a small hobby from time to time. Nothing too serious; some packet forging, datamining, memory editing and tiny dll-injections. Apparently there isn't even that much work involved with, say, making a godmode or a teleportation hack for Final Fantasy XIV, Archeage or Guild Wars 2. BeEF, Nessus and Metasploit are even more interesting to toy with.

Unfortunately I've moved mostly to Reddit and Stackoverflow when it comes to online coding communities. Thanks for the email though mouser, I will try and drop by more in the future!

2
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.

3
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. });

4
The <|/p> and <|p> tags somehow come from joining these two together:

$Firstpart[$rand] . $SecondPart[$rand];

5
Still weird tho ... I can print ie. CHESSBOARD as much as I want and it always puts <|/p><|p> after the word.  :huh:

6
Since I got your attention already, I'll ask if anyone knows, if it is possible in anyway for random <|p> and <|/p> -tags to get insterted into my code.
ALSO, str_replace wont find em either.

This is the output, don't mind about the contents  :-[


Code: Text [Select]
  1. <p>[18.26.23] - Rotation was <font color = 'orange'><b>225</b></font> degrees, done by <b>127.0.0.1</b>, who says: '<b>HIGHWAY|||</p><p>|||-CHESS BOARD|||</p><p>|||</b>'


I've highlighted the tags with '|||'s, which cause problem and I assure you, that I've gone trought EVERY FILE RELATED trying to find where those tags pop-up.
I've tried using find in text-editor, I've tried to strip and trim them and no I don't know what to do anymore...

This is just my foolish theory but ... might it be possible, since 'HIGHWAY' and 'CHESSBOARD' are obtained from text-file,
that they somehow contain invisible tags or something after them? Like HIGHWAY<|/p><|p> ?


7
Oh my god, it works perfectly! THAAAANKS!
I was worried that nobody wouldn't make any sense of what I want to achieve  ;D

Now, to reverse that back ... Im going to seek for function which switches the key-table's keys with values like so:

OLD:

Code: PHP [Select]
  1. $cryptkey = array('0' => 286, '1' => 949, '2' => 695);

NEW:

Code: PHP [Select]
  1. $cryptkey = array('286' => 0, '949' => 1, '695' => 2);

Edit: array_flip seems to do the work.

8
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.         }


9
Developer's Corner / Re: [PHP] Confused with functions
« on: February 06, 2011, 05:41 AM »
Yeah ... there's sometimes just too much questions I need answer for.
I'll go check the nearest library!

10
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;

11
Developer's Corner / Re: [PHP] 'Dynamic variable name' ?
« on: February 05, 2011, 05:00 PM »
Thanks!
It's working now as so:
(Btw, any 'better' way to thank like reputation + etc. ?)
Code: PHP [Select]
  1. $i = 0;
  2.         $openMap = fopen("map/map_1-1.txt", "r");
  3.                 while (!feof($openMap)) {
  4.                         $line = fgets($openMap);
  5.                         $map[$i] = str_split($line);
  6.                         $i++;
  7.                 }
  8. fclose($openMap);
  9.  
  10. for ($row = 0; $row <= 13; $row++)
  11. {
  12.     for ($col = 0; $col <= 13; $col++)
  13.     {
  14.                 if ($map[$row][$col] == 'X') {
  15.                         echo "<img src = 'img/wall/X.jpg'/>";}
  16.                 elseif ($map[$row][$col] == 'G') {
  17.                         echo "<img src = 'img/terrain/G.jpg'/>";}
  18.     }
  19. }

12
Developer's Corner / Re: [PHP] 'Dynamin variable name' ?
« on: February 05, 2011, 04:17 PM »
What do you mean?
Aren't I using arrays when splitting the lines to an array?

13
Developer's Corner / Re: [PHP] 'Dynamin variable name' ?
« on: February 05, 2011, 04:10 PM »
Whaat?

I want to get every line of the text-file.
Then spilt those lines to arrays called map1, map2, map3 ... where each character of the line is one cell of an array.
But how do I name the $map differently after every loop?

like $map$i or somrthing?

14
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?

15
Oh ... I also have background-music playing from the start ... I'd like it to stop when I say so.

Tried this one:

Code: ActionScript [Select]
  1. var bgMusic:bgMsc= new bgMsc();
  2. bgMusic.stop();

Also this:

Code: ActionScript [Select]
  1. var bgMusic:bgMsc= new bgMsc();
  2. bgMsc.stop();

Error is this:

TypeError: Error #1006: stop is not a function.
   at Untitled_fla::MainTimeline/frame96()


Isn't this similar (this is playsound-function when someone click the twitter-button)?:

Code: ActionScript [Select]
  1. function sound_play (e:MouseEvent):void {
  2. snd.play();
  3. }


16
Aha!
It was hidden under Advanced > Something > Something :P

http://img407.imageshack.us/img407/1435/aflashlink.jpg


Got it to work just right - Thanks so much for help!

- RedPillow

17
You might be right ... someone said this:

sound works just as movieclips, create a sound in the .fla, use the linkage dialog in teh library and set Class to: "MySound1"
then use it with:

var snd:MySound1= new MySound1();
snd.play();

should work..


But since Im new with flash I have no idea how to "create a sound in the .fla, use the linkage dialog in teh library and set Class to: "MySound1"".
(Incase it's important ... Im making a basic starting-sequence for a flash-game/animation like "Game by: blahahah" and there's a button which links to my twitter but I want it to make *click* -sound when clicked)

18
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?

19
Developer's Corner / Re: Rock physics math-thing [PHP]
« on: January 19, 2011, 06:03 AM »
But the exercise told me that formula  :huh:
My teacher has messed these up before though ... any idea how to actually do this thing then?

Edit: Oh ... I'll try the t^2 one.

Am I right when I think, that the printout should be something like this:


Rock's height is 10 when 1-seconds has passed.
Rock's height is 20 when 2-seconds has passed.
Rock's height is 30 when 3-seconds has passed.
Rock's height is 40 when 4-seconds has passed.
Rock's height is 30 when 5-seconds has passed.
Rock's height is 20 when 6-seconds has passed.
Rock's height is 10 when 7-seconds has passed.
Rock's height is 0 when 8-seconds has passed.


20
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

21
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) }

22
Developer's Corner / Re: What is wrong with this php-snippet?
« on: December 08, 2010, 03:28 AM »
_______
SOLVED

My html-side was messed-up really bad ...
I didn't even have a value for each option.

-- But hey, thanks a lot for your time and help !!

23
Developer's Corner / Re: What is wrong with this php-snippet?
« on: December 08, 2010, 03:17 AM »
Writing to file didn't work so well ... it only wrote the last option selected in the listbox to the file.

But here's a code from some php-site they used for multiple selections:

Code: HTML [Select]
  1. <form method=post action=''>
  2. <select name='color[]' size=4 multiple>
  3. <option value='blue'>Blue</option>
  4. <option value='green'>Green</option>
  5. <option value='red'>Red</option>
  6. <option value='yellow'>Yelllow</option>
  7. <option value='' selected>Select a Color </option>
  8. <option value='white'>White</option>
  9. <input type=submit></form>

///// collecting form data /////

Code: PHP [Select]
  1. @$color= $_POST['color'];
  2. if( is_array($color)){
  3. while (list ($key, $val) = each ($color)) {
  4. echo "$val <br>";
  5. }
  6. }//else{echo "not array";}


I fail to see what this snippet does differently ... maybe you can?

24
Developer's Corner / Re: What is wrong with this php-snippet?
« on: December 08, 2010, 02:49 AM »
Thanks, your explode-function works!
Though there is still a tiny problem..
With this, it only prints the last selected option in the listbox ie.

Option 1 -selected-
Option 2
Option 3 -selected-

output --> Only option 3

Btw, the value $_POST gets is not an array ... and it should be I guess since you can choose multiple options from the listbox.

Code: PHP [Select]
  1. $vehicles="";
  2. if (isset($_POST["vehicle"]))
  3. {$vehicles = "You chose:<br />";
  4. $arrex = explode(" ", $_POST["vehicle"]);
  5. foreach($arrex as $value)
  6. {$vehicles = $vehicles . $value . "<br />";}
  7. print $vehicles;}

25
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

Pages: [1] 2 3 4 5 6next