Search Results

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

Page 234/347 | < Previous Page | 230 231 232 233 234 235 236 237 238 239 240 241  | Next Page >

  • How to move the mouse

    - by GroundZero
    I'm making a little bot in C#. At the moment it works pretty well, it can load text from a file and type it for you. But for now, I need to manualy click the textfield to put the focus on it, remaximize my form and then click the Type-button. After the typing, I need to manualy slide the scorebar and press submit. I'd like to know how I can move my mouse with C# and if possible, if possible I'd like to load the mouse positions from a xml-file. I need to move to the textfield, click in it to focus on it, start the type script, move to the slider, hold the mouse down on it while dragging, releasing it on the correct position & clicking on the submitbutton This is what I have for now: To load in the variables, I'm using this script: private void Initialize() { XmlTextReader reader = new XmlTextReader(Application.StartupPath + @"..\..\..\CursorPositions.xml"); while (reader.Read()) { switch (reader.NodeType) { case XmlNodeType.Element: // The node is an element. element = reader.Value; break; case XmlNodeType.Text: //Display the text in each element. switch (element) { case "Textbox-X": textX = int.Parse(reader.Value); break; case "Textbox-Y": textY = int.Parse(reader.Value); break; case "SliderBegin-X": sliderX = int.Parse(reader.Value); break; case "SliderBegin-Y": sliderY = int.Parse(reader.Value); break; case "SubmitButton-X": submitX = int.Parse(reader.Value); break; case "SubmitButton-Y": submitY = int.Parse(reader.Value); break; } break; } } This is the xml-file: <?xml version="1.0" encoding="utf-8" ?> <CursorPositions> <Textbox-X>430</Textbox-X> <Textbox-Y>270</Textbox-Y> <SliderBegin-X>430</SliderBegin-X> <SliderBegin-Y>470</SliderBegin-Y> <SubmitButton-X>860</SubmitButton-X> <SubmitButton-Y>365</SubmitButton-Y> </CursorPositions> To move the mouse I'm using this piece of code: public partial class FrmMain : Form { [System.Runtime.InteropServices.DllImport("user32.dll")] public static extern void mouse_event(int dwFlags, int dx, int dy, int cButtons, int dwExtraInfo); public const int MOUSEEVENTF_LEFTDOWN = 0x0002; public const int MOUSEEVENTF_LEFTUP = 0x0004; public const int MOUSEEVENTF_RIGHTDOWN = 0x0008; public const int MOUSEEVENTF_RIGHTUP = 0x0010; ... private void btnStart_Click(object sender, EventArgs e) { // start button (de)activates loop if (!running) { btnStart.Text = "Stop"; btnStart.Cursor = Cursors.No; running = true; } else { btnStart.Text = "Start"; btnStart.Cursor = Cursors.AppStarting; running = false; } while (running) { // move to textbox & type Cursor.Position = new Point(textX, textY); mouse_event(MOUSEEVENTF_LEFTDOWN, textX, textY, 0, 0); mouse_event(MOUSEEVENTF_LEFTUP, textX, textY, 0, 0); Type(); // wait 90 seconds till slider available Thread.Sleep(90 * 1000); // move to slider & slide according to score Cursor.Position = new Point(sliderX, sliderY); mouse_event(MOUSEEVENTF_LEFTDOWN, sliderX, sliderY, 0, 0); Cursor.Position = new Point(sliderX + 345 / 10 * score, sliderY); mouse_event(MOUSEEVENTF_LEFTUP, sliderX + 345 / 10 * score, sliderY, 0, 0); // submit Cursor.Position = new Point(submitX, submitY); mouse_event(MOUSEEVENTF_LEFTDOWN, submitX, submitY, 0, 0); mouse_event(MOUSEEVENTF_LEFTUP, submitX, submitY, 0, 0); // wait 10 sec to be sure it's submitted Thread.Sleep(10 * 1000); // refresh page SendKeys.SendWait("{F5}"); // get new text NewText(); // wait 10 sec to refresh and load song Thread.Sleep(10 * 1000); } } } PS: I get the coordinates via my form. I've got 2 labels that show my X & Y coordinates. To capture them outside the form, I press and hold my Left Mouse Button and 'drag' it outside the form to the correct place. This way I get the coordinates of my mouse outside the form

    Read the article

  • Notepad++ Question

    - by Shane
    I would like a hotkey to Save All in Notepad++ then switch to the browser and refresh the page. I have to do this thousands of times a day and doing the Save All hotkey, then Alt-Tab to the right window, then F5 to refresh again and again, there must be a better solution? I am open to switching editors if there is another that can do this. I have tried using run commands but the problem is although it allows you to make something like [firefox.exe "current file"], if you come down to wanting to open it at a web address like localhost because it needs to run server side, then you have to manually specify the other part of the string, like [chrome.exe "custom var(web address) / filename"] and it always opens a new tab, then creates lots of clutter. Also, if you are editing an include file then it will try to open that instead of the page you want to see when you use the run command, a refresh would be the only realistic method I can think of using.

    Read the article

  • How to resolve error "Run-Time Check Failure #3"?

    - by karikari
    I am working on MS Visual Studio. I keep on getting this error: "Run-Time Check Failure #3 - The variable 'test' is being used without being initialized." I don't have any idea how to solve this. Here is the code that I'm currently tries to modify: STDMETHODIMP CButtonDemoBHO::Exec(const GUID*, DWORD nCmdID, DWORD d, VARIANTARG*, VARIANTARG* pvaOut) { CRebarHandler *test; switch (nCmdID){ case BUTTON_PRESSED: MessageBox(m_hWnd, L"You have pressed the button", L"Button Pressed", MB_OK); test->findButton(m_hWnd); test->setmenu(); break; case MENU_ITEM_SELECT: MessageBox(m_hWnd, L"You have simulated a button press with the menu ", L"Menu Pressed", MB_OK); break; } return S_OK; }

    Read the article

  • mySQL & Relational databases: How to handle sharding/splitting on application level?

    - by Industrial
    Hi everybody, I have thought a bit about sharding tables, since partitioning cannot be done with foreign keys in a mySQL table. Maybe there's an option to switch to a different relational database that features both, but I don't see that as an option right now. So, the sharding idea seems like a pretty decent thing. But, what's a good approach to do this on a application level? I am guessing that a take-off point would be to prefix tables with a max value for the primary key in each table. Something like products_4000000 , products_8000000 and products_12000000. Then the application would have to check with a simple if-statement the size of the id (PK) that will be requested is smaller then four, eight or twelve million before doing any actual database calls. So, is this a step in the right direction or are we doing something really stupid?

    Read the article

  • How to receive packets on the MCU's serial port?

    - by itisravi
    Hello, Consider this code running on my microcontroller unit(MCU): while(1){ do_stuff; if(packet_from_PC) send_data_via_gpio(new_packet); //send via general purpose i/o pins else send_data_via_gpio(default_packet); do_other_stuff; } The MCU is also interfaced to a PC via a UART.Whenever the PC sends data to the MCU, the *new_packet* is sent, otherwise the *default_packet* is sent.Each packet can be 5 or more bytes with a pre defined packet structure. My question is: 1.Should i receive the entire packet from PC using inside the UART interrut service routine (ISR)? In this case, i have to implement a state machine inside the ISR to assemble the packet (which can be lengthy with if-else or switch-case blocks). 2.Detect a REQUEST command (one byte)from the PC in my ISR set a flag, diable UART interrupt alone and form the packet in my while(1) loop by polling the UART?

    Read the article

  • two android threads and not synchronized data

    - by Sponge
    i have a (perhaps stupid) question: im using 2 threads, one is writing floats and one is reading this floats permanently. my question is, what could happen worse when i dont synchronize them? it would be no problem if some of the values would not be correct because they switch just a little every write operation. im running the application this way at the moment and dont have any problems so i want to know what could happen worse? a read/write conflict would cause a number like 12345 which is written to 54321 and red at the same time appear for example as 54345 ? or could happen something worse? (i dont want to use synchronization to keep the code as fast as possible)

    Read the article

  • How do you make your Java application memory efficient?

    - by Boune
    How do you optimize the heap size usage of an application that has a lot (millions) of long-lived objects? (big cache, loading lots of records from a db) Use the right data type Avoid java.lang.String to represent other data types Avoid duplicated objects Use enums if the values are known in advance Use object pools String.intern() (good idea?) Load/keep only the objects you need I am looking for general programming or Java specific answers. No funky compiler switch. Edit: Optimize the memory representation of a POJO that can appear millions of times in the heap. Use cases Load a huge csv file in memory (converted into POJOs) Use hibernate to retrieve million of records from a database Resume of answers: Use flyweight pattern Copy on write Instead of loading 10M objects with 3 properties, is it more efficient to have 3 arrays (or other data structure) of size 10M? (Could be a pain to manipulate data but if you are really short on memory...)

    Read the article

  • Create dynamic view with android

    - by ekevin
    Hi I'm stuck on a problem and if possible I will need help from the community. I'm not looking for a ready-made solution, but something which would help me to produce the result. I'm looking for a way to produce a dynamic activity based on a JSON object. Here an example of a JSON object: [ { "name": "my checkbox name", "type": "checkbox", "value": "one,two,three" } { "name": "my edit text", "type": "text", "value": "" } ...] This JSONObject could be totally random. I could have 2 text views, 3 select menus, 1 text view and so on. The goal is to iterate over this JSONObject and create the appropriate elements within my android code. To produce the result I've thought of a simple switch which would render one by one my different JSONObject to an android widget. But after that how could I have access of every property of every widget rendered? Thank you.

    Read the article

  • display image on a report based on two date

    - by Yongwei Xing
    Hi all I am using sql server 2005 reporting service to generate report base on a database. There are two columns which are datetime type ColumnA and ColumnB. The report would display a KPI image on this report by comparing these two columns.Below is the expression for selecting image SWITCH(DateDiff("d",Fields!ColumnA.Value,Fields!ColumnB.Value)<0,"kpi_r", DateDiff("d",Fields!ColumnA.Value,Fields!ColumnB.Value)>0,"kpi_g", DateDiff("d",Fields!ColumnA.Value,Fields!ColumnB.Value)=0,"kpi_y") For most of the records, the image is correct. Only for one record, the result is very strange. For this record ColumnA=2010-04-23 08:00:00 ColumnB=2010-04-22 17:00:00 It would display kpi_r, it displayed kpi_y. I have checked the value of DateDiff(d,Fields!ColumnA.Value,Fields!ColumnB.Value) in the SSMS, the value is -1. Why does it display kpi_y? Does anyone meet this problem before? Best Regards,

    Read the article

  • Noptepad++ Gripes Around File Reloading And Window Numbers

    - by ChloeRadshaw
    I ve started using Notepad++ moving over from TextPad I have two main gripes: 1) Can you actually see all the files open in your Notepad++ in a document explorer view like you could with TextPad? 2) Can you configure Notepad++ to only update files open if that file is the active document? Often I have ten log files open and I want to see when they get modified when I click on them 3) Can you control window numbers? Sometimes I look at two files and I always used to switch between them by doing Window - 1 and then Window - 2. With notepad++ a window number seems to assigned and never changes

    Read the article

  • WPF tabswitch/ render takes too much time..

    - by Socrates
    I have a WPF application with many tabs.. in one tab.. i make a verycomplex vector drawing consisting of thousands of drawing visuals.. (this represents a machine and all elements need to be interactable..) It takes 3/4 seconds for drawing this for the first time..After the first draw it should be done.. The problem is if i switch to another tab and comeback, it takes atlease 2,3 seconds to show the tabpage with drawing again.. Since there is no redraw, why should it take so much time..?

    Read the article

  • Error #2126: NetConnection object must be connected

    - by Shuo
    Hey guys , I want to count the online user,when each client login the system,it's connecting to the server and increase a variable stored in a remote shared object. But when client connecting server,problems arises:Error #2126: NetConnection object must be connected My web layout: Website --- apps --- userLogin Code snippets: rtmpnc = new NetConnection(); rtmpnc.objectEncoding = ObjectEncoding.AMF0; var uri:String = ServerConfig.getChannel("my-rtmp").endpoint + "/userLogin"; rtmpnc.connect("http://202.206.249.193:2367/userLogin"); rtmpnc.addEventListener(NetStatusEvent.NET_STATUS,onNetStatusHandler); The onNetStatusHander is defined as : switch(event.info.code) { case "NetConnection.Connect.Success":onConnSuccess();break; case "NetConnection.Connect.Failed":onConnError();break; } Could anyoue help me out?Much thanks! Best,Shuo

    Read the article

  • Mono 2.10.5 Runtime error on Ubuntu 11.10

    - by johnluetke
    I've install mono-runtime via apt in order to run my Mono console application on Ubuntu via SSH. However, when I run the command mono myapp.exe, It exits, with no message, and my program does nothing. If I throw the -v switch to Mono, such as mono -v myapp.exe, I get about 10k lines of output (as expected, -v is verbose), with the first few lines being: converting method System.OutOfMemoryException:.ctor (string) Method System.OutOfMemoryException:.ctor (string) emitted at 0xb7052c28 to 0xb7052c4b (code length 35) [myapp.exe] converting method (wrapper runtime-invoke) <Module>:runtime_invoke_void__this___object (object,intptr,intptr,intptr) Method (wrapper runtime-invoke) <Module>:runtime_invoke_void__this___object (object,intptr,intptr,intptr) emitted at 0xb7052c68 to 0xb7052cf6 (code length 142) [myapp.exe] converting method System.SystemException:.ctor (string) I read this as the runtime throwing an OutOfMemory exception, but the machine is under no intense load, has plenty of available RAM, and is running nothing other that system processes. I've removed and reinstalled Mono countless times, and have even run the executable on other machines perfectly fine. Am I missing something completely obvious here?

    Read the article

  • Controlling Windows Media Player through PHP / batch files

    - by Duroth
    I'm currently writing a tiny webapp for my HTPC (actually, a PC serving as both a media player and web- / fileserver) that will allow me to remotely control the playing of audio, without having to turn on my TV just to switch songs. I'm using Windows Media Player as my audio player of choice, and I thought I could control it through PHP's COM Class. Unfortunately, I've not been able to find any documentation or examples on controlling WMP through this interface. Can anyone point me in the right direction here? A second (and much less preferable) solution would be to use PHP's exec() call to start batch files that, in turn, control WMP.

    Read the article

  • coldfusion class path for multiple services - only recognizing first directory

    - by ffc
    Hi, I am trying to use multiple web services on a single CF page. I have entered the stubs directory for each of the web services in the ColdFusion Class Path within administrator server settings java and jvm paths are listed separated by commas: c:\coldfusion9\stubs\ws1,c:\coldfusion9\stubs\ws2 for some reason, only the web service whose stub path is listed first will work. When I try to call the second web service, I get a "web service operation ... cannot be found" but if i switch the order of paths listed in the admin settings and restart the service, the web service listed first now will work. any ideas on how to manage multiple web services and their stubs ? thanks!

    Read the article

  • JqueryUI Tab Linking from Another Page

    - by pschorr
    I'm having some issues with jqueryui tabs and linking to certain tabs on another page. Basically, each page has tabs, and all are navigational via drop down at the top, with each 'tab' being available in the drop down. Currently I'm able to text-link, but only within the page I'm on, and I'm just lost on the getting it to work correctly from page to page. Here's what I currently got working with internal text link. $(function() { $("#tabs").tabs( {fx: { opacity: 'toggle' }, selected: 0} ); var $tabs = $('#tabs').tabs(); // first tab selected $('a.nutrlink').click(function() { // bind click event to link $tabs.tabs('select', 1); // switch to third tab return false; }); });

    Read the article

  • Selecting the usercontrol to the relating datatemplate in mvvm

    - by msfanboy
    Hello, I have lets say a WeeklyViewUserControl.xaml and a DailyViewUserControl.xaml. Normally I used stuff like this to switch content: <DataTemplate DataType="{x:Type ViewModel:LessonPlannerViewModel}"> <View:LessonPlannerDailyUC/> </DataTemplate> This worked so far. But now I have still the WeeklyViewUC which uses 90 % of the LessonPlannerViewModel code so I want to make this additionally: <DataTemplate DataType="{x:Type ViewModel:LessonPlannerViewModel}"> <View:LessonPlannerWeeklyUC/> </DataTemplate> but this can not work, because from where does the ContentControl know that VM (LessonPlannerViewModel) should display a DailyViewUC or a WeeklyViewUC ? <ContentControl Content="{Binding VM}" />

    Read the article

  • Unreachable code detected in case statement

    - by alex
    I have a code: protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { switch (keyData) { case Keys.Alt|Keys.D1: if (this._condition1) { return true; } else { return base.ProcessCmdKey(ref msg, keyData); } break; case Keys.Control |Keys.U: if (this._condition2) { return true; } else { return base.ProcessCmdKey(ref msg, keyData); } break; default: return base.ProcessCmdKey(ref msg, keyData); } return true; It gives me "unreachable code detected" warning on breaks. Is it good practice not to use break operator here ? I don't want to turn off "unreachable code detected" warning. PS: There are many case in my ProcessCmdKey method.

    Read the article

  • XNA how to organize code with game components (managers)

    - by Johannes
    XNA If I have a button class, and I have a buttonManager class that manages what buttons to be drawn to the screen depending on what the current game state is (main menu, in game, etc), how do I organize my code so that when I click on a button, it takes the user to a different screen. (ex. options menu, ingame). To be more specific, if I were to put the check to see if the user clicks on the button within the buttonManager how would I have the game switch and run the actual game (which is in an entire different class)? Main gameclass buttonManager game component (adds buttons) Button class

    Read the article

  • wpf datagrid on click event

    - by gencay
    I use datagrid table on my project. One of the column of the datagrid is the path of the document according to my project. I would like to do that: When the user clicks the path cell/hyperlink cell, Program will get the path, Program will open another tab. I couldn't see the onclick event for the column, how can i do this? And also how can I switch the tabitems on the same wpf Window? Hyper link column is that: < toolkit:DataGridHyperlinkColumn Header="Path" Binding="{Binding path}" IsReadOnly="True" TargetName="{Binding Path=path}"

    Read the article

  • Getting Http Status code number (200, 301, 404, etc.) from HttpWebRequest and HttpWebResponse

    - by James Lawruk
    I am trying to get the HTTP status code number from the HttpWebResponse object returned from a HttpWebRequest. I was hoping to get the actual numbers (200, 301,302, 404, etc.) rather than the text description. ("Ok", "MovedPermanently", etc.) Is the number buried in a property somewhere in the response object? Any ideas other than creating a big switch function? Thanks. HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create("http://www.gooogle.com/"); webRequest.AllowAutoRedirect = false; HttpWebResponse response = (HttpWebResponse)webRequest.GetResponse(); //Returns "MovedPermanently", not 301 which is what I want. Console.Write(response.StatusCode.ToString());

    Read the article

  • networking application and GUI in python

    - by pygabriel
    I'm writing an application that sends files over network, I want to develop a custom protocol to not limit myself in term on feature richness (http wouldn't be appropriate, the nearest thing is the bittorrent protocol maybe). I've tried with twisted, I've built a good app but there's a bug that makes my GUI blocking, so I've to switch to another framework/strategy. What do you suggest? Using raw sockets and using gtk mainloop (there are select-like functions in the toolkit) is too much difficult? It's viable running two mainloops in different threads? Asking for suggestions

    Read the article

  • Texture repeats even with GL_CLAMP_TO_EDGE set [FIXED]

    - by Lliane
    Hi, i'm trying to put a translucing texture on a face which uses points 1 to 4 (don't mind the numbers) on the following screenshot Sadly as you can see the texture repeats herself in both dimensions, I tried to switch the TEXTURE_WRAP_S from REPEAT to CLAMP_to_EDGE but it doesn't change anything. Texture loading code is here : gl.glBindTexture(gl.GL_TEXTURE_2D, mTexture.get(4)); gl.glActiveTexture(4); gl.glTexParameterf(gl.GL_TEXTURE_2D, gl.GL_TEXTURE_MIN_FILTER, gl.GL_LINEAR); gl.glTexParameterf(gl.GL_TEXTURE_2D, gl.GL_TEXTURE_MAG_FILTER, gl.GL_LINEAR); gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_CLAMP_TO_EDGE); gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_CLAMP_TO_EDGE); gl.glTexImage2D(gl.GL_TEXTURE_2D, 0, gl.GL_RGBA, shadowbmp.width, shadowbmp.height, 0, gl.GL_RGBA, gl.GL_UNSIGNED_SHORT_4_4_4_4, shadowbmp.buffer); Texture coordinates are the following : float shadow_bot_text[] = { 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, 1.0f }; Thanks

    Read the article

  • MySQL Prepared Statements vs Stored Procedures Performance

    - by amardilo
    Hi there, I have an old MySQL 4.1 database with a table that has a few millions rows and an old Java application that connects to this database and returns several thousand rows from this this table on a frequent basis via a simple SQL query (i.e. SELECT * FROM people WHERE first_name = 'Bob'. I think the Java application uses client side prepared statements but was looking at switching this to the server, and in the example mentioned the value for first_name will vary depending on what the user enters). I would like to speed up performance on the select query and was wondering if I should switch to Prepared Statements or Stored Procedures. Is there a general rule of thumb of what is quicker/less resource intensive (or if a combination of both is better)

    Read the article

  • margin-bottom property of a div's last element doesn't "extend" the div

    - by kitsched
    I have an element in a div, which has a background image. Below the div I have another div with another background image. Now the problem is that if the last element contained in the first div has margin-bottom applied there will be a gap between the 2 divs like this: Notice the gray gap caused by the margin-bottom property of the h2 element contained within the first div. I know this can be solved if I switch margin-bottom to padding-bottom but what if I need margin-bottom? How to fix this?

    Read the article

< Previous Page | 230 231 232 233 234 235 236 237 238 239 240 241  | Next Page >