Search Results

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

Page 7/1150 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • mounts aren't case-sensitive

    - by Asi
    I mounted a few drives from Linux boxes in my network, but those mounts aren't case-sensitive. The mount command I used ( from the man mount.cifs, case-sensitive should be the default ): mount //10.0.1.10/remote_folder /local_folder -t cifs -o username=xxxx,password=xxxx but those mounts aren't sensitive. for example doing: ls -l /local_folder/testfile.txt ls -l /local_folder/TESTFILE.TXT give's the same result... instead of 'file not found' Couple of important points: All drives are running on Linux machines. My local machine is running Fedora 18 and it is case-sensitive for ANY folder/file expect the mounted drives. All drive/mounts are case-sensitive when when doing SSH. So if I SSH from my local machine to a remote machine, doing ls -l /local_folder/TESTFILE.TXT will say file not found as it should. So I believe the issue is in my local machine and not in the way I did the mount. but I'm not sure where to look next (I'm new to Linux)

    Read the article

  • Using a Case statement within the values section of an Insert statement

    - by mattgcon
    Please forgive my ignorance and poor SQL programming skills but I am normally a basic SQL developer. I need to create a trigger off the insertion of data in one table to insert different data into another table. Within this trigger I need to insert certain data into the new table based upon values within the newly inserted data from the original table. I am totally confused on this. i thought I would be creative and use a case statement within teh Values section but it is not working. Can anyone please help me on this? (below is the code for the trigger that I have as of now) INSERT INTO dbo.WebOnlineUserPeopleDashboard ( ONLINE_USERACCOUNT_ID, ONLINE_ROOMS_DIRECTORY, ONLINE_ROOMS_LIST, ONLINE_ROOMS_PLACEMENT, ONLINE_ROOMS_MANAGEMENT, ONLINE_MAILINGLIST_DIRECTORY, ONLINE_MAILINGLIST_LIST, ONLINE_MAILINGLIST_MEMBERS, ONLINE_MAILINGLIST_MANAGER, ONLINE_PEOPLESEARCH_DIRECTORY ) VALUES IF (SELECT ONLINE_PEOPLE_FULL_ACCESS FROM INSERTED) = 1 BEGIN SELECT ONLINE_USERACCOUNT_ID, 1, 1, 1, 1, 1, 1, 1, 1, 1 FROM INSERTED END ELSE IF (SELECT ONLINE_PEOPLE_FULL_ACCESS FROM INSERTED) = 0 BEGIN SELECT ONLINE_USERACCOUNT_ID, 0, 0, 0, 0, 0, 0, 0, 0, 0 FROM INSERTED END ELSE BEGIN SELECT ONLINE_USERACCOUNT_ID, CASE --DIRECTORY WHEN ONLINE_PEOPLE_ROOMS_PLACEMENT_FULL_ACCESS = 1 OR ONLINE_PEOPLE_ROOMS_PLACEMENT_VIEW = 1 OR ONLINE_PEOPLE_ROOMS_PLACEMENT_ADD = 1 OR ONLINE_PEOPLE_ROOMS_PLACEMENT_UPDATE = 1 OR ONLINE_PEOPLE_ROOMS_PLACEMENT_DELETE = 1 THEN 1 WHEN ONLINE_PEOPLE_ROOMS_PLACEMENT_FULL_ACCESS = 0 THEN 0 END, CASE WHEN ONLINE_PEOPLE_ROOMS_PLACEMENT_VIEW = 1 THEN 1 WHEN ONLINE_PEOPLE_ROOMS_PLACEMENT_VIEW = 0 THEN 0 END, CASE WHEN ONLINE_PEOPLE_ROOMS_PLACEMENT_ADD = 1 OR ONLINE_PEOPLE_ROOMS_PLACEMENT_UPDATE = 1 OR ONLINE_PEOPLE_ROOMS_PLACEMENT_DELETE = 1 THEN 1 WHEN ONLINE_PEOPLE_ROOMS_PLACEMENT_ADD = 0 AND ONLINE_PEOPLE_ROOMS_PLACEMENT_UPDATE = 0 AND ONLINE_PEOPLE_ROOMS_PLACEMENT_DELETE = 0 THEN 0 END, CASE WHEN ONLINE_PEOPLE_ROOMS_MANAGEMENT_FULL_ACCESS = 1 THEN 1 WHEN ONLINE_PEOPLE_ROOMS_MANAGEMENT_FULL_ACCESS = 0 THEN 0 END, CASE WHEN ONLINE_PEOPLE_MAILING_LISTS_FULL_ACCESS = 1 OR ONLINE_PEOPLE_MAILING_LISTS_VIEW = 1 OR ONLINE_PEOPLE_MAILING_LISTS_MEMBERS_ADD = 1 OR ONLINE_PEOPLE_MAILING_LISTS_MEMBERS_UPDATE = 1 OR ONLINE_PEOPLE_MAILING_LISTS_MEMBERS_DELETE = 1 THEN 1 WHEN ONLINE_PEOPLE_MAILING_LISTS_FULL_ACCESS = 0 THEN 0 END, CASE WHEN ONLINE_PEOPLE_MAILING_LISTS_VIEW = 1 THEN 1 WHEN ONLINE_PEOPLE_MAILING_LISTS_VIEW = 0 THEN 0 END, CASE WHEN ONLINE_PEOPLE_MAILING_LISTS_MEMBERS_ADD = 1 OR ONLINE_PEOPLE_MAILING_LISTS_MEMBERS_UPDATE = 1 OR ONLINE_PEOPLE_MAILING_LISTS_MEMBERS_DELETE = 1 THEN 1 WHEN ONLINE_PEOPLE_MAILING_LISTS_MEMBERS_ADD = 0 AND ONLINE_PEOPLE_MAILING_LISTS_MEMBERS_UPDATE = 0 AND ONLINE_PEOPLE_MAILING_LISTS_MEMBERS_DELETE = 0 THEN 0 END, CASE WHEN ONLINE_PEOPLE_MAILING_LISTS_ADD = 1 OR ONLINE_PEOPLE_MAILING_LISTS_UPDATE = 1 OR ONLINE_PEOPLE_MAILING_LISTS_DELETE = 1 THEN 1 WHEN ONLINE_PEOPLE_MAILING_LISTS_ADD = 1 OR ONLINE_PEOPLE_MAILING_LISTS_UPDATE = 1 OR ONLINE_PEOPLE_MAILING_LISTS_DELETE = 1 THEN 0 END, CASE WHEN ONLINE_PEOPLE_PEOPLE_SEARCH = 1 THEN 1 WHEN ONLINE_PEOPLE_PEOPLE_SEARCH = 0 THEN 0 END FROM INSERTED END END

    Read the article

  • C++: Calling class functions within a switch

    - by user1446002
    i've been trying to study for my finals by practicing classes and inheritance, this is what I've come up with so far for inheritance and such however I'm unsure how to fix the error occuring below. #include<iostream> #include<iomanip> #include<cmath> #include<string.h> using namespace std; //BASE CLASS DEFINITION class hero { protected: string name; string mainAttr; int xp; double hp; double mana; double armour; int range; double attkDmg; bool attkType; public: void dumpData(); void getName(); void getMainAttr(); void getAttkData(); void setAttkData(string); void setBasics(string, string, double, double, double); void levelUp(); }; //CLASS FUNCTIONS void hero::dumpData() { cout << "Name: " << name << endl; cout << "Main Attribute: " << mainAttr << endl; cout << "XP: " << xp << endl; cout << "HP: " << hp << endl; cout << "Mana: " << mana << endl; cout << "Armour: " << armour << endl; cout << "Attack Range: " << range << endl; cout << "Attack Damage: " << attkDmg << endl; cout << "Attack Type: " << attkType << endl << endl; } void hero::getName() { cout << "Name: " << name << endl; } void hero::getMainAttr() { cout << "Main Attribute: " << mainAttr << endl; } void hero::getAttkData() { cout << "Attack Range: " << range << endl; cout << "Attack Damage: " << attkDmg << endl; cout << "Attack Type: " << attkType << endl; } void hero::setAttkData(string attr) { int choice = 0; if (attr == "Strength") { choice = 1; } if (attr == "Agility") { choice = 2; } if (attr == "Intelligence") { choice = 3; } switch (choice) { case 1: range = 128; attkDmg = 80.0; attkType = 0; break; case 2: range = 350; attkDmg = 60.0; attkType = 0; break; case 3: range = 600; attkDmg = 35.0; attkType = 1; break; default: break; } } void hero::setBasics(string heroName, string attribute, double health, double mp, double armourVal) { name = heroName; mainAttr = attribute; hp = health; mana = mp; armour = armourVal; } void hero::levelUp() { xp = 0; hp = hp + (hp * 0.1); mana = mana + (mana * 0.1); armour = armour + ((armour*0.1) + 1); attkDmg = attkDmg + (attkDmg * 0.05); } //INHERITED CLASS DEFINITION class neutHero : protected hero { protected: string drops; int xpGain; public: int giveXP(int); void dropItems(); }; //INHERITED CLASS FUNCTIONS int neutHero::giveXP(int exp) { xp += exp; } void neutHero::dropItems() { cout << name << " has dropped the following items: " << endl; cout << drops << endl; } /* END OF OO! */ //FUNCTION PROTOTYPES void dispMenu(); int main() { int exit=0, choice=0, mainAttrChoice=0, heroCreated=0; double health, mp, armourVal; string heroName, attribute; do { dispMenu(); cin >> choice; switch (choice) { case 1: system("cls"); cout << "Please enter your hero name: "; cin >> heroName; cout << "\nPlease enter your primary attribute\n"; cout << "1. Strength\n" << "2. Agility\n" << "3. Intelligence\n"; cin >> mainAttrChoice; switch (mainAttrChoice) { case 1: attribute = "Strength"; health = 750; mp = 150; armourVal = 2; break; case 2: attribute = "Agility"; health = 550; mp = 200; armourVal = 6; break; case 3: attribute = "Intelligence"; health = 450; mp = 450; armourVal = 1; break; default: cout << "Choice invalid, please try again."; exit = 1; break; hero player; player.setBasics(heroName, attribute, health, mp, armourVal); player.setAttkData(attribute); heroCreated=1; system("cls"); cout << "Your hero has been created!\n\n"; player.dumpData(); system("pause"); break; } case 2: system("cls"); if (heroCreated == 1) { cout << "Your hero has been detailed below.\n\n"; **player.dumpData(); //ERROR OCCURS HERE !** system("pause"); } else { cout << "You have not created a hero please exit this prompt " "and press 1 on the menu to create a hero."; } break; case 3: system("cls"); cout << "Still Under Development"; system("pause"); break; case 4: system("cls"); exit = 1; break; default: cout << "Your command has not been recognised, please try again.\n"; system("pause"); break; } } while (exit != 1); system("pause"); return 0; } void dispMenu() { system("cls"); cout << "1. Create New Hero\n" "2. View Current Hero\n" "3. Fight Stuff\n" "4. Exit\n\n" "Enter your choice: "; } However upon compilation I get the following errors: 220 `player' undeclared (first use this function) Unsure exactly how to fix it as I've only recently started using OO approach. The error has a comment next to it above and is in case 2 in the main. Cheers guys.

    Read the article

  • Using VNC as a virtual KVM switch

    - by aurinko
    I'm wanting to control my laptop from my desktop. I've been doing this with VNC (PC desktop to Macbook pro) - but I want to remove the 'viewing' aspect of it on my desktop. I.e. I don't want to have the viewing screen on the desktop.. but be able to control the mouse/keyboard via VNC. Is this possible? I'm using realVNC viewer and connecting to the default in-built VNC server on Mac OS X Lion. Cheers for any help.

    Read the article

  • What happens when a consumer switch receives a VLAN-tagged Ethernet frame?

    - by netvope
    Suppose you connect a trunk port from a VLAN capable network switch to a (VLAN incapable) consumer-grade network switch via a direct cable. Now the former switch send the later switch a 802.1Q-tagged Ethernet frame. What should the later switch do? Drop the frame? Forward the frame? Undefined behavior? If the behavior is undefined, what is most probable? Edit: Thank you for your answers. To summarize, the behavior of the consumer switch depends on: How it handles frames with 0x8100 in the EtherType field1 How it handles jumbo frames, or frames with payload larger than 1500 bytes Wikipedia has a nice diagram comparing an untagged and a tagged Ethernet frame: There are reports that some consumer-grade switches pass VLAN-tagged frames just fine. 1 or more precisely, where an EtherType field is expected for non-tagged frames

    Read the article

  • Cisco FC SAN switch decision

    - by Chopper3
    I've got to buy a bunch of FC SAN switches in the next week or so, I have to, and want to, buy Cisco MDSs. Servers are HP BL490c G6's in C7000 chassis with Virtual-Connect Flex-10 ethernet interconnects and VC FC interconnects (Emulex HBAs btw), all running ESX 3.5U4 (for now). I think I've only really got two choices; MDS 9509's with dual-supervisors with a single 48-port 4Gb FC card MDS 9222i's with single supervisor and the built-in 18-FC-port/4-GigE-FCIP-port option Both have the same functionality (I think, buying the enterprise licence btw), both have plenty enough performance and adequate ports for now and the next three years. The 9222i's are about 55% the price of the 9509's - logic says get the 'i's but will I really miss the dual-supervisors? I've got lots of 9509's with dual-supervisors that I'm very happy with but I'm not sure I've every benefitted from the dual-sups in the past and they are nearly twice the price - but if I don't buy them and miss them I can't retrofit them later. What are your thoughts?

    Read the article

  • Networking switch setup

    - by Crash893
    I have two 48 port gigabit netgear switches with 2 SFP ports each (i also have two Mini-GBIC copper transceiver modules) Is it best to set the ports up by using the built in ports (ie plug port 1 of switchB into port 48 of switchA and port1 of switchA into the router) or is there an advantage to using the mini-gbic? (lets call the sfp ports 49 and 50) router - port 49 on switchA, port 50 switchA - port 49 SwitchB

    Read the article

  • Connecting server to more than one switch.

    - by Jake
    I have 3 switches, one NEATGEAR GS748T and two JGS524. Initially I wanted to connect them in a triangle loop, but later suspect that the JG524 does not have spanning tree support. Now I have a Dell R710 with 2 NIC at the back. If I connect the server in between the two JGS524, which both in turn connect to the GS748T, will that consitute a loop? According to my limited understanding, with 2 NICs there will be 2 IPs for the server. Will the file server even work or not? Theoretically speaking, will this configuration increase the access speeds for clients? Thanks.

    Read the article

  • Switch User in RedHat like XP

    - by rd42
    In our cluster, RedHat4 & 5 machines, if someone locks the computer and walks away no body can use it. Is there a feature in RedHat5, Gnome, KDE etc that would allow for the option of switching users at the lock screen, so more than one person can be logged in? Thanks, rd42

    Read the article

  • Virtual bridge/switch for Windows server&client?

    - by Tiberiu-Ionu? Stan
    I can't find a very simple application, with litle to zero configuration on both client and server side which would help one computer to bring other computers on an existing private LAN. OpenVPN seems like an overkill for this type of thing, and is really hard to get running or debug by various clueless people trying to connect. Does such a software exist? It's very odd not to. THe Windows provided VPN (PPTP over TCP and GRE) is not what I'm looking for because it is often filtered by ISPs. Only TCP and UDP solutions pls. Encryption is not needed.

    Read the article

  • Looking for KVM switch (over IP) with good linux client [closed]

    - by B14D3
    I have some ATEN CN6000 and i1708 KVM boxes and clients for them are made for windows and java. Java clients doesnt work neither on win or linux systems(I can run them with JavaRE but they dont connect to KVM box). Client for CN6000 on windows works quite well but a have huge problems with connect to i1708 with win client. So I'm looking for some good replacement. I'm aiming to KVM with linux client. Whether there are such ? What kind of KVMs you are using and have good opinion about them?

    Read the article

  • Problem with upper-case and lower-case xpath functions in selenium IDE

    - by Aristotelis
    Hi, I am trying to get a xpath query using the xpath function lower-case or uppper-case, but they seem to not work in selenium (where I test my xpath before I apply it). Example that does NOT work: //*[.=upper-case('some text')] I have no problem locating the nodes I need in complex path and even using aggregated functions, as long as I don't use the upper and lower case. Has anyone encountered this before? Does it make sense? Thanks.

    Read the article

  • error: switch quantity not an integer

    - by nikeunltd
    I have researched my issue all over StackOverflow and multi-google links, and I am still confused. I figured the best thing for me is ask... Im creating a simple command line calculator. Here is my code so far: const std::string Calculator::SIN("sin"); const std::string Calculator::COS("cos"); const std::string Calculator::TAN("tan"); const std::string Calculator::LOG( "log" ); const std::string Calculator::LOG10( "log10" ); void Calculator::set_command( std::string cmd ) { for(unsigned i = 0; i < cmd.length(); i++) { cmd[i] = tolower(cmd[i]); } command = cmd; } bool Calculator::is_legal_command() const { switch(command) { case TAN: case SIN: case COS: case LOG: case LOG10: return true; break; default: return false; break; } } the error i get is: Calculator.cpp: In member function 'bool Calculator::is_trig_command() const': Calculator.cpp: error: switch quantity not an integer Calculator.cpp: error: 'Calculator::TAN' cannot appear in a constant-expression Calculator.cpp: error: 'Calculator::SIN' cannot appear in a constant-expression Calculator.cpp: error: 'Calculator::COS' cannot appear in a constant-expression The mighty internet, it says strings are allowed to be used in switch statements. Thanks everyone, I appreciate your help.

    Read the article

  • C# - using decimal in switch impossible?

    - by phobia
    Hi, I'm justing starting out learning C# and I've become stuck at something very basic. For my first "app" I thought I'd go for something simple, so I decided for a BMI calculator. The BMI is calculated into a decimal type which I'm now trying to use in a switch statement, but aparently decimal can't be used in a switch? What would be the C# solution for this: decimal bmi = calculate_bmi(h, w); switch (bmi) { case < 18.5: bmi_description = "underweight."; break; case > 25: bmi_description = "overweight"; case > 30: bmi_description = "very overweight"; case > 40: bmi_description = "extreme overweight"; break; } Thanks in advance :)

    Read the article

  • How to simplify this php switch statement?

    - by janoChen
    I would like to change this: // use appropiate lang.xx.php file according to the value of the $lang switch ($_SESSION['lang']) { case 'en': $lang_file = 'lang.en.php'; break; case 'es': $lang_file = 'lang.es.php'; break; case 'zh-tw': $lang_file = 'lang.zh-tw.php'; break; case 'zh-cn': $lang_file = 'lang.zh-cn.php'; break; default: $lang_file = 'lang.en.php'; } into something like this: //include file for final output include_once 'languages/lang.'.$_SESSION['lang'].'php; So that I can skip the whole switch part. I tried other combinations but they don't seem to work. Any suggestions?

    Read the article

  • PHP Get variable to equal value of switch

    - by user342391
    I am trying to get a variable on my page to equal the result of a switch I have. This is the code: $payment_method = switch ($cardtype) { case "visa" : echo "VSA"; break; case "mastercard" : echo "MSC"; break; case "maestro" : echo "MAE"; break; case "amex" : echo "AMX" ; break; default : echo "Please specify a payment method!"; break; }; How can I get $payment_method to equal the result of this???? So far I recieve an error: Parse error: syntax error, unexpected T_SWITCH in /var/www/account/credits/moneybookers/process.php on line 65

    Read the article

  • When are references declared in a switch statement?

    - by sandis
    To my surprise this code works fine: int i = 2; switch(i) { case 1: String myString = "foo"; break; case 2: myString = "poo"; System.out.println(myString); } But the String reference should never be declared? Could it be that all variables under every case always are declared no matter what, or how is this resolved?

    Read the article

  • iphone sdk conditional in switch function

    - by Oliver
    I'm trying to make a random image appear on the press of a button. So it generates a random number, and the switch algorithm swaps the chosen image with the one in the imgview. but I want a switch in the settings app to toggle which set of images to use. I know pretty much how to do it...it's just that it doesn't work. I'm missing some syntax thing...Please help, stackoverflow? it's my birthday. int Number = rand() %30; NSString *toggleValue = [[NSUserDefaults standardUserDefaults] stringForKey:@"enabled_preference"]; switch (Number) { if (*toggleValue == 0) { case 0: picture.image = [UIImage imageNamed:@"1.png"]; break; case 1: picture.image = [UIImage imageNamed:@"2.png"]; break;} else { case 0: picture.image = [UIImage imageNamed:@"3.png"]; break; case 1: picture.image = [UIImage imageNamed:@"4.png"]; break;} }

    Read the article

  • Why no switch on pointers?

    - by meeselet
    For instance: #include <stdio.h> void why_cant_we_switch_him(void *ptr) { switch (ptr) { case NULL: printf("NULL!\n"); break; default: printf("%p!\n", ptr); break; } } int main(void) { void *foo = "toast"; why_cant_we_switch_him(foo); return 0; } gcc test.c -o test test.c: In function 'why_cant_we_switch_him': test.c:5: error: switch quantity not an integer test.c:6: error: pointers are not permitted as case values Just curious. Is this a technical limitation? EDIT People seem to think there is only one constant pointer expression. Is that is really true, though? For instance, here is a common paradigm in Objective-C (it is really only C aside from NSString, id and nil, which are merely a pointers, so it is still relevant — I just wanted to point out that there is, in fact, a common use for it, despite this being only a technical question): #include <stdio.h> #include <Foundation/Foundation.h> static NSString * const kMyConstantObject = @"Foo"; void why_cant_we_switch_him(id ptr) { switch (ptr) { case kMyConstantObject: // (Note that we are comparing pointers, not string values.) printf("We found him!\n"); break; case nil: printf("He appears to be nil (or NULL, whichever you prefer).\n"); break; default: printf("%p!\n", ptr); break; } } int main(void) { NSString *foo = @"toast"; why_cant_we_switch_him(foo); foo = kMyConstantObject; why_cant_we_switch_him(foo); return 0; } gcc test.c -o test -framework Foundation test.c: In function 'why_cant_we_switch_him': test.c:5: error: switch quantity not an integer test.c:6: error: pointers are not permitted as case values It appears that the reason is that switch only allows integral values (as the compiler warning said). So I suppose a better question would be to ask why this is the case? (though it is probably too late now.)

    Read the article

  • Switch Statement in C#

    - by pm_2
    Does anyone know if it's possible to include a range in a switch statement (and if so, how)? For example: switch (x) { case 1: //do something break; case 2..8: //do something else break; default: break; } The compiler doesn't seem to like this kind of syntax - neither does it like: case <= 8:

    Read the article

  • C# Switch-case Loop for Datagridview cells

    - by Nail Yener
    Hi, I am working on a form with datagridview and webbrowser controls. I have three columns as URL, username and password in datagridview. What I want to do is to automate the login for some websites that I use frequently. For that reason I am not sure if this is the right approach but I created the below code. The problem is with the argument of switch. I will click the row on datagridview and then click the login_button so that the username and password info will be passed to the related fields on the webpage. Why I need a switch-case loop is because all the webpages have different element IDs for username and password fields. As I said, I am not sure if datagridview allows switch-case, I searched the net but couldn't find any samples. private void login_button_Click(object sender, EventArgs e) { switch (dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString()) { case "http://www.website1.com": webBrowser1.Document.GetElementById("username").InnerText = dataGridView1.Rows[3].Cells[3].Value.ToString(); webBrowser1.Document.GetElementById("password").InnerText = dataGridView1.Rows[3].Cells[4].Value.ToString(); return; case "http://www.website2.com": webBrowser1.Document.GetElementById("uname").InnerText = dataGridView1.Rows[4].Cells[3].Value.ToString(); webBrowser1.Document.GetElementById("pswd").InnerText = dataGridView1.Rows[4].Cells[4].Value.ToString(); return; } HtmlElementCollection elements = this.webBrowser1.Document.GetElementsByTagName("Form"); foreach (HtmlElement currentElement in elements) { currentElement.InvokeMember("Login"); } }

    Read the article

  • Weird switch behavior in .NET 4

    - by RaYell
    I have a problem understanding what's causes the compilation error in the code below: static class Program { static void Main() { dynamic x = ""; var test = foo(x); if (test == "test") { Console.WriteLine(test); } switch (test) { case "test": Console.WriteLine(test); break; } } private static string foo(object item) { return "bar"; } } The error I get is in switch (test) line: A switch expression or case label must be a bool, char, string, integral, enum, or corresponding nullable type. Intellisence shows me that foo operation will be resolved on runtime, which is fine because I'm using a dynamic type as a param. However I don't understand how if condition compiles fine when switch doesn't. Code above is just simplified version of what I have in my application (VSTO) which appeared after migrating the app from VSTO3 to VSTO4 when one method in VSTO was changed to return dynamic type values instead of object. Can anyone give me an explanation what's the problem. I know how to resolve it but I'd like to understand what's happening.

    Read the article

  • Switch statement usage - C

    - by Jamie Keeling
    Hello, I have a thread function on Process B that contains a switch to perform certain operations based on the results of an event sent from Process A, these are stored as two elements in an array. I set the first element to the event which signals when Process A has data to send and I have the second element set to the event which indicates when Process A has closed. I have began to implement the functionality for the switch statement but I'm not getting the results as I expect. Consider the following: // //Thread function DWORD WINAPI ThreadFunc(LPVOID passedHandle) { for(i = 0; i < 2; i++) { ghEvents[i] = OpenEvent(EVENT_ALL_ACCESS, FALSE, TEXT("Global\\ProducerEvents")); if(ghEvents[i] == NULL) { getlasterror = GetLastError(); } } dwProducerEventResult = WaitForMultipleObjects( 2, ghEvents, FALSE, INFINITE); switch (dwProducerEventResult) { case WAIT_OBJECT_0 + 0: { //Producer sent data //unpackedHandle = *((HWND*)passedHandle); MessageBox(NULL,L"Test",L"Test",MB_OK); break; } case WAIT_OBJECT_0 + 1: { //Producer closed ExitProcess(1); break; } default: return; } } As you can see if the event in the first array is signalled Process B should display a simple message box, if the second array is signalled the application should close. When I actually close Process A, Process B displays the message box instead. If I leave the first case blank (Do nothing) both applications close as they should. Furthermore Process B sends data an error is thrown (When I comment out the unpacking): Have I implemented my switch statement incorrectly? I though I handled the unpacking of the HWND correctly too, any suggestions? Thanks for your time.

    Read the article

  • Why is the link between my switch and my router always negotiating half-duplex mode?

    - by Massimo
    I have a Cisco 2950 switch which has one of its ports connected to an Internet router provided by my ISP; I have no access to the router configuration, but I manage the switch. If I leave all switch ports with their default setup (auto-negotiation of speed and duplex mode), this link always connects at 100 MBit/s, but in half-duplex mode. I've tried replacing the cable, and also moving the link to another switch port: the result is always the same. A different device connected to the same port (or to any switch port, really) shows no problem at all. It could be guesed that someone configured the router to only connect in half-duplex mode... BUT, here's the catch: if I manually force the switch port to full-duplex mode (duplex full in the interface configuration), the link goes up, stays up and is completely stable. So: The connection is not forced to half-duplex mode by the router, otherwise it would not connect at all if I force the switch end to full-duplex. There is no actual link problem, otherwise the full-duplex connection would not go up or would at least show some errors. But if I leave the port free to auto-negotiate, it always connects in half-duplex mode. Why?

    Read the article

  • Repository pattern - Switch out the database and switch in XML files

    - by glasto red
    Repository pattern - Switch out the database and switch in XML files. Hello I have an asp.net MVC 2.0 project and I have followed the Repository pattern. Periodically, I am losing access to the database server so I want to have another mechanism in place (XML files) to continue developing. It is not possible to have a local version of the db unfortunately! I thought this would be relatively easy using the Repository pattern, to switch out the db repositories and switch in XML versions. However, I am having real trouble coming up with a solution. I have tried LinqToXML but then ran into problems trying to return a List of News items as the LinqToXML ToList returns Generic.List Should I be mapping the XElement list over to the News list by hand? It just seems a bit clunky compared to LinqToSQL attributes on the News class and then simply doing a Table.....ToList(); Any direction would be appreciated. Thanks

    Read the article

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