Search Results

Search found 1507 results on 61 pages for 'spaces'.

Page 31/61 | < Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >

  • Converting String to int in Java and getting a NumberFormatException, can't figure out why

    - by user1687682
    ipString is a String representation of an IP address with spaces instead of dots. String[] ipArray = ipString.split(" "); String ip = ""; for (String part : ipArray){ if (part != null){ ip += part } } ip = ip.trim(); int ipInt = Integer.parseInt(ip); // Exception is thrown here. Exception in thread "main" java.lang.NumberFormatException: For input string: "6622015176". Could someone explain why this exception is being thrown?

    Read the article

  • DataGridView formatting

    - by Vadim
    I have a DGV with columns "code" and "name". Depends of lenght of a code I want to add tabulation to the "name" cells, to show structure of a data. Like that in this picture: How is it better to do? I think there is a better way then just loop for all rows and add spaces in front of names, right?

    Read the article

  • How to change the separation character of Zend Url?

    - by koko
    I use Zend URL view helper for building my urls. Everythings works exactly as I'd like to, except one thing: The character used for replacing spaces in the url is a plus (+). I'd like it to be a 'min' (-). How can I change this? Example: Now: /nl/nieuws/bericht/3/title/nieuwe*+affiches Wish: /nl/nieuws/bericht/3/title/nieuwe-*affiches Thanks in advcance!

    Read the article

  • NetBeans Development 7 - Windows 7 64-bit … JNI native calls ... a how to guide

    - by CirrusFlyer
    I provide this for you to hopefully save you some time and pain. As part of my expereince in getting to know NB Development v7 on my Windows 64-bit workstation I found another frustrating adventure in trying to get the JNI (Java Native Interface) abilities up and working in my project. As such, I am including a brief summary of steps required (as all the documentation I found was completely incorrect for these versions of Windows and NetBeans on how to do JNI). It took a couple of days of experimentation and reviewing every webpage I could find that included these technologies as keyword searches. Yuk!! Not fun. To begin, as NetBeans Development is "all about modules" if you are reading this you probably have a need for one, or more, of your modules to perform JNI calls. Most of what is available on this site or the Internet in general (not to mention the help file in NB7) is either completely wrong for these versions, or so sparse as to be essentially unuseful to anyone other than a JNI expert. Here is what you are looking for ... the "cut to the chase" - "how to guide" to get a JNI call up and working on your NB7 / Windows 64-bit box. 1) From within your NetBeans Module (not the host appliation) declair your native method(s) and make sure you can compile the Java source without errors. Example: package org.mycompanyname.nativelogic; public class NativeInterfaceTest { static { try { if (System.getProperty( "os.arch" ).toLowerCase().equals( "amd64" ) ) System.loadLibrary( <64-bit_folder_name_on_file_system>/<file_name.dll> ); else System.loadLibrary( <32-bit_folder_name_on_file_system>/<file_name.dll> ); } catch (SecurityException se) {} catch (UnsatisfieldLinkError ule) {} catch (NullPointerException npe) {} } public NativeInterfaceTest() {} native String echoString(String s); } Take notice to the fact that we only load the Assembly once (as it's in a static block), because othersise you will throw exceptions if attempting to load it again. Also take note of our single (in this example) native method titled "echoString". This is the method that our C / C++ application is going to implement, then via the majic of JNI we'll call from our Java code. 2) If using a 64-bit version of Windows (which we are here) we need to open a 64-bit Visual Studio Command Prompt (versus the standard 32-bit version), and execute the "vcvarsall" BAT file, along with an "amd64" command line argument, to set the environment up for 64-bit tools. Example: <path_to_Microsoft_Visual_Studio_10.0>/VC/vcvarsall.bat amd64 Take note that you can use any version of the C / C++ compiler from Microsoft you wish. I happen to have Visual Studio 2005, 2008, and 2010 installed on my box so I chose to use "v10.0" but any that support 64-bit development will work fine. The other important aspect here is the "amd64" param. 3) In the Command Prompt change drives \ directories on your computer so that you are at the root of the fully qualified Class location on the file system that contains your native method declairation. Example: The fully qualified class name for my natively declair method is "org.mycompanyname.nativelogic.NativeInterfaceTest". As we successfully compiled our Java in Step 1 above, we should find it contained in our NetBeans Module something similar to the following: "/build/classes/org/mycompanyname/nativelogic/NativeInterfaceTest.class" We need to make sure our Command Prompt sets, as the current directly, "/build/classes" because of our next step. 4) In this step we'll create our C / C++ Header file that contains the JNI required statments. Type the following in the Command Prompt: javah -jni org.mycompanyname.nativelogic.NativeInterfaceTest and hit enter. If you receive any kind of error that states this is an unrecognized command that simply means your Windows computer does not know the PATH to that command (it's in your /bin folder). Either run the command from there, or include the fully qualified path name when invoking this application, or set your computer's PATH environmental variable to include that path in its search. This should produce a file called "org_mycompanyname_nativelogic_NativeInterfaceTest.h" ... a C Header file. I'd make a copy of this in case you need a backup later. 5) Edit the NativeInterfaceTest.h header file and include an implementation for the echoString() method. Example: JNIEXPORT jstring JNICALL Java_org_mycompanyname_nativelogic_NativeInterfaceTest_echoString (JNIEnv *env, jobject jobj, jstring js) { return((*env)->NewStringUTF(env, "My JNI is up and working after lots of research")); } Notice how you can't simply return a normal Java String (because you're in C at the moment). You have to tell the passed in JVM variable to create a Java String for you that will be returned back. Check out the following Oracle web page for other data types and how to create them for JNI purposes. 6) Close and Save your changes to the Header file. Now that you've added an implementation to the Header change the file extention from ".h" to ".c" as it's now a C source code file that properly implements the JNI required interface. Example: NativeInterfaceTest.c 7) We need to compile the newly created source code file and Link it too. From within the Command Prompt type the following: cl /I"path_to_my_jdks_include_folder" /I"path_to_my_jdks_include_win32_folder" /D:AMD64=1 /LD NativeInterfaceTest.c /FeNativeInterfaceTest.dll /link /machine:x64 Example: cl /I"D:/Program Files/Java/jdk1.6.0_21/include" /I"D:/Program Files/java/jdk1.6.0_21/include/win32" /D:AMD64=1 /LD NativeInterfaceTest.c /FeNativeInterfaceTest.dll /link /machine:x64 Notice the quotes around the paths to the 'include" and 'include/win32' folders is required because I have spaces in my folder names ... 'Program Files'. You can include them if you have no spaces without problems, but they are mandatory if you have spaces when using a command prompt. This will generate serveral files, but it's the DLL we're interested in. This is what the System.loadLirbary() java method is looking for. 8) Congratuations! You're at the last step. Simply take the DLL Assembly and paste it at the following location: <path_of_NetBeansProjects_folder>/<project_name>/<module_name>/build/cluster/modules/lib/x64 Note that you'll probably have to create the "lib" and "x64" folders. Example: C:\Users\<user_name>\Documents\NetBeansProjects\<application_name>\<module_name>\build\cluster\modules\lib\x64\NativeInterfaceTest.dll Java code ... notice how we don't inlude the ".dll" file extension in the loadLibrary() call? System.loadLibrary( "/x64/NativeInterfaceTest" ); Now, in your Java code you can create a NativeInterfaceTest object and call the echoString() method and it will return the String value you typed in the NativeInterfaceTest.c source code file. Hopefully this will save you the brain damage I endured trying to figure all this out on my own. Good luck and happy coding!

    Read the article

  • How do i make the text in this div expand vertically and not horizontally?

    - by Shripad K
    Here is something that has bogged me down for quite sometime. I have created two fiddles so you can test live: Fiddle #1: http://www.jsfiddle.net/Jdk9R/2/ Fiddle #2: http://www.jsfiddle.net/d5PEu/ Looking at the Fiddle #1 you can make out that if the text is not formatted properly with spaces, the text overflows the border. How do i make this function similar to fiddle #2? Or is this unavoidable?

    Read the article

  • Alphanumeric and more

    - by Luke
    So I am designing a registration page and checking the username is alphanumeric. "^([0-9a-z])+$" I use that to do so. Is there any way I can get that to include underscores (_), dash (-), and spaces? Thanks

    Read the article

  • how do I replace certain characters in a string?

    - by user296516
    Hi guys, Suppose I have a string like this SOMETHING [1000137c] SOMETHING = John Rogers III [SOMETHING] SOMETHING ELSE and I need to turn it into this SOMETHING [1000137c] SOMETHING = John_Rogers_III [SOMETHING] SOMETHING ELSE Therefor I need to replace spaces between words after "[1000137c] SOMETHING = " and before " [". How can I do that in php? Thanks!

    Read the article

  • C#: How to replace "-" with " -" only when it's not preceded by "e"?

    - by MaDDoX
    I imagine I should use Regex for that but I still scratch my head a lot about it (and the only similar question I found wasn't exactly my case) so I decided to ask for help. This is the input and expected output: Input: "c-0.68219,-0.0478 -1.01455-0.0441 0.2321e-4,0.43212" Output:"c -0.68219,-0.0478 -1.01455 -0.0441 0.2321e-4,0.43212" Basically I need either commas or spaces as value separators, but I can't break the exponential index (e-4). Maybe do two successive replacements?

    Read the article

  • Dealing with whitespace in SVN?

    - by Eric the Red
    All of the SVN shops I've worked in have a strict rule - replace all tabs with spaces, to avoid whitespace conflicts and variations of tabs in different editors. Is this a very common standard? Does it really make a huge difference, and is it worth the trouble to push this standard to a group of developers new to SVN?

    Read the article

  • Using enums in Java across multiple classes

    - by Richard Mar.
    I have the following class: public class Card { public enum Suit { SPACES, HEARTS, DIAMONDS, CLUBS }; public Card(Suit nsuit, int nrank) { suit = nsuit; rank = nrank; } private Suit suit; private int rank; } I want to instantiate it in another class, but that class doesn't understand the Suit enum. Where should I put the enum to make it publicly visible?

    Read the article

  • reload masonry when div has fadeout onclick?

    - by Jason
    Hi, I'm using masonry for layout. I have set up a filter for the divs using the following code: $("#logo").click(function() { $(".box").fadeIn(); $(".box:not(.logo)").fadeOut(); }); when I select an item, I want masonry to reload the layout so that the items are reshuffled and that there aren't blank spaces. Ideas? thanks

    Read the article

  • CodeMirror 2 - (readonly and editable code)

    - by Happy Hacking
    Can CodeMirror 2 be used to set part of the code to be uneditable? I do not wish to do it like fully editable code. Example: Code inline: example public static void main(String args[]){ //content } I hope to be able to make Line 1 and 3 uneditable BUT able to edit lines in between them adding characters/spaces increasing the number of lines inside the method as we speak AND still unable to edit the starting and closing bracket lines.

    Read the article

  • How to convert the amount of indentation in a source code file?

    - by toby
    I find that I now often work with code bases that have different amounts of indentation. Some use 2 spaces, some use 4 space, some even use tabs! Once in a while, I have to share code between these codebases, or, sometimes I use an incorrect amount of indentation by mistake. Is there a tool or a text editor feature that will convert between different amounts of indentation?

    Read the article

< Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >