Search Results

Search found 28747 results on 1150 pages for 'switch case'.

Page 10/1150 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • Linux: Case-INSENSITIVE Filesystem

    - by Quandary
    What methods are there to make the Linux filesystem case-INSENSITIVE ? I have asp.net applications developed on Windows, but there are always issues with capitalization/spelling on mono when putting it on Linux. One way is to mount a localhost SMB share to /var/www. Are there any others ?

    Read the article

  • proper concurrent users estimation case studies

    - by golemwashere
    I've been asked to size a web architecture for an excessive number of concurrent users ( hundreds of thousands ). I'm having a hard time convincing these people that unless you are in the top 5 of your country websites it's quite hard to hit those numbers. Can anyone provide some real world case studies providing stats for total / concurrent users explaining what is the usual ratio between total vs concurrent?

    Read the article

  • How to fix a bad case rattle

    - by C. Ross
    I have a full sized ATX case with several fans, including one on the door/removable side. This fan makes the "door" rattle or vibrate loudly when the fan runs at full speed, such as at startup. I can stop the rattle temporarily by placing my hand on the "door", or pushing an object next to it. Do you have any suggestions for a permanent solution? Note: The "door" in question is a slide out panel with two twist screws at the back to hold it in.

    Read the article

  • Swapping switch-case in extra fle/data structure (Java)

    - by poeschlorn
    Hi guys, it may be a nooby question, but I've never needed it before: I have several strings and I want to compare them to given ones... At first glance it would lead to a switch/case construction in what every available entry is checked. Is there a more elegant way to swap those strings as key/value datas? greets, poeschlorn

    Read the article

  • How to calculate required switch speed based on network usage?

    - by tobefound
    I have a 48 port HP Procurve Switch 2610 (J9088A) that can handle 13.0 million PPS (packets per second) and features wire speed switching capacity at 17.6Gbps. First off, what does that REALLY mean? Where do I start when trying to figure out if my office (with 70 employees) will be well setup with this switch? How to calculate through-put based on a user average load of X MB per day? 90% of the folks will only be sending email, access random websites, etc... the other 10% will be conducting heavier tasks like moving image files (10 MB) across network shares, constant external FTP streams through the switch to a server etc... Is this switch good enough?

    Read the article

  • 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

  • Ruby switch like idiom

    - by Eef
    Hey, I have recently started a project in Ruby on Rails. I used to do all my projects before in Python but decided to give Ruby a shot. In the projects I wrote in Python I used a nice little technique explained by the correct answer in this post: http://stackoverflow.com/questions/277965/dictionary-or-if-statements-jython I use this technique due to Python not having a native switch function and it also get rid of big if else blocks I have been trying to do recreate the above method in Ruby but can't seem to quite get it. Could anyone help me out? Thanks Eef

    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

  • code optimization; switch versus if's

    - by KaiserJohaan
    Hello, I have a question about whether to use 'case' or 'ifs' in a function that gets called quite alot. Here's the following as it is now, in 'ifs'; the code is self-explanatory: int identifyMsg(char* textbuff) { if (!strcmp(textbuff,"text")) { return 1; } if (!strcmp(textbuff,"name")) { return 2; } if (!strcmp(textbuff,"list")) { return 3; } if (!strcmp(textbuff,"remv")) { return 4; } if (!strcmp(textbuff,"ipad")) { return 5; } if (!strcmp(textbuff,"iprm")) { return 6; } return 0; } My question is: Would a switch perform better? I know if using ifs, I can place the most likely options at the top.

    Read the article

  • Switch statement for string matching in JavaScript

    - by yaya3
    How do I write a swtich for the following conditional? If the url contains "foo", then settings.base_url is "bar". The following is achieving the effect required but I've a feeling this would be more manageable in a switch: var doc_location = document.location.href; var url_strip = new RegExp("http:\/\/.*\/"); var base_url = url_strip.exec(doc_location) var base_url_string = base_url[0]; //BASE URL CASES // LOCAL if (base_url_string.indexOf('xxx.local') > -1) { settings = { "base_url" : "http://xxx.local/" }; } // DEV if (base_url_string.indexOf('xxx.dev.yyy.com') > -1) { settings = { "base_url" : "http://xxx.dev.yyy.com/xxx/" }; } Thanks

    Read the article

  • Java application if/case recommendation

    - by Jesse
    I am writing an application for a Java course. I am a complete beginner and am just going off material I have learned from the course and from the web. The application is exhibiting some behavior and I am not sure what is causing it. The application is GUI based and does calculations on user input. For the action listener section, I have a set of If statements such as: "if this button do this if this button do this" All in a row like that. It seems as if the application is running ALL the if statements instead of running the one that corresponds with the button pressed. Would I be better off using a case/switch structure for this sort of thing? I can post my code if necessary, I am new around this site and am not sure if that thing is acceptable.

    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

  • What is the best way to connect a 3 switches with a router?

    - by Carlos Morales
    Hello everyone, I'm trying to rebuild the network from my work and I was thinking what is the best way to connect three switches and a router. The router has 4 ports so I thought to connect 2 switches to the router (each switch connected with 2 cables to the router) and then connect the third switch to one of the others with two cables. So is like this, two cables from switch one to the router, two cables from switch two to the router and two cables from switch 3 to switch 1 or 2. So my questions are: Is it better to connect the router to each switch with a cable or the more cables you have the better? If I connect the switch 3 to switch 1 or 2 is it better to connect it with a cable or you get better performance with more cables. If I'm wrong and there is a better or more efficient way to connect them please let me know. The router is a Netgear RP114 (I'll upgrade it to a Sonicwall NSA 240), switch 1 is a Netgear GS748T, switch 2 is a Cisco Catalyst 2924-XL and switch 3 is a D-link DGS-1024D Thank you very much

    Read the article

  • What is the best way to connect 3 switches with a router?

    - by Carlos Morales
    Hello everyone, I'm trying to rebuild the network from my work and I was thinking what is the best way to connect three switches and a router. The router has 4 ports so I thought to connect 2 switches to the router (each switch connected with 2 cables to the router) and then connect the third switch to one of the others with two cables. So is like this, two cables from switch one to the router, two cables from switch two to the router and two cables from switch 3 to switch 1 or 2. So my questions are: Is it better to connect the router to each switch with a cable or the more cables you have the better? If I connect the switch 3 to switch 1 or 2 is it better to connect it with a cable or you get better performance with more cables. If I'm wrong and there is a better or more efficient way to connect them please let me know. The router is a Netgear RP114 (I'll upgrade it to a Sonicwall NSA 240), switch 1 is a Netgear GS748T, switch 2 is a Cisco Catalyst 2924-XL and switch 3 is a D-link DGS-1024D Thank you very much

    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

  • 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

  • Using Enums for comparing string values in Switch

    - by kaleidoscope
    Problem Scenario: There is an enum keeping track of operations to be performed on a table Public Enum PartitionKey { Createtask, Updatetask, Deletetask } User is entering the value for the operation to be performed and the code to check the value entered in switch case. Switch (value) {           case PartitionKey.Createtask.ToString():          {          Create();          break;          }          case PartitionKey.Updatetask.ToString():          {           Update();           break;          }          case PartitionKey.Deletetask.ToString():          {           Delete();          break;          } } and it displays as error as “.” Solution: One of the possible implmentation is as below. Public Enum PartitionKey: byte { Createtask, Updatetask, Deletetask } Switch ((PartitionKey)(Int32.Parse(value))) {          case PartitionKey.Createtask:          {                   Create();                   break;          }          case PartitionKey.Updatetask:          {                    Update();                   break;          }          case PartitionKey.Deletetask:          {                    Delete();                   break;          }          default:          {                   break;          } } Technorati Tags: Enum,A Constant Value is required,Geeta,C#

    Read the article

  • Use case modelling for calculator

    - by kyrogue
    hi, i need help modelling a use case diagram from a topic, it will be in java GUI Design a Calculator that 1.Allow user to key in a legitimate arithmetic statement that involves number, operator +, - and bracket '(' and ')' ; 2.When user press “Calculate” button, display result; 3.Some legitimate statement would be ((3+2)-4+2) (equals 3) and (-2+3)-(3-1) (equals -1); 4.You should NOT use a pre-existing function that just take in the statement as a parameter and returns the result but you should write the logic of parsing every character in your code. 5.Store the last statement and answer so it is displayed when user press the “Last calculation” button. i have designed two use case diagrams using UML on netbeans 6.5.1, one of the use case i am not sure whether is it containing too much use cases etc, while the other is what i think could be too vague for the topic.i hope to get some feedback on whether the use case diagram are appropriate, thanks.

    Read the article

  • Query with many CASE statements - optimization

    - by Nemanja Vujacic
    Hi guys, I have one very dirty query that per sure can be optimized because there are so many CASE statements in it! SELECT (CASE pa.KplusTable_Id WHEN 1 THEN sp.sp_id WHEN 2 THEN fw.fw_id WHEN 3 THEN s.sw_Id WHEN 4 THEN id.ia_id END) as Deal_Id, max(CASE pa.KplusTable_Id WHEN 1 THEN sp.Trans_Id WHEN 2 THEN fw.Trans_Id WHEN 3 THEN s.Trans_Id WHEN 4 THEN id.Trans_Id END) as TransId_CurrentMax INTO #MaxRazlicitOdNull FROM #PotencijalniAktuelni pa LEFT JOIN kplus_sp sp (nolock) on sp.sp_id=pa.Deal_Id AND pa.KplusTable_Id=1 LEFT JOIN kplus_fw fw (nolock) on fw.fw_id=pa.Deal_Id AND pa.KplusTable_Id=2 LEFT JOIN dev_sw s (nolock) on s.sw_Id=pa.Deal_Id AND pa.KplusTable_Id=3 LEFT JOIN kplus_ia id (nolock) on id.ia_id=pa.Deal_Id AND pa.KplusTable_Id=4 WHERE isnull(CASE pa.KplusTable_Id WHEN 1 THEN sp.BROJ_TIKETA WHEN 2 THEN fw.BROJ_TIKETA WHEN 3 THEN s.tiket WHEN 4 THEN id.BROJ_TIKETA END, '')<>'' GROUP BY CASE pa.KplusTable_Id WHEN 1 THEN sp.sp_id WHEN 2 THEN fw.fw_id WHEN 3 THEN s.sw_Id WHEN 4 THEN id.ia_id END Because I have same condition couple times, do you have idea how to optimize query, make it simpler and better. All suggestions are welcome! TnX in advance! Nemanja

    Read the article

  • Why Would one VLAN have no Communication on one Switch?

    - by Webs
    So the problem is we have a device or host that needs to communicate on a specific VLAN. This VLAN is not new, it is running all throughout our environment and works fine. But the VLAN was recently configured on the switch in question, a Cisco 3750. The DHCP server is handing out addresses on that VLAN with no problem. I have verified the cable between the host and switch and tried multiple hosts, but none of them can communicate or get an address. I plugged my laptop into an empty port which had a different VLAN assigned and immediately got a DHCP address. When I changed that port to the same VLAN I'm having issues with I got the same problem. The laptop just sits there and tries to DHCP an address but nothing happens. I double checked the cores and their Layer 3 VLAN config and its fine too. Plus I figured the issue couldn't be with them because the VLAN works fine everywhere else it exists. So the only other thing I can think of is the switch, but the VLAN exists on the switch and seems to be configured correctly. The trunks appear to be configured just fine as well too. Anyone have any ideas? I'm lost on this one.

    Read the article

  • Why do I need a managed switch and which one should I buy?

    - by ascanio1
    I bought a 2nd router and I want both routers to have direct WAN access to the modem. One of the 2 routers directs VOIP traffic to a telephone line port. This VOIP service is provided by the cable carrier which also leases the modem & the router. The cable company technician told me that this VOIP line uses IPv6 addressing and therefore I must employ an IPv6 capable/compliant Giga Hub/Switch or my telephone line won't work anymore. Pls advise me (brand/model) an IPv6 compliant, 2 port, switch to purchase. Pls educate me: By reading this forum I thought that hubs broadcast traffic to all ports, regardless of which input/output is being used and so, theoretically, they have nothing to do with IP. Correct? Same story for unmanaged switches, where the only difference is that these latter devices route traffic only to those ports which are detected to be in use. Correct? I also understood that unmanaged switches route traffic simply by detecting hardware use and not by selecting specific IP traffic. Correct? Finally, there are managed switches which DO select traffic based on IP and, therefore, only these managed switches are involved with IPv6... Why would my cable company explicitly tell me, over and over, that I must use an IPv6 compliant switch? Why would they need a managed switch instead of an unmanaged one? Thanks in advance for helping me understand!

    Read the article

  • Naming case classes in Scala.

    - by Lukasz Lew
    I tend to have this redundant naming in case classes: abstract class MyTree case class MyTreeNode (...) case class MyTreeLeaf (...) Isn't it possible to define Node and Leaf inside of MyTree? What are best practices here?

    Read the article

  • MySQL Query WHERE Including CASE or IF?

    - by handfix
    Strange problem. My Query looks like SELECT DISTINCT ID, `etcetc`, `if/elses over muliple joined tables` FROM table1 AS `t1` # some joins, eventually unrelated in that context WHERE # some standard where statements, they work/ CASE WHEN `t1`.`field` = "foo" THEN (`t1`.`anOtherField` != 123 AND `t1`.`anOtherField` != 456 AND `t1`.`anOtherOtherField` != "some String") WHEN `t1`.`field` = "bar" THEN `t1`.`aSecondOtherField` != 12345 END #ORDER BY CASE etc. Standard Stuff Apperantly MySQL returns a wrong rowcount and I think my problem is in the logic of the WHERE ... CASE statement. Maybe with the brackets? Maybe I should go for operator OR and not AND? Should my the second WHEN include brackets also, even when I only compare one field? Should I use IF and not CASE? Basically I want to exclude some rows with specific values IF theres a specific value in field foo or bar I would try that all out, but it takes a huge amount of time to complete that query... :(

    Read the article

  • What are my options in replacing the noisy fan in my Linksys Cisco SRW2008P managed GigE switch?

    - by Fred Sobotka
    My first managed GigE switch, the Linksys SRW2008, was a dream, until it started randomly chattering on various ports. That started while I was on the road all the time, which made it take forever to diagnose, but that's a different problem. When I finally determined that the switch was bad, it was still covered by warranty by Linksys/Cisco, so I opened an RMA ticket and returned it. Unfortunately, Linksys/Cisco "upgraded" my replacement switch to a SRW2008P, which has Power over Ethernet features I never planned on using. That by itself wasn't so bad, but it's my guess that the inclusion of PoE functions in this model required a tiny, super-loud internal fan to keep everything cool. This wasn't something I wanted or asked for, but, now that I am stuck with it, I am investigating options for replacing that little internal fan with something far quieter. For example, if I attach a larger fan to the outsite of the chassis, I think it could push enough air to replace the stock fan that is currently there. Any advice on carrying this out? I have no interest in melting my switch due to insufficient ventilation.

    Read the article

  • Case Statements versus coded if statements

    - by Eric
    What is more efficient - handling with case statements in sql or handling the same data using if statements in code. I'm asking because my colleague has a huge query that has many case statements. I advised her to take stress off of the DB by coding the case statements. I've found that it is more efficient...but why?

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >