Search Results

Search found 1544 results on 62 pages for 'oh boy'.

Page 2/62 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Indian school boy never misses a class for 14 years. Applies for Gunnies Records

    - by Gopinath
    If you ask the question “What is the most fun activity?” to school or college kids, most of the kids would say “bunking classes”. Many of us are grown up bunking classes in the name of stomachache, relatives marriage, high fever, rain or some other reason. Here is a wonder kid who is an exception of regular school kids. Mohammed Omar, a 17 year Indian school boy, never skipped his classes for the past 14 years. His attendance records shows 100% for all the 14 years of school he attended so far and it’s an unbelievable track record. Omar lives in Kanpur, a suburban in Uttar Pradesh with parents and a younger brother. He attended school even when the area where he lives was once flooded, had high temperature. When flooded and motor vehicles were not able to run on the streets he loaned a bicycle from neighbors. When he was on high temperature he just popped a tablet and headed towards the school.  Whatever may be the adverse situation, he just found a way to attend school instead of bunking. He recently applied for Guinness Book of World Records. The determination of the boy is incredible and inspiration to many young. I  wish to see this guy soon flashing on TV Channels with Guinness World Records certificates on his hands. Source: NDTV, creative common image: flickr/seeveeaar

    Read the article

  • Big Oh Notation - formal definition.

    - by aloh
    I'm reading a textbook right now for my Java III class. We're reading about Big-Oh and I'm a little confused by its formal definition. Formal Definition: "A function f(n) is of order at most g(n) - that is, f(n) = O(g(n)) - if a positive real number c and positive integer N exist such that f(n) <= c g(n) for all n = N. That is, c g(n) is an upper bound on f(n) when n is sufficiently large." Ok, that makes sense. But hold on, keep reading...the book gave me this example: "In segment 9.14, we said that an algorithm that uses 5n + 3 operations is O(n). We now can show that 5n + 3 = O(n) by using the formal definition of Big Oh. When n = 3, 5n + 3 <= 5n + n = 6n. Thus, if we let f(n) = 5n + 3, g(n) = n, c = 6, N = 3, we have shown that f(n) <= 6 g(n) for n = 3, or 5n + 3 = O(n). That is, if an algorithm requires time directly proportional to 5n + 3, it is O(n)." Ok, this kind of makes sense to me. They're saying that if n = 3 or greater, 5n + 3 takes less time than if n was less than 3 - thus 5n + n = 6n - right? Makes sense, since if n was 2, 5n + 3 = 13 while 6n = 12 but when n is 3 or greater 5n + 3 will always be less than or equal to 6n. Here's where I get confused. They give me another example: Example 2: "Let's show that 4n^2 + 50n - 10 = O(n^2). It is easy to see that: 4n^2 + 50n - 10 <= 4n^2 + 50n for any n. Since 50n <= 50n^2 for n = 50, 4n^2 + 50n - 10 <= 4n^2 + 50n^2 = 54n^2 for n = 50. Thus, with c = 54 and N = 50, we have shown that 4n^2 + 50n - 10 = O(n^2)." This statement doesn't make sense: 50n <= 50n^2 for n = 50. Isn't any n going to make the 50n less than 50n^2? Not just greater than or equal to 50? Why did they even mention that 50n <= 50n^2? What does that have to do with the problem? Also, 4n^2 + 50n - 10 <= 4n^2 + 50n^2 = 54n^2 for n = 50 is going to be true no matter what n is. And how in the world does picking numbers show that f(n) = O(g(n))? Please help me understand! :(

    Read the article

  • C# WMI, Performance Counters, & SNMP Oh My!

    - by Keith
    I have a C# windows service which listens to a MSMQ and sends each message out as an email. Since there's no UI, I'd like to offer an ability to monitor this service to see things such as # messages in queue, # emails sent (by message type perhaps), # of errors, etc. What is the best/recommended way to accomplish this? Is it WMI or performance counters? Is this data viewed using PerfMon or WMI CIM Studio? Does any approach allow one to monitor the service real-time as well as providing historical analysis? I can dig into the details myself but would appreciate some broad guidance to help demystify this subject.

    Read the article

  • RegEx, Php, Preg_match, Phone numbers, Oh my!

    - by Kirk
    How do I find phone number of the following format and store them to a variable. It needs to match 3334445555, 333.444.5555, 333-444-5555, 333 444 5555, (333) 444 5555 and all combinations thereof. Here is the frame of it $regex = expression; if (preg_match ('/$regex/', matches)) { $phone = matches[1]; }

    Read the article

  • EAGLContext, EAGLSharegroups, RenderBuffers, FrameBuffers, oh my!

    - by quixoto
    Hi all, I'm trying to wrap my head around the OpenGL object model on iPhone OS. I'm currently rendering into a few different UIViews (build on CAEAGLayers) on the screen. I currently have each of these as using separate EAGLContext, each of which has a color renderbuffer and a framebuffer. I'm rendering similar things in them, and I'd like to share textures between these instances to save memory overhead. My current understanding is that I could use the same setup (some number of contexts, each with a FBO/RBO) but if I spawn the later ones using the EAGLShareGroup of the first one, then I can simply use the texture names (GLuints) from the first one in the later ones. Is this accurate? If this is the case, I guess the followup question is: what's the benefit to having it be a "sharegroup"? Could I just reuse the same context, and attach multiple FBOs/RBOs to that context? I think I'm struggling with the abstraction layer of a sharegroup, which seems to share "objects" (textures and other named things) but not "state" (matrices, enabled/disabled states) which are owned by the context. What's the best way to think of this? Thanks for any enlightenment!

    Read the article

  • analysis Big Oh notation psuedocode

    - by tesshu
    I'm having trouble getting my head around algorithm analysis. I seem to be okay identifying linear or squared algorithms but am totally lost with nlogn or logn algorithms, these seem to stem mainly from while loops? Heres an example I was looking at: Algorithm Calculate(A,n) Input: Array A of size n t?0 for i?0 to n-1 do if A[i] is an odd number then Q.enqueue(A[i]) else while Q is not empty do t?t+Q.dequeue() while Q is not empty do t?t+Q.dequeue() return t My best guess is the for loop is executed n times, its nested while loop q times making NQ and the final while loop also Q times resulting in O(NQ +Q) which is linear? I am probably totally wrong. Any help would be much appreciated. thanks

    Read the article

  • uh-oh windows mobile threading issues!

    - by violet313
    specifically WM6x, winCE5x Now my current understanding from trawling the msdn etal is that the IMAPIAdviseSink::OnNotify callback can be made from any old thread; from (ce)mapi or perhaps even from a third-party service provider. Under WM6x, i cannot seem to coax an in-thread response by invoking HrThisThreadAdviseSink, since while this function is declared in mapiutil.h, a definition appears not to exist (in cemapi.lib or wherever??) ~But i notice that all the OnNotify callbacks i get, derive from windows messages that i am receiving on my thread (=looks to me like an in-thread implementation in any case under cemapi)... So, can anyone confirm that this is infact always the case -or am i just getting lucky right now? ah, i should add that my advise source is IMAPISession::Advise (ActiveSync) erm i should also say that i might have cross-posted this on the msdn forum -but they're mostly numptys over there,,

    Read the article

  • JPanels, JFrames, and Windows, Oh my!

    - by Jonathan
    Simply stated, I am trying to make a game I am working on full-screen. I have the following code I am trying to use: GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice gs = ge.getDefaultScreenDevice(); if(!gs.isFullScreenSupported()) { System.out.println("full-screen not supported"); } Frame frame = new Frame(gs.getDefaultConfiguration()); Window win = new Window(frame); try { // Enter full-screen mode gs.setFullScreenWindow(win); win.validate(); } Problem with this is that I am working within a class that extends JPanel, and while I have a variable of type Frame, I have none of type Window within the class. My understanding of JPanel is that it is a Window of sorts, but I cannot pass 'this' into gs.setFullScreenWindow(Window win)... How should I go about doing this? Is there any easy way of calling that, or a similar method, using a JPanel? Is there a way I can get something of type Window from my JPanel? - EDIT: The following method changes the state of JFrame and is called every 10ms: public void paintScreen() { Graphics g; try{ g = this.getGraphics(); //get Panel's graphic context if(g == null) { frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setExtendedState(frame.getExtendedState()|JFrame.MAXIMIZED_BOTH); frame.add(this); frame.pack(); frame.setResizable(false); frame.setTitle("Game Window"); frame.setVisible(true); } if((g != null) && (dbImage != null)) { g.drawImage(dbImage, 0, 0, null); } Toolkit.getDefaultToolkit().sync(); //sync the display on some systems g.dispose(); } catch (Exception e) { if(blockError) { blockError = false; } else { System.out.println("Graphics context error: " + e); } } } I anticipate that there may be a few redundancies or unnecessary calls after the if(g==null) statement (all the frame.somethingOrOther()s), any cleanup advice would be appreciated... Also, the block error is what it seems. I am ignoring an error. The error only occurs once, and this works fine when setup to ignore the first instance of the error... For anyone interested I can post additional info there if anyone wants to see if that block can be removed, but i'm not concerned... I might look into it later.

    Read the article

  • Oh no, Not another Undefined Reference Question!

    - by roony
    Unfortunately yes. I have my shared library compiled, the linker doesn't complain about not finding it but still I get undefined reference error. Thinking that I might be doing something wrong I did a little research and found this nice, simple walkthrough: http://www.adp-gmbh.ch/cpp/gcc/create_lib.html which I've followed to the letter but still I get: $ gcc -Wall main.c -o dynamically_linked -L.\ -lmean /tmp/ccZjkkkl.o: In function `main': main.c:(.text+0x42): undefined reference to `mean' collect2: ld returned 1 exit status This is pretty simple stuff so what's going wrong?!?!? Can anyone suggest something in my set up that might need checking/tweeking? GCC 4.3.2 Fedora 10 64-bit

    Read the article

  • mysql_real_escape_string & slashes (again, oh yes)

    - by Fizzadar
    Righto, firstly magic quotes & runtime are disabled correctly in php.ini, and confirmed by phpinfo(). PHP version: 5.3.4 MySQL version: 5.1.52 I'm only use mysql_real_escape_string on the data, after htmlspecialchars and a trim, that's all the data cleaning on the variable. Yet, when I submit a single quote, the slash remains in the database. When running mysql_query I'm using "' . $var . '", although in the past this hasn't changed anything (could be due to the double quotes?). Any ideas? and please don't tell me about PDO/prepared statements, I'm aware of them and I have my reasons for doing it this way. Thanks!

    Read the article

  • Zsh super slow inside my Git repo

    - by Jason Swett
    My Zsh is super slow inside a certain Git repo of mine. When I Google "zsh git slow", I get a bunch of results about Git autocompletion being slow, but autocompletion isn't necessarily my problem; it's everything. I tried removing all plugins and that, strangely, didn't do anything at all when I opened a new shell. Zsh would still do Git stuff inside my Git repo. I found this snippet on this page: function git_prompt_info() { ref=$(git symbolic-ref HEAD 2> /dev/null) || return echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$ZSH_THEME_GIT_PROMPT_SUFFIX" } That made everything fast again, but it also gave me a prompt that looks like this: ? snip git:(master Note the missing right parenthesis. That's kind of lame. Plus the whole thing just seems like a hack I shouldn't have to do. There's also this promising-looking SU question, but the links on the accepted answer are dead. How can I get my Zsh not to be slow inside a Git repo?

    Read the article

  • Google Maps Developers Live: Ships, Polylines, Symbols, Oh My!

    Google Maps Developers Live: Ships, Polylines, Symbols, Oh My! For the second part of our "A Journey of 245k Points" series, Paul shows some cool tricks for making stunning map visualizations of numerous ship voyages using polylines, making polylines interactive, and animating voyages with symbols. Data Source: CLIWOC (Climatological Database for the World's Oceans, 1750-1850): www.ucm.es From: GoogleDevelopers Views: 0 0 ratings Time: 30:00 More in Education

    Read the article

  • How to prepare for a programming competition? Graphs, Stacks, Trees, oh my! [closed]

    - by Simucal
    Last semester I attended ACM's (Association for Computing Machinery) bi-annual programming competition at a local University. My University sent 2 teams of 3 people and we competed amongst other schools in the mid-west. We got our butts kicked. You are given a packet with about 11 problems (1 problem per page) and you have 4 hours to solve as many as you can. They'll run your program you submit against a set of data and your output must match theirs exactly. In fact, the judging is automated for the most part. In any case.. I went there fairly confident in my programming skills and I left there feeling drained and weak. It was a terribly humbling experience. In 4 hours my team of 3 people completed only one of the problems. The top team completed 4 of them and took 1st place. The problems they asked were like no problems I have ever had to answer before. I later learned that in order to solve them some of them effectively you have to use graphs/graph algorithms, trees, stacks. Some of them were simply "greedy" algo's. My question is, how can I better prepare for this semesters programming competition so I don't leave there feeling like a complete moron? What tips do you have for me to be able to answer these problems that involve graphs, trees, various "well known" algorithms? How can I easily identify the algorithm we should implement for a given problem? I have yet to take Algorithm Design in school so I just feel a little out of my element. Here are some examples of the questions asked at the competitions: ACM Problem Sets Update: Just wanted to update this since the latest competition is over. My team placed 1st for our small region (about 6-7 universities with between 1-5 teams each school) and ~15th for the midwest! So, it is a marked improvement over last years performance for sure. We also had no graduate students on our team and after reviewing the rules we found out that many teams had several! So, that would be a pretty big advantage in my own opinion. Problems this semester ranged from about 1-2 "easy" problems (ie bit manipulation, string manipulation) to hard (graph problems involving fairly complex math and network flow problems). We were able to solve 4 problems in our 5 hours. Just wanted to thank everyone for the resources they provided here, we used them for our weekly team practices and it definitely helped! Some quick tips that I have that aren't suggested below: When you are seated at your computer before the competition starts, quickly type out various data structures that you might need that you won't have access to in your languages libraries. I typed out a Graph data-structure complete with floyd-warshall and dijkstra's algorithm before the competition began. We ended up using it in our 2nd problem that we solved and this is the main reason why we solved this problem before anyone else in the midwest. We had it ready to go from the beginning. Similarly, type out the code to read in a file since this will be required for every problem. Save this answer "template" someplace so you can quickly copy/paste it to your IDE at the beginning of each problem. There are no rules on programming anything before the competition starts so get any boilerplate code out the way. We found it useful to have one person who is on permanent whiteboard duty. This is usually the person who is best at math and at working out solutions to get a head start on future problems you will be doing. One person is on permanent programming duty. Your fastest/most skilled "programmer" (most familiar with the language). This will save debugging time also. The last person has several roles between assessing the packet of problems for the next "easiest" problem, helping the person on the whiteboard work out solutions and helping the person programming work out bugs/issues. This person needs to be flexible and be able to switch between roles easily.

    Read the article

  • UppercuT v1.0 and 1.1&ndash;Linux (Mono), Multi-targeting, SemVer, Nitriq and Obfuscation, oh my!

    - by Robz / Fervent Coder
    Recently UppercuT (UC) quietly released version 1 (in August). I’m pretty happy with where we are, although I think it’s a few months later than I originally planned. I’m glad I held it back, it gave me some more time to think about some things a little more and also the opportunity to receive a patch for running builds with UC on Linux. We also released v1.1 very recently (December). UppercuT v1 Builds On Linux Perhaps the most significant changes to UC going v1 is that it now supports builds on Linux using Mono! This is thanks mostly to Svein Ackenhausen for the patches and working with me on getting it all working while not breaking the windows builds!  This means you can use mono on Windows or Linux. Notice the shell files to execute with Linux that come as part of UC now. Multi-Targeting Perhaps one of the hardest things to do that requires an automated build is multi-targeting. At v1 this is early, and possibly prone to some issues, but available.  We believe in making everything stupid simple, so it’s as simple as adding a comma to the microsoft.framework property. i.e. “net-3.5, net-4.0” to suddenly produce both framework builds. When you build, this is what you get (if you meet each framework’s requirements): At this time you have to let UC override the build location (as it does by default) or this will not work.  Semantic Versioning By now many of you have been using UppercuT for awhile and have watched how we have done versioning. Many of you who use git already know we put the revision hash in the informational/product version as the last octet. At v1, UppercuT has adopted the semantic versioning scheme. What does that mean? This is a short read, but a good one: http://SemVer.org SemVer (Semantic Versioning) is really using versioning what it was meant for. You have three octets. Major.Minor.Patch as in 1.1.0.  UC will use three different versioning concepts, one for the assembly version, one for the file version, and one for the product version. All versions - The first three octects of the version are owned by SemVer. Major.Minor.Patch i.e.: 1.1.0 Assembly Version - The assembly version would much closer follow SemVer. Last digit is always 0. Major.Minor.Patch.0 i.e: 1.1.0.0 File Version - The file version occupies the build number as the last digit. Major.Minor.Patch.Build i.e.: 1.1.0.2650 Product/Informational Version - The last octect of your product/informational version is the source control revision/hash. Major.Minor.Patch.RevisionOrHash i.e. (TFS/SVN): 1.1.0.235 i.e. (Git/HG): 1.1.0.a45ace4346adef0 SemVer is not on by default, the passive versioning scheme is still in effect. Notice that version.use_semanticversioning has been added to the UppercuT.config file (and version.patch in support of the third octet): Gems Support Gems support was added at v1. This will probably be deprecated as some point once there is an announced sunset for Nu v1. Application gems may keep it around since there is no alternative for that yet though (CoApp would be a possible replacement). Nitriq Support Nitriq is a code analysis tool like NDepend. It’s built by Mr. Jon von Gillern. It uses LINQ query language, so you can use a familiar idiom when analyzing your code base. It’s a pretty awesome tool that has a free version for those looking to do code analysis! To use Nitriq with UC, you are going to need the console edition.  To take advantage of Nitriq, you just need to update the location of Nitriq in the config: Then add the nitriq project files at the root of your source. Please refer to the Nitriq documentation on how these are created. UppercuT v1.1 Obfuscation One thing I started looking into was an easy way to obfuscate my code. I came across EazFuscator, which is both free and awesome. Plus the GUI for it is super simple to use. How do you make obfuscation even easier? Make it a convention and a configurable property in the UC config file! And the code gets obfuscated! Closing Definitely get out and look at the new release. It contains lots of chocolaty (sp?) goodness. And remember, the upgrade path is almost as simple as drag and drop!

    Read the article

  • Oh no! My padding's invalid!

    - by Simon Cooper
    Recently, I've been doing some work involving cryptography, and encountered the standard .NET CryptographicException: 'Padding is invalid and cannot be removed.' Searching on StackOverflow produces 57 questions concerning this exception; it's a very common problem encountered. So I decided to have a closer look. To test this, I created a simple project that decrypts and encrypts a byte array: // create some random data byte[] data = new byte[100]; new Random().NextBytes(data); // use the Rijndael symmetric algorithm RijndaelManaged rij = new RijndaelManaged(); byte[] encrypted; // encrypt the data using a CryptoStream using (var encryptor = rij.CreateEncryptor()) using (MemoryStream encryptedStream = new MemoryStream()) using (CryptoStream crypto = new CryptoStream( encryptedStream, encryptor, CryptoStreamMode.Write)) { crypto.Write(data, 0, data.Length); encrypted = encryptedStream.ToArray(); } byte[] decrypted; // and decrypt it again using (var decryptor = rij.CreateDecryptor()) using (CryptoStream crypto = new CryptoStream( new MemoryStream(encrypted), decryptor, CryptoStreamMode.Read)) { byte[] decrypted = new byte[data.Length]; crypto.Read(decrypted, 0, decrypted.Length); } Sure enough, I got exactly the same CryptographicException when trying to decrypt the data even in this simple example. Well, I'm obviously missing something, if I can't even get this single method right! What does the exception message actually mean? What am I missing? Well, after playing around a bit, I discovered the problem was fixed by changing the encryption step to this: // encrypt the data using a CryptoStream using (var encryptor = rij.CreateEncryptor()) using (MemoryStream encryptedStream = new MemoryStream()) { using (CryptoStream crypto = new CryptoStream( encryptedStream, encryptor, CryptoStreamMode.Write)) { crypto.Write(data, 0, data.Length); } encrypted = encryptedStream.ToArray(); } Aaaah, so that's what the problem was. The CryptoStream wasn't flushing all it's data to the MemoryStream before it was being read, and closing the stream causes it to flush everything to the backing stream. But why does this cause an error in padding? Cryptographic padding All symmetric encryption algorithms (of which Rijndael is one) operates on fixed block sizes. For Rijndael, the default block size is 16 bytes. This means the input needs to be a multiple of 16 bytes long. If it isn't, then the input is padded to 16 bytes using one of the padding modes. This is only done to the final block of data to be encrypted. CryptoStream has a special method to flush this final block of data - FlushFinalBlock. Calling Stream.Flush() does not flush the final block, as you might expect. Only by closing the stream or explicitly calling FlushFinalBlock is the final block, with any padding, encrypted and written to the backing stream. Without this call, the encrypted data is 16 bytes shorter than it should be. If this final block wasn't written, then the decryption gets to the final 16 bytes of the encrypted data and tries to decrypt it as the final block with padding. The end bytes don't match the padding scheme it's been told to use, therefore it throws an exception stating what is wrong - what the decryptor expects to be padding actually isn't, and so can't be removed from the stream. So, as well as closing the stream before reading the result, an alternative fix to my encryption code is the following: // encrypt the data using a CryptoStream using (var encryptor = rij.CreateEncryptor()) using (MemoryStream encryptedStream = new MemoryStream()) using (CryptoStream crypto = new CryptoStream( encryptedStream, encryptor, CryptoStreamMode.Write)) { crypto.Write(data, 0, data.Length); // explicitly flush the final block of data crypto.FlushFinalBlock(); encrypted = encryptedStream.ToArray(); } Conclusion So, if your padding is invalid, make sure that you close or call FlushFinalBlock on any CryptoStream performing encryption before you access the encrypted data. Flush isn't enough. Only then will the final block be present in the encrypted data, allowing it to be decrypted successfully.

    Read the article

  • Oh that XML - did you ever try to read a raw file?

    - by GGBlogger
    If you've ever looked at a raw XML file - even a very simple one - you'll understand. XML files are nearly impossible to read in raw format. That's where various tools come in and there are a bunch of them including some very simple tools. If, however, you need some horsepower one of the best tools on the planet is LiquidXML! LiquidXML is a developer's tool. It's also an analyst's tool, a tester's tool and a designer's tool. Did I mention that it is compatible with Visual Studio? Once again I will be following up on this as time permits. But if this sounds like something you can use just visit http://www.liquid-technologies.com/. You will find a very complete description plus high quality training videos that will help you decide if this is a tool you can use.

    Read the article

  • Oh My Goddard! An Early Look at Fedora 13

    <b>Linux Magazine:</b> "Fedora 13 is on the way and while it innovates in its own right, it also borrows some major features from other distros such as Ubuntu and Mandriva. This is looking to be yet another great release from the Fedora community!"

    Read the article

  • What is the Big-Oh nitation for this? [closed]

    - by laniam
    procedure quartersearch (x : inter, a1, a2, ?, an) : increasing integers) i := 1{i is left endpoint of search interval} ? j := n {j is right endpoint of search interval} while i < j begin m :=? ?(i + j)? / 4 if x am then ?i := m+1 else if x am then ?m : = ?(i + j)? / 4 else if x am then m := 2 ?(i + j)? /4 else ?if x am then m := 3 ?(i + j)? /4 else j := m end if x = ai then location := i else location := 0

    Read the article

  • Nesting, grouping Sqlite syntax?

    - by Linda
    I can't for the life of me figure out this Sqlite syntax. Our database contains records like: TX, Austin OH, Columbus OH, Columbus TX, Austin OH, Cleveland OH, Dayton OH, Columbus TX, Dallas TX, Houston TX, Austin (State-field and a city-field.) I need output like this: OH: Columbus, Cleveland, Dayton TX: Dallas, Houston, Austin (Each state listed once... and all the cities in that state.) What would the SELECT statement(s) look like?

    Read the article

  • Shortening jQuery Code by Replacing Variable

    - by Jerry
    I have a form with a bunch of dropdown options that I'm dressing up by allowing the option to be selected by clicking links and (in the future, images) instead of using the actual dropdown. There are a lot of dropdowns and most all will repeat the same basic idea, and some will literally repeat just with different variables. Here's the HTML for one of those. <tr class="box1"> <td> <select id="cimy_uef_7"> <option value="Boy">Boy</option> <option value="Girl">Girl</option> </select> </td> </tr> Then the corresponding fancier links to click that will select the corresponding option in the dropdown. <div id="genderBox1"> <div class="gender"><a class="boy" href="">Boy</a></div> <div class="gender"><a class="girl" href="">Girl</a></div> </div> So, when you click the link "Boy" it will select the corresponding dropdown value "Boy" There are going to be multiple Box#, so I can just repeat the jQuery each time with the new variables, but there's surely a shorter way. Here's the jQuery that makes it work. //Box1 Gender var Gender1 = $('select#cimy_uef_7'); var Boy1 = $("#genderBox1 .gender a.boy"); var Girl1 = $("#genderBox1 .gender a.girl"); //On Page Load - Check Gender Box 1 Selection and addClass to corresponding div a if ( $(Gender1).val() == "Boy" ) { $(Boy1).addClass("selected"); } else { $(Boy1).removeClass("selected"); } if ( $(Gender1).val() == "Girl" ) { $(Girl1).addClass("selected"); } else { $(Girl1).removeClass("selected"); } //On Click - Change Gender Box 1 select based on image click $(Boy1).click(function(event) { event.preventDefault(); $(this).addClass("selected"); $(Gender1).val("Boy"); $(Girl1).removeClass("selected"); }); $(Girl1).click(function(event) { event.preventDefault(); $(this).addClass("selected"); $(Gender1).val("Girl"); $(Boy1).removeClass("selected"); }); My thought for shortening it was to just have a list of variables for each box and cycle through the numbers- 1,2,3,4 and have the jQuery grab the same # for each variable, but I can't figure out a way to do it. Let me know if there's anything else I can provide to make the question better. This is my best idea for shortening this code, as I'm still very much a beginner at jQuery, but I'm positive there are much better ideas out there, so feel free to recommend a better path if you see it :)

    Read the article

  • switching users in byobu session

    - by JohnMerlino
    I launched a byobu session (tmux) and then tried to switch to a user called kommander "su - kommander", it immediately prompted me with: [Oh My Zsh] Would you like to check for updates? Type Y to update oh-my-zsh: Now I usually press "n" and everything is fine, but within the byobu session, when I press enter it just displays a "^M" character. I have no idea how to exit out if this prompt: [Oh My Zsh] Would you like to check for updates? Type Y to update oh-my-zsh: n^M

    Read the article

  • New user profile creation error - Windows cannot open *.exe

    - by Jake
    I have a windows 7 laptop with the user "mydomain\boy" that cannot log in to the laptop. the error message is something like "User profile service cannot log in the user boy". I then logged in with the domain admin account "mydomain\admin" and then went to delete the "mydomain\boy" from my computer system properties advance system settings user profiles settings. I also ensure that the user is deleted from control panel user accounts. I then also deleted the user folder c:\users\boy I also checked that the registry at this location HKLM\software\microsoft\windows nt\currentversion\profilelist\ and ensure that there is no entry for boy. I followed http://support.microsoft.com/kb/947215 using the method 3 "fix it for me" but does not seem to do anything. (or i don't know how to use it). AFTER EVERYTHING DONE ABOVE... Everytime i log in with a new user, be it boy, girl or anything other domain account (other than the admin account already created when I first logged in to begin the fix/break), it takes a long time, and when the "preparing desktop" goes away, it starts to exe cannot open error e.g. regsvr.exe etc.. file association problem with exe QUESTION (phew finally..): Please tell me how to fix it? Thanks!

    Read the article

  • OpenSolaris livecd, NForce NIC driver, and NTFS USB mounting. Oh My!

    - by Jake Wharton
    I'm attempting to install OpenSolaris 2009.06 on my server. Before I do I would like to test that everything works and am running in to problems. It has an Abit AN-M2 motherboard with an NForce chipset. The driver config utility says that I need a third-party driver and links me to http://homepage2.nifty.com/mrym3/taiyodo/eng/. Scrolling to the bottom, I have downloaded both tgzs just in case. Now the fun part: The only way to get this on to the computer is via a USB drive since I can't access the network. Also, install CD in the drive otherwise I'd just burn them to DVD. Since my USB key is NTFS formatted I cannot mount it since the install CD seems to be lacking NTFS drivers which require more downloaded packages. What should I do? The server will simply be a dumb NAS and I know that there exists other OpenSolaris-based flavors such as Nexenta but from what I read the stock install is likely the best. If this is not the case and pursuing a different flavor is required or better I will also accept that as an answer (but please don't jump straight to it).

    Read the article

  • Sound vs. Valid Argument

    - by MarkPearl
    Today I spent some time reviewing my Formal Logic course for my up coming exam. I came across a section that I have never really explored in any proper depth… the difference between a valid argument and a sound argument. Here go some notes I made… What is an argument? In this case we are not referring to a verbal fight, but more what we call a set of premise followed by a conclusion. Before we go further we need to understand what a premise is… a premise is a statement that an argument claims will induce or justify a conclusion. Think of a premise as an assumption that something is true. So, an argument can consist of one or more premises and a conclusion… When is an argument valid? An argument can be either valid or invalid. An argument is valid if, and only if, it is impossible for there to be a situation in which all it's premises are TRUE and it's conclusion is FALSE. It is generally easier to determine if an argument is invalid. Do this by applying the following… Assume that all the premises are true, then ask yourself if it is now possible for the conclusion to be false. If the answer is "yes," the argument is invalid. If it's "no," the argument is valid. Example 1… P1 – Mark is Tall P2 – Mark is a boy C –  Mark is a tall boy Walkthrough 1… Assume Mark is Tall is true and also assume that Mark is a boy. Based on these two premises, the conclusion is also true – Mark is a tall boy, thus the it is a valid argument. Let’s make this an invalid argument…   Example 2… P1 – Mark is Tall P2 – Mark is a boy C – Mark is a short boy Walkthrough 2… This would be an invalid argument, since from the premises we assume that Mark is tall and he is a boy, and then the conclusion goes against this by saying that Mark is short. Thus an invalid argument.   When is an argument sound? An argument is said to be sound when it is valid and all the premises are indeed true (not just assumed to be true). Rephrased, an argument is said to be sound when the conclusion will follow from the premises and the premises are indeed true in real life. In example 1 we were referring to a specific person, if we generalized it a bit we could come up with the following example.   Example 3 P1 – All people called Mark are tall P2 – I know a specific person called Mark C – He is a tall person   In this instance, it is a valid argument (we assume the premises are true, which leads to the conclusion being true), but the argument is NOT sound. In the real world there must be at least one person called Mark who is not tall. Something also to note, all invalid arguments are also unsound – this makes sense, if an argument is not valid, how on earth can it be true in the real world.   What happens when the premises contradict themselves? This is an interesting one… An argument is valid if, and only if, it is impossible for there to be a situation in which all it's premises are TRUE and it's conclusion is FALSE. When premises are contradictory, the argument is always valid because it is impossible for all the premises to be true at one time. Lets look at an example.. P1 - Elvis is dead P2 – Elvis is alive C – Laura is a woolly mammoth This is a valid argument, but not a sound one. Think about it. Is it possible to have a situation in which the premises are true and the conclusion is false? Sure, it's possible to have a situation in which the conclusion is false, but for the argument to be invalid, it has to be possible for the premises to all be true at the same time the conclusion is false. So if the premises can't all be true, the argument is valid. (If you still think the argument is invalid, draw a picture in which the premises are all true and the conclusion is false. Remember, there's only one Elvis, and you can't be both dead and alive.) For more info on this I suggest reading the following blog post.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >