Search Results

Search found 11 results on 1 pages for 'riddles'.

Page 1/1 | 1 

  • Frequently Asked Riddles in Job Interviews

    - by Faruz
    Were you asked any logic riddles in job interviews? Are you usually asking riddles in job interviews? What are they, and what are the answers? I was asked once how can you divide evenly 5 apples to 6 people without dividing any apple to 1/6 (or 1/12 or 1/18 etc.). (Would love to hear answers in the comments, I'm not sure my answer was the best)

    Read the article

  • Riddle: Spot the serious bug in this bubble sort implementation

    - by ripper234
    (No, this isn't a homework assignment, I just found the bug and thought it might be useful to share it here) import java.util.List; public class BubbleSorter { public <T extends Comparable<T>> void sort(List<T> list) { while (true) { boolean didWork = false; for (int i = 0; i < list.size() - 1; ++i) { if (list.get(i).compareTo(list.get(i + 1)) > 0) { swap(list, i, i + 1); didWork = true; break; } } if (!didWork) return; } } private static <T> void swap(List<T> list, int i, int j) { T tmp = list.get(i); list.set(i, list.get(j)); list.set(j, tmp); } }

    Read the article

  • Encrypt text using a number

    - by Adam Matan
    Project Euler I have recently begun to solve some of the Project Euler riddles. I found the discussion forum in the site a bit frustrating (most of the discussions are closed and poorly-threaded), So I have decided to publish my Python solutions on launchpad for discussion. The problem is that it seems quite unethical to publish these solutions, as it would let other people gain reputation without doing the programming work, which the site deeply discourages. My Encryption problem I want to encrypt my answers so that only those who have already solved the riddles can see my code. The logical key would be the answer to the riddle, which is always numeric. In order to prevent brute-force attacks on my answers, I want to find an encryption algorithm that takes a significantly long time (few seconds) to run. Do you know any such algorithm? I would fancy a Python package, which I can attach to the code, over an external program that might have portability issues. Thanks, Adam

    Read the article

  • Is there an Unobtrusive Captcha for web forms?

    - by KP
    What is the best unobtrusive CAPTCHA for web forms? One that does not involve a UI, rather a non-UI Turing test. I have seen a simple example of a non UI CAPTCHA like the Nobot control from Microsoft. I am looking for a CAPTCHA that does not ask the user any question in any form. No riddles, no what's in this image.

    Read the article

  • Game Review: Monument Valley

    Once again, it was a tweet that caught my attention... and the official description on the Play Store sounds good, too. "In Monument Valley you will manipulate impossible architecture and guide a silent princess through a stunningly beautiful world. Monument Valley is a surreal exploration through fantastical architecture and impossible geometry. Guide the silent princess Ida through mysterious monuments, uncovering hidden paths, unfolding optical illusions and outsmarting the enigmatic Crow People." So, let's check it out. What an interesting puzzle game Once again, I left some review on the Play Store: "Beautiful but short distraction Woohoo, what a great story behind the game. Using optical illusions and impossible geometries in this fantastic adventure of the silent princess just puts all the pieces perfectly together. Walking the amazing paths in the various levels and solving the riddles gives some decent hours of distraction but in the end you might have the urge to do more..." I can't remember exactly when and who tweeted about the game but honestly it caught my attention based on the simplicity of the design and the aspect that it seems to be an isometric design. The game relies heavily on optical illusions in order to guide to the silent princess Ida through her illusory adventure of impossible architecture and forgiveness. The game is set like a clockwork and you are turning, flipping and switching elements on the paths between the doors. Unfortunately, there aren't many levels and the game play lasted only some hours. Maybe there are more astonishing looking realms and interesting gimmicks in future versions. Play Store: Monument Valley Also, check out the latest game updates on the official web site of ustwo BTW, the game is also available on the Apple App Store and on Amazon Store for the Kindle Fire.

    Read the article

  • Three coworkers Riddle Problem

    - by John S
    This isn't homework, I've got a solution, however it doesn't protect against cheaters. Three coworkers would like to know their average salary. However, they are self-conscious and don't want to tell each other their own salaries, for fear of either being ridiculed or getting their houses robbed. How can they find their average salary, without disclosing their own salaries? Now, a solution that requires the last person to tell the group the sum isn't allowed because that person could cheat. Solution: http://karavi.wordpress.com/2009/12/18/solutions-to-wu%E2%80%99s-puzzles-and-riddles-ghetto-encryption-2-medium/

    Read the article

  • Mathemagics - 3 consecutive number

    - by PointsToShare
    © 2011 By: Dov Trietsch. All rights reserved Three Consecutive numbers When I was young and handsome (OK, OK, just young), my father used to challenge us with riddles and tricks involving Logic, Math and general knowledge. Most of the time, at least after reaching the ripe age of 10, I would see thru his tricks in no time. This one is a bit more subtle. I had to think about it for close to an hour and then when I had the ‘AHA!’ effect, I could not understand why it had taken me so long. So here it is. You select a volunteer from the audience (or a shill, but that would be cheating!) and ask him to select three consecutive numbers, all of them 1 or 2 digits. So {1, 2, 3} would be good, albeit trivial set, as would {8, 9, 10} or {97, 98, 99} but not {99, 99, 100} (why?!). Now, using a calculator – and these days almost every phone has a built in calculator – he is to perform these steps: 1.      Select a single digit 2.      Multiply it by 3 and write it down 3.      Add the 3 consecutive numbers 4.      Add the number from step 2 5.      Multiply the sum by 67 6.      Now tell me the last 2 digits of the result and also the number you wrote down in step 2 I will tell you which numbers you selected. How do I do this? I’ll give you the mechanical answer, but because I like you to have the pleasure of an ‘AHA!’ effect, I will not really explain the ‘why’. So let’s you selected 30, 31, and 32 and also that your 3 multiple was 24, so here is what you get 30 + 31 + 32 = 93 93 + 24 = 117 117 x 67 = 7839, last 2 digits are 39, so you say “the last 2 digits are 39, and the other number is 24.” Now, I divide 24 by 3 getting 8. I subtract 8 from 39 and get 31. I then subtract 1 from this getting 30, and say: “You selected 30, 31, and 32.” This is the ‘how’. I leave the ‘why’ to you! That’s all folks! PS do you really want to know why? Post a feedback below. When 11 people or more will have asked for it, I’ll add a link to the full explanation.

    Read the article

  • correct file permissions for trac and git user to access gitolite server repos

    - by klemens
    hi, sounds like a stupid questions (to me), but i couldn't find any info. on my server i host some git repositories via gitolite, and have a trac for every repository. i have a user called git to push/pull from server (git clone git@server:repo). and trac is a apache vhost with mod_wsgi. this runs with the www-data user. so what riddles me (maybe because I have not much of a clue about file-permissions at all) is whats the best permissions setup (chown, chmod) for the git repositories (/home/git/repositories/...). www-data (or trac) needs to at least read permissions (i think). and git (or gitolite) needs obviously read/write permissions to push changesets. i tried a little bit around (i.e. adding www-data and/or git to the www-data/git group), but didn't got it right. at least one of the two don't work (git or trac). any suggestions are highly appreciated. regard, klemens

    Read the article

  • Geocaching - World wide treasure hunt

    I'm not quite sure how I came across this topic but actually I find it absolutely interesting, challenging and most of all a great fun for the family and friends. The interesting part is for sure that you can follow other peoples treasures and their preferred locations where a cache might be hidden. Of course, it wont be easy to find a cache after all. Sometimes there are even 'mystery caches' which have either riddles, further instructions or little brain games for you in order to find the actual cache - that's the challenge. And last but not least, those caches are hidden outdoor. A great experience to explore nature either on your own, or your family especially with children, or as a treasure hunting pack with a couple of friends. What is geocaching? It's a high-tech outdoor treasure hunting game that's a great way to explore the world with friends, family or on your own. Participants use GPS-enabled devices to locate hidden containers called geocaches. There are over one million geocaches hidden around the world today, waiting for you to find them. Visit Geocaching.com to search for geocaches near you.(Source: Referral Email of geocaching.com) Checkout the Geocaching 101 for further details and information. They also provide a video channel on YouTube. Which equipment do I need? Any GPS-enabled device is sufficient to go onto the hunt. I'm going to start our geocaching experience equipped with my Samsung Galaxy Tab. Additionally, I installed a geocaching.com client called c:geo that hopefully assists me soon. Combined with a map app like Google Maps and a nice Compass app you should be fully equipped and ready to go. I guess, that even a car navigation system is perfect for that task. Later on, with more experience and demand for technology (or precision) it might be interesting to opt-in for a pure GPS device, like a Garmin or any other brand on the market. {loadposition content_adsense} What is a geocache and what does it contain? In its simplest form, a cache always contains a logbook or logsheet for you to log your find. Larger caches may contain a logbook and any number of items. These items turn the adventure into a true treasure hunt. You never know what the cache owner or visitors to the cache may have left for you to enjoy. Remember, if you take something, leave something of equal or greater value in return. It is recommended that items in a cache be individually packaged in a clear, zipped plastic bag to protect them from the elements. Finding your first geocache Well, first you have to have interest to pick up the challenge. Then you have to check out the Geocache directory on geocaching.com. They have recommendations for beginner's caches but you are free to choose any. Actually, we have a Mystery Cache very close to our base, and I guess that we are going for that one on our first trip. Anyway, there is a very informative guide on the website which should answer all your questions about starting your new outdoor adventure. For sure, it's going to be rewarding. Team up with friends and family Especially as a beginner there might be misunderstandings in handling the GPS coordinates, the compass, or the map, and even finding the container at the documented position isn't easy in the first place. Luckily, there are logbook reports online from other hunters, and most of the time there are even 'spoiler' images available. But also bear in mind, that a geocache might have been removed or is lost due to unconscious people or whatever other reasons. Don't be disappointed in case that you can't find anything... There be nothing anymore. A general recommendation in this case would be to replace the missing container with a new one, and give feedback to the original owner about the state of that particular location. After all, it's about fun and active participation in a world-wide community. Geocaches in Mauritius? Yes, there are currently about 45 geocaches spread all over the island, and even a single in Rodriguez - that's gonna be a tough one. Hopefully, we will get increasing numbers as Geocaching.com allows, no better, even encourages you to hide new containers at your locations of choice. I think this is going to be real fun for us during the upcoming weeks and months. Especially, when we are travelling to other countries and transfer so-called trackable items between geocaches. On my first impression, Geocaching.com seems to be very mature, open and community-oriented. There are literally hundreds of thousands geocache 'hunters' all over the world. And usually finding a container remote from your home is very rewarding. I'll keep you updated in these matters during the next months to come...

    Read the article

  • What Counts for A DBA - Logic

    - by drsql
    "There are 10 kinds of people in the world. Those who will always wonder why there are only two items in my list and those who will figured it out the first time they saw this very old joke."  Those readers who will give up immediately and get frustrated with me for not explaining it to them are not likely going to be great technical professionals of any sort, much less a programmer or administrator who will be constantly dealing with the common failures that make up a DBA's day.  Many of these people will stare at this like a dog staring at a traffic signal and still have no more idea of how to decipher the riddle. Without explanation they will give up, call the joke "stupid" and, feeling quite superior, walk away indignantly to their job likely flipping patties of meat-by-product. As a data professional or any programmer who has strayed  to this very data-oriented blog, you would, if you are worth your weight in air, either have recognized immediately what was going on, or felt a bit ignorant.  Your friends are chuckling over the joke, but why is it funny? Unfortunately you left your smartphone at home on the dresser because you were up late last night programming and were running late to work (again), so you will either have to fake a laugh or figure it out.  Digging through the joke, you figure out that the word "two" is the most important part, since initially the joke mentioned 10. Hmm, why did they spell out two, but not ten? Maybe 10 could be interpreted a different way?  As a DBA, this sort of logic comes into play every day, and sometimes it doesn't involve nerdy riddles or Star Wars folklore.  When you turn on your computer and get the dreaded blue screen of death, you don't immediately cry to the help desk and sit on your thumbs and whine about not being able to work. Do that and your co-workers will question your nerd-hood; I know I certainly would. You figure out the problem, and when you have it narrowed down, you call the help desk and tell them what the problem is, usually having to explain that yes, you did in fact try to reboot before calling.  Of course, sometimes humility does come in to play when you reach the end of your abilities, but the ‘end of abilities’ is not something any of us recognize readily. It is handy to have the ability to use logic to solve uncommon problems: It becomes especially useful when you are trying to solve a data-related problem such as a query performance issue, and the way that you approach things will tell your coworkers a great deal about your abilities.  The novice is likely to immediately take the approach of  trying to add more indexes or blaming the hardware. As you become more and more experienced, it becomes increasingly obvious that performance issues are a very complex topic. A query may be slow for a myriad of reasons, from concurrency issues, a poor query plan because of a parameter value (like parameter sniffing,) poor coding standards, or just because it is a complex query that is going to be slow sometimes. Some queries that you will deal with may have twenty joins and hundreds of search criteria, and it can take a lot of thought to determine what is going on.  You can usually figure out the problem to almost any query by using basic knowledge of how joins and queries work, together with the help of such things as the query plan, profiler or monitoring tools.  It is not unlikely that it can take a full day’s work to understand some queries, breaking them down into smaller queries to find a very tiny problem. Not every time will you actually find the problem, and it is part of the process to occasionally admit that the problem is random, and everything works fine now.  Sometimes, it is necessary to realize that a problem is outside of your current knowledge, and admit temporary defeat: You can, at least, narrow down the source of the problem by looking logically at all of the possible solutions. By doing this, you can satisfy your curiosity and learn more about what the actual problem was. For example, in the joke, had you never been exposed to the concept of binary numbers, there is no way you could have known that binary - 10 = decimal - 2, but you could have logically come to the conclusion that 10 must not mean ten in the context of the joke, and at that point you are that much closer to getting the joke and at least won't feel so ignorant.

    Read the article

1