Search Results

Search found 23576 results on 944 pages for 'case study'.

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

  • Yield and default case || do not output default case

    - by coulix
    Hello Railers, I have a simple yield use case and for some unknown reason the default case is never shown: In my super_admin layout I have: <%= yield :body_id || 'super_admin_main' %> My controller class Superadmin::GolfsController < ApplicationController layout "super_admin" def show end end My show view With or without <% content_for(:body_id) do %sadmin_golfs<% end % With: sadmin_golfs is shown. without: empty string is shown instead of super_admin_main Can anyone reproduce the same behavior ? Rails 3

    Read the article

  • Switch Case on type of object (C#)

    - by Sem Dendoncker
    If you want to switch a type of object, what is the best way to do this? ex: private int GetNodeType(NodeDTO node) { switch (node.GetType()) { case typeof(CasusNodeDTO): return 1; case typeof(BucketNodeDTO): return 3; case typeof(BranchNodeDTO): return 0; case typeof(LeafNodeDTO): return 2; default: return -1; } } I know this doesn't work that way, but I was wondering how you could solve this. Is an if then else else else statement appropriate in this case? Or do you use this switch and add .ToString() to the types? Kind regards, Sem

    Read the article

  • Switch-Case for strings in Javascript not working as expected

    - by Coltin
    So I have this problem with strings and switch-case, and I'll try to keep it as simple as possible. Here event.keyCode has the value "65", and is the result of a keydown event of 'a' (using JQuery). if (event.keyCode == "65") { alert("hmmmm"); } That works, but: switch (event.keyCode) { case '65': alert("Yay!"); break; } That doesn't. However this will work: switch ('65') { case '65': alert("Yay!"); break; } And if I do this: var t = '65'; switch (t) { case '65': alert("Yay!"); break; } It works. And then I tried this: var t = event.keyCode; switch (t) { case '65': alert("Yay!"); break; } But it fails! So why does it match in the if-block at the beginning, but not for the switch-case?

    Read the article

  • Why do case class companion objects extend FunctionN?

    - by retronym
    When you create a case class, the compiler creates a corresponding companion object with a few of the case class goodies: an apply factory method matching the primary constructor, equals, hashCode, and copy. Somewhat oddly, this generated object extends FunctionN. scala> case class A(a: Int) defined class A scala> A: (Int => A) res0: (Int) => A = <function1> This is only the case if: There is no manually defined companion object There is exactly one parameter list There are no type arguments The case class isn't abstract. Seems like this was added about two years ago. The latest incarnation is here. Does anyone use this, or know why it was added? It increases the size of the generated bytecode a little with static forwarder methods, and shows up in the #toString() method of the companion objects: scala> case class A() defined class A scala> A.toString res12: java.lang.String = <function0>

    Read the article

  • Switch case assembly level code

    - by puffadder
    Hi All, I am programming C on cygwin windows. After having done a bit of C programming and getting comfortable with the language, I wanted to look under the hood and see what the compiler is doing for the code that I write. So I wrote down a code block containing switch case statements and converted them into assembly using: gcc -S foo.c Here is the C source: switch(i) { case 1: { printf("Case 1\n"); break; } case 2: { printf("Case 2\n"); break; } case 3: { printf("Case 3\n"); break; } case 4: { printf("Case 4\n"); break; } case 5: { printf("Case 5\n"); break; } case 6: { printf("Case 6\n"); break; } case 7: { printf("Case 7\n"); break; } case 8: { printf("Case 8\n"); break; } case 9: { printf("Case 9\n"); break; } case 10: { printf("Case 10\n"); break; } default: { printf("Nothing\n"); break; } } Now the resultant assembly for the same is: movl $5, -4(%ebp) cmpl $10, -4(%ebp) ja L13 movl -4(%ebp), %eax sall $2, %eax movl L14(%eax), %eax jmp *%eax .section .rdata,"dr" .align 4 L14: .long L13 .long L3 .long L4 .long L5 .long L6 .long L7 .long L8 .long L9 .long L10 .long L11 .long L12 .text L3: movl $LC0, (%esp) call _printf jmp L2 L4: movl $LC1, (%esp) call _printf jmp L2 L5: movl $LC2, (%esp) call _printf jmp L2 L6: movl $LC3, (%esp) call _printf jmp L2 L7: movl $LC4, (%esp) call _printf jmp L2 L8: movl $LC5, (%esp) call _printf jmp L2 L9: movl $LC6, (%esp) call _printf jmp L2 L10: movl $LC7, (%esp) call _printf jmp L2 L11: movl $LC8, (%esp) call _printf jmp L2 L12: movl $LC9, (%esp) call _printf jmp L2 L13: movl $LC10, (%esp) call _printf L2: Now, in the assembly, the code is first checking the last case (i.e. case 10) first. This is very strange. And then it is copying 'i' into 'eax' and doing things that are beyond me. I have heard that the compiler implements some jump table for switch..case. Is it what this code is doing? Or what is it doing and why? Because in case of less number of cases, the code is pretty similar to that generated for if...else ladder, but when number of cases increases, this unusual-looking implementation is seen. Thanks in advance.

    Read the article

  • SQL: Using a CASE Statement to update 1000 rows at once

    - by SoLoGHoST
    Ok, I would like to use a CASE STATEMENT for this, but I am lost with this. Basically, I need to update a ton of rows, but just on the "position" column. I need to update all "position" values from 0 - count(position) for each id_layout_position column per id_layout column. OK, here is a pic of what the table looks like: Now let's say I delete the circled row, this will remove position = 2 and give me: 0, 1, 3, 5, 6, 7, and 4. But I want to add something at the end now and make sure that it has the last possible position, but the positions are already messed up, so I need to reorder them like so before I insert the new row: 0, 1, 2, 3, 4, 5, 6. But it must be ordered by lowest first. So 0 stays at 0, 1 stays at 1, 3 gets changed to 2, the 4 at the end gets changed to a 3, 5 gets changed to 4, 6 gets changed to 5, and 7 gets changed to 6. Hopefully you guys get the picture now. I'm completely lost here. Also, note, this table is tiny compared to how fast it can grow in size, so it needs to be able to do this FAST, thus I was thinking on the CASE STATEMENT for an UPDATE QUERY. Here's what I got for a regular update, but I don't wanna throw this into a foreach loop, as it would take forever to do it. I'm using SMF (Simple Machines Forums), so it might look a little different, but the idea is the same, and CASE statements are supported... $smcFunc['db_query']('', ' UPDATE {db_prefix}dp_positions SET position = {int:position} WHERE id_layout_position = {int:id_layout_position} AND id_layout = {int:id_layout}', array( 'position' => $position++, 'id_layout_position' => (int) $id_layout_position, 'id_layout' => (int) $id_layout, ) ); Anyways, I need to apply some sort of CASE on this so that I can auto-increment by 1 all values that it finds and update to the next possible value. I know I'm doing this wrong, even in this QUERY. But I'm totally lost when it comes to CASES. Here's an example of a CASE being used within SMF, so you can see this and hopefully relate: $conditions = ''; foreach ($postgroups as $id => $min_posts) { $conditions .= ' WHEN posts >= ' . $min_posts . (!empty($lastMin) ? ' AND posts <= ' . $lastMin : '') . ' THEN ' . $id; $lastMin = $min_posts; } // A big fat CASE WHEN... END is faster than a zillion UPDATE's ;). $smcFunc['db_query']('', ' UPDATE {db_prefix}members SET id_post_group = CASE ' . $conditions . ' ELSE 0 END' . ($parameter1 != null ? ' WHERE ' . (is_array($parameter1) ? 'id_member IN ({array_int:members})' : 'id_member = {int:members}') : ''), array( 'members' => $parameter1, ) ); Before I do the update, I actually have a SELECT which throws everything I need into arrays like so: $disabled_sections = array(); $positions = array(); while ($row = $smcFunc['db_fetch_assoc']($request)) { if (!isset($disabled_sections[$row['id_group']][$row['id_layout']])) $disabled_sections[$row['id_group']][$row['id_layout']] = array( 'info' => $module_info[$name], 'id_layout_position' => $row['id_layout_position'] ); // Increment the positions... if (!is_null($row['position'])) { if (!isset($positions[$row['id_layout']][$row['id_layout_position']])) $positions[$row['id_layout']][$row['id_layout_position']] = 1; else $positions[$row['id_layout']][$row['id_layout_position']]++; } else $positions[$row['id_layout']][$row['id_layout_position']] = 0; } Thanks, I know if anyone can help me here it's definitely you guys and gals... Anyways, here is my question: How do I use a CASE statement in the first code example, so that I can update all of the rows in the position column from 0 - total # of rows found, that have that id_layout value and that id_layout_position value, and continue this for all different id_layout values in that table? Can I use the arrays above somehow? I'm sure I'll have to use the id_layout and id_layout_position values for this right? But how can I do this? Ok, guy, I get an error, saying "Hacking Attempt" with the following code: // Updating all positions in here. $smcFunc['db_query']('', ' SET @pos = 0; UPDATE {db_prefix}dp_positions SET position=@pos:=@pos+1 ORDER BY id_layout_position, position', array( ) ); Am I doing something wrong? Perhaps SMF has safeguards against this approach?? Perhaps I need to use a CASE STATEMENT instead?

    Read the article

  • Google I/O Sandbox Case Study: Angry Birds

    Google I/O Sandbox Case Study: Angry Birds We interviewed Rovio, the makers of Angry Birds, at the Google I/O Sandbox on May 11, 2011 and they explained to us the benefits of building on Chrome. Angry Birds, one of the most popular games for mobile devices, is now available on Chrome! For more information about developing on Chrome, visit: code.google.com For more information on Rovio, visit: www.rovio.com From: GoogleDevelopers Views: 19 0 ratings Time: 01:14 More in Science & Technology

    Read the article

  • Google I/O Sandbox Case Study: Eureka Streams

    Google I/O Sandbox Case Study: Eureka Streams We interviewed Lockheed Martin at the Google I/O Sandbox on May 10, 2011 and they demoed their product, Eureka Streams, and explained to us the benefits of using web toolkit to build it. Eureka Streams is a social communication platform built to help individuals in large corporations communicate with each other. For more information on Google Web Toolkit, visit: code.google.com For more information on Eureka Streams, visit: www.eurekastreams.org From: GoogleDevelopers Views: 29 0 ratings Time: 02:35 More in Science & Technology

    Read the article

  • Google I/O Sandbox Case Study: CardinalCommerce

    Google I/O Sandbox Case Study: CardinalCommerce We interviewed CardinalCommerce at the Google I/O Sandbox on May 10, 2011. They explained to us the benefits of integrating with Google Checkout. CardinalCommerce enables authenticated payments and alternative payment brands and is working with Google to create Google Mobile Wallet. For more information about developing with Google Commerce, visit: code.google.com For more information on CardinalCommerce, visit: www.cardinalcommerce.com From: GoogleDevelopers Views: 611 16 ratings Time: 02:19 More in Science & Technology

    Read the article

  • Google I/O Sandbox Case Study: HistoryPin

    Google I/O Sandbox Case Study: HistoryPin We interviewed HistoryPin at the Google I/O Sandbox on May 10, 2011 and they explained to their new technology and the benefits of integrating with Google Maps. HistoryPin lets you upload historical photos of places onto their respective points on Google Maps, enabling users to see what cities looked like at different points in time. For more information about developing on Google Maps visit: code.google.com For more information on HistoryPin, visit: www.historypin.com From: GoogleDevelopers Views: 90 0 ratings Time: 01:28 More in Science & Technology

    Read the article

  • Google I/O Sandbox Case Study: Apps4Android

    Google I/O Sandbox Case Study: Apps4Android We interviewed Apps4Android at the Google I/O Sandbox on May 11, 2011 and they explained to us the benefits of building accessibility applications on the Android platform. Apps4Android creates high-quality applications that enhance the quality-of-life and independence of individuals with disabilities. For more information about developing accessibility applications, visit: google.com For more information on Apps4Android, visit: www.apps4android.org From: GoogleDevelopers Views: 26 0 ratings Time: 02:01 More in Science & Technology

    Read the article

  • What PSU is usually used in mini-ITX cases/chassis?

    - by Subaru Tashiro
    The mini-ITX computer will be a general use computer. Not a dedicated HTPC or Home server. In general use mini-ITX cases, what PSU form factor is usually used? I understand that some case manufacturers provide custom built PSU to fit their case but I prefer to get the ones that use a PSU that follows standard form factors in case a replacement is needed. For example, what PSU fits into general purpose cases by Lian Li? Am I to assume that smaller PSU form factors also affect the possible maximum output?

    Read the article

  • MCSD Certification, any recommended study material?

    - by Dayan
    I wish to study for the new MCSD Certification For web applications: I headed over to Amazon in search of some books and had no luck with finding anything up to date, most books are outdated, such as the list provided by Amazon MCSD Books. Is this because the test is more based on experience rather than just an understanding of the subject? Any tips and/or recommended materials will be appreciated, thank you!

    Read the article

  • Java EE Web Services study guides

    - by Marthin
    I´m going for the Java EE 6 Web Services Developer certificat but I´m having a hard time to find som solid study guides and mock exams. I already have the JPA and very soon EJB cert so i´m not new to this stuff but I´v looked at coderanch and other places but all information seems a bit outdated. So any tips for books, mock exams free or not, tutorials or other guides would be very much appreciated. EDIT: I will of course read all JSR´s needed.

    Read the article

  • Google I/O Sandbox Case Study: WebFilings

    Google I/O Sandbox Case Study: WebFilings We interviewed WebFilings at the Google I/O Sandbox on May 10, 2011 and they explained to us the benefits of using App Engine to build their website. WebFilings provides a secure, cloud-based end-to-end financial reporting solution for SEC reporting companies. For more information on App Engine Developers, visit: code.google.com For more information on WebFilings, visit: www.webfilings.com From: GoogleDevelopers Views: 29 1 ratings Time: 02:31 More in Science & Technology

    Read the article

  • Google I/O Sandbox Case Study: Box

    Google I/O Sandbox Case Study: Box We interviewed Box at the Google I/O Sandbox on May 11, 2011. They explained to us the benefits of integrating with the Chrome OS system. Box offers cloud-based content management for businesses and they recently unveiled a streamlined content upload process on the Chrome OS. For more information about developing on Chrome, visit: code.google.com For more information on Box, visit: www.box.net From: GoogleDevelopers Views: 20 0 ratings Time: 01:47 More in Science & Technology

    Read the article

  • Google I/O Sandbox Case Study: DayZipping

    Google I/O Sandbox Case Study: DayZipping We interviewed DayZipping at the Google I/O Sandbox on May 10, 2011. They explained to us the benefits of integrating with Google Maps. DayZipping is a website where users can find and share day trips for a variety of popular destinations. For more information about developing on Google Maps, visit: code.google.com For more information on DayZipping, visit: www.dayzipping.com From: GoogleDevelopers Views: 33 0 ratings Time: 02:09 More in Science & Technology

    Read the article

  • Google I/O Sandbox Case Study: GoAnimate

    Google I/O Sandbox Case Study: GoAnimate We interviewed GoAnimate at the Google I/O Sandbox on May 10, 2011 and they explained to us the benefits of using partnering with YouTube. GoAnimate is an video creation platform that lets users easily create animated videos and publish them on YouTube. For more information on developing on YouTube, visit: code.google.com For more information on GoAnimate, visit: goanimate.com From: GoogleDevelopers Views: 33 0 ratings Time: 02:17 More in Science & Technology

    Read the article

  • Google I/O Sandbox Case Study: Evite

    Google I/O Sandbox Case Study: Evite We interviewed Evite at the Google I/O Sandbox on May 10, 2011 and they explained to us the benefits of using App Engine to build their website. Evite is the world's largest online personal invitations platform, allowing users to create customized invitations for any type of gathering. For more information on App Engine Developers, visit: code.google.com For more information on Evite, visit: www.evite.com From: GoogleDevelopers Views: 29 0 ratings Time: 01:51 More in Science & Technology

    Read the article

  • Google I/O Sandbox Case Study: Assistly

    Google I/O Sandbox Case Study: Assistly We interviewed Assistly at the Google I/O Sandbox on May 11, 2011. They explained to us the benefits of building on Google Apps. Assistly is a customer management system that helps companies deliver top-quality customer service. For more information about developing with Google Apps, visit: code.google.com For more information on Assistly, visit: www.assistly.com From: GoogleDevelopers Views: 21 0 ratings Time: 01:29 More in Science & Technology

    Read the article

  • Google I/O Sandbox Case Study: VectorUnit

    Google I/O Sandbox Case Study: VectorUnit We interviewed VectorUnit at the Google I/O Sandbox on May 11, 2011 and they explained to us the benefits of building for the Android Platform. VectorUnit creates console-quality video games for the Android. For more information on Android developers, visit: developers.android.com For more information on VectorUnit, visit vectorunit.com From: GoogleDevelopers Views: 13 0 ratings Time: 01:33 More in Science & Technology

    Read the article

  • Google I/O Sandbox Case Study: CloudSherpas

    Google I/O Sandbox Case Study: CloudSherpas We interviewed CloudSherpas at the Google I/O Sandbox on May 10, 2011. They explained to us the benefits of integrating with Google Apps. CloudSherpas helps companies migrate to Google Apps and offers SherpaTools as an additional contact management solution for companies' administrators. For more information about developing with Google Apps, visit: code.google.com For more information on CloudSherpas, visit: www.cloudsherpas.com From: GoogleDevelopers Views: 406 13 ratings Time: 02:29 More in Science & Technology

    Read the article

  • Google I/O Sandbox Case Study: MOVL

    Google I/O Sandbox Case Study: MOVL We interviewed MOVL at the Google I/O Sandbox on May 10, 2011 and they explained to us the benefits of developing on the Google TV Platform. MOVL develops gaming applications that people can play on their Google TV's, using their mobile phones as the controllers. For more information on developing on Google TV, visit: code.google.com For more information on MOVL, visit: movl.com From: GoogleDevelopers Views: 19 0 ratings Time: 02:03 More in Science & Technology

    Read the article

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