Daily Archives

Articles indexed Thursday October 25 2012

Page 11/17 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • Setting APPMENU_DISPLAY_BOTH for gnome applications does not work on Ubuntu 12.04 LTS

    - by Jack'
    To start the application with the menu enabled in the application and the panel, the following command has to be used: APPMENU_DISPLAY_BOTH=1 appname I recently discovered that this only works for non-gnome applications on Ubuntu 12.04 LTS, i.e. if you replace appname with applications such as gnome-terminal, gedit, evince, empathy, evolution, rhythmbox, nautilus, etc. only global menus will be displayed. However, if you start, for example, gimp or inkscape by using APPMENU_DISPLAY_BOTH, both global and local menus will be shown. The questions is: why is APPMENU_DISPLAY_BOTH not taken into account when starting such gnome applications? P.S. I know how to disable global menus in order to get the local ones (UBUNTU_MENUPROXY trick, removing appmenu-gtk/qt packages, removing the indicator-appmenu, etc.) Thanks for the help!

    Read the article

  • How to type all the math, stat, greek, equations EFFICIENTLY in libreoffice?

    - by kernel_panic
    i am preparing a report related to physics which is full of greek, stat and calculus things, i know there is this question how to insert a greek symbol, but my problem is i cant fiddle with a drop down/ scroll list for for every symbol(my paper in FULL of those), is there a way to do something with my keyboard layout, and turn it into something like the one Tony Stark uses in Ironman(i am not kidding please). i am literally tired for this fiddle-work for half of the day and have completed just 2 sheets, hmmm.

    Read the article

  • How di I fix this Synaptic manager error

    - by mick
    Synaptic manager is giving me the following error: Failed to fetch cdrom://Ubuntu 11.04 _Natty Narwhal_ - Release i386 (20110427.1)/kubuntu/dists/natty/main/binary-i386/Packages Please use apt-cdrom to make this CD-ROM recognised by APT. apt-get update cannot be used to add new CD-ROMs Failed to fetch cdrom://Ubuntu 11.04 _Natty Narwhal_ - Release i386 (20110427.1)/kubuntu/dists/natty/restricted/binary-i386/Packages Please use apt- cdrom to make this CD-ROM recognised by APT. apt-get update cannot be used to add new CD-ROMs Failed to fetch cdrom://Ubuntu 11.04 _Natty Narwhal_ - Release i386 (20110427.1)/xubuntu/dists/natty/main/binary-i386/Packages Please use apt-cdrom to make this CD-ROM recognised by APT. apt-get update cannot be used to add new CD-ROMs Failed to fetch cdrom://Ubuntu 11.04 _Natty Narwhal_ - Release i386 (20110427.1)/xubuntu/dists/natty/restricted/binary-i386/Packages Please use apt-cdrom to make this CD-ROM recognised by APT. apt-get update cannot be used to add new CD-ROMs

    Read the article

  • How to re-add RAID-10 dropped drive?

    - by thiesdiggity
    I have a problem that I can't seem to solve. We have a Ubuntu server setup with RAID-10 and two of the drives dropped out of the array. When I try to re-add them using the following command: mdadm --manage --re-add /dev/md2 /dev/sdc1 I get the following error message: mdadm: Cannot open /dev/sdc1: Device or resource busy When I do a "cat /proc/mdstat" I get the following: Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [r$ md2 : active raid10 sdb1[0] sdd1[3] 1953519872 blocks 64K chunks 2 near-copies [4/2] [U__U] md1 : active raid1 sda2[0] sdc2[1] 468853696 blocks [2/2] [UU] md0 : active raid1 sda1[0] sdc1[1] 19530688 blocks [2/2] [UU] unused devices: <none> When I run "/sbin/mdadm --detail /dev/md2" I get the following: /dev/md2: Version : 00.90 Creation Time : Mon Sep 5 23:41:13 2011 Raid Level : raid10 Array Size : 1953519872 (1863.02 GiB 2000.40 GB) Used Dev Size : 976759936 (931.51 GiB 1000.20 GB) Raid Devices : 4 Total Devices : 2 Preferred Minor : 2 Persistence : Superblock is persistent Update Time : Thu Oct 25 09:25:08 2012 State : active, degraded Active Devices : 2 Working Devices : 2 Failed Devices : 0 Spare Devices : 0 Layout : near=2, far=1 Chunk Size : 64K UUID : c6d87d27:aeefcb2e:d4453e2e:0b7266cb Events : 0.6688691 Number Major Minor RaidDevice State 0 8 17 0 active sync /dev/sdb1 1 0 0 1 removed 2 0 0 2 removed 3 8 49 3 active sync /dev/sdd1 Output of df -h is: Filesystem Size Used Avail Use% Mounted on /dev/md1 441G 2.0G 416G 1% / none 32G 236K 32G 1% /dev tmpfs 32G 0 32G 0% /dev/shm none 32G 112K 32G 1% /var/run none 32G 0 32G 0% /var/lock none 32G 0 32G 0% /lib/init/rw tmpfs 64G 215M 63G 1% /mnt/vmware none 441G 2.0G 416G 1% /var/lib/ureadahead/debugfs /dev/mapper/RAID10VG-RAID10LV 1.8T 139G 1.6T 8% /mnt/RAID10 When I do a "fdisk -l" I can see all the drives needed for the RAID-10. The RAID-10 is part of the /dev/mapper, could that be the reason why the device is coming back as busy? Anyone have any suggestions on what I can try to get the drives back into the array? Any help would be greatly appreciated. Thanks!

    Read the article

  • Getting Started with 12.04 LTS Problems

    - by mark
    Okay previously I used ubuntu 10.04 in Desktops and Loved it! I bought a newer Toshiba Satellite with an i7 CPU, 8GB Ram, 1TB HD, first thing I tried to do was install Ubuntu 9 on it then I found out it was no longer Supported. (I gave my 10.04 disk away) So I tried installing Windows 7 and experienced SO MANY problems, I am going back to try 12.04. Starting all over again. After installing 12.04 Wireless was Detected yet said it was Disabled by a Hardware Switch. Went read through the Message Boards found Solution which was Sudo rf Kill All. Okay all excited I would finally get my Ubuntu to finally work I rushed back to my laptop from the internet cafe, and went looking for the TERMINAL input on my Ubuntu 12.04, and I cannot find the Terminal. If I can't find the TERMINAL how Can I enter any Sudo Stuff? So I guess the first question is Where is the Terminal Located in 12.04? Thank you.

    Read the article

  • Boot screen appears to be asking a question but garbled

    - by mark kaylor
    I'm running 12.04 Precise Pangolin, Kernel 3.2.0-32 w/ GNOME 3.4.2 I perused the prior questions/answers and did not find exactly the same problem, I am concerned that AUTOFSCK, Grub or some other critical event that needs some attention ? Any idea on how to get my video clean during boot? Once I get past the boot screen the video driver/card, etc is performing beautifully ! Here is a photo of the boot screen; nVidia GeForce CARD INFORMATION (lspci -vvv) 01:00.0 VGA compatible controller: NVIDIA Corporation G72 [GeForce 7300 LE] (rev a1) (prog-if 00 [VGA controller]) Subsystem: Gateway 2000 Device 3a07 Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx- Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast TAbort- SERR- [disabled] Capabilities: Kernel driver in use: nvidia Kernel modules: nvidia_173, nouveau, nvidiafb Thanks for your help/advice.

    Read the article

  • Thunderbird 16.0.1 filling disk space

    - by Kris
    I'm on Ubuntu 12.04 with Thunderbird 16.0.1 and Kernel 3.6.0-030600rc4-generic. I used Thunderbird for quite a while and never had any problems with it. But now it seems to fill up my disk space very fast: watch -n 1 df -h . so Ubuntu started giving out warnings. First I removed some files but not much later it had filled up around 600 MB. It eats around 50 MB/min while I just download 10 emails or so via IMAP. This behaviour is new and seems to be some kind of bug. I don't want to delete my old mails, so what else could I do?

    Read the article

  • How do I get a transparent page/screen in Firefox?

    - by s0dafire
    So, everytime I open a new tab (about:newtab) or just a white screen (about:blank). It would be better, Firefox displays my desktop instead (or what's 'behind' firefox) to work more efficient. I thought to try Firefox's Add-On 'Stylish' to solve this problem, but those scripts are only for Windows with Aero support. So... any other ideas how I get a transparent page/screen in Firefox? EDIT To clean things up: I don't want the whole window transparent!

    Read the article

  • Which LAN card / module combinations proven to work with Wake on LAN

    - by pablomo
    I've got a 12.04 headless server that I've been trying to get to work with wake-on-lan. The card is Marvel 88E8053 using the sky2 module. Although WOL is enabled in BIOS and ethtool shows the card as WOL enabled, it refuses to wake when I send the magic packet. I have verified that the packet is being received OK when the machine is on. The machine does wake OK from a BIOS alarm which suggests it is a network card issue. I've seen reference to bugs in sky2 that mean WOL fails in recent versions of Ubuntu (and have tried a module conf file as suggested here but to no avail) So I am thinking the best bet is to replace the ethernet card with one that definitely works with WOL in 12.04 - please could you post your card make and model no if you are using it successfully?

    Read the article

  • G5 quad core will not boot from Ubuntu CD

    - by Steve Howard
    I have a PPC G5 Quad Core with Leopard on one hard drive and I want to install Ubuntu on a second hard drive. The second drive is installed and formatted as a Mac OS Extended (Journaled) drive. I have had no success booting from a CD or DVD with various PPC versions of Ubuntu using any of the suggested keys such as "C, Option, or anything else. Booting into open firmware doesn't work as the system can't find the \install\yaboot file. I am using various CD's burned as iso disk images, but none will boot. I have reset the PRAM, etc, to no avail. Beginning to get very frustrated. Can someone shed some light and provide me with a command line in open firmware that will work, or else direct me to a confirmed PPC bootable version of Ubuntu please? I'd appreciate any help you can provide....

    Read the article

  • protecting css selectors on large website

    - by Tim
    I have content that appears within a corporate website inside an iframe. Several departments contribute their own CSS files to manage the overall UI and design. My problem is that they may use selectors for elements like td (for instance), without notice. Of course that will affect my own content in the frame unless I add a class to every td. I'm just using td as an example: the generic style for any element could change without notice. Is there any method/convention/practice I can use to protect my own styling?

    Read the article

  • PHP 5.4 and Hiphop compatibility

    - by boundless08
    I was wondering does anyone know which of the features in php 5.4 are not supported in php hiphop. There's some questions on the hiphop github wiki, such as this one, that very vaguely state HipHop does not currently support all PHP 5.4 features. At the moment I just have to assume, for working purposes, all new features are not compatible as none are specified to work, if anyone has any insight on this that would be great, thanks in advance.

    Read the article

  • How exactly is Google Webmaster Tools measuring "Site Performance"?

    - by Rémi
    I've been working for two months now on improving our response time (mainly server side) on a new forum (a brand new product on a technical point of view) we've launched in Germany a few month ago and I'm a lot surprised by the results I get. I monitor our response time using Apache logs and our own implementation of Boomerang beacon. Using my stats, I can see that our new product responds in about 680 ms where our old product was responding in about 1050 ms. On the other side, Google Webmaster Tool tells us that our pages have an average reponse time of about 1500 ms today where it was 700 three months ago with our old product. I've figured that GWT was taking client side metrics into account so I've added some measures on our Boomerang beacon and everything looks just fine. I've also ran some random pages on ySlow and Google's Page Speed and everything looks better than it was before. We event have a 82% on Google's Page Speed tool which is quite cool for a site with some ads in it :) Lately, we have signed a deal with Akamai to use two of their products : CDN for our static files (we were using another CDN before but it wasn't very effective) and RMA to improve Networks routes. We have also introduced a new agressive cache mecanism to ensure that most of the pages served to crawlers are cached by our memcache grid. After checking my metrics, it seems that this changes have improved from 650ms to about 500ms, which is good (still not great but it is definitly an improvement). But webmaster tools continues to report an increasing average response time where we see it decreasing in the same time. Have you ever had the same kind of wierd behavior on your sites while doing performance improvements ? Do you have any idea how to monitor the same thing Google does with Site Performance in Google Webmaster Tools so that we could improve our site and constantly check if it is what Google wants ? Edit 2011/07/26 : Thanks for your answers guys ! Nevertheless, I was not precise enough. The main issue we have is not with the Site Performance page but with the Crawl Stats one for now. We probably found an issue on our side with some very slow pages (around 3000 ms !!) and we are trying to fix them. I'll keep you posted as soon I'll have some infos. Thanks again !

    Read the article

  • GoogleAuthUtil: Daily Limit for Unauthenticated Use Exceeded

    - by Copa
    I am using the Google Client API and the GoogleAuthUtil.class to get access to the user's Google Drive Account. String scope = "oauth2:" + DriveScopes.DRIVE; String token = GoogleAuthUtil.getToken(getContext(), account.name, scope); This is the whole magic. It worked the whole day but since a couple of hours I receive the following message when sending API calls: com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden { "code": 403, "errors": [ { "domain": "usageLimits", "message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.", "reason": "dailyLimitExceededUnreg", "extendedHelp": "https://code.google.com/apis/console" } ], "message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup." } I dont know how to use a API Key from the console instead of an oauth2 authentication. There are two different "getToken()" messages. One has four parameters and the description for the last one says: extras: Bundle containing additional information that may be relevant to the authentication scope. But what do these information should look like? What informations do I have to put in the Bundle?

    Read the article

  • What are the drawbacks of this Classing format?

    - by Keysle
    This is a 3 layer example of my classing format function __(_){return _.constructor} //class var _ = ( CLASS = function(){ this.variable = 0; this.sub = new CLASS.SUBCLASS(); }).prototype; _.func = function(){ alert('lvl'+this.variable); this.sub.func(); } _.divePeak = function(){ alert('lvl'+this.variable); this.sub.variable += 5; } //sub class _ = ( __(_).SUBCLASS = function(){ this.variable = 1; this.sub = new CLASS.SUBCLASS.DEEPCLASS(); }).prototype; _.func = function(){ alert('lvl'+this.variable); this.sub.func(); } //deep class _ = ( __(_).DEEPCLASS = function(){ this.variable = 2; }).prototype; _.func = function(){ alert('lvl'+this.variable); } Before you blow a gasket, let me explain myself. The purpose behind the underscores is to accelerate the time needed to specify functions for a class and also specify sub classes of a class. To me it's easier to read. I KNOW, this does interfere with underscore.js if you intend to use it in your classes. I'm sure _.js can be easily switched over to another $ymbol though ... oh wait, But I digress. Why have classes within a class? because solar.system() and social.system() mean two totally different things but it's convenient to use the same name. Why user underscores to manage the definition of the class? because "Solar.System.prototype" took me about 2 seconds to type out and 2 typos to correct. It also keeps all function names for all classes in the same column of texts, which is nice for legibility. All I'm doing is presenting my reasoning behind this method and why I came up with it. I'm 3 days into learning OO JS and I am very willing to accept that I might have messed up.

    Read the article

  • Two way binding when setter is overriden

    - by Nicolas Goy
    I have an NSTextField bound to some object "zoom" property. In this object's class implementation, I have the following - (void)setZoom:(CGFloat)zoom { _zoom = MAX(0, MIN(10, zoom)); } If I write "-5" in the textfield, setZoom: will be called with "-5" as argument and _zoom will be set to 0. Then problem is that the textfield is not updating itself and it shows "-5" instead of re-reading the property value it has just set. If I do myObject.zoom = -5; in code, the text field will display 0 correctly. I tried to wrap _zoom =... inside willChangeValueForKey/didChangeValueForKey calls but it didn't change anything.

    Read the article

  • Object reference not set to an instance of an object- Linked List Example

    - by Zoro Roronoa
    I am seeing following errors : Object reference not set to an instance of an object! Check to determinate if the object is null before calling the method! I'am new with C#,and I made a program for Sorted Linked Lists. Here is the code where the error comes! public void Insert(double data) { Link newLink = new Link(data); Link current = first; Link previous = null; if (first == null) { first = newLink; } else { while (data > current.DData && current != null) { previous = current; current = current.Next; } previous.Next = newLink; newLink.Next = current; } } It says that the current referenc is null while (data current.DData && current != null), but I assigned it current = first; Please Help ! The rest is the complete code of the Program! class Link { double dData; Link next=null; public Link Next { get { return next; } set { next = value; } } public double DData { get { return dData; } set { dData = value; } } public Link(double dData) { this.dData = dData; } public void DisplayLink() { Console.WriteLine("Link : "+ dData); } } class SortedList { Link first; public SortedList() { first = null; } public bool IsEmpty() { return (this.first == null); } public void Insert(double data) { Link newLink = new Link(data); Link current = first; Link previous = null; if (first == null) { first = newLink; } else { while (data > current.DData && current != null) { previous = current; current = current.Next; } previous.Next = newLink; newLink.Next = current; } } public Link Remove() { Link temp = first; first = first.Next; return temp; } public void DisplayList() { Link current; current = first; Console.WriteLine("Display the List!"); while (current != null) { current.DisplayLink(); current = current.Next; } } } class SortedListApp { public void TestSortedList() { SortedList newList = new SortedList(); newList.Insert(20); newList.Insert(22); newList.Insert(100); newList.Insert(1000); newList.Insert(15); newList.Insert(11); newList.DisplayList(); newList.Remove(); newList.DisplayList(); } }

    Read the article

  • performing a javascript event without triggering that event handler

    - by bento
    In my latest code, I have an event handler for a focus on a textarea. When the user clicks on the textarea, that event-handler is triggered which sets some other DOM states based on the selected textarea. However, elsewhere in my program I want to programmatically set the focus of the textarea without triggering that event handler. I know Backbone, for instance, has a way to silently perform an action. My only pseudo-solution is to temporarily set a variable: var silence = true; And then, in my event handler, only perform the logic if silence is false. The handler is still triggered, but the logic doesn't run. Does anyone else know of better strategies for this?

    Read the article

  • Database (MySQL) structuring: pros and cons of multiple tables

    - by Gideon
    I am collecting data and storing it MySQL, for: 75 variables 55 countries Each year I have, at this stage since I am building this tool created a single table, of variables / countries (storing 1 year worth of data). Next year (and for several years after that) a new set of data will be input for each country. There are therefore 3 variables in controlling data returned to a user reviewing all collected data. The general form of any query would be: Show me these specifics variables, for these specific countries, for these specific years. (Show me average age and weight, for USA and Canada, for 2012 and 2009, for example) My question is, it seems that I have two options for arranging this data: -Multiple tables where I create a table of country / variable for each year data is collected - Single table and simply add a column (field) for the year that data relates to. As far as I can tell I could make these database calls with either sructure, but is one more powerful / efficient / quicker, and why? Thanks for your consideration. It's a PDO / PHP interface if that is relevent.

    Read the article

  • Bulk inserting and updating with Entity Framework (Probably a better alternative?)

    - by Dave
    I have a data set of devices, addresses, and companies that I need to import into our database, with the catch that our database may already include a specific device/address/company that is included in the new data set. If that is the case, I need to update that entry with the new information in the data set, excluding addresses. We check if an exact copy of that address exists, otherwise we make a new entry. My issue is that it is very slow to attempt to grab a device/company in EF and if it exist updated it, otherwise insert it. To fix this I tried to get all the companies, devices, and addresses and insert them into respective hashmaps, and check if the identifier of the new data exists in the hashmap. This hasn't led to any performance increases. I've included my code below. Typically I would do a batch insert, I'm not sure what I would do for a batch update though. Can someone advise a different route? var context = ObjectContextHelper.CurrentObjectContext; var oldDevices = context.Devices; var companies = context.Companies; var addresses = context.Addresses; Dictionary<string, Company> companyMap = new Dictionary<string, Company>(StringComparer.OrdinalIgnoreCase); Dictionary<string, Device> deviceMap = new Dictionary<string, Device>(StringComparer.OrdinalIgnoreCase); Dictionary<string, Address> addressMap = new Dictionary<string, Address>(StringComparer.OrdinalIgnoreCase); foreach (Company c in companies) { if (c.CompanyAccountID != null && !companyMap.ContainsKey(c.CompanyAccountID)) companyMap.Add(c.CompanyAccountID, c); } foreach (Device d in oldDevices) { if (d.SerialNumber != null && !deviceMap.ContainsKey(d.SerialNumber)) deviceMap.Add(d.SerialNumber, d); } foreach (Address a in addresses) { string identifier = GetAddressIdentifier(a); if (!addressMap.ContainsKey(identifier)) addressMap.Add(identifier, a); } foreach (DeviceData.TabsDevice device in devices) { // update a device Company tempCompany; Address tempAddress; Device currentDevice; if (deviceMap.ContainsKey(device.SerialNumber)) //update a device deviceMap.TryGetValue(device.SerialNumber, out currentDevice); else // insert a new device currentDevice = new Device(); currentDevice.SerialNumber = device.SerialNumber; currentDevice.SerialNumberTABS = device.SerialNumberTabs; currentDevice.Model = device.Model; if (device.CustomerAccountID != null && device.CustomerAccountID != "") { companyMap.TryGetValue(device.CustomerAccountID, out tempCompany); currentDevice.CustomerID = tempCompany.CompanyID; currentDevice.CustomerName = tempCompany.CompanyName; } if (companyMap.TryGetValue(device.ServicingDealerAccountID, out tempCompany)) currentDevice.CompanyID = tempCompany.CompanyID; currentDevice.StatusID = 1; currentDevice.Retries = 0; currentDevice.ControllerFamilyID = 1; if (currentDevice.EWBFrontPanelMsgOption == null) // set the Panel option to the default if it isn't set already currentDevice.EWBFrontPanelMsgOption = context.EWBFrontPanelMsgOptions.Where( i => i.OptionDescription.Contains("default")).Single(); // link the device to the existing address as long as it is actually an address if (addressMap.TryGetValue(GetAddressIdentifier(device.address), out tempAddress)) { if (GetAddressIdentifier(device.address) != "") currentDevice.Address = tempAddress; else currentDevice.Address = null; } else // insert a new Address and link the device to it (if not null) { if (GetAddressIdentifier(device.address) == "") currentDevice.Address = null; else { tempAddress = new Address(); tempAddress.Address1 = device.address.Address1; tempAddress.Address2 = device.address.Address2; tempAddress.Address3 = device.address.Address3; tempAddress.Address4 = device.address.Address4; tempAddress.City = device.address.City; tempAddress.Country = device.address.Country; tempAddress.PostalCode = device.address.PostalCode; tempAddress.State = device.address.State; addresses.AddObject(tempAddress); addressMap.Add(GetAddressIdentifier(tempAddress), tempAddress); currentDevice.Address = tempAddress; } } if (!deviceMap.ContainsKey(device.SerialNumber)) // if inserting, add to context { oldDevices.AddObject(currentDevice); deviceMap.Add(device.SerialNumber, currentDevice); } } context.SaveChanges();

    Read the article

  • Django - Weird behaviour of sessions variables with Apache

    - by Étienne Loks
    In a Menu class with Section children, each Section has an available attribute. This attribute is initialized during the instance creation. The process of getting the availability is not trivial, so I stock a Menu instance for each user in a session variable. With the Django embedded webserver this works well. But when I deploy the application on an Apache webserver I can observe a very weird behavior. Once authentified, a click on a link or a refreshment of the page and the availability of each Section seems to be forgotten (empty menu but in the log file I can see that all Sections are here) then a new refresh on the page the availability is back, a new refresh the menu disappears once again, etc. There is no cache activated on the web server. The menu is initialized in a context processor. def get_base_context(request): if 'MENU' not in request.session or \ not request.session['MENU'].childs or\ request.session['MENU'].user != request.user: _menu = Menu(request.user) _menu.init() request.session['MENU'] = _menu (...) I have no idea what could cause such a behavior. Any clue?

    Read the article

  • Escaping and unescaping a string with single and double quotes in Javascript

    - by Reina
    I have a search box that a user can search for any string including single AND double quotes, once they have searched, the backend is passing the keyword back to me so I can put it back in the box. I don't know what the string is so I can't escape quotes myself, below is an example: var keyword = "hello"; $("#selectionkeywords").val(); The issue I am having is that if the user enters "hello" the keyword becomes ""hello"" and I get this error: missing ) after argument list [Break On This Error] jQuery("#selectionkeywords").val(""hello""); The user could also enter single quotes so that rules it out as well. I tried using escape unescape but I still have the same issue e.g. escape(""hello"") I could get the value in an unescaped format e.g. "hello" but I don't know what to do with it, escape doesn't work on it I end up with this %26%23034%3Bhello%26%23034%3B So I'm pretty much stuck at the moment as I can't do anything to the string, any ideas?

    Read the article

  • How to make a pause before continuing method

    - by user1766728
    Now, I know that this has been asked, but I need to know how to do this NOT on html or anything. Heres my code, not including all of the other java files. package rtype; import java.awt.Image; import java.awt.event.KeyEvent; import java.util.ArrayList; import javax.swing.ImageIcon; public class aa { private int xd; private int yd; private int dx; private int dy; private int x; private int y; private Image image; private ArrayList missiles; private final int CRAFT_SIZE = 70; public aa() { ImageIcon ii = new ImageIcon(this.getClass().getResource("/aa.png")); image = ii.getImage(); missiles = new ArrayList(); x = 10; y = 10; xd = -14; yd = 140; } public void move() { if(y >=xd) y += dx; else if(y < xd) y += 1; if(y <=yd) y += dy; else if(y > yd) y += -1; } public int getX() { return x; } public int getY() { return y; } public Image getImage() { return image; } public ArrayList getMissiles() { return missiles; } public void keyPressed(KeyEvent e) { int key = e.getKeyCode(); if (key == KeyEvent.VK_SPACE) { fire(); } if (key == KeyEvent.VK_UP) { dy = -1; } if (key == KeyEvent.VK_DOWN) { dy = 1; } if (key == KeyEvent.VK_RIGHT) { yd++; } if (key == KeyEvent.VK_LEFT) { yd--; } if (key == KeyEvent.VK_W) { xd++; } if (key == KeyEvent.VK_S) { xd--; } } public void fire() { try{ missiles.add(new Missle(x + CRAFT_SIZE, y + CRAFT_SIZE)); }catch(Exception e){} } public void keyReleased(KeyEvent e) { int key = e.getKeyCode(); if (key == KeyEvent.VK_UP) { dy = 0; } if (key == KeyEvent.VK_DOWN) { dy = 0; } } } So, at the method, fire(), I want to make it delay between shots. HOW? sorry if this is n00bish

    Read the article

  • I need to cut a portion of a string in linux

    - by Abeed Salam
    I have a file in a folder like this: installer-x86_64-XXX.XX-diagnostic.run The XXX.XX is a version number and I need the version number only. How to do it in linux? I have this code: #!/bin/bash current_ver=$(find /mnt/builds/current -name '*.run'|awk -F/ '{print $NF}') So this gives me just the name of the file correctly (minus the location, which I dont want). But how do I only get the XXX.XX version number into a variable such as $version

    Read the article

  • Connecting data to a GUI - OOP

    - by tau
    I have an application with several graphs and tables on it. I worked fast and just made classes like Graph and Table that each contained a request object (pseudo-code): class Graph { private request; public function setDateRange(dateRange) { request.setDateRange(dateRange); } public function refresh() { request.getData(function() { //refresh the display }); } } Upon a GUI event (say, someone changes the date range dropdown), I'd just call the setters on the Graph instance and then refresh it. Well, when I added other GUI elements like tables and whatnot, they all basically had similar methods (setDateRange and other things common to the request). What are some more elegant OOP ways of doing this? The application is very simple and I don't want to over-architect it, but I also don't want to have a bunch of classes with basically the same methods that are just routing to a request object. I also don't want to set up each GUI class as inheriting from the request class, but I'm open to any ideas really.

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17  | Next Page >