Search Results

Search found 23261 results on 931 pages for 'case sensitive'.

Page 19/931 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • best practices - multiple functions vs single function with switch case

    - by Amit
    I have a situation where I need to perform several small (but similar) tasks. I can think of two ways to achieve this. First Approach: function doTask1(); function doTask2(); function doTask3(); function doTask4(); Second Approach: // TASK1, TASK2, ... TASK4 are all constants function doTask(TASK) { switch(TASK) { case TASK1: // do task1 break; case TASK2: // do task2 break; case TASK3: // do task3 break; case TASK4: // do task4 break; } } A few more tasks may be added in future (though the chances are rare. but this cannot be ruled out) Please suggest which of the two approaches (or if any other) is a best practice in such a situation.

    Read the article

  • how to break outer loop from switch case

    - by Ravisha
    I have below code , enter code here for(int i=0;i<15;i++) { switch(i) { case 6: break; case 7: //Want to break the outer loop } } enter code here Is there a way to break the loop inside case statement? I know of one way is to use labels and goto .

    Read the article

  • Switch case in jquery

    - by Jasl
    Am I writing the correct switch case? var cnt = $("#div1 p").length; alert(cnt); switch (cnt) { case (cnt >= 10 && cnt <= 20): alert('10'); break; case (cnt >= 21 && cnt <= 30): alert('21'); break; case (cnt >= 31 && cnt <= 40): alert('31'); break; default: alert('>41'); } For some reason, the alert does not occur when the conditions are matched!

    Read the article

  • C++ Switch won't compile with externally defined variable used as case

    - by C Nielsen
    I'm writing C++ using the MinGW GNU compiler and the problem occurs when I try to use an externally defined integer variable as a case in a switch statement. I get the following compiler error: "case label does not reduce to an integer constant". Because I've defined the integer variable as extern I believe that it should compile, does anyone know what the problem may be? Below is an example: test.cpp #include <iostream> #include "x_def.h" int main() { std::cout << "Main Entered" << std::endl; switch(0) { case test_int: std::cout << "Case X" << std::endl; break; default: std::cout << "Case Default" << std::endl; break; } return 0; } x_def.h extern const int test_int; x_def.cpp const int test_int = 0; This code will compile correctly on Visual C++ 2008. Furthermore a Montanan friend of mine checked the ISO C++ standard and it appears that any const-integer expression should work. Is this possibly a compiler bug or have I missed something obvious? Here's my compiler version information: Reading specs from C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/specs Configured with: ../gcc-3.4.5-20060117-3/configure --with-gcc --with-gnu-ld --with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --enable-languages=c,c++,f77,ada,objc,java --disable-win32-registry --disable-shared --enable-sjlj-exceptions --enable-libgcj --disable-java-awt --without-x --enable-java-gc=boehm --disable-libgcj-debug --enable-interpreter --enable-hash-synchronization --enable-libstdcxx-debug Thread model: win32 gcc version 3.4.5 (mingw-vista special r3)

    Read the article

  • VB.NET Select...Case Statement Equivalent in C#

    - by Alex Essilfie
    I just started using C# and I've got a couple of issues. Is there any way to code the C# equivalent of the VB.NET Select statement like the following? Select Object.Name.ToString() Case "Name1" 'Do something Case "Name2" 'Do something else Case Else 'Do the default action End Select Any help would be greatly appreciated.

    Read the article

  • code duplication in sql case statements

    - by NS
    Hi I'm trying to output something like the following but am finding that there is a lot of code duplication going on. | australian_has_itch | kiwi_has_itch | | yes | no | | no | n/a | | n/a | no | ... My query looks like this with two case statements that do the same thing but flip the country (my real query has 5 of these case statements): SELECT CASE WHEN NOT EXISTS ( SELECT person_id FROM people_with_skin WHERE people_with_skin.person_id = people.person_id AND people.country = "Australia" ) THEN 'N/A' WHEN EXISTS ( SELECT person_id FROM itch_none_to_report WHERE people.country = "Australia" AND person_id = people.person_id ) THEN 'None to report' WHEN EXISTS ( SELECT person_id FROM itchy_people WHERE people.country = "Australia" AND person_id = people.person_id ) THEN 'Yes' ELSE 'No' END australian_has_itch, CASE WHEN NOT EXISTS ( SELECT person_id FROM people_with_skin WHERE people_with_skin.person_id = people.person_id AND people.country = "NZ" ) THEN 'N/A' WHEN EXISTS ( SELECT person_id FROM itch_none_to_report WHERE people.country = "NZ" AND person_id = people.person_id ) THEN 'None to report' WHEN EXISTS ( SELECT person_id FROM itchy_people WHERE people.country = "NZ" AND person_id = people.person_id ) THEN 'Yes' ELSE 'No' END kiwi_has_itch, FROM people Is there a way for me to condense this somehow and not have so much code duplication? Thanks!

    Read the article

  • CASE statement within WHERE statement

    - by niao
    Greetings, I would like to include CASE Statement inside my where statement as follows: SELECT a1.ROWGUID FROM Table1 a1 INNER JOIN Table2 a2 on a1.ROWGUID=a2.Table1ROWGUID WHERE a1.Title='title' AND (CASE WHEN @variable is not null THEN a1.ROWGUID in (SELECT * FROM #TempTable)) However, this 'CASE' statement does not work inside 'WHERE' statement. How can I do it correct?

    Read the article

  • Select...Case VB.NET to C# Equivalent

    - by Alex Essilfie
    I just started using C# and I've got a couple of issues. I hook several controls to one event handler as in the following and I want to perform a slightly different action for each control: Private Sub Button_Click(sender as Object, e as EventArgs) _ Handles button1.Click, Button2.Click 'do a general activity Select CType(sender, Button).Name Case button1.Name 'do something Case button2.Name 'do something else Case Else 'do the defalut action End Select End Sub Is there any way of doing the above select statement in C# without having to use nested ifs?

    Read the article

  • how to use use case relations - uml

    - by joao alves
    Heys guys! Im have been study UML and im trying to to design the use case diagram of a problem. Lets supose my app consists in this: Two Requesites: - create teams - create players This is the deal: A user can create a team, and after create a team he can create players for that team(not required). But in this app there are multiple users, and a user can create a team and other user can create players. The only constraint is that to create players must exist alreay a team. I research and i end up a little confuse. If i get the concepts of relations on use case diagrams right, i think i should have the folowwing two use cases: [use case - create team] <-------extends---- [use case - create player] I need opinions,Is this the proper solution? or should i have two not related use cases? Thanks in advance, and im sorry my english.

    Read the article

  • Maintain case sensitivity when importing db into windows

    - by razass
    I have an export from a MYSQL database on a linux machine however when importing that database into MYSQL on windows all of the table names that were camel cased are now all lower case. The sql dump has the correct case in it but the importing via phpmyadmin seams to remove these. How can I import it and keep the case? Thanks

    Read the article

  • java switch case question

    - by hkvega
    public String sizeOfSupermarket() { String size; switch (this.numberOfProducts) { case (this.numberOfProducts > 5000): size = "Large"; break; case (this.numberOfProducts > 2000 && this.numberOfProducts < 5000): size = "Medium"; break; case (this.numberOfProducts < 2000): size = "Small"; break; } return size; } the above is wrong, how to write the compare statement in case statement?

    Read the article

  • How to manage and estimate unstructured requirements received from customers

    - by user20358
    A lot of the times I receive a software system's requirements from our customers in a very unstructured format. It is usually a bunch of "product development" guys from the customer's who come up with these "proposed solutions" to the business problems they have. While they are the experts at the business domain, a lot of the times they don't have the solutions right. This results in multiple versions of the same requirement mixing up of two requirements into one a few versions of the requirement later down the line, the requirements which were combined together get separated out again, each taking with it some of the new additions How do you work with such requirements coming in and sort them out into proper use cases and before development begins? What tools can we use to track a particular requirement's history, from the first time it was conceived till the time it gets crystallized into a proper use case? Estimating work against requirements received in such a fashion is a nightmare which ends up in making mistakes in understanding the requirement correctly and estimating the effort against it correctly. Any tips, tools, tricks to make this activity more manageable? I'm just trying to get some insights from someone more experienced than I am in requirements management and effort estimation.

    Read the article

  • C++ - Creating folder method

    - by Matthew
    I have the following method in C++: void create_folder(LPCWSTR full_folder) //Method to create folder in case it does not exist { if(!CreateDirectory(full_folder,attr)) //Checking whether the folder already exists { switch (GetLastError()) { case ERROR_ALREADY_EXISTS: printf("The folder already exists!\n\n"); break; case NULL: printf("The folder does not exist!\n\n"); printf("The folder was created successfully!\n\n"); break; } } } In case the folder already exists, the correct message is displayed on the screen. However, if the folder does NOT exist, nothing is displayed on the screen, that is, the part identified by case NULL is not executed. How can I solve this problem? In other words, how can I get the code after the case NULL to run if the folder does not exist?

    Read the article

  • SunOne case-insensitive URLs

    - by RoToRa
    It it possible to configure a SunOne web server to automatically redirect all URLs with capital letters to the corresponding lower case URLs? For example, redirect /Example, /eXamPle and /EXAMPLE all to /example. This would have to be for all URLs (or at least a subset excluding a specific prefix) I normally have nothing to do with web server configuration (especially not SunOne). I just need to now if it is generally possible and be pointed to the right direction on how to do this. Thanks.

    Read the article

  • Select a word using keyboard special case

    - by wataka
    I know the Ctrl+Shift+Arrow_Key to select a word. But suppose this is the case: "Hello!, my na|me is Peter" Where the cursor is where the pipe is. I'm looking for some keyboard shorcut that select the word "name". The only way I found was: Ctrl+Right, Left, Ctrl+Shift+Left. But it isn't practical. Any hint? Edit: I'm on Windows 7, and I'd like some generic solution if exists (not software dependent)

    Read the article

  • Use case for sharing wifi over bluetooth?

    - by Andrew Koester
    What is the use case for applications like PDAnet or Android Wifi Tether supporting sharing wifi over Bluetooth? A friend and I were discussing this, and neither of us could figure out why you would need to redistribute wifi over a Bluetooth connection. In most cases, said receiving device would already have wifi. Any clues would be appreciated.

    Read the article

  • What happens in case of utility power failure?

    - by Jake
    (in the office) Today, the UPS battery replace warning light lit up and there was a slight panic as the all the technical people will not be around the next few days. But after thinking a bit further, I realise that in case of power failure, no client computers will be able to turn on in the first place and operations will be disrupted regardless of whether the UPS keeps the server up. This makes me wonder if the UPS is really such a critical component? What do you think?

    Read the article

  • How to clean green gunk off case fans?

    - by Wesley
    Hi all, I just bought a used custom-built computer locally. In the process of checking the hardware, I notice that the case fans have accumulated a lot of green "gunk" and I've tried wetting the edge of a paper towel to wipe and rub it off. Still, there is always some residue remaining. What's the best way to clean off this gunk? Thanks in advance. No pictures, but I can take some if needed.

    Read the article

  • Good coding style to do case-select in XSLT

    - by Scud
    I want to have a page display A,B,C,D depending on the return value from XML value (1,2,3,4). My approaches are by javascript or XSLT:choose. I want to know which way is better, and why? Can I do this case-select in .cs code (good or bad)? Should I javascript code in XSLT? Can the community please advise? Thanks. Below are the code. Javascript way (this one works): <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:js="urn:custom-javascript"> <xsl:template match="page"> <msxsl:script language="JavaScript" implements-prefix="js"> <![CDATA[ function translateSkillLevel(level) { switch (level) { case 0: return "Level 1"; case 1: return "Level 2"; case 2: return "Level 3"; } return "unknown"; } ]]> </msxsl:script> <div id="skill"> <table border="0" cellpadding="1" cellspacing="1"> <tr> <th>Level</th> </tr> <xsl:for-each select="/page/Skill"> <tr> <td> <!-- difference here --> <script type="text/javascript"> document.write(translateSkillLevel(<xsl:value-of select="@level"/>)); </script> </td> </tr> </xsl:for-each> </table> </div> </xsl:template> </xsl:stylesheet> Javascript way (this one doesn't work, getting undefined js tag): <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:js="urn:custom-javascript"> <xsl:template match="page"> <msxsl:script language="JavaScript" implements-prefix="js"> <![CDATA[ function translateSkillLevel(level) { switch (level) { case 0: return "Level 1"; case 1: return "Level 2"; case 2: return "Level 3"; } return "unknown"; } ]]> </msxsl:script> <div id="skill"> <table border="0" cellpadding="1" cellspacing="1"> <tr> <th>Level</th> </tr> <xsl:for-each select="/page/Skill"> <tr> <td> <!-- difference here --> <xsl:value-of select="js:translateSkillLevel(string(@level))"/> </td> </tr> </xsl:for-each> </table> </div> </xsl:template> </xsl:stylesheet> XSLT way: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="page"> <div id="skill"> <table border="0" cellpadding="1" cellspacing="1"> <tr> <th>Level</th> </tr> <xsl:for-each select="/page/Skill"> <tr> <td> <xsl:choose> <xsl:when test="@level = 0"> Level 1 </xsl:when> <xsl:when test="@level = 1"> Level 2 </xsl:when> <xsl:when test="@level = 2"> Level 3 </xsl:when> <xsl:otherwise> unknown </xsl:otherwisexsl:otherwise> </xsl:choose> </td> </tr> </xsl:for-each> </table> </div> </xsl:template> </xsl:stylesheet> EDIT: Also, I have some inline javascript functions for form submit. <input type="submit" onclick="javascript:document.forms[0].submit();return false;"/>

    Read the article

  • Webcor Builders Coordinates Construction Schedules and Mitigates Potential Delays More Efficiently with Integrated Project Management

    - by Sylvie MacKenzie, PMP
    Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman","serif";} With more than 40 years of commercial construction experience, Webcor Builders is a leading builder of distinguished, high-profile projects, including high-rise condominiums and hotels, laboratories, healthcare centers, and public works projects. Webcor is also known for its award-winning concrete, interior construction, historic restoration, and seismic renovation work. The company has completed more than 50 million square feet of projects to date. Considering the variety and complexity of the construction projects Webcor undertakes, an integrated project management solution is critical to ensuring optimal efficiency and completing client projects on time and on budget. The company previously used a number of scheduling systems for its various building projects. These packages provided different levels of schedule detail and required schedulers, engineers, and other employees to learn multiple systems. From an IT cost and complexity perspective, the company had to manage multiple scheduling systems and pay for multiple sets of licenses. The company looked to standardize on an enterprise project management system, and selected Oracle’s Primavera P6 Enterprise Project Portfolio Management. Webcor uses the solution’s advanced capabilities to schedule complex projects, analyze delays, model and propose multiple scenarios to demonstrate and mitigate delays and cost overruns, and process that information efficiently to deliver the scheduling precision that public and private projects require. In fact, the solution was instrumental in helping the company’s expansion into public sector projects during the recent economic downturn, and with Primavera P6 in place, it can deliver the precise schedule reporting required for large public projects. With Primavera P6 in place, the company could deliver the precise scheduling and milestone reporting capabilities required for large public projects. The solution is in managing the high-profile University of California – Berkeley Memorial Stadium project. Webcor was hired as construction manager and general contractor for the stadium renovation project, which is a fast-paced project located near the seismically active Hayward Fault Zone. Due to the University of California’s football schedule, meeting the Universities deadline for the coming season placed Webcor in a situation where risk awareness and early warnings of issues would be paramount. Webcor and the extended project team needed a solution that could instantly analyze alternate scenarios to mitigate potential delays; Primavera would deliver those answers.The team would also need to enable multiple stakeholders to use an internet-based platform to access the schedule from various locations, and model complicated sequencing requirements where swift decisions would be made to keep the project on track. The schedule is an integral part of Webcor’s construction management process for the stadium project. Rather than providing the client with the industry-standard monthly update, Webcor updates the critical path method (CPM) schedule on a weekly basis. The project team also reviews the schedule and updates weekly to confirm that progress and forecasted performance are accurate. Hired by the University for their ability to deliver in high risk environments The Webcor team was hit recently with a design supplement that could have added up to 70 days to the project. Using Oracle Primavera P6 the team sprung into action analyzing multiple “what if” scenarios to review mitigation means and methods.  Determined to make sure the Bears could take the field in the coming season the project team nearly eliminated the impact with their creative analysis in working the schedule. The total time from the issuance of the final design supplement to an agreed mitigation response was less than one week; leveraging the Oracle Primavera solution Webcor was able to deliver superior customer value With the ability to efficiently manage projects and schedules, Webcor can ensure it completes its projects on time and on budget, as well as inform clients about what changes to plans will mean in terms of delays and additional costs. Read the complete customer case study at :  http://www.oracle.com/us/corporate/customers/customersearch/webcor-builders-1-primavera-ss-1639886.html

    Read the article

  • How do uppercase and lowercase letters differ by only one bit?

    - by Vibhakar SInha
    I have found one example in Data and Communication Networking book written by Behrouza Forouzan regarding upper- and lowercase letters which differ by only one bit in the 7 bit code. For example, character A is 1000001 (0x41) and character a is 1100001 (0x61).The difference is in bit 6, which is 0 in uppercase letters and 1 in lowercase letters. If we know the code for one case, we can easily find the code for the other by adding or subtracting 32 in decimal, or we can just flip the sixth bit. What does all this mean? I have found myself very confused with all these things. Could someone provide examples of how these things really work out?

    Read the article

  • Are scheduled job servers the right choice for a time sensitive game engine?

    - by maple_shaft
    I am currently architecting and designing an exciting new web application that will be entering into some areas that I have very little experience in, game development. The application is not necessarily a game, but there are some very time sensitive tasks and scheduled jobs that a server will need to run to perform game related activities (Eg. New match up starts at noon every day for a 12 day tournament, updating scoreboards at 5pm every day, etc...) In the past I have typically used cron jobs with the Quartz Scheduler running within a web application server, but I know that this isn't likely a scalable solution for the truly massive userbase that management is telling me to expect (Granted they are management and are probably highly optimistic about this) and also for how important the role of these tasks are in this web application. The other important thing I want to consider is that I want to avoid SPOF (Single Point Of Failure). If the primary job server goes down, another job server should be able to successfully run the job in its place. I suppose this can be done appropriately record locking and database transactions. My question is if scheduled jobs like CRON running on a web application server are a wise design choice given the time sensitive game tasks of this application, or is there something more appropriate for running a scalable game engine parallel to the web application servers?

    Read the article

  • How to use Public IP in case of two ISP when two differs from each other

    - by user1471995
    Please bare with my long explanation but this is important to explain the actual problem. Please also pardon my knowledge with PFsense as i am new to this. I have single PFSense box with 3 Ethernet adapter. Before moving to configuration for these, i want to let you know i have two Ethernet based Internet Leased Line Connectivity let's call them ISP A and ISP B. Then last inetrface is LAN which is connected to network switch. Typical network diagram ISP A ----- PFSense ----> Switch ---- > Servers ISP B ----- ISP A (Initially Purchased) WAN IP:- 113.193.X.X /29 Gateway IP :- 113.193.X.A and other 4 usable public IP in same subnet(So the gateway for those IP are also same). ISP B (Recently Purchased) WAN IP:- 115.115.X.X /30 Gateway IP :- 115.115.X.B and other 5 usable public IP in different subnet(So the gateway for those IP is different), for example if 115.119.X.X2 is one of the IP from that list then the gateway for this IP is 115.119.X.X1. Configuration for 3 Interfaces Interface : WAN Network Port : nfe0 Type : Static IP Address : 113.193.X.X /29 Gateway : 113.193.X.A Interface : LAN Network Port : vr0 Type : Static IP Address : 192.168.1.1 /24 Gateway : None Interface : RELWAN Network Port : rl0 Type : Static IP Address : 115.115.X.X /30 (I am not sure of the subnet) Gateway : 115.115.X.B To use Public IP from ISP A i have done following steps a) Created Virtual IP using either ARP or IP Alias. b) Using Firewall: NAT: Port Forward i have created specific natting from one public IP to my internal Lan private IP for example :- WAN TCP/UDP * * 113.193.X.X1 53 (DNS) 192.168.1.5 53 (DNS) WAN TCP/UDP * * 113.193.X.X1 80 (HTTP) 192.168.1.5 80 (HTTP) WAN TCP * * 113.193.X.X2 80 (HTTP) 192.168.1.7 80 (HTTP) etc., c) Current state for Firewall: NAT: Outbound is Manual and whatever default rule are defined for the WAN those are only present. d) If this section in relevant then for Firewall: Rules at WAN tab then following default rule has been generated. * RFC 1918 networks * * * * * Block private networks * Reserved/not assigned by IANA * * * * * * To use Public IP from ISP B i have done following steps a) Created Virtual IP using either ARP or IP Alias. b) Using Firewall: NAT: Port Forward i have created specific natting from one public IP to my internal Lan private IP for example :- RELWAN TCP/UDP * * 115.119.116.X.X1 80 (HTTP) 192.168.1.11 80 (HTTP) c) Current state for Firewall: NAT: Outbound is Manual and whatever default rule are defined for the RELWAN those are only present. d) If this section in relevant then for Firewall: Rules at RELWAN tab then following default rule has been generated. * RFC 1918 networks * * * * * * Reserved/not assigned by IANA * * * * * * Last thing before my actual query is to make you aware that to have multiple Wan setup i have done following steps a) Under System: Gateways at Groups Tab i have created new group as following MultipleGateway WANGW, RELWAN Tier 2,Tier 1 Multiple Gateway Test b) Then Under Firewall: Rules at LAN tab i have created a rule for internal traffic as follows * LAN net * * * MultipleGateway none c) This setup works if unplug first ISP traffic start routing using ISP 2 and vice-versa. Now my main query and problem is i am not able to use public IP address allocated by ISP B, i have tried many small tweaks but not successful in anyone. The notable difference between the two ISP is a) In case of ISP A there Public usable IP address are on same subnet so the gateway used for the WAN ip is same for the other public IP address. b) In case of ISP B there public usable IP address are on different subnet so the obvious the gateway IP for them is different from WAN gateway's IP. Please let me know how to use ISP B public usable IP address, in future also i am going to rely for more IPs from ISP B only.

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >