Search Results

Search found 8673 results on 347 pages for 'kvm switch'.

Page 41/347 | < Previous Page | 37 38 39 40 41 42 43 44 45 46 47 48  | Next Page >

  • How to make UIImagePickerController works under switch case UIActionSheet

    - by Phy
    -(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { UIImage *tempImage = [info objectForKey:UIImagePickerControllerOriginalImage]; imgview.image = tempImage; [self dismissModalViewControllerAnimated:YES]; [picker release]; } -(void)imagePickerControllerDidCancel:(UIImagePickerController *)picker { [self dismissModalViewControllerAnimated:YES]; [picker release]; } -(IBAction) calllib { img1 = [[UIImagePickerController alloc] init]; img1.delegate = self; img1.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; [self presentModalViewController:img1 animated:YES]; } all the codes above works well for taking out photos from the photo library. problem is that when i tried to use it under the UIActionSheet it does not work. i just copy the lines of codes from the -(IBAction) calllib as follow. (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { UIImage *detectface = [Utilities detectFace:imgview.image]; UIImage *grayscale = [Utilities grayscaleImage:imgview.image]; UIImage *avatars = [Utilities avatars:imgview.image]; img1 = [[UIImagePickerController alloc] init]; img1.delegate = self; img1.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; switch (buttonIndex) { case 0: [self presentModalViewController:img1 animated:YES]; imgview.image = detectface; break; case 1: [self presentModalViewController:img1 animated:YES]; imgview.image = grayscale; break; case 2: [self presentModalViewController:img1 animated:YES]; imgview.image = avatars; break; default: break; } } it does not work. can somebody help me to figure out what is the problem? the switch case works perfectly without the [self presentModalViewController:img1 animated:YES]; ... thanks

    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

  • Switch gettext translated language with original language

    - by Ruben
    Hi everyone, I started my PHP application with all text in German, then used gettext to extract all strings and translate them to English. So, now I have a .po file with all msgids in German and msgstrs in English. I want to switch them, so that my source code contains the English as msgids. There are numerous reasons for this: More translators will know English, so it is only appropriate to serve them up a file with msgids in English. I could always switch the file before I give it out and after I receive it It would help me to write English object & function names and comments if the content text was also English. I'd like to do that, so the project is more open to other Open Source collaborators (more likely to know English than German). I could do this manually and this is the sort of task where I anticipate it will take me more time to write an automated routine for it (because I'm very bad with shell scripts) than do it by hand. But I also anticipate despising every minute of manual computer labour (feels like a oxymoron, right?) like I always do. Has someone done this before? I figured this would be a common problem, but couldn't find anything. Many thanks ahead. Sample Problem: <title><?=_('Routinen')?></title> #: /users/ruben/sites/v/routinen.php:43 msgid "Routinen" msgstr "Routines"

    Read the article

  • Specify More "case" in switch parameters

    - by Sophie Mackeral
    I have the following code: $ErrorType = null; switch ($ErrNo){ case 256,1: $ErrorType = "Error"; break; case 512,2: $ErrorType = "Warning"; break; case 1024,8: $ErrorType = "Notice"; break; case 2048: $ErrorType = "Strict Warning"; break; case 8192: $ErrorType = "Depreciated"; break; } But the problem is, I'm going from the pre-defined constants for an error handling software solution.. I cannot specify more than one "case" for the dedicated error categories, example: switch ($ErrNo){ case 1: $ErrorType = "Error"; break; case 256: $ErrorType = "Error"; } That's a repeat of code.. Whereas with a solution like my first example, it would be beneficial as two integers fall under the same category.. Instead, i'm returned with the following: Parse error: syntax error, unexpected ',' in Action_Error.php on line 37

    Read the article

  • Is there any alternative way of writing this switch statement(C#3.0)

    - by Newbie
    Can it be done in a better way public static EnumFactorType GetFactorEnum(string str) { Standardization e = new Standardization(); switch (str.ToLower()) { case "beta": e.FactorType = EnumFactorType.BETA; break; case "bkp": e.FactorType = EnumFactorType.BOOK_TO_PRICE; break; case "yld": e.FactorType = EnumFactorType.DIVIDEND_YIELD; break; case "growth": e.FactorType = EnumFactorType.GROWTH; break; case "mean": e.FactorType = EnumFactorType.MARKET_CAP; break; case "momentum": e.FactorType = EnumFactorType.MOMENTUM; break; case "size": e.FactorType = EnumFactorType.SIZE; break; case "stat_fact1": e.FactorType = EnumFactorType.STAT_FACT_1; break; case "stat_fact2": e.FactorType = EnumFactorType.STAT_FACT_2; break; case "value": e.FactorType = EnumFactorType.VALUE; break; } return e.FactorType; } If I create a Static class(say Constatant) and declare variable like public static string BETA= "beta"; and then if I try to put that in the Case expression like Case Constants.BETA : e.FactorType = EnumFactorType.BETA; break; then the compiler will report error.(quite expected) So is there any other way?(I canot change the switch statement) Using C#3.0 Thanks

    Read the article

  • The counter doesnt seem to increase when ever the edittext changes

    - by Mabulhuda
    Im using Edit-texts and i need when ever an edit-text is changed to increment a counter by one but the counter isnt working , I mean the app starts and everything but the counter doesnt seem to change please help here is the code public class Numersys extends Activity implements TextWatcher { EditText mark1 ,mark2, mark3,mark4,mark5,mark6 , hr1 ,hr2,hr3,hr4,hr5,hr6; EditText passed, currentavg; TextView tvnewavg ; Button calculate; double marks , curAVG , NewAVG ; String newCumAVG; int counter , hrs , curHr , NewHr; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.numersys); mark1=(EditText)findViewById(R.id.mark1n); mark2=(EditText)findViewById(R.id.mark2n); mark3=(EditText)findViewById(R.id.mark3n); mark4=(EditText)findViewById(R.id.mark4n); mark5=(EditText)findViewById(R.id.mark5n); mark6=(EditText)findViewById(R.id.mark6n); hr1=(EditText)findViewById(R.id.ethour1); hr2=(EditText)findViewById(R.id.ethour2); hr3=(EditText)findViewById(R.id.ethour3); hr4=(EditText)findViewById(R.id.ethour4); hr5=(EditText)findViewById(R.id.ethour5); hr6=(EditText)findViewById(R.id.ethour6); passed=(EditText)findViewById(R.id.etPassCn); currentavg=(EditText)findViewById(R.id.etCavgn); tvnewavg=(TextView)findViewById(R.id.tvcAVGn); mark1.addTextChangedListener(this); mark2.addTextChangedListener(this); mark3.addTextChangedListener(this); mark4.addTextChangedListener(this); mark5.addTextChangedListener(this); mark6.addTextChangedListener(this); calculate=(Button)findViewById(R.id.bAvgCalcn); @Override public void onClick(View arg0) { // TODO Auto-generated method stub switch(arg0.getId()) { case 0: break; case 1: hrs=Integer.valueOf(hr1.getText().toString()); marks=Double.valueOf(mark1.getText().toString())*Integer.valueOf(hr1.getText().toString()); curHr=Integer.valueOf(passed.getText().toString()); curAVG=Double.valueOf(currentavg.getText().toString())*curHr; NewHr= curHr+hrs; NewAVG= (marks+curAVG)/NewHr; break; case 2: hrs=Integer.valueOf(hr1.getText().toString())+Integer.valueOf(hr2.getText().toString()); marks=Double.valueOf(mark1.getText().toString())*Integer.valueOf(hr1.getText().toString()) +Double.valueOf(mark2.getText().toString())*Integer.valueOf(hr2.getText().toString()); curHr=Integer.valueOf(passed.getText().toString()); curAVG=Double.valueOf(currentavg.getText().toString())*curHr; NewHr= curHr+hrs; NewAVG= (marks+curAVG)/NewHr; break; case 3: hrs=Integer.valueOf(hr1.getText().toString())+Integer.valueOf(hr2.getText().toString()) +Integer.valueOf(hr3.getText().toString()); marks=Double.valueOf(mark1.getText().toString())*Integer.valueOf(hr1.getText().toString()) +Double.valueOf(mark2.getText().toString())*Integer.valueOf(hr2.getText().toString()) +Double.valueOf(mark3.getText().toString())*Integer.valueOf(hr3.getText().toString()); curHr=Integer.valueOf(passed.getText().toString()); curAVG=Double.valueOf(currentavg.getText().toString())*curHr; NewHr= curHr+hrs; NewAVG= (marks+curAVG)/NewHr; break; case R.id.bAvgCalcn: newCumAVG=String.valueOf(NewAVG); tvnewavg.setText(newCumAVG); } } }); } @Override public void afterTextChanged(Editable arg0) { // TODO Auto-generated method stub } @Override public void beforeTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) { // TODO Auto-generated method stub } @Override public void onTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) { // TODO Auto-generated method stub if(mark1.hasFocus()) { counter = counter+1; } if(mark2.hasFocus()) { counter = counter+1; } if(mark3.hasFocus()) { counter = counter+1; } if(mark4.hasFocus()) { counter = counter+1; } if(mark5.hasFocus()) { counter = counter+1; } if(mark6.hasFocus()) { counter = counter+1; } }

    Read the article

  • C++ Builder 2010 How to switch to FASTMM

    - by James
    Hello I have some projects which were done in c++ builder 2009 and they need borlandmm.dll to run. I have read that c++ Builder 2010 by default use Fastmm, but it dont seems to be the case in my projects. They still need borlandmm.dll So how can i switch my projects to use fastmm ? Regards James

    Read the article

  • How to switch versions of iPhone SDK?

    - by mobibob
    Now that I installed SDK 3.2 for my iPad development, I need to build with the previous version for my old iTouch. Is this possible to switch or do I have to uninstall 3.2, install 3.1.x and re-install 3.2 in a "versioned" folder?

    Read the article

  • RVM can't switch to Ruby 1.9.1

    - by Marco
    I installed Ruby 1.8.7 through apt-get. I then installed 1.9.1 through RVM. The RVM 1.9.1 installation was successful: root: rvm install 1.9.1 <i>Installing Ruby from source to: /usr/local/rvm/rubies/ruby-1.9.1-p378 </i> <i>/usr/local/rvm/src/ruby-1.9.1-p378 has already been extracted. </i> <i>Configuring ruby-1.9.1-p378, this may take a while depending on your cpu(s)... </i> <i>Compiling ruby-1.9.1-p378, this may take a while, depending on your cpu(s)... </i> <i>Installing ruby-1.9.1-p378 </i> <i>Installation of ruby-1.9.1-p378 is complete. </i> <i>Updating rubygems for /usr/local/rvm/gems/ruby-1.9.1-p378@global </i> <i>Updating rubygems for /usr/local/rvm/gems/ruby-1.9.1-p378 </i> <i>adjusting shebangs for ruby-1.9.1-p378 (gem irb erb ri rdoc testrb rake). </i> <i>Installing gems for ruby-1.9.1-p378 (rdoc rake). </i> <i>Installing rdoc to /usr/local/rvm/gems/ruby-1.9.1-p378@global </i> <i>Installing rdoc to /usr/local/rvm/gems/ruby-1.9.1-p378 </i> <i>Installing rake to /usr/local/rvm/gems/ruby-1.9.1-p378@global </i> <i>Installing rake to /usr/local/rvm/gems/ruby-1.9.1-p378 </i> <i>Installation of gems for ruby-1.9.1-p378 is complete. </i> However, I cannot get RVM to switch to the new version: root: ruby -v ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux] root: rvm 1.9.1 root: ruby -v ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux] Despite that, it seems to have installed fine: root: /usr/local/rvm/bin/ruby-1.9.1-p378 -v ruby 1.9.1p378 (2010-01-10 revision 26273) [x86_64-linux] I also tried setting the rvm --default to 1.9.1 but that did not help. Why can't RVM switch to the new version? Should I just set an alias for ruby=1.9.1? *running Debian

    Read the article

  • Visual Studio Macro To Switch Solution Configuration

    - by Eddie Parker
    I'm trying to write a macro that toggles between release/debug solution configurations in Visual Studio. It appears I can switch the configuration by using 'DTE.ExecuteCommand("Build.SolutionConfigurations", "Debug")'. Is there a way I can 'read' the value? Or is there a way I can use macros to 'focus' on the solution configuration UI element?

    Read the article

  • How can I switch the activity of the content of a tab in Tabhost

    - by hap497
    Hi, I have created a TabHost and in 1 of the tab, I have added the content using mTabHost.addTab(mTabHost.newTabSpec("tab1") .setIndicator(getString(R.string.dialerIconLabel), getResources().getDrawable(R.drawable.ic_tab_dialer)) .setContent(intent)); Is it possible for me to switch the content's activity programatically after I called 'addTab of TabHost'? Thank you.

    Read the article

  • rewrite rule to switch to subfolder

    - by Midday
    I'm deploying a Wordpress blog, but I don't want to overwrite the current site yet. public_html/. <-- the current site public_html/wp/. <-- the new site How must my .htaccess look like so I can seamlessly switch from the current site to the new one so that http://domain.tld shows the new site like it would be directly in the public_html folder

    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

  • C# program to switch updating from Master server to Slave server

    - by tanthiamhuat
    assuming that I have setup the Database (MySQL) Replication using Master-Slave configuration, and have synchronized those Master and Slave servers, how can my C# program know that it has to update the Slave server when the Master server fails? What are the conditions that the C# program switch from the Master server to the Slave server? I am using MySQL server.

    Read the article

  • How do I switch Ruby-on-Rails into en-UK

    - by Nick Clarke
    Hi, I'm trying to switch one of my websites into en-UK so that I get the correct date and currency formats etc... I have found this yaml file: http://github.com/mattetti/globalite/blob/master/lang/rails/en-UK.yml Any ideas if there is a better one to use? I also checked here but could not see it: http://github.com/svenfuchs/rails-i18n/tree/master/rails/locale Thanks, Nick

    Read the article

  • Switch between speakerphone and headset on Android

    - by user210504
    Hi! I wish to know if there is a way, using which we can switch between the speaker and headset dynamically in an android application. I am using this sample code, I found online for my experiments final float frequency = 440; float increment = (float)(2*Math.PI) * frequency / 44100; // angular increment for each sample float angle = 0; AndroidAudioDevice device = new AndroidAudioDevice( ); AudioManager am = (AudioManager)getSystemService(AUDIO_SERVICE); am.setMode(AudioManager.MODE_IN_CALL); float samples[] = new float[1024]; int count = 0; while( count < 10 ) { count++; for( int i = 0; i < samples.length; i++ ) { samples[i] = (float)Math.sin( angle ) ; angle += increment; } device.writeSamples( samples ); } device.stop(); am.setMode(AudioManager.MODE_NORMAL); ---- next class public class AndroidAudioDevice { AudioTrack track; short[] buffer = new short[1024]; public AndroidAudioDevice( ) { int minSize =AudioTrack.getMinBufferSize( 44100, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT ); track = new AudioTrack( AudioManager.STREAM_VOICE_CALL, 44100, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT, minSize, AudioTrack.MODE_STREAM); track.play(); } public void writeSamples(float[] samples) { fillBuffer( samples ); track.write( buffer, 0, samples.length ); } private void fillBuffer( float[] samples ) { if( buffer.length < samples.length ) buffer = new short[samples.length]; for( int i = 0; i < samples.length; i++ ) buffer[i] = (short)(samples[i] * Short.MAX_VALUE);; } public void stop() { track.stop(); } } As per my understanding this should play audio on headset, because we have not enabled the speaker phone. However, the audio is playing on the speaker phone. 1 Am I doing something wrong here? 2 What would be a way to switch between internal speaker and speaker phone dynamically for same code peice Any help will be appreciated.

    Read the article

  • Can't see how to compile a header file with /clr switch in a mixed class

    - by MattN
    When creating a mixed mode class, on compilation the header file complains that it needs to be complied with the /clr switch as it is a mixed mode class, however, I can't see any option to specifically compile that header with /clr from visual studio, and I don't want to set the entire project with a /clr flag, Does anyone know how I can specify that this header file is compiled correctly with /clr? Thanks in advance!

    Read the article

  • Determine Mouse Button Switch State

    - by VoiDeD
    Hello, I'm trying to determine the host operating system's settings regarding mouse button switch state to properly handle a context menu event. I want to determine whether or not the operating system my application is running on has switched the left and right mouse buttons, and handle the mouse click event accordingly. What would be the best way to determine that in C#? Thanks!

    Read the article

  • switch easily between different main()

    - by lezebulon
    I'm using VS2010 I have a project with several headers and one file with the main() function. For testing purposes I'd like to be able to easily another main() function that would instanciate different things than my original main. Is there an easy way to define 2 "main" function, and easily switch between them? The best would be to compile 2 binaries, one that starts at main1() and the other at main2(), or it can be a solution that requires to recompile some files, it doesn't matter

    Read the article

< Previous Page | 37 38 39 40 41 42 43 44 45 46 47 48  | Next Page >