mostyfriedman's Profile User Rating: *****

Reputation: 729 Enlightened
Expert w/DIC++
Active Posts:
4,503 (1.69 per day)
24-October 08
Profile Views:
Last Active:
User is offline Jul 10 2015 05:36 PM

Previous Fields

OS Preference:
Favorite Browser:
Favorite Processor:
Favorite Gaming Platform:
Your Car:
Dream Kudos:
Expert In:

Latest Visitors

Icon   mostyfriedman knows nothing about anything

Posts I've Made

  1. In Topic: random numbers

    Posted 18 Apr 2014

    try this

    Math.random() generates psuedorandoms in the range [0, 1), so by multiplying by 3, I'll generate numbers in the range [0, 3), then subtracting 1 will make the range into [-1, 2). Hope this helps.


    I just noticed that you used the same formula. This should work, if you're having trouble, then I'll need to see more the code to figure out where the problem is.
  2. In Topic: Function scoring alignment of two strings (Scheme)

    Posted 16 Apr 2014

    Add an extra parameter to the procedure, that will be the output. In the base case, return the value of that argument, otherwise update its value when you make a recursive call.

    Also, don't scatter the parenthesis, don't format scheme code the same way you'd format Java or C.
  3. In Topic: 10 Programming Languages You Should Learn

    Posted 19 Mar 2014

    View PostSkydiver, on 19 March 2014 - 06:12 AM, said:

    As I stare at that code (and trying to envision how my defragger will work), I've come to the realization that is not quicksort. Quicksort is supposed to sort in place and a pivot is supposed to be picked out. What I'm seeing there is that new memory is being allocated and I can't for the life of me see where the pivot is being chosen (other than just grabbing the first number to be the pivot). For my defragger, that would mean that I would need more memory than I have diskspace...

    That was just a very simple implementation of sorting a list in Haskell, it's easy for newcomers to understand and write. If you want "true" quicksort, it'll look pretty similar to its imperative counterpart.

    xclite's description of what the code does is correct.
  4. In Topic: 10 Programming Languages You Should Learn

    Posted 17 Mar 2014


    You mean Edsgar Dijkstra? I didn't know he ever advocated FP.

    Yes, see here.


    I've noticed that the term "elegant", in both math and programming, generally indicates something which has been rigorously golfed down to its minimal-length expression, with no concern for readability. When I see the term "elegant" I usually expect to read something which makes perfect sense to someone who already understands it perfectly, but which communicates nothing to a reader coming to it fresh. That is, it's usually a piece of writing that shouldn't have happened, since it's perfectly useless.

    That's totally fine, it depends on how you define elegance.


    Computers are wonderfully, frustratingly, linear. Imperative languages are how a computer thinks. You can take a simple C program and go one to one to assembly and then machine instructions. For computer science, you must understand this.

    Functional programming is a level of abstraction intended to allow the human to think of the problem in a different way. Unfortunately, the computer will still keep on chewing one instruction at a time, regardless of the language those instructions started in.

    And, when you have to debug, guess which paradigm is the most transparent.

    That is very true, but because of that we need to build abstractions that make our lives easier. I believe FP is one such abstraction. I have written and debugged both functional and imperative programs, and definitely debugging a higher level program is much easier.
  5. In Topic: 10 Programming Languages You Should Learn

    Posted 17 Mar 2014

    I totally agree, but in my experience FP can teach one a lot of great things that will make you a better programmer, even if you don't actually use FP in your job. If you want to know what I am talking about, read Structure and Interpretation of Computer Programs. It uses Scheme, and it's available to read online for free. The video lectures are also available on the book's website.

My Information

Member Title:
The Algorithmi
26 years old
April 15, 1989
Cairo, Egypt
Analysis and design of Algorithms
Theory Of Computation
recreational mathematics
functional programming
Artificial Intelligence
Full Name:
Mostafa Hany El Sayed
Years Programming:
Programming Languages:
Java, Python, Ruby, Prolog, Haskell (learning), common lisp, C/C++, MySql, MSSQL, verilog hdl


  • (2 Pages)
  • +
  • 1
  • 2
  1. Photo

    modi123_1 Icon

    17 Mar 2014 - 12:24
    What eve what eva.. I do what I want.
  2. Photo

    tarmizi_adam2005 Icon

    21 Feb 2014 - 07:03
    Ah ok, Hopefully, everything is fine there InsyaAllah.
  3. Photo

    tarmizi_adam2005 Icon

    19 Feb 2014 - 19:24
    How is it in Misr ? How is the new government there ? Heard a lot about Misr, but I guess I should ask someone who is really from Misr to really find out.
  4. Photo

    tarmizi_adam2005 Icon

    12 Jan 2014 - 03:53
  5. Photo

    BenignDesign Icon

    27 Sep 2013 - 06:59
  6. Photo

    no2pencil Icon

    21 Nov 2011 - 21:04
    Wow, have not seen you in a while?! Things good?
  7. Photo

    Martyr2 Icon

    01 Feb 2011 - 23:06
    Sounds like Hosni Mubarak may step down now. I hope he keeps his word. But you can never trust a dictator! :)
  8. Photo

    red_4900 Icon

    01 Feb 2011 - 01:45
    Seriously dude, don't go back to Egypt right now. It's a mess.
  9. Photo

    absynthe Icon

    28 Jan 2011 - 22:18
    I hope you are safe my friend! I'm thinking of you and hoping all is well! Don't pick up any rocks please..
  10. Photo

    Dogstopper Icon

    03 Jan 2011 - 00:15
    Hope you had a good New Year's day Mosty!
  11. Photo

    skyhawk133 Icon

    31 Dec 2010 - 13:59
    You too man! Hope 2011 is a good year for you! Glad to have you here at DIC.
  12. Photo

    Alex6788 Icon

    15 Nov 2010 - 23:07
    Hey mostyfriedman
  13. Photo

    Bent al-Yemen Icon

    19 Aug 2010 - 02:07
    looool, i don't know , i just got used to do so.
  14. Photo

    megglz Icon

    11 Aug 2010 - 05:21
  15. Photo

    absynthe Icon

    11 Aug 2010 - 05:17
    whats up sexy? :)
  • (2 Pages)
  • +
  • 1
  • 2