Announcement

Collapse
No announcement yet.

Let's make a deal!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #91
    It sounds like the Italians know how to cook a goat:

    In the mountainous Abruzzo region, says Italian cooking expert and author Domenica Marchetti, baby goats are enjoyed in the spring months, while older animals are eaten in late summer and fall.

    “One Abruzzese specialty is capra alla neretese, a stew in which the meat is cooked with onions and wine and seasoned with lemon peel and whole cloves,” Marchetti says. “While the stew simmers, you fry a batch of peppers, and add them toward the end of cooking.”

    Other regional preparations, she adds, include goat cooked alla brace (over hot coals), al forno (roasted in the oven), and sugo di capra, in which leg or shoulder meat is stewed with tomatoes, herbs, garlic, and wine, and served as a sauce over pasta.
    But Nepal does it with more spice. I would be tempted to add beer to the recipe but that would probably **** it up.

    One special-occasion goat dish popular in Nepal is khasi ko masu, says Pat Tanumihardja, author of The Asian Grandmothers Cookbook. To make this Nepalese curry, goat meat is marinated on the bone with garlic, ginger, yogurt, and garam masala for several hours, then sautéed in ghee and flavored with turmeric. It may be transferred to a pressure cooker to ensure tenderness, and is traditionally served with roti or basmati rice.
    Try http://wordforge.net/index.php for discussion and debate.

    Comment


    • #92
      Originally posted by Hauldren Collider View Post
      OS doesn't teach you about the fiddly bits in Windows. It teaches systems programming.
      <p style="font-size:1024px">HTML is disabled in signatures </p>

      Comment


      • #93
        At my last job I was basically hired to fix all of their concurrency problems. One of their biggest culprits for their program's crap performance was this abomination
        Code:
        public class ConcurrentQueue implements Queue {
            private Queue queue = new LinkedList();
        
            public synchronized boolean offer(T t) {
                return queue.offer(t);
            }
        
            public synchronized T poll() {
                return queue.poll();
            }
        }
        They used this damned thing all over the place, and needless to say it didn't scale worth a damn. I just replaced all of these with the lock-free ConcurrentLinkedQueue and the program instantly ran ten times faster.

        I don't think I've ever run into a situation where a solution that uses locks performs better than an lock-free solution; but people only get taught how to program with locks, so that's all they use.
        Last edited by loinburger; March 27, 2013, 12:58.
        <p style="font-size:1024px">HTML is disabled in signatures </p>

        Comment


        • #94
          All they teach us in Parallel at cmu is the idea of work and span and divide and conquer and stuff, it's bull****. We don't learn about locks or semaphores or anything. They cover that in systems.
          If there is no sound in space, how come you can hear the lasers?
          ){ :|:& };:

          Comment


          • #95
            It's a good idea to familiarize yourself with your language's concurrency library - you ought to use it to avoid locks wherever possible. At a minimum it probably has a thread-safe queue, a thread-safe dictionary/hash table, and a way to make atomic modifications to primitives. For example, let's say you've got an integer and you want to add 5 to it - you could just lock the integer, but that's dumb and lazy. Instead, your language either has a way to atomically add 5 to an integer (e.g. C#'s System.Threading.Interlocked.Add), or it has a compare-and-set method, which looks like
            Code:
            boolean compareAndSet(refreference, oldValue, newValue)
            You pass in a reference to a variable, an old value, and a new value. If the old value matches the current value of the referenced variable then the variable is set to the new value and the method returns true. If the old value doesn't match the current value then the method returns false without modifying the variable. This is all done in one clock cycle (ancient processors won't be able to do this, but any modern processor has the appropriate instruction set, with the exception of some embedded processors). Then you use this in a loop
            Code:
            int variable = 0;
            boolean success = false;
            while(!success) {
                int oldValue = variable;
                int newValue = oldValue + 5;
                success = compareAndSet(ref variable, oldValue, newValue);
            }
            If a thousand threads are all trying to change the variable then this might take awhile, but in that case you need to ask yourself why a thousand threads are all trying to change the variable
            Last edited by loinburger; March 27, 2013, 13:26.
            <p style="font-size:1024px">HTML is disabled in signatures </p>

            Comment


            • #96
              Originally posted by Hauldren Collider View Post
              All they teach us in Parallel at cmu is the idea of work and span and divide and conquer and stuff, it's bull****. We don't learn about locks or semaphores or anything. They cover that in systems.
              Bloody useless. They should be teaching you useful stuff. How to shoot and roast goats.

              Comment


              • #97
                Then once the goat is roasted we can divide and conquer it harrrrrrrrrrrrr
                <p style="font-size:1024px">HTML is disabled in signatures </p>

                Comment


                • #98
                  poor goat
                  To us, it is the BEAST.

                  Comment


                  • #99
                    But tasty. :yum:
                    Try http://wordforge.net/index.php for discussion and debate.

                    Comment


                    • Originally posted by Braindead View Post
                      Bloody useless. They should be teaching you useful stuff. How to shoot and roast goats.
                      ****ing liberals here hate guns
                      If there is no sound in space, how come you can hear the lasers?
                      ){ :|:& };:

                      Comment


                      • Kill the goat with some sort of indigenous weapon and say it's part of an independent study in anthropology

                        Vegan: It's barbaric that you're killing and eating a goat.
                        HC: This is part of an independent study in anthropology - Are you saying that indigenous cultures are barbaric???
                        Vegan: I am slain.
                        <p style="font-size:1024px">HTML is disabled in signatures </p>

                        Comment


                        • If there is no sound in space, how come you can hear the lasers?
                          ){ :|:& };:

                          Comment


                          • Originally posted by Hauldren Collider View Post
                            OK, that took longer than it should have because I took a break to eat, but here's my solution:

                            Code:
                              1 #simple circular prime solver
                              2 def eratosthenes(max):
                              3     nums = []
                              4     primes = []
                              5     for n in range(0, max):
                              6         nums.append([n, 0])
                              7     #edge cases
                              8     nums[0][1] = -1
                              9     nums[1][1] = -1
                             10     #the sieve
                             11     for n in range(2, max):
                             12         if nums[n][1]: #status has been assigned
                             13             continue
                             14         for m in range(n, max, n):
                             15             nums[m][1] = -1
                             16         nums[n][1] = 1
                             17         primes.append(n)
                             18     return (nums, primes)
                             19
                             20 def circulate(x, nums):
                             21     #make a list of the digits
                             22     y = list(str(x))
                             23     for n in range(0, len(y)-1):
                             24         #rotate digits
                             25         y.insert(0,y.pop())
                             26         #convert back to int
                             27         z = int("".join(y))
                             28         if(nums[z][1] != 1):
                             29             return False
                             30     return True
                             31
                             32 (nums, primes) = eratosthenes(1000000)
                             33 t=0
                             34 a=[]
                             35 for p in primes:
                             36     if circulate(p, nums):
                             37         a.append(p)
                             38         t+=1
                             39 print "Number of circular primes: " + str(t)
                             40 print "Primes: " + str(a)
                             41
                            And the result:



                            Did I get it right, loinburger?
                            Super cool

                            Comment


                            • Originally posted by loinburger View Post
                              Kill the goat with some sort of indigenous weapon and say it's part of an independent study in anthropology

                              Vegan: It's barbaric that you're killing and eating a goat.
                              HC: This is part of an independent study in anthropology - Are you saying that indigenous cultures are barbaric???
                              Vegan: I am slain.
                              I am currently taking a cultural anthropology class.

                              I have decided that anthropology has to be the worst and most evil ****ing field in the whole world because it is the only one where providing basic technology like clean water to the most desperately poor people on the planet is considered a breach of ethics.

                              Comment


                              • Incidentally, algorithms like RSA use extremely large prime numbers (usually 1024 bits, 2048 bits, or 4096 bits), and it's not practical to use a deterministic method to determine whether numbers of that magnitude are prime (even if you're using the sieve of Eratosthenes, which has a big-oh of n^(1/2), this still means that your run time for a 1024 bit prime will be around 2^512). Instead, probabilistic primality tests are used, such as Miller-Rabin or Solovay-Strassen. When determining if a number is prime, these tests will never return a false negative, but have a 25% or 50% chance (depending on the test) of returning a false positive. You just keep repeating the test until you're reasonably certain that you've got a prime, e.g. if you want a 2^-256 chance of having a composite then you repeat the test 128 times (if the test has a 25% chance of a false positive) or 256 times (if the test has a 50% chance of a false positive). There are other mathematical tricks that will speed this up, but that's outside of my area of expertise.
                                <p style="font-size:1024px">HTML is disabled in signatures </p>

                                Comment

                                Working...
                                X