Search Results

Search found 28782 results on 1152 pages for 'input language'.

Page 4/1152 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • C++ CIN cin skips randomly

    - by user69514
    I have this program, but cin in randomly skips.. I mean sometimes it does, and sometimes it doesn't. Any ideas how to fix this? int main(){ /** get course name, number of students, and assignment name **/ string course_name; int numb_students; string assignment_name; Assignment* assignment; cout << "Enter the name of the course" << endl; cin >> course_name; cout << "Enter the number of students" << endl; cin >> numb_students; cout << "Enter the name of the assignment" << endl; cin >> assignment_name; assignment = new Assignment(assignment_name); /** iterate asking for student name and score **/ int i = 0; string student_name; double student_score = 0.0; while( i < numb_students ){ cout << "Enter the name for student #" << i << endl; cin >> student_name; cout << "Enter the score for student #" << i << endl; cin >> student_score; assignment->addScore( Student( student_name, student_score )); i++; } }

    Read the article

  • How to reset the language of the package descriptions

    - by xubuntix
    I have had German as my main language about a year ago. Later I changed it to English. Most parts of the system accepted the change. The notable exceptions are the package descriptions, which remain in German for some packages. You can see in the image (apt-cache and software-center), that while some descriptions are in English, some have remained in German. So the question is: how do I reset this? I guess that there is somewhere a description cache that needs to be told that it should update all descriptions? EDIT: As asked: the output of some language related commands: $ cat /etc/default/locale LANG="en_US.UTF-8" $ apt-config dump | grep Lang Acquire::Languages ""; Acquire::Languages:: "de_DE"; Acquire::Languages:: "de"; Acquire::Languages:: "en"; Acquire::Languages:: "none"; $ locale LANG=de_DE.UTF-8 LANGUAGE=en LC_CTYPE="de_DE.UTF-8" LC_NUMERIC="de_DE.UTF-8" LC_TIME="de_DE.UTF-8" LC_COLLATE="de_DE.UTF-8" LC_MONETARY="de_DE.UTF-8" LC_MESSAGES="de_DE.UTF-8" LC_PAPER="de_DE.UTF-8" LC_NAME="de_DE.UTF-8" LC_ADDRESS="de_DE.UTF-8" LC_TELEPHONE="de_DE.UTF-8" LC_MEASUREMENT="de_DE.UTF-8" LC_IDENTIFICATION="de_DE.UTF-8" LC_ALL= As a note: I'm not sure what each entry means, but some of the de_DE.UTF-8 are probably ok, since I do want paper-sizes, monetary, time, etc. in standard German formats.

    Read the article

  • New scripting language

    - by j-t-s
    Hi All I am trying to create a scripting language by myself (it doesn't have to be perfect - although that would be great if it was), mostly because i'm doing it for fun and to learn about how they're created etc. According to the answer over here: http://stackoverflow.com/questions/2439929/creating-a-scripting-language what I'm supposed to be looking into is this: http://msdn.microsoft.com/en-us/library/xawadt95%28VS.85%29.aspx . But, I have absolutely no idea what that MSDN page is on about. Can somebody please help? P.S. Are there any free/open source scripting languages that target the Windows Script Host, that also have full source code available for it that I can play around with? Thank you

    Read the article

  • Input validation in WPF

    - by irfanali-wpfexpert
    i am developing an application in wpf using MVVM design pattern. i have a listbox when an item is slected then a dialog is open having the same record in editable mode. this dialog is binded with the selected item of the list. i have apply the validation rule for textbox using IDataErrorInfo. when the user update a record on dialogbox then at every key press, the selected record in listbox is also changed. if the user press save button then i submit changes to database. but if user click cancel button then i do not submit changes to database but the list box is updated with the current updation in GUI. when i refresh the list then old value appears again. My requirement is to update the listbox only when the user hit the save button but not on every key press on dialog box. I first fill the generic list with the linq to sql classes then bind the listbox with it. Please let me know what i have to do. Thanks in advance

    Read the article

  • Jquery append input for 2 different input-sections

    - by Email
    Hi i use the following simple jquery script to append input. Source http://muiomuio.com/web-design/add-remove-items-with-jquery <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Add and Remove - jQuery tutorial</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script> <script type="text/javascript"> $(function() { var i = $('input').size() + 1; $('a.add').click(function() { $('<p><input type="text" value="input ' + i + '" name="input_field'+ i +'" /></p>').animate({ opacity: "show" }, "slow").appendTo('#inputs'); i++; }); $('a.remove').click(function() { if(i > 2) { $('input:last').animate({opacity:"hide"}, "slow").remove(); i--; } }); $('a.reset').click(function() { while(i > 2) { $('input:last').remove(); i--; } }); }); </script> </head> <body> <h1>Add / remove text fields from webform</h1> <a href="#" class="add"><img src="add.png" width="24" height="24" alt="add" title="add input" /></a> <a href="#" class="remove"><img src="remove.png" width="24" height="24" alt="remove input" /></a> <a href="#" class="reset"><img src="reset.png" width="24" height="24" alt="reset" /></a> <div id="inputs"> <p> <input type="text" value="input 1" name="input_field1"> </p> </div> </div> </body> </html> I know want to add more input fields so i add this html <div id="outputs"> <p> <input type="text" value="output 1" name="output_field1"> </p> how can i achieve that the var i = $('input').size() + 1; will be individually for every input section? EDITED: the full script is the following. copy and paste will get you a full clone of mine. Problem still exists <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Add and Remove - jQuery tutorial</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script> <script type="text/javascript"> $(function() { var i = $('input').size() + 1; $('a.add').click(function() { $('<p><input type="text" value="input ' + i + '" name="input_field'+ i +'" /></p>').animate({ opacity: "show" }, "slow").appendTo('#inputs'); i++; }); $('a.remove').click(function() { if(i > 2) { $('input:last').animate({opacity:"hide"}, "slow").remove(); i--; } }); $('a.reset').click(function() { while(i > 2) { $('input:last').remove(); i--; } }); $('a.add_o').click(function() { $('<p><input type="text" value="output ' + i + '" name="input_field'+ i +'" /></p>').animate({ opacity: "show" }, "slow").appendTo('#outputs'); i++; }); $('a.remove_o').click(function() { if(i > 2) { $('input:last').animate({opacity:"hide"}, "slow").remove(); i--; } }); $('a.reset_o').click(function() { while(i > 2) { $('input:last').remove(); i--; } }); }); </script> <style rel="stylesheet" type="text/css"> h1 { font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;} .hide {visibility:hidden;} img {border:none;} input { width:500px; height:20px; padding:10px; background:#f7f7f7; border:1px solid #f0f0f0; color:#333; font-size:20px; text-align:center; line-height:120px; margin:0; -moz-border-radius:5px; -webkit-border-radius:5px; } #inputs { width:520px; padding:0px 20px; border:1px solid #f0f0f0; -moz-border-radius:20px; -webkit-border-radius:20px; } </style> </head> <body> <h1>Add / remove text fields from webform</h1> <a href="#" class="add"><img src="http://muiomuio.com/tutorials/jquery/add-remove/add.png" width="24" height="24" alt="add" title="add input" /></a> <a href="#" class="remove"><img src="http://muiomuio.com/tutorials/jquery/add-remove/remove.png" width="24" height="24" alt="remove input" /></a> <a href="#" class="reset"><img src="http://muiomuio.com/tutorials/jquery/add-remove/reset.png" width="24" height="24" alt="reset" /></a> <div id="inputs"> <p> <input type="text" value="input 1" name="input_field1"> </p> </div> <a href="#" class="add_o"><img src="http://muiomuio.com/tutorials/jquery/add-remove/add.png" width="24" height="24" alt="add" title="add input" /></a> <a href="#" class="remove_o"><img src="http://muiomuio.com/tutorials/jquery/add-remove/remove.png" width="24" height="24" alt="remove input" /></a> <a href="#" class="reset_o"><img src="http://muiomuio.com/tutorials/jquery/add-remove/reset.png" width="24" height="24" alt="reset" /></a> <div id="outputs"> <p> <input type="text" value="output 1" name="output_field1"> </p> </div> </body> </html>

    Read the article

  • 'Other' Features in a programming language

    - by user12960
    Online (i cant remember where) i saw someone mention he wishes programming language has more built in features for tools like documentation and source control. Now i dont understand what needs to be built in for source control since tools like git (sorry but i dont have much experience with others) has everything i need and is very easy to use. Documentation i can understand, perhaps the ability to generate remote procedures calls from source to some kind of IDL would be cool. But really i dont understand what features a programming language can/should have that isnt tied with code generation and syntax (except the two i mention when it comes to libraries). What ideas do you guys have? What is your wishlist?

    Read the article

  • Language Club

    - by Ben Griswold
    We started a language club at work this week.  Thus far, we have a collective interest in a number of languages: Python, Ruby, F#, Erlang, Objective-C, Scala, Clojure, Haskell and Go. There are more but these 9 received the most votes. During the first few meetings we are going to determine which language we should tackle first. To help make our selection, each member will provide a quick overview of their favored language by answering the following set of questions: Why are you interested in learning “your” language(s). (There’s lots of work, I’m an MS shill, It’s hip and  fun, etc) What type of language is it?  (OO, dynamic, functional, procedural, declarative, etc) What types of problems is your language best suited to solve?  (Algorithms over big data, rapid application development, modeling, merely academic, etc) Can you provide examples of where/how it is being used?  If it isn’t being used, why not?  (Erlang was invented at Ericsson to provide an extremely fault tolerant, concurrent system.) Quick history – Who created/sponsored the language?  When was it created?  Is it currently active? Does the language have hardware support (an attempt was made at one point to create processor instruction sets specific to Prolog), or can it run as an interpreted language inside another language (like Ruby in the JVM)? Are there facilities for programs written in this language to communicate with other languages?  How does this affect its utility? Does the language have a IDE tool support?  (Think Eclipse or Visual Studio) How well is the language supported in terms of books, community and documentation? What’s the number one things which differentiates the language from others?  (i.e. Why is it cool?) How is the language applicability to us as consultants?  What would the impact be of using the language in terms of cost, maintainability, personnel costs, etc.? What’s the number one things which differentiates the language from others?  (i.e. Why is it cool?) This should provide an decent introduction into nearly a dozen languages and give us enough context to decide which single language deserves our undivided attention for the weeks to come.  Stay tuned for the winner…

    Read the article

  • Display current layout (language code/country flag) in keyboard indicator

    - by Jono
    Just upgraded from 10.04 to 10.10, and the keyboard indicator applet no longer displays the two-letter country code for the active layout. This is terrible. Is this the default behaviour? Anyone using two layouts can't tell which language they're in. I can't seem to find the setting for this, it used to be in the preferences for keyboard layout. Update 1: In case this wasn't obvious - I have two keyboard layouts - English and Hebrew. I just upgraded form 10.04, where the country code (USA/IL) was displayed, overlaid on the flag. Now all I get is a vague keyboard icon, and can't find the settings for this. Update 2: this seems to be a bug that people have been reporting since Lucid, and is now back in Maverick

    Read the article

  • Display current layout (language code/country flag) in keyboard indicator

    - by Jono
    Just upgraded from 10.04 to 10.10, and the keyboard indicator applet no longer displays the two-letter country code for the active layout. This is terrible. Is this the default behaviour? Anyone using two layouts can't tell which language they're in. I can't seem to find the setting for this, it used to be in the preferences for keyboard layout. Update 1: In case this wasn't obvious - I have two keyboard layouts - English and Hebrew. I just upgraded form 10.04, where the country code (USA/IL) was displayed, overlaid on the flag. Now all I get is a vague keyboard icon, and can't find the settings for this. Update 2: this seems to be a bug that people have been reporting since Lucid, and is now back in Maverick

    Read the article

  • What programming language matches this description? [on hold]

    - by Benubird
    I am looking for a functional language that is basically dynamic programming - i.e. one where functions are first-class objects - but where all function calls are asynchronous by default; i.e. you define function X(a,b) = (Y(a)+Z(b)), and when X() is called, it sees it is waiting for the return from two functions, runs one in the current thread, and spawns a new thread to run the other. The future is very much parallel processing; multiple cores, multiple machines, the internet of things, etc. and I was wondering if there was a language specifically designed to make this kind of parallelization easy. I currently have only used imperative languages (c, php, java, ruby, etc), so I don't know anything about what kind of functional languages are available.

    Read the article

  • A quiz with results

    - by Keon Davies
    I'm currently working on programming a quiz withe results. I've tried this: <html> <body> <h1></h1> <form> <ol> <li> How much are you willing to spend on a phone per month?</li> <ul> <li><input type = "radio" name = "q1" id="q1_1"> £5-£10.</input></li> <li><input type = "radio" name = "q1" id="q1_2"> £10-£15.</input></li> <li><input type = "radio" name = "q1" id="q1_3"> £15-£20.</input></li> <li><input type = "radio" name = "q1" id="q1_4"> £20-£25.</input></li> <li><input type = "radio" name = "q1" id="q1_5"> £25-£30.</input></li> <li><input type = "radio" name = "q1" id="q1_6"> £30-£35.</input></li> <li><input type = "radio" name = "q1" id="q1_7"> £35-£40.</input></li> </ul> <li> Are you good with technology</li> <ul> <li><input type = "radio" name = "q2" id="q2_1"> Yes.</input></li> <li><input type = "radio" name = "q2" id="q2_2"> No.</input></li> </ul> <li> Are you looking for an easy to use phone</li> <ul> <li><input type = "radio" name = "q3" id="q3_1"> Yes.</input></li> <li><input type = "radio" name = "q3" id="q3_2"> No.</input></li> </ul> <li> Are you looking for a modern type of phone?</li> <ul> <li><input type = "radio" name = "q4" id="q4_1"> Yes.</input></li> <li><input type = "radio" name = "q4" id="q4_2"> No.</input></li> </ul> <li> How big do you want the phone to be?</li> <ul> <li><input type = "radio" name = "q5" id="q5_1"> Big.</input></li> <li><input type = "radio" name = "q5" id="q5_2"> Medium.</input></li> <li><input type = "radio" name = "q5" id="q5_3"> Small.</input></li> <li><input type = "radio" name = "q5" id="q5_4"> I don't really mind.</input></li> </ul> <li> Do you care about the colour of the phone?</li> <ul> <li><input type = "radio" name = "q6" id="q6_1"> Yes.</input></li> <li><input type = "radio" name = "q6" id="q6_2"> No.</input></li> </ul> <li> Have you ever owned a phone before?</li> <ul> <li><input type = "radio" name = "q7" id="q7_1"> Yes.</input></li> <li><input type = "radio" name = "q7" id="q7_2"> No.</input></li> </ul> <li> Do you want to be able to use the phone to get out of awkward social situations?</li> <ul> <li><input type = "radio" name = "q8" id="q8_1"> Yes.</input></li> <li><input type = "radio" name = "q8" id="q8_2"> No.</input></li> </ul> <li> Do you want to be able to access the app store and download apps using your phone?</li> <ul> <li><input type = "radio" name = "q9" id="q9_1"> Yes.</input></li> <li><input type = "radio" name = "q9" id="q9_2"> No.</input></li> </ul> <li> What happened to the last phone you owned?</li> <ul> <li><input type = "radio" name = "q10" id="q10_1"> I got bored of it.</input></li> <li><input type = "radio" name = "q10" id="q10_2"> It broke.</input></li> <li><input type = "radio" name = "q10" id="q10_3"> The contract ran out.</input></li> <li><input type = "radio" name = "q10" id="q10_4"> Other.</input></li> </ul> </ol> <input type = "button" value = "Submit" onclick="getResults()"> <input type = "reset" value = "Clear"></input> <textarea id="result">The right phone for you will be displayed here.</textarea> </html> <script> function getResults() { if (document.getElementById('q1_1').checked && document.getElementById('q2_1').checked && document.getElementById('q3_1').checked && document.getElementById('q4_1').checked && document.getElementById('q5_1').checked && document.getElementById('q6_1').checked && document.getElementById('q7_1').checked && document.getElementById('q8_1').checked && document.getElementById('q9_1').checked && document.getElementById('q10_1').checked ) { document.getElementById('result').innerHTML = 'Unfortunately, the iPhone is the right phone for you.'; } } </script> </body> But it's just too long winded. Is there any other ways I can design a quiz like this but without having to write a block of code for each radio button?

    Read the article

  • Getting input from keyboard

    - by SAMIR BHOGAYTA
    When you type on the keyboard the keystrokes go to a particular application, the active application. The active application receives the input from the keyboard. This means the application has input focus. There are two events for a key on a keyboard, when the key is pressed and when it is released. No it's not a single event as you might expect if you have no prior programming experience, in shooter games for example when you keep the forward key pressed (KeyDown) the player goes forward, and when it isn't pressed (KeyUp) the player stays put. The event that occurs when the key is pressed is called KeyPress. It occurs between KeyDown and KeyUp, and therefore acts similar to KeyDown. Similar to the way we handle OnPaint and other events we also handle the OnKeyDown event (because we want the event to occur when the key is pressed and not when it is released) by overriding it. Try the code below and test it. You will understand the role of each property. protected override void OnKeyDown(KeyEventArgs keyEvent) { // Gets the key code lblKeyCode.Text = "KeyCode: " + keyEvent.KeyCode.ToString(); // Gets the key data; recognizes combination of keys lblKeyData.Text = "KeyData: " + keyEvent.KeyData.ToString(); // Integer representation of KeyData lblKeyValue.Text = "KeyValue: " + keyEvent.KeyValue.ToString(); // Returns true if Alt is pressed lblAlt.Text = "Alt: " + keyEvent.Alt.ToString(); // Returns true if Ctrl is pressed lblCtrl.Text = "Ctrl: " + keyEvent.Control.ToString(); // Returns true if Shift is pressed lblShift.Text = "Shift: " + keyEvent.Shift.ToString(); } How do I find out when the user presses a specific key? As you probably imagine, this will be easily accomplished using 'if'. if (keyEvent.KeyCode == Keys.A) { MessageBox.Show("'A' was pressed."); } Probably most beginners would be tempted to do this: if (keyEvent.KeyCode == "A") .... which is definitely incorrect because we can't compare System.Windows.Forms.Keys to a string. Also note that in the example we are using 'keyEvent.KeyCode', that means that even if we have other shift keys pressed (Alt, Ctrl, Shift, Windows...) simultaneous with A, the if condition returns true because it doesn't recognize key combinations. If we want to ignore key combinations (Alt+A, Ctrl+Shift+A), etc. we need to use 'keyEvent.KeyData' of course: if (keyEvent.KeyData == Keys.A) { MessageBox.Show("'A', and only A, was pressed."); } When you right click on a file in Windows Explorer and you have the Shift key pressed you get the additional 'Open with...' item in the menu. This and many others are cases when you need to use the mouse button together with the keyboard. The following code will change the background color of the form only if the form is clicked while the Ctrl key on the keyboard is pressed. If the Ctrl key is unpressed and the form is clicked nothing happens. private void Form1_Click(object sender, System.EventArgs e) { Keys modKey = Control.ModifierKeys; if(modKey == Keys.Control) { this.BackColor = Color.Yellow; } } If you have further questions feel free to ask them and also check the following pages at MSDN: KeyUp Event KeyPress Event KeyDown Event

    Read the article

  • Doesn't installing "All locales" install necessary fonts too?

    - by its_me
    I recently noticed that my browsers rendered blank text (or invisible text?) on some websites in foreign languages, like Chinese. inside.com.tw, for example. Later I learnt that by default Debian only installs one locale (the one you choose during the installation process), and others need to be installed manually. So, I ran the command: # dpkg-reconfigure locales And selected All locales from the options screen that followed, and proceeded with the rest of the process, which also includes changing the default locale (which I set to en_US.UTF-8). Then I restarted my system. I still can't read the website that I mentioned earlier (inside.com.tw). Most of the text is blank, i.e. invisible. With the page translated by Chrome to my default language (en_US), the text is visible; BUT not in the original language. Why is this happening? Does this mean that installing locales isn't actually necessary, and all I have to do is install the fonts for all supported languages? If so, how do I install all the fonts necessary for All locales? UPDATE: An easy fix is to install the unifont package which adds support for all Unicode 5.1 characters. But the rendering is of very bad quality. So, how I install all font packages? I notice that there are three sets, ones starting with fonts-*, another with xfonts-*, and ttf-*? Which set should I exactly go with, and how do I install that set of fonts. Looking for a knowledgeable solution.

    Read the article

  • Handling keyboard and mouse input (Win API)

    - by Deluxe
    There is a number of ways to catch mouse or keyboard under Windows. So I tried some of them, but every of them has some advantages and drawbacks. I want to ask you: Which method do use? I've tried these: WM_KEYDOWN/WM_KEYUP - Main disadvantage is that, I can't distinguish between left and right-handed keys like ALT, CONTROL or SHIFT. GetKeyboardState - This solves problem of first method, but there is new one. When I get that the Right-ALT key is pressed, I also get that the Left-Control key is down. This behaviour happens only when using localized keyboard layout (Czech - CS). WM_INPUT (Raw Input) - This method also doesn't distinguish left and right-handed keys (if I can remember) and for mouse movement sometimes generates message with zero delta values of mouse position.

    Read the article

  • Input Signal Out of Range 1920x1080

    - by Zach
    I've recently installed Ubuntu 12.04 on my computer. Now, every time I boot and when I shut down, my monitor goes blank and says "Input Signal Out of Range - Change Setting to 1920x1080 60Hz." Once the computer gets to the login screen, it's okay again. This problem also happens when I try to open any 3d app. My graphics card is NVIDIA GEforce 6150 SE. I tried updating the drivers, but it broke everything and I had to reinstall Ubuntu. Any help?

    Read the article

  • Inputting cheat codes - hidden keyboard input

    - by Fibericon
    Okay, here's what I want to do - when the player is at the main menu, I want them to be able to type in cheat codes. That's the only place I want it to work. I don't want to give them a text box to type into. Rather, I want them to simply type in a word (let's say "cheat", just for simplicity sake) that activates the cheat code. I only need to capture keyboard input when the window is in focus. What can I do to accomplish this?

    Read the article

  • Best way to let users choose country/language when submiting an URL to a directory

    - by Claudiu
    Hi all, I want to offer the user the possibility to add the country/language for websites they would submit to a fairly simple website directory. I have a folder with flags from http://www.famfamfam.com/lab/icons/flags/ . The flag images are named according to the ISO 3166-1 alpha-2 country codes, meaning that I could make a PHP script that would be able to retrieve images and the name of the country retrieved from the image name (not the full name, but it wouldn't be necessary). Just to make things clearer, I couldn't find a proper combo-box jQuery plugin for my needs (that would act exactly like the native but with an icon before the text) and don't really have the time to develop one on my own. Considering the number of images, I also wouldn't just display them all with a radio box near them. Also, having a classic drop-down list would be a nightmare for me as I would have to assign the short country name manually to each entry, or do it once for every country. Offering the user a dropdown list with the short country names but no flag near them would also be unfriendly and confusing. The idea is that every website featured in the directory would have the country flag icon near it. I have the images named properly but I don't know how to let the user choose the right image for their website. Any idees? Thank you all in advance! EDIT Temporary solution is this file: http://www.andrewpatton.com/countrylist.csv It contains a list of countries including various other info, like the short country name, the same name that's used for the flag images. I can take that information and have a classic like this: <select name="countries"> <option value="ro">Romania</option> <option value="ie">Ireland</option> <!-- and so on --> </select> Still, If anybody has a better idea...

    Read the article

  • Best way to let users choose country/language when submiting an URL to a directory

    - by Claudiu
    I want to offer the user the possibility to add the country/language for websites they would submit to a fairly simple website directory. I have a folder with flags from http://www.famfamfam.com/lab/icons/flags/ . The flag images are named according to the ISO 3166-1 alpha-2 country codes, meaning that I could make a PHP script that would be able to retrieve images and the name of the country retrieved from the image name (not the full name, but it wouldn't be necessary). Just to make things clearer, I couldn't find a proper combo-box jQuery plugin for my needs (that would act exactly like the native but with an icon before the text) and don't really have the time to develop one on my own. Considering the number of images, I also wouldn't just display them all with a radio box near them. Also, having a classic drop-down list would be a nightmare for me as I would have to assign the short country name manually to each entry, or do it once for every country. Offering the user a dropdown list with the short country names but no flag near them would also be unfriendly and confusing. The idea is that every website featured in the directory would have the country flag icon near it. I have the images named properly but I don't know how to let the user choose the right image for their website. Any idees? Thank you all in advance! EDIT Temporary solution is this file: http://www.andrewpatton.com/countrylist.csv It contains a list of countries including various other info, like the short country name, the same name that's used for the flag images. I can take that information and have a classic like this: <select name="countries"> <option value="ro">Romania</option> <option value="ie">Ireland</option> <!-- and so on --> </select> Still, If anybody has a better idea...

    Read the article

  • Understanding run time code interpretation and execution

    - by Bob
    I'm creating a game in XNA and was thinking of creating my own scripting language (extremely simple mind you). I know there's better ways to go about this (and that I'm reinventing the wheel), but I want the learning experience more than to be productive and fast. When confronted with code at run time, from what I understand, the usual approach is to parse into a machine code or byte code or something else that is actually executable and then execute that, right? But, for instance, when Chrome first came out they said their JavaScript engine was fast because it compiles the JavaScript into machine code. This implies other engines weren't compiling into machine code. I'd prefer not compiling to a lower language, so are there any known modern techniques for parsing and executing code without compiling to low level? Perhaps something like parsing the code into some sort of tree, branching through the tree, and comparing each symbol and calling some function that handles that symbol? (Wild guessing and stabbing in the dark)

    Read the article

  • Input Handling and Game loop

    - by Bob Coder
    So, I intercept the WM_KEYDOWN and other messages. Thing is, my game can't/shouldn't react to these messages just yet, since my game might be currently drawing to the screen or in the middle of updating my game entities. So the idea is to keep a keyboardstate and mousestate, which is updated by the part of my code that intercepts the windows messages. These states just keep track of which keys/buttons are currently pressed. Then, at the start of my game's update function, I access these keyboard and mouse states and my game reacts to the user input. Now, which is the best way to access these states? I assume that windows messages can be sent whenever, so the keyboard/mouse states are constantly being edited. Accessing say a list of currently pressed keys in the keyboard state the same time another part of the code is editing the list would cause problems. Should I make a deep copy of a state and act on that? How would I deal with the garbage generated though, this would take place every frame.

    Read the article

  • Java keyboard input [on hold]

    - by dØd
    I'm trying to implement a input system that can detect whether a certain key was held or was only pressed briefly. So far I have this: KEY_INTERACTION_TRESHOLD = 400ms //inside a constructor shouldMeasure = true; @Override public void keyPressed(KeyEvent e) { if (shouldMeasure) { startTime = System.currentTimeMillis(); shouldMeasure = false; return; } System.out.println("Button is held down"); e.consume(); } @Override public void keyReleased(KeyEvent e) { if (System.currentTimeMillis() - startTime < KEY_INTERACTION_TRESHOLD) { System.out.println("Button was only pressed briefly"); } startTime = 0; shouldMeasure = true; e.consume(); } Now this works, but the problem is that there is this delay between when I press a key to hold and when the message 'Button is held down' gets displayed. I understand why this delay occurs (for example when you press and hold a letter there will be a similar delay between the first and the second letter printed out), but I would like to somehow avoid it. I'm using only the Java API.

    Read the article

  • Input/Output console window in XNA

    - by Will Bagley
    I am currently making a simple game in XNA but am at a point where testing various aspect gets a bit tricky, especially when you have to wait till you have 1000 score to see if your animation is playing correctly etc. Of course i could just edit the starting variable in the code before I launched but I have recently been interested in trying to implement a console style window which can print out values and take input to alter public variables during run-time. I am aware that VS has the immediate window which achieves a similar thing but i would prefer mine is an actual part of the game with the intention that the user may have limited access to it in the future. Some of the key things i have yet to find an answer to after looking around for a while are: how i would support free text entry how i would access variables during runtime how i would edit these variable I have also read about using a property grid from windows form aps (and partially reflection) which looked like it could simplify a lot of things but i am not sure how I would get that running inside my XNA game window or how i would get it to not look out of place (as the visual aspect of is seems to be aimed just for development time viewing). All in all I'm quite open to any suggestions on how to approach this task as currently I'm not sure where to start. Thanks in advance.

    Read the article

  • Prioritize compiler functionality/tasks, when designing a new language

    - by Mahdi
    Well, the question should be so hard to ask and I expect couple of down votes, however, I'm really interested to have your ideas and recommendations. :) I've already made a very simple compiler, with a few and limited functionality. Now I'm getting more on it to make it more like a real-world compiler. I definitely need to start over 'cause I've much more experience and ideas in this area rather a few years ago. So, I want to know, right now, from the very first step again, which tasks/features for the new compiler should implement first and which tasks has lower priority rather than others? For example, I'd say, first I'd go to decide about the object-oriented structure for the new language, but you might say, hey, just go for a compiler that could define a variable, when you finished that, then start thinking about OOP designs ... I prefer to hear the pros and cons for your suggestions also. Actually I like to start from Bottom to Top, where I could add simplest tasks first, and later adding more complex ones, but I'm totally open for any new ideas, and really appreciate that. Also please consider that I'm thinking about the design concepts. Actually I expect answers like: Priority from Highest to Lowest: variables, because .... functions, because .... loops, because .... ... Not: define a syntax for your new language, and start parsing your source code ...

    Read the article

  • Unwanted Chinese language got set in system settings

    - by Registered User
    I was discussing on the Ubuntu users list how to type in in Hindi (Indic language) in Libre Office and about a package installation problem. I have made some changes in system settings, following suggestions by some users. However, this morning when I did a reboot I am unable to see English as my default language. My system is showing some Chinese characters which I do not understand. All I wanted was to use Libre Office for a particular document in Hindi. What happened is that even Gmail is opening in Chinese. The system settings folder and others are also opening in Chinese. I am unable to use the system now. I have uploaded the snapshots here: please have a look. Upon a reboot, I was asked to rename all folders. Gmail opening in Chinese This is how menu on my system looks: half English and half Chinese Notice that in the third snapshot the calendar and menu are appearing in Chinese. I want the original US English menus and folder names back. I just wanted to type a document with Lohit Hindi font in Libre Office. I use Ubuntu 11.10. I do not use Unity, only Gnome desktop. I installed gnome-session-fallback a long time back and have been using that ever since. How do I get back to all English submenus and English folder names? I have a US English Keyboard and I use only US English. This thing which is now somehow set is unwanted.

    Read the article

  • Implement a simple class in your favorite language.

    - by Oscar Reyes
    I'm doing this to learn syntax of different programming languages. So, how would you defined the following class along with with it's operations in your favorite programming language? Image generated by http://yuml.me/ And a main method or equivalent to invoke it: For instance, for Java it would be: ... public static void main( String [] args ) { Fraction f = new Fraction(); f.numerator( 2 ); f.denominator( 5 ); f.print(); } ....

    Read the article

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