Search Results

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

Page 241/347 | < Previous Page | 237 238 239 240 241 242 243 244 245 246 247 248  | Next Page >

  • Creating an OpenGL texture with alpha using NSBitmapImageRep

    - by BROK3N S0UL
    I am loading a PNG using: theImage = [NSBitmapImageRep imageRepWithContentsOfFile:imagePath]; from which I can successfully create a gl texture and render correctly without any transparency. However, when I switch blending on using: glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE); The texture renders with the correct transparent background, but the image colours are incorrect. I have tried several options in the blend function, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_DST_ALPHA, etc. I was taught maybe I need to reorder the bits in the image data, maybe the channels have been mixed up, but I would not expect it to render correctly when blending is off in that case. Alternatively, I could use libPNG I guess, but I would like to try using a NSBitmapImageRep if it is possible.

    Read the article

  • Best of both worlds: arrow keys for cursor movement or flipping through buffers.

    - by dreeves
    I really like this vim trick to use the left and right arrows to flip between buffers: "left/right arrows to switch buffers in normal mode map <right> :bn<cr> map <left> :bp<cr> (Put that in ~/.vimrc) But sometimes I'm munching on a sandwich or something when scrolling around a file and I really want the arrow keys to work normally. I think what would make most sense is for the arrow keys to have the above buffer-flipping functionality only if there are actually multiple buffers open. Is there a way to extend the above to accomplish that?

    Read the article

  • Mistake in dispaly and insert method (double - ended queue)

    - by MANAL
    1) My problem when i make remove from right or left program will be remove true but when i call diplay method the content wrong like this I insert 12 43 65 23 and when make remove from left program will remove 12 but when call display method show like this 12 43 65 and when make remove from right program will remove 23 but when call display method show like this 12 43 Why ?????? ); and when i try to make insert after remove write this Can not insert right because the queue is full . first remove right and then u can insert right where is the problem ?? Please Help me please 2) My code FIRST CLASS class dqueue { private int fullsize; //number of all cells private int item_num; // number of busy cells only private int front,rear; public int j; private double [] dqarr; //========================================== public dqueue(int s) //constructor { fullsize = s; front = 0; rear = -1; item_num = 0; dqarr = new double[fullsize]; } //========================================== public void insert(double data) { if (rear == fullsize-1) rear = -1; rear++; dqarr[rear] = data; item_num++; } public double removeLeft() // take item from front of queue { double temp = dqarr[front++]; // get value and incr front if(front == fullsize) front = 0; item_num --; // one less item return temp; } public double removeRight() // take item from rear of queue { double temp = dqarr[rear--]; // get value and decr rear if(rear == -1) // rear = item_num -1; item_num --; // one less item return temp; } //========================================= public void display () //display items { for (int j=0;j //========================================= public int size() //number of items in queue { return item_num; } //========================================== public boolean isEmpty() // true if queue is empty { return (item_num ==0); } } SECOND CLASS import java.util.Scanner; class dqueuetest { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.println(" Welcome here** "); System.out.println(" * Mind Of Programming Group*** "); System.out.println(" _________________________ "); System.out.println("enter size of your dqueue"); int size = input.nextInt(); dqueue mydq = new dqueue(size); System.out.println(""); System.out.println("enter your itemes"); //===================================== for(int i = 0;i<=size-1;i++) { System.out.printf("item %d:",i+1); double item = input.nextDouble(); mydq.insert(item); System.out.println(""); } //===================================== int queue =size ; int c = 0 ; while (c != 6) { System.out.println(""); System.out.println("**************************"); System.out.println(" MAIN MENUE"); System.out.println("1- INSERT RIGHT "); System.out.println("2- REMOVE LEFT"); System.out.println("3- REMOVE RIGHT"); System.out.println("4- DISPLAY"); System.out.println("5- SIZE"); System.out.println("6- EXIT"); System.out.println("**************************"); System.out.println("choose your operation by number(1-6)"); c = input.nextInt(); switch (c) { case 1: if (queue == size) System.out.print("Can not insert right because the queue is full . first remove right and then u can insert right "); else { System.out.print("enter your item: "); double item = input.nextDouble(); mydq.insert(item);} break; case 2: System.out.println("REMOVE FROM REAR :"); if( !mydq.isEmpty() ) { double item = mydq.removeLeft(); System.out.print(item + "\t"); } // end while System.out.println(""); mydq.display(); break; case 3: System.out.println("REMOVE FROM FRONT :"); if( !mydq.isEmpty() ) { double item = mydq.removeRight(); System.out.print(item + "\t"); } // end while System.out.println(""); mydq.display(); break; case 4: System.out.println("The items in Queue are :"); mydq.display(); break; case 5: System.out.println("The Size of the Queue is :"+mydq.size()); break; case 6: System.out.println("Good Bye"); break; default: System.out.println("wrong chiose enter again"); } //end switch } //end while } // end main }//end class

    Read the article

  • after dup2, stream still contains old contents?

    - by BobTurbo
    so if I do: dup2(0, backup); // backup stdin dup2(somefile, 0); // somefile has four lines of content fgets(...stdin); // consume one line fgets(....stdin); // consume two lines dup2(backup, 0); // switch stdin back to keyboard I am finding at this point.. stdin still contains the two lines I haven't consumed. Why is that? Because there is just one buffer no matter how many times you redirect? How do I get rid of the two lines left but still remember where I was in the somefile stream when I want to go back to it?

    Read the article

  • Interrupt a thread in DatagramSocket.receive

    - by SEK
    I'm building an application that listens on both TCP and UDP, and I've run into some trouble with my shutdown mechanism. When I call Thread.interrupt() on each of the listening threads, the TCP thread is interrupted from listening, whereas the UDP listener isn't. To be specific, the TCP thread uses Socket.accept(), which simply returns (without actually connecting). Whereas the UDP thread uses DatagramSocket.receive, and doesn't exit that method. Is this an issue in my JRE, my OS, or should I just switch to (Datagram)Socket.close()?

    Read the article

  • The glutKeyboardFunc does not react to key presses immediately

    - by Nibirue
    I have a function glutKeyboardFunc(keyboard), where keyboard has: void keyboard(unsigned char key, int x, int y){ float alpha = 1.0; switch(key){ case 'c': glClearColor(1,0,0,alpha); printf("success"); break; } } This is a summary of the function; it works properly, but only once some other action has occurred. For instance, the printf statement reports success immediately on keystroke 'c', but the background color does not become active until I click somewhere else on the canvas. I want all keystrokes to have an immediate effect.

    Read the article

  • Waiting for DialogActivity to return before continuing executing of the main thread

    - by jax
    How would I force the current thread to wait until another has finished before continuing. In my program the user selects a MODE from an AlertDialog, I want to halt executing of the program before continuing as the mode holds important configuration for the gameplay. new AlertDialog.Builder(this) .setItems(R.array.game_modes, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { switch (which) { case 0: setMode(TRAINING_MODE); case 1: setMode(QUIZ_MODE); default: setMode(TRAINING_MODE); break; } //continue loading the rest of onCreate(); contineOnCreate(); } }) .create().show(); If this is impossible can anyone give a possible solution?

    Read the article

  • jQuery changing images with animation and waiting for it to trigger hyperlink

    - by user1476298
    I want to switch images on .click() using the url attr I can do so, but I can't figure out how to make it wait, until the animation is done to redirect to the new webpage. Here's the js $(function() { $('.cv').click(function(){ $("#cv img").fadeOut(2000, function() { $(this).load(function() { $(this).fadeIn(); }); $(this).attr("src", "images/cv2.png"); return true; }); }); }); Here's the html: <div id="cv" class="img one-third column"> <a class="cv" target="#" href="cv.joanlascano.com.ar"> <img src="images/cv1.png" alt="Curriculum"/> <br />CV</a> </div> Thank you in advantage!

    Read the article

  • Deployment process

    - by Balaji
    We are having a massive system having around 15 servers hosting .Net WCF services, mvc application etc. When we do a deployment (out of office hours) we have to uninstall and install everything on the live servers. This takes lot of time and if something goes wrong we have to rollback everything. can you please suggest something different to this? like Deply into a other environment (whenever you like) and switch the URL to point to new servers [This comes with the overhead of cost of maintaining 2 copies of production (active and passive)] any other ideas please.

    Read the article

  • how to set the tab order for the UI controls in win 32?

    - by Rakesh
    hello all I have a small dialog which I created dynamically, which has a textbox and a button..if the user presses the TAB key it has to switch between the two control(textbox and button)...I tried using SetwindowPos...but it doesnt seem to solve my problem...please give me a solution for this..in the below code..I also tried to include the mainwindow in the taborder..still it doesnt work //dialog creation HWND dialogHandle = CreateWindowEx(0,WC_DIALOG,L"Security Alert",WS_OVERLAPPEDWINDOW|WS_VISIBLE,600,300,280,160,NULL,NULL,NULL,NULL); //create textboxcontrol within the dialog HWND textBoxHandle = CreateWindowEx(WS_EX_CLIENTEDGE,L"EDIT",L"",WS_CHILD|WS_VISIBLE |ES_PASSWORD | WS_TABSTOP,123,48,110,25,dialogHandle,(HMENU)IDD_TEXTBOX,NULL,NULL); //create button HWND buttonHandle = CreateWindowEx(NULL,L"Button",L"OK",WS_CHILD|WS_VISIBLE| WS_TABSTOP,151,85,85,25,dialogHandle,(HMENU)ID_PASSWORD_OK,NULL,NULL); //setwindowpos SetWindowPos(NULL,textBoxHandle,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE); SetWindowPos(textBoxHandle,buttonHandle,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);

    Read the article

  • How do you get GWT 2.0 to accept clicks on two different Widgets added to a LayoutPanel?

    - by kerrr
    Using GWT 2.0 I have an entry point that adds two Widgets to a LayoutPanel. The Widgets both handle click events and have click events ergistered to them. The problem is that only the last widget added to the LayoutPanel can actually be clicked. Switch the order in which the widgets are added switches the widget that works. Add mroe widgets and still the only you can click is the last one added to the LayoutPanel. Any idea why this is? Is there any reasoning behind the behaviour, or have I missunderstood what is happening under the covers? How do I gat all widgets in the LayoutPanel to accept events? Should I be using another panel class? I'm not too bothered if the LayoutPanel prevents anything below it from being clicked, but want all Widgets added to it to be clickable.

    Read the article

  • Mysql help with view more button.

    - by WAC0020
    I am working on a widget that is a lot like twitters widget where there is a list of postings and a view more button. I can get it to work with using ID variables but I would like to sort by popular posts. Here is my mysq code: $sql = "SELECT id, title, category, icon_normal, status, description, views_monthly FROM posts WHERE views_monthly<=".$lastPost." AND status='1' ORDER BY views_monthly DESC LIMIT 9" So the problem that I am having is it shows the first 9 just fine. When it gets to the point where views_monthly = 0 then it just loads the same 9 post over again. How do it get it to switch to using ID when it reaches Views_monthly = 0 and load fresh posts?

    Read the article

  • Python 2.6 - I can not write dwords greater than 0x7fffffff into registry using _winreg.SetValueEx()

    - by stasizke
    using regedit.exe I have manually created a key in registry called HKEY_CURRENT_USER/00_Just_a_Test_Key and created two dword values dword_test_1 and dword_test_2 I am trying to write some values into those two keys using following program import _winreg aReg = _winreg.ConnectRegistry(None,_winreg.HKEY_CURRENT_USER) aKey = _winreg.OpenKey(aReg, r"00_Just_a_Test_Key", 0, _winreg.KEY_WRITE) _winreg.SetValueEx(aKey,"dword_test_1",0, _winreg.REG_DWORD, 0x0edcba98) _winreg.SetValueEx(aKey,"dword_test_2",0, _winreg.REG_DWORD, 0xfedcba98) _winreg.CloseKey(aKey) _winreg.CloseKey(aReg) I can write into the first key, dword_test_1, but when I attempt to write into the second, I get following message Traceback (most recent call last): File "D:/src/registry/question.py", line 7, in <module> _winreg.SetValueEx(aKey,"dword_test_2",0, _winreg.REG_DWORD, 0xfedcba98) ValueError: Could not convert the data to the specified type. How do I write the second value 0xfedcba98, or any value greater than 0x7fffffff as a dword value? Originally I was writing script to switch the "My documents" icon on or off by writing "0xf0500174" to hide or "0xf0400174" to display the icon into [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CLSID{450D8FBA-AD25-11D0-98A8-0800361B1103}\ShellFolder]

    Read the article

  • Should I share UI for objects that use common fields?

    - by wb
    I have a parent class that holds all of the fields that are common between all device types. From that, I have a few derived classes that each hold their unique fields. Say I have device type "Switch" and "Transformer". Both derived classes only have 2-3 of their own unique fields. When doing the UI design (windows forms) in this case. Should I create two separate forms for each device type or create a user control with all fields that are shared among all devices? Thank you.

    Read the article

  • Changing UITableViewCell height on a grouped cell doesn't look good

    - by Sheehan Alam
    I have a UITableView with 3 sections. In the first section I have 2 grouped cells. I am modifying the first cell to be larger than the second. Though the first cell resizes, it seems to mess up the cell below it. How can I resolve this? - (CGFloat)tableView:(UITableView *)tblView heightForRowAtIndexPath:(NSIndexPath *)indexPath { CGFloat rowHeight; if(indexPath.section == kBioSection) { switch(indexPath.row) { case kBioSectionDescriptionRow: rowHeight = 100; break; } } else { rowHeight = 50; } return rowHeight; }

    Read the article

  • using different string files in android

    - by boreas
    I'm porting my iPhone app to android and I'm having a problem with the string files now. The app is a translation tool and users can switch the languages, so all the localized strings are in both languages and they are independent from what locale the OS is running. For iOS version I have different files like de.strings, en.strings and fr.strings and so on. For every target with specified language pair I read the strings from the string tables, e.g. for de-fr I will include de.strings and fr.strings in project and set the name of the string tables in the info-list file and read strings from them. In the end I have one project containing different targets (with different info-list files) and all are well configured. I'm intending to do the same on android platform, but Is only one strings.xml allowed per project? How do I set different build target? How do I specify per target which strings.xml it should read?

    Read the article

  • javascript code to prevent screensaver from starting

    - by gertjan
    Hi all, I am completely new to javascript programming and I have a question that I didn't manage to find an answer for anywhere. I have recently put together a simple slideshow to view the photos remotely that I host on my home computer. This by itself works fine. The problem I run into is that when I'm viewing photos I don't interact with the hardware, which after some time causes the monitor to switch off. This is particularly annoying when watching photos on my mobile phone. My question is: is there a way to prevent this from happening? I am thinking in the direction of faking a mouse or other event every time I refresh the photo, but I have no clue how to do that and if it is possible. Any help is greatly appreciated!

    Read the article

  • How to find the remainder of large number division in C++?

    - by Beelzeboul
    Hello, I have a question regarding modulus in C++. What I was trying to do was divide a very large number, lets say for example, M % 2, where M = 54,302,495,302,423. However, when I go to compile it says that the number is to 'long' for int. Then when I switch it to a double it repeats the same error message. Is there a way I can do this in which I will get the remainder of this very large number or possibly an even larger number? Thanks for your help, much appreciated.

    Read the article

  • How to pass an anonymous array of strings to a JavaScript function?

    - by abatishchev
    I want to pass to an array of controls' IDs to a javascript script function so it will switch control's enable state. For example, in C# it would be like this: func(false, new[] { "Control1", "Control2", "Control3" }); In that function I want to find corresponding controls and disable/enable them. For one control I do this next way: <script type="text/javascript" language="javascript"> function switchControls(value, arr) { for (var n = 0; n < array.length; n++) document.getElementById(n).disabled = value; } </script> <asp:CheckBox runat="server" onclick="switchControls(this.checked, [ '<%= Control1.ClientID %>', '<%= Control2.ClientID %>' ])" Text="Take?" /> How to implement this properly? Have I to use jQuery?

    Read the article

  • iDevice for Dummies: Can a device be assigned multiple provisions (Personal/Enterprise)?

    - by Alex
    Hi guys, Is it possible to assign multiple provisions to an iDevice? To be honest, I'm not sure if I'm using the correct terminology, but basically, I'm developing an iPad app for a company and I've only been testing it in the simulator because I don't have a registration to the developer program and they haven't setup their enterprise registration yet either. And I'm sure you all know how limited the simulator is... I don't really care about the $99 it costs to join, but what I'm worried about is having my iDevices locked permanently to my personal registration and unable to switch back and forth to the enterprise registration. I'd appreciate it if someone can explain to me how the registrations work. And keep in mind, I'm a dummy. :) Thanks in advance!

    Read the article

  • Low-overhead way to access the memory space of a traced process?

    - by vovick
    Hello all. I'm looking for an efficient way to access(for both read and write operations) the memory space of my ptraced child process. The size of blocks being accessed may vary from several bytes up to several megabytes in size, so using the ptrace call with PTRACE_PEEKDATA and PTRACE_POKEDATA which read only one word at a time and switch context every time they're called seems like a pointless waste of resources. The only one alternative solution I could find, though, was the /proc/<pid>/mem file, but it has long since been made read only. Is there any other (relatively simple) way to do that job? The ideal solution would be to somehow share the address space of my child process with its parent and then use the simple memcpy call to copy data I need in both directions, but I have no clues how to do it and where to begin. Any ideas?

    Read the article

  • Start all tab's activities for pre-cache

    - by Pentium10
    I have a TabActivity with three tabs defined. The first tab is light-weight and renders in acceptable time. But the 2nd and 3rd tab, does need a couple of seconds to get visually rendered, after I click them. I would like to launch them, after I've loaded my first tab, in background for pre-cache. Once they are loaded, I can switch quickly between them. So I am wondering how can I launch the 2nd and 3rd tab. They are intents loaded in the view area.

    Read the article

  • Any way to break if statement in PHP?

    - by Usman
    Is there any command in PHP to stop executing the current or parent if statement, same as break or break(1) for switch/loop. For example $arr=array('a','b'); foreach($arr as $val) { break; echo "test"; } echo "finish"; in the above code PHP will not do echo "test"; and will go to echo "finish"; I need this for if $a="test"; if("test"==$a) { break; echo "yes"; // I don't want this line or lines after to be executed, without using another if } echo "finish"; I want to break the if statement above and stop executing echo "yes"; or such codes which are no longer necessary to be executed, there may be or may not be an additional condition, is there way to do this?

    Read the article

  • Beginners PHP / mySQL question

    - by Reg H
    I'm brand new to PHP & MySQL, and one function I'm creating needs to access a large table or database. I've created the database and it's currently in a MySQL table, which I'm accessing with no problem. The table is 11,000 rows in length, with 8 columns (all text less than 8 characters long) - it's static, and will never change. Without getting too particular, my users will hit a button which will trigger scripts to access the data, say 500 times or more. So in general would it be better practice to include all of this data in a big 'switch' or 'if... then' conditional right in my scripts, rather than opening and accessing the database connection hundreds, or maybe even thousands of times? It just seems like that might be a bottleneck waiting to happen. Thanks!

    Read the article

  • How to change jQuery toggle() status

    - by Zier Gofren Schlanum
    Using toogle to show/hide the div, I've got a problem that when I hide my div with anothor function, I have to click twice on the button to perform correct action. Is there any way change the toggle switch like I clicked the button? $('#add_task').toggle(function() { if ($("#new_task_status").attr("value")==0) { $("#new_task").slideDown(); $("#new_task_status").attr("value", "1"); } }, function() { if ($("#new_task_status").attr("value")==1) { $("#new_task").slideUp(); $("#new_task_status").attr("value", "0"); } }); $('nav').click(function() { if ($("#new_task_status").attr("value")==1) { $("#new_task_status").attr("value", "0"); $("#new_task").slideUp(); } });

    Read the article

< Previous Page | 237 238 239 240 241 242 243 244 245 246 247 248  | Next Page >