Martyr2's Profile User Rating: *****

Reputation: 4864 Guru
Active Posts:
13,257 (4.21 per day)
18-April 07
Profile Views:
Last Active:
User is offline Today, 06:51 PM

Previous Fields

OS Preference:
Favorite Browser:
Favorite Processor:
Favorite Gaming Platform:
Your Car:
Who Cares
Dream Kudos:
Expert In:
C/C++, Java, VB, VB.NET, C#, PHP, Web Development, HTML & CSS, Javascript

Latest Visitors

Icon   Martyr2 is most definitely the real life Tony Stark.

Posts I've Made

  1. In Topic: Regex - get all text after a certain line

    Posted 29 Nov 2015

    You could try Title: Example title(\s*(.*))* This will say that there might be any mount of white space in between "Example title" and the text that follows. This is newlines, spaces, tabs etc. Then by grouping \s(.*) in its own group and wildcarding it with an asterisk you are saying repeat that indefinitely. So it will eat up all white space between content all the way to the end.

    Example from showing how it eats up content and additional lines...

    Attached File  output.jpg (139.06K)
    Number of downloads: 1

    Enjoy! :)
  2. In Topic: Help! (Arrays and functions)

    Posted 29 Nov 2015

    Ok a couple of things to note here...

    1) In readFile() you should not attempt to use getline() before you actually check if the file open was successful. Don't do line 36 until you check first if the open was successful.

    2) You should use forward declarations (lines 18, 64 etc) only when you define the function AFTER main. You do forward declarations to let the compiler know that those functions are coming up. If you define the function before main (or the function that uses them) then the compiler already knows about them so you don't need to do the declarations.

    3) You are displaying the long tedious way. you are dealing with null terminated strings, you can send those to cout straight way. Check out this display function...

    void display(char student_id[][10], char students_a[][MAX_NUMBER_QUESTIONS], double st_score[], char l_score[], int num_students)
    	for (int s = 0; s < num_students; s++)
    		cout << student_id[s] << '\t' << students_a[s] << '\t' << st_score[s] << "\t" << l_score[s] << endl;

    This will give you the nice tabbed look with none of the printed garbage as before.

    But anyways, other than this, I have not run into your actual error. I ran this in VS 2013.


    Attached File  output.jpg (78.91K)
    Number of downloads: 0
  3. In Topic: Jquery events not working for dynamically added divs

    Posted 28 Nov 2015

    View PostTheDude0806, on 28 November 2015 - 02:28 PM, said:

    It's not as simple as that, i don't save the specific div in localStorage but one with children, i.e. div->div->table->dynamic tr->dynamic td-> dynamic div @Martyr2

    Ummm so? Why would it matter if it has children or not? An element is an element. You asked about attaching an event to an element dynamically, pass the element, wrap it in a jQuery $() and attach an event with .on(). You don't have to know anything about the actual element to do this and it doesn't matter if it has children or not. jQuery even has ways to navigate your element without knowing anything about them other than their relation to one another.

    Still not seeing the problem here. You could pass that whopping div element (children and all) to your function, your function could navigate down and bind the element to any element you want... to help with this you could even use find()/children() or whatever. jQuery can work on fragments and bind events to any particular elements you want.

    My original comment still happily applies. :)
  4. In Topic: What are you working on today?

    Posted 28 Nov 2015

    I got up this morning and started the task of migrating some of my work content onto my home computer and getting a new environment working so I can work on the project locally at home when I am not at work. I thought it was going to be quite a task to fight the software to install the way I want and get it configured properly. I thought it would take me the better part of the weekend to fight with. Got it configured and running within a half hour with only two minor issues. So I am pretty stoked about that.

    Now just deciding if I should go out and enjoy some of the sunshine even though it is near freezing out. I probably will. :)
  5. In Topic: Jquery events not working for dynamically added divs

    Posted 28 Nov 2015

    Ok well you have said here that for each ".icon" element you want to attach an event for dblclick. Pull that event binding code out and put it into its own function which will take an element as a parameter. In the function it will attach the dblclick event to it and returns the element. You can then append that element anywhere you want. So now you can pull your element out of localstorage, pass it to your function which will bind the dblclick to it, it returns the element and then you insert it in place of the non saved element.

    The 'this' keyword here means nothing to the problem in that 'this' is only replacing the currently iterated element in your loop. It's a stand in for an element. Hopefully you get it. The element you pass to your new function can be put in place of 'this'.


My Information

Member Title:
Programming Theoretician
Age Unknown
Birthday Unknown
Vancouver, Canada
I love programming and science (almost became a chemist). My favorite languages are C#, Java, Python and PHP. While I am not programming I enjoy movies that feature something medieval (Gladiator, Braveheart etc) or high tech (like Hackers or Swordfish).

I have a diploma in computer science and another in arts and science. My favorite sciences are astronomy, chemistry and geology.

If you have any questions regarding programming, you will find I live and breathe the stuff and should prove an invaluable asset.

Winner of 28 2008-2014 DIC Community Awards including Blog of the Year, Mentor of the Year, DIC Head of the Year, Most helpful Programming Category, Most Helpful in Web Development Category and overall Nicest Member of the year.

You can now catch me on Twitter! Follow me as I talk about technology and specifically programming and answer questions like the best book to learn from or how to organize your code. :)
Years Programming:
Programming Languages:
C/C++/VC++/C#, VB6/VB.NET, Java, JavaScript, Ruby, HTML/CSS, PHP, ASP/.NET, Python, mIRC Scripting

Contact Information

Website URL:
Website URL


  • (8 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »
  1. Photo

    rooster24 Icon

    21 Oct 2015 - 09:03
    I bought your Programmers Idea Ebook. Do you have Java solutions to some of the Projects that I can reference as needed?
  2. Photo

    Dogstopper Icon

    05 Dec 2013 - 14:39
    Have a 6-year badge good sir!
  3. Photo

    mostyfriedman Icon

    12 Oct 2013 - 21:07
    I am good, busy as well.
  4. Photo

    Martyr2 Icon

    07 Oct 2013 - 12:16
    Good mosty, you? Been busy lately.
  5. Photo

    mostyfriedman Icon

    07 Oct 2013 - 11:26
    Martyr2 my man, how's it going??
  6. Photo

    ishkabible Icon

    22 Aug 2013 - 15:58
    O ah, didn't even realize it. No prob. much deserved!
  7. Photo

    balloon1 Icon

    18 May 2013 - 14:57
    Hi can you help me with one of my questions!
  8. Photo

    groovmuffn Icon

    24 Apr 2013 - 10:10
    Greetings! Newish coder here. I came across your php histogram equalization code the other day and figured I'd try and draft something similar up in javascript. I feel like my code is sound, though something has to be wrong as the output of the image is black with some faint greens. I'm wondering if I am missing something from your original code. Consider perusing a jsFiddle?
  9. Photo

    Martyr2 Icon

    31 Dec 2012 - 12:48
    Thanks lucky3! Winning these types of things always energizes me to continue my work to help everyone I can here. I am a firm believer that we should always provide more than just a quick answer, but teach as well. :)
  10. Photo

    lucky3 Icon

    31 Dec 2012 - 02:23
    Congratulations for the "Mentor of the Year" 1st place, "Nicest Member of the Year" 1st place, "Most Helpful- Web Development" 1st place, and "DIC Blog of the Year" award 3rd place awards! Really impressive, and well deserved.
  11. Photo

    xwordgrl Icon

    27 Dec 2012 - 14:26
    Martyr2, I’m a reporter for the Wall Street Journal and would like to ask you a question about your post on Code Academy. Please email me at Thanks!
  12. Photo

    MsParnel Icon

    16 Sep 2012 - 23:17
    Thank you very much for the project list :).
  13. Photo

    ishkabible Icon

    19 Feb 2012 - 20:19
    "This is Chris's basement!!!"
  14. Photo

    Martyr2 Icon

    19 Feb 2012 - 12:47
    Very very true. echo "THIS IS SPARTA!!!";
  15. Photo

    no2pencil Icon

    19 Feb 2012 - 11:51
    It's like the movie 300. 10 times.
  • (8 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »